/* ============================================================
   Yishii — /demo/ scan experience.
   Loads after styles.css (full system: tokens, fonts, components).
   Page-only classes are prefixed scan- so nothing collides.
   No new colours, no new fonts — tokens from styles.css only.
   Reuses: .hero, .sec/.sec-*, .layer-card, .a-score, .form-grid,
   .form-submit/.form-error/.form-success, .btn, .footer.
   ============================================================ */

/* Without JavaScript the interactive acts stay hidden by their [hidden]
   attribute; this page explains itself and the Act 4 form still POSTs, so the
   capture act is force-shown in that case (beats styles.css' [hidden] rule). */
.js .scan-nojs { display: none; }
.no-js #capture { display: block !important; }

/* ---------- ACT 1 · PERSONA GATE ---------- */
/* Short hero: a booth QR scan must see the three cards without scrolling. */
.scan-hero { padding: calc(56px + var(--safe-t)) 24px 64px; }
.scan-hero .lede { margin-bottom: 34px; }
.scan-hero h1 { font-size: clamp(30px, 7vw, 54px); }
.scan-grid {
  display: grid; gap: 14px; max-width: 1000px; margin: 0 auto; text-align: left;
}
.scan-card {
  display: block; width: 100%; text-align: left; cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s;
}
.scan-card h2 { font-size: 19px; font-weight: 700; color: var(--white); margin-bottom: 6px; }
.scan-card p { font-size: 14.5px; color: var(--on-dark-mut); line-height: 1.5; }
.scan-go { margin-top: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mint); }
.scan-card:hover, .scan-card:focus-visible { border-color: rgba(182,252,190,.4); transform: translateY(-2px); }
/* Selected persona: the same mint border, plus a mint ✓ on the go line
   (mirrors .scan-step-btn .num::after). JS keeps exactly one selected. */
.scan-card.is-selected { border-color: rgba(182,252,190,.4); }
.scan-card.is-selected .scan-go::after { content: " ✓"; }

/* Small print / accuracy statement (light print, both themes).
   --fg-muted, not --fg-subtle: these are claims-critical, they must pass 4.5:1. */
.scan-fine { max-width: 640px; margin: 26px auto 0; font-size: 12.5px; line-height: 1.6; color: var(--on-dark-mut); }
.sec .scan-fine { color: var(--fg-muted); }
.scan-acc { font-size: 12.5px; line-height: 1.6; color: var(--fg-muted); margin-top: 10px; }
.scan-mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-subtle); margin-top: 10px; }
.scan-nojs { max-width: 640px; margin: 30px auto 0; font-size: 14.5px; line-height: 1.7; color: var(--on-dark-mut); }
.scan-nojs a { color: var(--mint); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- ACT LAYOUT ---------- */
.scan-narrow { max-width: var(--maxw-narrow); }
.scan-act { scroll-margin-top: 76px; }
.scan-act .sec-lede { margin-bottom: 30px; }

/* ---------- ACT 2 · FIVE TAPS ---------- */
.scan-row { border: 0; padding: 0; margin: 0 0 18px; }
.scan-row legend { font-size: 13.5px; font-weight: 600; color: var(--fg-muted); margin-bottom: 9px; }
.scan-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.scan-chip { position: relative; display: inline-flex; cursor: pointer; }
.scan-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.scan-chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 9px 15px;
  border-radius: var(--radius-pill); border: 1px solid var(--line-light);
  background: var(--white); color: var(--fg-muted); font-size: 14px; font-weight: 500;
  transition: background .2s, border-color .2s, color .2s;
}
.scan-chip:hover span { border-color: var(--indigo-700); }
.scan-chip input:checked + span { background: var(--indigo-700); border-color: var(--indigo-700); color: var(--white); font-weight: 600; }
.scan-chip input:focus-visible + span { outline: 2px solid var(--indigo-700); outline-offset: 2px; }
.scan-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; align-items: center; }
/* Button hierarchy: gold = the primary action ("show my reading", the shared
   .btn-primary). "Random inputs" is the quiet path — a .scan-skip text control,
   placed after the submit at every breakpoint, and never gold. */
.scan-actions .scan-skip { margin-top: 0; }

/* ---------- ACT 3 · READING ---------- */
.scan-readout {
  background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm); margin-top: 6px;
}
.scan-readout .tag-mono {
  color: var(--fg-subtle); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  display: block; margin-bottom: 14px;
}
.scan-readout .a-score-row { margin-top: 0; }
.scan-band { font-size: 21px; font-weight: 600; color: var(--indigo-700); margin-top: 10px; }
.scan-what { font-size: 14.5px; color: var(--fg-muted); margin-top: 12px; }
.scan-readout .scan-fine { margin: 18px 0 0; color: var(--fg-muted); }

.scan-steps { margin-top: 44px; }
.scan-steps h3 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.scan-steps-lede { font-size: 15px; color: var(--fg-muted); margin-top: 8px; margin-bottom: 18px; }
.scan-step { border-top: 1px solid var(--line-light); }
.scan-step-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: transparent; border: 0; cursor: pointer; padding: 16px 2px;
  font-size: 16.5px; font-weight: 600; color: var(--indigo-700); min-height: 52px;
}
.scan-step-btn .num { font-family: var(--font-mono); font-size: 12px; color: var(--fg-subtle); }
.scan-step-btn:hover, .scan-step-btn:focus-visible { color: var(--indigo-900); }
.scan-step-btn[aria-expanded="true"] { color: var(--indigo-900); }
.scan-step-btn[aria-expanded="true"] .num::after { content: " ✓"; color: var(--indigo-700); }
.scan-step-body { padding: 0 2px 22px; }
.scan-step-body p { font-size: 15.5px; line-height: 1.6; color: var(--fg); max-width: 620px; }
.scan-step-body p + p { margin-top: 10px; }
.scan-close { font-weight: 600; color: var(--indigo-900); }
.scan-skip {
  margin-top: 26px; background: transparent; border: 0; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--indigo-700); text-decoration: underline;
  text-underline-offset: 3px; min-height: 44px;
}
.scan-skip:hover, .scan-skip:focus-visible { color: var(--indigo-900); }

/* ---------- ACT 4 · CAPTURE ---------- */
.scan-capture { max-width: 660px; margin: 0 auto; text-align: left; }
.scan-book { color: var(--mint); font-weight: 600; }
.scan-book:hover, .scan-book:focus { text-decoration: underline; text-underline-offset: 3px; }
.scan-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.scan-capture .form-error { min-height: 18px; }
.scan-retry {
  margin-top: 10px; background: transparent; border: 1px solid var(--line-dark); color: var(--white);
  font-weight: 600; font-size: 14px; padding: 10px 20px; border-radius: var(--radius-pill); cursor: pointer; min-height: 44px;
}
.scan-retry:hover, .scan-retry:focus { border-color: var(--mint); color: var(--mint); }

/* ---------- RESPONSIVE ---------- */
@media (min-width: 760px) {
  .scan-grid { grid-template-columns: repeat(3, 1fr); }
  .scan-actions { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .scan-hero { padding-bottom: 52px; }
  .scan-chips { gap: 6px; }
  .scan-chip span { min-height: 46px; padding: 9px 13px; font-size: 13.5px; }
  .scan-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .scan-card { transition: none; }
}
