/* ============================================================
   ShortList landing — "How it works" steps + scroll-driven
   phone demo, recovery-routine cards, verdict cards.
   Demo screens mirror the app (AllergenChecklist.tsx, IntroPage.tsx,
   RecoveryRoutine.tsx / RecoveryStepCard.tsx).
   All values come from tokens.css.
   ============================================================ */

/* ---------- shared section type ---------- */
.eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-muted); margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.015em; color: var(--color-brand);
  font-size: clamp(28px, 3.8vw, 40px); line-height: 1.1; max-width: 22ch; margin-bottom: 16px;
}
.section-lead { font-size: clamp(16px, 1.8vw, 18px); line-height: 1.6; color: var(--color-muted); max-width: 58ch; }

/* ---------- how it works ---------- */
.how { padding-top: 88px; padding-bottom: 48px; }
.how-grid {
  display: grid; grid-template-columns: 1fr 320px; gap: 48px; margin-top: 32px;
}
.steps { list-style: none; }
/* Reason: each step gets most of a viewport so the pinned phone has room to play its part beside it */
.step {
  min-height: 54vh; padding-top: 14vh;
  opacity: 0.35; transition: opacity 0.35s ease;
}
.step:first-child { padding-top: 8vh; }
.step.is-active { opacity: 1; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-brand); color: var(--color-brand-text);
  font-family: var(--font-display); font-weight: 800; font-size: 18px; margin-bottom: 16px;
}
.step h3 {
  font-family: var(--font-display); font-weight: 800; color: var(--color-brand);
  font-size: clamp(24px, 3vw, 32px); line-height: 1.12; max-width: 24ch; margin-bottom: 12px;
}
.step p { font-size: clamp(16px, 1.8vw, 18px); line-height: 1.6; color: var(--color-muted); max-width: 44ch; }

/* ---------- phone (pinned) ---------- */
.phone-track { position: relative; }
.phone-pin { position: sticky; top: max(24px, calc(50vh - 290px)); }
.phone {
  width: 300px; margin: 0 auto; background: var(--color-surface); border-radius: 38px;
  border: 7px solid var(--color-brand); padding: 16px 14px 14px; box-shadow: var(--shadow-card);
}
.notch { width: 84px; height: 16px; background: var(--color-brand); border-radius: var(--radius-pill); margin: 0 auto 14px; }
.screens { position: relative; height: 510px; overflow: hidden; }
.screen { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.screen.is-active { opacity: 1; pointer-events: auto; }

/* screen text */
.p-h { font-family: var(--font-display); font-size: 20px; font-weight: 800; line-height: 1.15; color: var(--color-ink); margin-bottom: 4px; }
.p-sub { font-size: 11px; color: var(--color-muted); margin-bottom: 12px; }

/* screen 1: allergen checklist */
.p-search {
  background: var(--color-bg); border-radius: var(--radius-pill); padding: 9px 14px;
  font-size: 11px; color: var(--color-muted); margin-bottom: 12px;
}
.p-family {
  font-size: 10.5px; font-weight: 800; color: var(--color-ink);
  padding: 8px 2px 6px; border-bottom: 1px solid var(--color-hairline); margin-bottom: 6px;
}
.p-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 2px; }
.p-check {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--color-muted); color: transparent;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.p-row.is-ticked .p-check { background: var(--color-brand); border-color: var(--color-brand); color: var(--color-brand-text); }
.p-aname { font-size: 11.5px; font-weight: 800; }
.p-ameta { font-size: 9.5px; color: var(--color-muted); margin-top: 1px; }
.p-read {
  display: inline-block; margin-top: 4px; font-size: 8.5px; font-weight: 800;
  background: var(--color-accent); color: var(--color-accent-ink);
  border-radius: var(--radius-pill); padding: 2px 8px;
}
.p-confirm {
  position: absolute; left: 0; right: 0; bottom: 0; text-align: center;
  background: var(--color-chip); color: var(--color-muted);
  border-radius: var(--radius-pill); padding: 12px; font-size: 12px; font-weight: 800;
  transition: background 0.2s ease, color 0.2s ease;
}
.p-confirm.is-ready { background: var(--color-brand); color: var(--color-brand-text); }

/* screen 2: skin intro, mid-recording (timer driven by js/demo.js) */
.p-tips {
  background: var(--color-brand); color: var(--color-brand-text);
  border-radius: var(--radius-tile); padding: 12px 14px; margin: 10px 0 14px;
}
.p-tips-title { font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.p-tips ul { list-style: disc; padding-left: 16px; }
.p-tips li { font-size: 9.5px; line-height: 1.5; color: var(--color-brand-muted); }
.p-rec { background: var(--color-bg); border-radius: var(--radius-tile); padding: 12px 14px; margin-bottom: 14px; }
.p-rec-label { font-size: 11px; font-weight: 800; margin-bottom: 8px; }
.p-rec-label span { display: block; font-size: 9.5px; font-weight: 500; color: var(--color-muted); }
.p-rec-live { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; color: var(--color-verdict-flagged); }
.p-rec-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--color-verdict-flagged);
  animation: rec-pulse 1.2s ease-in-out infinite;
}
.p-rec-time span { font-variant-numeric: tabular-nums; }
/* Reason: 22 bars with staggered delays read as a live voice level, not a loop */
.p-wave { display: flex; align-items: center; gap: 3px; height: 34px; margin: 10px 0; }
.p-wave i {
  flex: 1; height: 30%; border-radius: 2px; background: var(--color-brand); opacity: 0.8;
  animation: wave 0.9s ease-in-out infinite alternate;
}
.p-wave i:nth-child(3n)   { animation-delay: -0.3s; animation-duration: 0.7s; }
.p-wave i:nth-child(3n+1) { animation-delay: -0.6s; animation-duration: 1.1s; }
.p-wave i:nth-child(4n)   { animation-delay: -0.15s; animation-duration: 0.8s; }
.p-wave i:nth-child(5n)   { animation-delay: -0.45s; animation-duration: 1.3s; }
.p-rec-stop {
  text-align: center; font-size: 11px; font-weight: 800; color: var(--color-ink);
  border: 1.5px solid var(--color-hairline); border-radius: var(--radius-pill); padding: 8px; background: var(--color-surface);
}
.p-type-label { font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.p-type-label span { font-weight: 500; color: var(--color-muted); }
.p-type { height: 52px; border: 1px solid var(--color-hairline); border-radius: var(--radius-tile); background: var(--color-surface); }
@keyframes rec-pulse { 50% { opacity: 0.25; } }
@keyframes wave { from { height: 18%; } to { height: 100%; } }

/* screen 3: recovery routine (scrolled by js/demo.js) */
.routine-scroll { will-change: transform; }
.p-group {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-muted); margin: 14px 2px 8px;
}
.p-card { background: var(--color-bg); border-radius: var(--radius-tile); padding: 12px; margin-bottom: 8px; }
.p-pill {
  display: inline-block; font-size: 8.5px; font-weight: 800; color: var(--color-muted);
  background: var(--color-chip); border-radius: var(--radius-pill); padding: 2px 8px; margin-bottom: 6px;
}
.p-brand { font-size: 8.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); }
.p-pname { font-family: var(--font-display); font-size: 14px; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.p-switch { font-size: 9.5px; color: var(--color-muted); line-height: 1.4; margin-bottom: 6px; }
.p-chip {
  display: inline-block; font-size: 9.5px; font-weight: 800; border-radius: var(--radius-pill); padding: 3px 9px;
  background: var(--color-verdict-ok-bg); color: var(--color-verdict-ok);
}
.p-foot { font-size: 8.5px; color: var(--color-muted); line-height: 1.45; margin-top: 7px; }
.p-report {
  background: var(--color-brand); color: var(--color-brand-text); border-radius: var(--radius-tile);
  padding: 12px; font-size: 10.5px; font-weight: 700; line-height: 1.45; margin-top: 14px;
}

/* ---------- recovery routine cards ---------- */
.recovery { padding-top: 0; }
.r-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
.r-card { background: var(--color-surface); box-shadow: var(--shadow-card); border-radius: var(--radius-block); padding: 30px; }
.r-card h3 { font-family: var(--font-display); font-weight: 800; color: var(--color-brand); font-size: 22px; margin: 10px 0 8px; }
.r-card p { font-size: 15px; line-height: 1.6; color: var(--color-muted); }
.r-num { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--color-muted); }
.r-card-brand { background: var(--color-brand); }
.r-card-brand h3 { color: var(--color-brand-text); }
.r-card-brand p, .r-card-brand .r-num { color: var(--color-brand-muted); }

/* ---------- verdict cards (kept from the Solera page) ---------- */
.verdicts { padding-top: 72px; }
.v-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 16px; }
.cell { border-radius: var(--radius-block); padding: 30px; }
.cell h3 { font-family: var(--font-display); font-size: 21px; font-weight: 700; margin: 12px 0 8px; }
.cell p { font-size: 14.5px; line-height: 1.55; }
.verdict-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 800; padding: 7px 16px; border-radius: var(--radius-pill);
}
.c-flag { background: var(--color-verdict-flagged-bg); color: var(--color-verdict-flagged-deep); }
.c-flag .verdict-chip { background: var(--color-verdict-flagged-bg-strong); color: var(--color-verdict-flagged); }
.c-ok { background: var(--color-verdict-ok-bg); color: var(--color-verdict-ok-deep); }
.c-ok .verdict-chip { background: var(--color-verdict-ok-bg-strong); color: var(--color-verdict-ok); }
.c-unv { background: var(--color-verdict-unverified-bg); color: var(--color-verdict-unverified-deep); }
.c-unv .verdict-chip { background: var(--color-verdict-unverified-bg-strong); color: var(--color-verdict-unverified); }

/* ---------- responsive ---------- */
.m-shot { display: none; }
@media (max-width: 920px) {
  .how-grid { grid-template-columns: 1fr; gap: 8px; margin-top: 16px; }
  /* Reason: on one column there is no scroll following — each step shows its own static screen instead */
  .step, .step:first-child { min-height: 0; padding-top: 24px; opacity: 1; }
  .phone-track { display: none; }
  .m-shot { display: block; margin-top: 24px; }
  .m-shot:empty { display: none; }
  .r-grid, .v-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .how, .verdicts { padding-top: 56px; }
  .r-card, .cell { padding: 24px; }
}

/* ---------- reduced motion: no transitions; the routine can be scrolled by hand ---------- */
@media (prefers-reduced-motion: reduce) {
  .step, .p-check, .p-confirm { transition: none; }
  .p-rec-dot, .p-wave i { animation: none; }
  .p-wave i:nth-child(odd) { height: 60%; }
  .screen-routine { overflow-y: auto; }
}
