/* ===== Design tokens ===== */
:root {
  --bone: #F6F3EE;
  --paper: #FBF9F6;
  --ink: #1F2420;
  --ink-soft: #4B534D;
  --teal: #2F5D5A;
  --teal-dark: #1E4543;
  --clay: #D98E64;
  --clay-soft: #F1D9C3;
  --layer: #EAE5DB;
  --line: rgba(31, 36, 32, 0.12);
  --radius: 18px;
  --shadow: 0 20px 40px -24px rgba(31, 36, 32, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

a { color: inherit; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header ===== */
.site-header {
  padding: 28px 0 0;
}
.wordmark {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wordmark .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--clay);
  display: inline-block;
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
  padding: 64px 0 80px;
}
.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.08;
}
.hero h1 em {
  font-style: normal;
  color: var(--teal);
}
.hero p.lede {
  margin-top: 20px;
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 460px;
}

.cta-row {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 16px 28px;
  border-radius: 999px;
  background: var(--teal);
  color: var(--paper);
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--teal-dark); transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.full { width: 100%; }

.price-note {
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.price-note strong { color: var(--ink); }

/* Layered skin-barrier visual: stacked translucent panels */
.layers {
  position: relative;
  height: 360px;
}
.layer {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--layer), var(--paper));
}
.layer-1 { transform: rotate(-7deg) translate(10px, 20px); opacity: 0.55; }
.layer-2 { transform: rotate(4deg) translate(-6px, -4px); opacity: 0.8; }
.layer-3 {
  transform: rotate(-1.5deg);
  background: var(--paper);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
}
.layer-3 .tag {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}
.layer-3 .read {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.3rem;
  color: var(--ink);
}
.layer-3 .meter {
  height: 8px;
  border-radius: 999px;
  background: var(--layer);
  overflow: hidden;
}
.layer-3 .meter span {
  display: block;
  height: 100%;
  width: 72%;
  background: var(--clay);
  border-radius: 999px;
}

@media (prefers-reduced-motion: no-preference) {
  .layer { transition: transform 0.4s ease; }
  .layers:hover .layer-1 { transform: rotate(-9deg) translate(14px, 26px); }
  .layers:hover .layer-2 { transform: rotate(6deg) translate(-10px, -8px); }
}

/* ===== How it works ===== */
.steps {
  padding: 40px 0 80px;
  border-top: 1px solid var(--line);
}
.steps h2 {
  font-size: 1.6rem;
  margin-bottom: 36px;
}
.step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.step .num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 0.95rem;
  color: var(--clay);
  margin-bottom: 10px;
}
.step h3 { font-size: 1.1rem; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

/* ===== Footer ===== */
.site-footer {
  padding: 28px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.82rem;
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .layers { height: 280px; order: -1; }
  .step-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ===== Result page ===== */
.result-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.card {
  width: 100%;
  max-width: 460px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
}
.card .eyebrow { margin-bottom: 10px; }
.card h1 { font-size: 1.6rem; margin-bottom: 8px; }
.card p.lede { color: var(--ink-soft); font-size: 0.96rem; margin: 0 0 24px; }

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.92rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--teal); background: var(--layer); }
.dropzone input { display: none; }
.preview {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 16px;
  display: none;
}

.status {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-align: center;
}
.status.error { color: #B23B2E; }

.result-card {
  margin-top: 24px;
  padding: 20px;
  border-radius: 14px;
  background: var(--layer);
  display: none;
}
.result-card .tag {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}
.result-card p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--teal);
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PWA install banner ===== */
#pwa-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  padding: 10px 16px;
  background: var(--teal);
  color: var(--paper);
}
#pwa-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
}
#pwa-banner-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}
#pwa-banner-text {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
}
#pwa-install-btn {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid var(--paper);
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
#pwa-install-btn:hover {
  background: var(--paper);
  color: var(--teal);
}
#pwa-banner-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(251,249,246,0.7);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}
#pwa-banner-close:hover { color: var(--paper); }

/* ── Treat yourself band ─────────────────────────────────────────── */
.treat-band {
  background: var(--ink);
  padding: 72px 24px;
  margin: 48px 0 0;
}
.treat-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.treat-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 14px;
}
.treat-headline {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--paper);
  line-height: 1.2;
  margin: 0 0 20px;
  font-weight: 800;
}
.treat-headline em {
  color: var(--clay);
  font-style: normal;
}
.treat-body {
  font-size: 1rem;
  color: rgba(251,249,246,0.7);
  line-height: 1.7;
  margin: 0 0 28px;
}
.treat-btn {
  background: var(--clay) !important;
  color: var(--paper) !important;
}
.treat-btn:hover { background: #c47a52 !important; }
.treat-stats {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.treat-stat {
  border-left: 3px solid var(--clay);
  padding-left: 20px;
}
.treat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--paper);
  line-height: 1.1;
  margin-bottom: 4px;
}
.treat-label {
  font-size: 0.88rem;
  color: rgba(251,249,246,0.6);
  line-height: 1.5;
}
@media (max-width: 680px) {
  .treat-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .treat-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }
  .treat-stat { flex: 1; min-width: 120px; }
}
