/* Course Pop — editorial course player. See DESIGN.md for the system rationale.
   Register: brand. Strategy: Committed (one ink hue + one reserved accent).
   No #000/#fff, no Inter/Roboto, no glow, no gradient text. */

/* ---------------------------------------------------------------- tokens */
:root {
  /* color — OKLCH, neutrals tinted toward the ink hue (215) */
  --ink:         oklch(0.28 0.045 215);
  --ink-strong:  oklch(0.22 0.05 215);
  --ink-soft:    oklch(0.46 0.035 215);
  --accent:      oklch(0.63 0.16 47);   /* RESERVED: progress / CTA / correct */
  --accent-deep: oklch(0.52 0.15 47);
  --paper:        oklch(0.975 0.008 85);
  --paper-raised: oklch(0.992 0.006 85);
  --paper-sunk:   oklch(0.945 0.01 85);
  --line:         oklch(0.86 0.012 215);
  --line-strong:  oklch(0.74 0.02 215);
  --good: oklch(0.55 0.11 150);
  --warn: oklch(0.55 0.13 28);

  /* type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Newsreader", Georgia, serif;
  --fs-eyebrow: clamp(0.72rem, 0.7rem + 0.2vw, 0.8rem);
  --fs-sm:   clamp(0.86rem, 0.83rem + 0.2vw, 0.95rem);
  --fs-body: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  --fs-lg:   clamp(1.3rem, 1.2rem + 0.6vw, 1.55rem);
  --fs-h2:   clamp(1.6rem, 1.4rem + 1.1vw, 2.1rem);
  --fs-h1:   clamp(2.3rem, 1.8rem + 2.6vw, 3.6rem);
  --fs-display: clamp(2.9rem, 2rem + 4.5vw, 5rem);
  --measure: 68ch;

  /* space */
  --s-1: 0.5rem; --s-2: 0.75rem; --s-3: 1rem; --s-4: 1.5rem;
  --s-5: 2.5rem; --s-6: 4rem; --s-7: clamp(4rem, 8vw, 8rem);

  /* motion — the one principle: ease-out exponential */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: var(--display); font-weight: 600; line-height: 1.05; }

a { color: var(--accent-deep); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }

/* a soft engraved-paper texture: two near-invisible radial tints. No glow. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 88% -10%, oklch(0.97 0.018 85) 0%, transparent 60%),
    radial-gradient(50vw 50vw at -8% 108%, oklch(0.965 0.02 215) 0%, transparent 55%);
}

/* ----------------------------------------------------- shared structure */
.wrap { width: min(var(--measure), 92vw); margin-inline: auto; }
.wrap-wide { width: min(1180px, 92vw); margin-inline: auto; }

.eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 var(--s-3);
}
.eyebrow.muted { color: var(--ink-soft); }

.rule { border: 0; border-top: 1px solid var(--line); margin: var(--s-5) 0; }
.rule.thin { margin: var(--s-4) 0; }

/* screens: only one visible at a time, swapped by app.js.
   IMPORTANT: hide by default and only let the ACTIVE screen take its layout display.
   (Screen-type rules like .idea{display:grid} must NOT override the hidden default —
   so the grid/centering layout is scoped to .is-active.) */
.screen { display: none; }
.screen.is-active { display: block; }

/* page-load entrance: one orchestrated stagger */
.enter > * { opacity: 0; transform: translateY(14px); }
.enter.is-active > * { animation: rise 0.62s var(--ease) forwards; }
.enter.is-active > *:nth-child(1) { animation-delay: 0.02s; }
.enter.is-active > *:nth-child(2) { animation-delay: 0.09s; }
.enter.is-active > *:nth-child(3) { animation-delay: 0.16s; }
.enter.is-active > *:nth-child(4) { animation-delay: 0.23s; }
.enter.is-active > *:nth-child(5) { animation-delay: 0.30s; }
.enter.is-active > *:nth-child(6) { animation-delay: 0.37s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ------------------------------------------------------- masthead band */
.masthead {
  background: var(--ink-strong);
  color: var(--paper);
  padding: var(--s-3) 0;
  position: relative;
}
.masthead::after { content: ""; display: block; position: absolute;
  left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); opacity: 0.85; }
.masthead .wrap-wide { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.logo {
  font-family: var(--display); font-weight: 900; font-size: var(--fs-lg);
  letter-spacing: -0.01em; color: var(--paper); text-decoration: none;
  display: inline-flex; align-items: baseline; gap: 0.4ch;
}
.logo .mark { color: var(--accent); }
.masthead .colophon {
  font-family: var(--display); font-size: var(--fs-eyebrow);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: oklch(0.78 0.02 215); margin: 0;
}

/* =====================================================================
   SCREEN 1 — Idea entry
   ===================================================================== */
.idea.is-active {
  min-height: 100dvh; display: grid; align-content: center;
  padding: var(--s-7) 0;
}
.idea .wrap { width: min(60ch, 92vw); }
.idea h1 {
  font-size: var(--fs-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-3);
  max-width: 16ch;
}
.idea h1 em { font-style: italic; font-weight: 400; color: var(--accent-deep); }
.idea .lede {
  font-size: var(--fs-lg); color: var(--ink-soft);
  max-width: 46ch; margin: 0 0 var(--s-5);
}
.idea-form { display: grid; gap: var(--s-3); }
.field-shell {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  border-radius: 2px;
  transition: border-color 0.2s var(--ease-soft), box-shadow 0.2s var(--ease-soft);
}
.field-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.63 0.16 47 / 0.16);
}
.field-shell input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-family: var(--body); font-size: var(--fs-lg); color: var(--ink);
  padding: var(--s-3) var(--s-4);
}
.field-shell input::placeholder { color: var(--ink-soft); opacity: 0.7; }

.btn {
  font-family: var(--display); font-weight: 600; font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  border: 0; cursor: pointer; border-radius: 2px;
  padding: var(--s-3) var(--s-4);
  transition: transform 0.14s var(--ease), background 0.18s var(--ease-soft), color 0.18s;
}
.btn:disabled { cursor: default; opacity: 0.55; }
.btn-primary { background: var(--accent); color: oklch(0.99 0.01 85); }
.btn-primary:hover:not(:disabled) { background: var(--accent-deep); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.field-shell .btn-primary { border-radius: 0; white-space: nowrap; }

.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--ink-soft); transform: translateY(-1px); }

.seed-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: baseline; }
.seed-row .label { font-size: var(--fs-sm); color: var(--ink-soft); margin-right: var(--s-1); }
.seed {
  font-family: var(--body); font-style: italic; font-size: var(--fs-sm);
  background: transparent; border: 0; border-bottom: 1px solid var(--line-strong);
  color: var(--accent-deep); cursor: pointer; padding: 0.1em 0.1em;
  transition: border-color 0.18s var(--ease-soft), color 0.18s;
}
.seed:hover { border-color: var(--accent); color: var(--accent); }

.form-error {
  font-size: var(--fs-sm); color: var(--warn);
  min-height: 1.4em; margin: 0;
}

/* =====================================================================
   SCREEN 2 — Generating
   ===================================================================== */
.generating.is-active {
  min-height: 100dvh; display: grid; align-content: center; padding: var(--s-7) 0;
}
.generating .wrap { width: min(56ch, 92vw); }
.gen-topic {
  font-family: var(--display); font-style: italic; color: var(--ink-soft);
  font-size: var(--fs-lg); margin: 0 0 var(--s-2);
}
.gen-headline {
  font-size: var(--fs-h1); font-weight: 600; margin: 0 0 var(--s-5);
  letter-spacing: -0.01em; min-height: 1.1em;
}

/* the indeterminate "printing press" bar — a classy travelling sweep */
.press {
  height: 3px; background: var(--paper-sunk); border-radius: 2px;
  position: relative; overflow: hidden; margin-bottom: var(--s-5);
}
.press::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 38%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: sweep 1.9s var(--ease-soft) infinite;
}
@keyframes sweep { 0% { left: -40%; } 100% { left: 102%; } }

/* staged status list — each lights up as the stage advances */
.stages { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.stages li {
  display: grid; grid-template-columns: 1.4em 1fr; align-items: baseline;
  gap: var(--s-2); color: var(--ink-soft);
  transition: color 0.3s var(--ease-soft);
}
.stages li .dot {
  width: 0.5em; height: 0.5em; border-radius: 50%;
  border: 1px solid var(--line-strong); justify-self: center;
  margin-top: 0.5em; transition: all 0.3s var(--ease-soft);
}
.stages li.done { color: var(--ink); }
.stages li.done .dot { background: var(--accent); border-color: var(--accent); }
.stages li.active { color: var(--ink); }
.stages li.active .dot { border-color: var(--accent); animation: pulse 1.6s var(--ease-soft) infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(0.63 0.16 47 / 0.4); }
  50% { box-shadow: 0 0 0 5px oklch(0.63 0.16 47 / 0); }
}
.gen-note { font-size: var(--fs-sm); color: var(--ink-soft); margin-top: var(--s-5); }

.gen-error { display: none; }
.gen-error.is-shown { display: block; }
.gen-error h2 { font-size: var(--fs-h2); margin: 0 0 var(--s-2); }
.gen-error p { color: var(--ink-soft); margin: 0 0 var(--s-4); max-width: 44ch; }

/* =====================================================================
   SCREEN 3 — Course map
   ===================================================================== */
.course { padding-bottom: var(--s-7); }

.hero {
  background: var(--ink-strong); color: var(--paper);
  padding: var(--s-7) 0 var(--s-6);
  position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent); opacity: 0.85; }
.hero .grid {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--s-6); align-items: end;
}
.hero .eyebrow { color: var(--accent); }
.hero h1 {
  color: var(--paper); font-weight: 900; font-size: var(--fs-display);
  letter-spacing: -0.02em; margin: 0 0 var(--s-3); max-width: 16ch;
}
.hero .summary { color: oklch(0.86 0.02 215); font-size: var(--fs-lg); max-width: 46ch; margin: 0; }
.hero .audience {
  font-size: var(--fs-sm); color: oklch(0.78 0.02 215);
  margin-top: var(--s-4); font-style: italic;
}

/* cover image placeholder slot (Phase 5 fills it) */
.cover-slot {
  aspect-ratio: 3 / 2; border: 1px solid oklch(0.5 0.03 215);
  background: oklch(0.32 0.04 215);
  display: grid; place-content: center; text-align: center;
  color: oklch(0.72 0.02 215); border-radius: 2px; padding: var(--s-3);
}
.cover-slot .ph-label { font-family: var(--display); font-size: var(--fs-eyebrow);
  letter-spacing: 0.16em; text-transform: uppercase; }
.cover-slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }

/* Phase 5: progressive image reveal. A landed image starts transparent and fades to opaque
   over an ease-out curve; behind prefers-reduced-motion the swap is instant (no transition). */
.img-reveal { opacity: 0; transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1); }
.img-reveal.is-shown { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .img-reveal { transition: none; opacity: 1; }
}
/* a slot that now holds a real image drops its placeholder framing */
.cover-slot.has-img, .lesson-img-slot.has-img { background: none; border-color: var(--line); }

/* module thumbnail slot (Phase 5) — small landscape chip on each module row */
.mod .thumb {
  grid-row: 1 / -1; align-self: center; width: clamp(64px, 9vw, 108px);
  aspect-ratio: 16 / 10; border-radius: 2px; overflow: hidden; position: relative;
  background: var(--paper-sunk); border: 1px solid var(--line);
}
.mod .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mod.locked .thumb { opacity: 0.5; }

/* progress meter under hero */
.progress-strip { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-5); }
.progress-track {
  flex: 1; height: 4px; background: oklch(0.4 0.03 215); border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%; background: var(--accent); border-radius: 2px;
  transform-origin: left center;
  transition: width 0.8s var(--ease);
}
.progress-label { font-family: var(--display); font-size: var(--fs-sm);
  color: oklch(0.82 0.02 215); letter-spacing: 0.04em; white-space: nowrap; }

/* the editorial module list — intentional hierarchy, not a uniform grid */
.toc { margin-top: var(--s-6); }
.toc-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.toc-head h2 { font-size: var(--fs-h2); margin: 0; }

.modules { list-style: none; margin: var(--s-5) 0 0; padding: 0; }
.mod {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-4);
  align-items: baseline; padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s var(--ease-soft);
}
.mod:last-child { border-bottom: 1px solid var(--line); }
.mod .num {
  font-family: var(--display); font-weight: 900; font-size: var(--fs-h2);
  color: var(--line-strong); line-height: 1; letter-spacing: -0.02em;
  transition: color 0.2s var(--ease-soft);
  font-variant-numeric: tabular-nums;
}
.mod .body h3 { font-size: var(--fs-lg); margin: 0 0 0.2em; font-weight: 600; }
.mod .body .intro { font-size: var(--fs-sm); color: var(--ink-soft); margin: 0; max-width: 56ch; }
.mod .meta { font-size: var(--fs-eyebrow); color: var(--ink-soft);
  letter-spacing: 0.04em; text-align: right; white-space: nowrap; font-family: var(--display); }

.mod:hover { background: oklch(0.96 0.012 85); }
.mod:hover .num { color: var(--accent); }

/* Phase 6: Deep study (voice tutor) entry link on each unlocked module */
.deep-study {
  display: inline-flex; align-items: center; gap: 0.5ch;
  margin-top: var(--s-2);
  font-family: var(--display); font-size: var(--fs-eyebrow);
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent-deep); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease);
}
.deep-study:hover { border-bottom-color: var(--accent-deep); }
.deep-study .lock-glyph { width: 0.9em; height: 0.9em; }
.mod.lead .resume .deep-study { margin-top: 0; margin-left: var(--s-3); }

/* the LEAD module (active / next) is dominant — not a list row */
.mod.lead {
  grid-template-columns: auto 1fr; align-items: start;
  background: var(--paper-raised);
  border: 1px solid var(--line); border-radius: 3px;
  padding: var(--s-5); margin-bottom: var(--s-4);
}
.mod.lead .num { font-size: clamp(3rem, 2rem + 4vw, 5rem); color: var(--accent); }
.mod.lead .body h3 { font-size: var(--fs-h2); }
.mod.lead .body .intro { font-size: var(--fs-body); color: var(--ink-soft); margin-top: var(--s-2); max-width: 52ch; }
.mod.lead .resume {
  margin-top: var(--s-4); display: inline-flex; align-items: center; gap: 0.6ch;
}
.mod.lead .resume .btn-primary { padding: var(--s-2) var(--s-4); }

/* state affordances */
.mod .tag {
  display: inline-flex; align-items: center; gap: 0.4ch;
  font-family: var(--display); font-size: var(--fs-eyebrow); letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mod.done .num { color: var(--good); }
.mod.done .tag { color: var(--good); }
.mod.locked {
  background: var(--paper-sunk); cursor: not-allowed; color: var(--ink-soft);
}
.mod.locked .num { color: var(--line-strong); }
.mod.locked .body h3 { color: var(--ink-soft); }
.mod.locked .tag { color: var(--ink-soft); }
.mod.locked:hover { background: var(--paper-sunk); }
.mod.locked:hover .num { color: var(--line-strong); }
.lock-glyph { width: 0.85em; height: 0.85em; display: inline-block; vertical-align: -0.05em; }

/* =====================================================================
   SCREEN 4 — Lesson view
   ===================================================================== */
.lesson-layout { padding-top: var(--s-5); }
.lesson-layout .grid {
  display: grid; grid-template-columns: 15rem 1fr; gap: var(--s-6); align-items: start;
}

/* secondary nav rail */
.rail { position: sticky; top: var(--s-4); }
.rail .back {
  font-family: var(--display); font-size: var(--fs-sm); letter-spacing: 0.04em;
  background: none; border: 0; color: var(--ink-soft); cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; gap: 0.5ch; margin-bottom: var(--s-4);
  transition: color 0.18s var(--ease-soft), gap 0.18s var(--ease-soft);
}
.rail .back:hover { color: var(--accent); gap: 0.8ch; }
.rail .rail-eyebrow { font-family: var(--display); font-size: var(--fs-eyebrow);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 var(--s-2); }
.rail ol { list-style: none; padding: 0; margin: 0; counter-reset: l; }
.rail li {
  counter-increment: l; padding: var(--s-2) 0; border-top: 1px solid var(--line);
  font-size: var(--fs-sm); color: var(--ink-soft); cursor: pointer;
  display: grid; grid-template-columns: 1.6em 1fr; gap: var(--s-1);
  transition: color 0.18s var(--ease-soft);
}
.rail li::before { content: counter(l, decimal-leading-zero);
  font-family: var(--display); color: var(--line-strong); font-size: var(--fs-eyebrow); }
.rail li:hover { color: var(--ink); }
.rail li.current { color: var(--ink); }
.rail li.current::before { color: var(--accent); }

/* the reading sheet — the dominant element */
.sheet {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: 3px; padding: clamp(var(--s-4), 4vw, var(--s-6));
  max-width: 72ch;
}
.sheet .lesson-eyebrow { color: var(--accent-deep); }
.sheet h1 { font-size: var(--fs-h1); margin: 0 0 var(--s-4); letter-spacing: -0.01em; }

/* lesson image placeholder slot (Phase 5) */
.lesson-img-slot {
  aspect-ratio: 16 / 9; margin: 0 0 var(--s-5);
  border: 1px solid var(--line); background: var(--paper-sunk);
  display: grid; place-content: center; color: var(--ink-soft);
  text-align: center; border-radius: 2px; padding: var(--s-3);
}
.lesson-img-slot .ph-label { font-family: var(--display); font-size: var(--fs-eyebrow);
  letter-spacing: 0.16em; text-transform: uppercase; }
.lesson-img-slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }

/* rendered markdown prose */
.prose { font-size: var(--fs-body); color: var(--ink); }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 var(--s-3); }
/* drop-cap on the first paragraph — the printed field-guide touch */
.prose > p:first-of-type::first-letter {
  font-family: var(--display); font-weight: 900;
  float: left; font-size: 3.4em; line-height: 0.72;
  padding: 0.04em 0.12em 0 0; color: var(--accent-deep);
}
.prose h2 { font-size: var(--fs-h2); margin: var(--s-5) 0 var(--s-3); }
.prose h3 { font-size: var(--fs-lg); margin: var(--s-4) 0 var(--s-2); }
.prose ul, .prose ol { margin: 0 0 var(--s-3); padding-left: 1.4em; }
.prose li { margin: 0.3em 0; }
.prose strong { font-weight: 600; color: var(--ink-strong); }
.prose em { font-style: italic; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85em;
  background: var(--paper-sunk); padding: 0.1em 0.4em; border-radius: 2px;
}

.lesson-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); margin-top: var(--s-6); padding-top: var(--s-4);
  border-top: 1px solid var(--line); flex-wrap: wrap;
}
.lesson-foot .left { color: var(--ink-soft); font-size: var(--fs-sm); }

/* =====================================================================
   SCREEN 5 — Checkpoint (placeholder for Phase 4)
   ===================================================================== */
.checkpoint .sheet { max-width: 64ch; }
.checkpoint .ck-eyebrow { color: var(--accent-deep); }
.checkpoint h1 { font-size: var(--fs-h1); margin: 0 0 var(--s-3); }
.checkpoint .ck-lede { color: var(--ink-soft); font-size: var(--fs-lg); margin: 0 0 var(--s-5); max-width: 50ch; }
.ck-q { padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.ck-q .q { font-family: var(--display); font-weight: 600; font-size: var(--fs-lg); margin: 0 0 var(--s-3); }
.ck-choices { display: grid; gap: var(--s-2); }
/* selectable choice: now a real <button> (event-delegated; no inline onclick under helmet CSP) */
.ck-choice {
  display: flex; align-items: baseline; gap: var(--s-2);
  padding: var(--s-2) var(--s-3); border: 1px solid var(--line);
  border-radius: 2px; cursor: pointer; color: var(--ink);
  background: var(--paper); width: 100%; text-align: left;
  font: inherit; transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.ck-choice:hover:not(:disabled) { border-color: var(--line-strong); background: var(--paper-raised); }
.ck-choice.is-selected { border-color: var(--accent); background: oklch(0.96 0.03 47); }
.ck-choice.is-selected .key { color: var(--accent-deep); }
.ck-choice:disabled { cursor: default; opacity: 0.92; }
.ck-choice .key { font-family: var(--display); font-weight: 600; color: var(--line-strong); }

/* post-submit per-question verdict + revealed explanation */
.ck-q.is-correct { border-top-color: var(--good); }
.ck-q.is-wrong   { border-top-color: oklch(0.55 0.14 28); }
.ck-verdict { font-family: var(--display); font-weight: 600; font-size: var(--fs-sm); margin: var(--s-2) 0 0.3em; }
.ck-verdict.ok { color: var(--good); }
.ck-verdict.no { color: oklch(0.5 0.16 28); }
.ck-verdict .lock-glyph { color: inherit; }
.ck-explain { font-size: var(--fs-sm); color: var(--ink-soft); margin: 0; max-width: 56ch; }

/* result banner + actions */
.ck-result { margin: var(--s-4) 0 0; font-size: var(--fs-sm); }
.ck-result:empty { margin: 0; }
.ck-result.is-pass { color: var(--good); font-size: var(--fs-body); }
.ck-result.is-fail { color: oklch(0.5 0.16 28); font-size: var(--fs-body); }
.ck-result.is-note { color: var(--ink-soft); font-style: italic; }
.ck-actions { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; margin-top: var(--s-5);
  border-top: 1px solid var(--line); padding-top: var(--s-4); }
.ck-note { font-size: var(--fs-sm); color: var(--ink-soft); font-style: italic; margin-top: var(--s-5); }

/* =====================================================================
   SCREEN 6 — Completion celebration
   ===================================================================== */
.complete.is-active {
  min-height: 100dvh; display: grid; align-content: center; padding: var(--s-7) 0;
  text-align: center; position: relative; overflow: hidden;
}
.complete .wrap { width: min(54ch, 92vw); }
.seal {
  width: 7rem; height: 7rem; margin: 0 auto var(--s-5);
  position: relative;
}
.seal svg { width: 100%; height: 100%; display: block; }
.seal .ring { fill: none; stroke: var(--accent); stroke-width: 2.5;
  stroke-dasharray: 295; stroke-dashoffset: 295;
  animation: draw-ring 0.9s var(--ease) 0.15s forwards; }
.seal .tick { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round;
  stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50;
  animation: draw-ring 0.5s var(--ease) 0.75s forwards; }
@keyframes draw-ring { to { stroke-dashoffset: 0; } }
.complete .eyebrow { color: var(--accent-deep); }
.complete h1 { font-size: var(--fs-display); font-weight: 900; letter-spacing: -0.02em; margin: 0 0 var(--s-3); }
.complete .ct-title { font-style: italic; color: var(--accent-deep); }
.complete p { color: var(--ink-soft); font-size: var(--fs-lg); margin: 0 auto var(--s-5); max-width: 44ch; }
.complete .actions { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }

/* confetti canvas sits above content but ignores pointer */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* =================================================== responsive (390px) */
@media (max-width: 760px) {
  .hero .grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .hero .cover { order: -1; }
  .cover-slot { aspect-ratio: 16 / 9; }
  .lesson-layout .grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .rail { position: static; }
  .rail ol { display: none; } /* nav collapses to back-link on mobile; lesson nav via foot buttons */
  .mod { grid-template-columns: auto 1fr; }
  .mod .meta { grid-column: 2; text-align: left; margin-top: var(--s-1); }
  .mod.lead { padding: var(--s-4); }
  .field-shell { flex-direction: column; }
  .field-shell .btn-primary { border-radius: 0 0 2px 2px; }
}

/* =========================================== reduced motion: static fallbacks */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .enter > * { opacity: 1; transform: none; }
  .press::after { animation: none; left: 0; width: 100%; opacity: 0.5; }
  .seal .ring, .seal .tick { stroke-dashoffset: 0; }
  .progress-fill { transition: none; }
}
