/* ==========================================================================
   Video Course — design system

   Visual rules are not decoration here. They are load-bearing:
     - working memory holds ~4 chunks (Cowan), so no screen ever asks the
       learner to hold more than four things at once;
     - on-screen text is SIGNAL, not transcript. Narration carries the words
       (Mayer's redundancy principle) so the visual channel stays free;
     - one accent colour per meaning, used consistently, so colour itself
       becomes a retrieval cue rather than noise.
   ========================================================================== */

:root {
  /* surface */
  --ink-900: #070a12;
  --ink-850: #0a0e18;
  --ink-800: #0e1421;
  --ink-700: #141c2e;
  --ink-600: #1c2740;
  --ink-500: #26334f;
  --ink-400: #384868;
  --line:    #22304c;
  --line-soft: #1a2438;

  /* text */
  --fg:      #eaf0fb;
  --fg-mute: #a8b6d4;
  --fg-dim:  #6d7d9f;

  /* accents — one meaning each */
  --gold:    #f5b23d;   /* the concept / the answer  */
  --gold-dk: #7a5715;
  --cyan:    #4fd6e0;   /* the mechanism / motion    */
  --cyan-dk: #14545c;
  --violet:  #a98bff;   /* the math / formal         */
  --violet-dk:#3a2f66;
  --rose:    #ff7a8a;   /* the danger / the wrong    */
  --rose-dk: #6b2632;
  --lime:    #8fe06a;   /* correct / verified       */
  --lime-dk: #2f5a1d;

  --radius:   14px;
  --radius-s: 9px;
  --shadow:   0 1px 0 rgba(255,255,255,.04) inset, 0 12px 34px -18px rgba(0,0,0,.9);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --measure: 68ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--fg);
  background: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.6;
}

/* faint blueprint grid — reads as "notebook", costs nothing visually */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(79,214,224,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,214,224,.028) 1px, transparent 1px);
  background-size: 46px 46px;
  pointer-events: none;
  z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 860px; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- masthead */
.masthead {
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--ink-850), rgba(10,14,24,.6));
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}
.masthead-in { display: flex; align-items: center; gap: 20px; height: 58px; }
.brand { display: flex; align-items: baseline; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand .mark {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(140deg, var(--gold), #d8761a);
  color: #241503; font-size: 13px; font-weight: 900;
  align-self: center;
}
.brand small { color: var(--fg-dim); font-weight: 500; font-size: 12.5px; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a {
  color: var(--fg-mute); font-size: 14px; padding: 7px 12px;
  border-radius: 8px; font-weight: 500;
}
.nav a:hover { background: var(--ink-700); color: var(--fg); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--gold); background: rgba(245,178,61,.09); }

/* ---------------------------------------------------------------- hero */
.hero { padding: 68px 0 40px; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 18px;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.04; letter-spacing: -.028em; font-weight: 800;
  max-width: 20ch;
}
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.lede {
  font-size: clamp(16px, 1.9vw, 19.5px); color: var(--fg-mute);
  max-width: 62ch; margin: 0 0 26px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px; border-radius: 11px;
  font-size: 14.5px; font-weight: 650; font-family: inherit;
  border: 1px solid var(--line); background: var(--ink-700); color: var(--fg);
  cursor: pointer; transition: .16s ease; text-decoration: none;
}
.btn:hover { background: var(--ink-600); border-color: var(--ink-500); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(140deg, var(--gold), #e08a1e);
  color: #221503; border-color: transparent; font-weight: 750;
}
.btn-primary:hover { background: linear-gradient(140deg, #ffc457, #ee9a26); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------------------------------------------------------------- cards */
.card {
  background: linear-gradient(170deg, var(--ink-800), var(--ink-850));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--fg-mute); font-size: 14.5px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--ink-850); padding: 20px 22px; }
.stat b { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat span { display: block; font-size: 12.5px; color: var(--fg-dim); margin-top: 5px; text-transform: uppercase; letter-spacing: .07em; }
.stat.gold b { color: var(--gold); }
.stat.cyan b { color: var(--cyan); }
.stat.violet b { color: var(--violet); }
.stat.lime b { color: var(--lime); }

/* ---------------------------------------------------------------- semester block */
.sem { margin: 56px 0; }
.sem-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.sem-head h2 { margin: 0; font-size: 27px; letter-spacing: -.02em; }
.sem-head .badge {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-dim);
}
.sem p.blurb { color: var(--fg-mute); max-width: var(--measure); margin: 8px 0 0; }

.progressbar { height: 6px; border-radius: 99px; background: var(--ink-600); overflow: hidden; margin-top: 12px; }
.progressbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--lime)); border-radius: 99px; transition: width .4s ease; }

/* ---------------------------------------------------------------- chapter list */
.chapter {
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--ink-850); margin-bottom: 12px; overflow: hidden;
}
.chapter > summary {
  cursor: pointer; padding: 16px 20px; list-style: none;
  display: flex; align-items: center; gap: 16px;
  transition: background .15s;
}
.chapter > summary::-webkit-details-marker { display: none; }
.chapter > summary:hover { background: var(--ink-800); }
.chap-no {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center; border-radius: 10px;
  background: var(--ink-700); color: var(--fg-mute);
}
.chapter[data-done="partial"] .chap-no { background: rgba(245,178,61,.16); color: var(--gold); }
.chapter[data-done="full"] .chap-no { background: rgba(143,224,106,.16); color: var(--lime); }
.chap-main { flex: 1; min-width: 0; }
.chap-main b { display: block; font-size: 15.5px; font-weight: 650; letter-spacing: -.008em; }
.chap-main span { display: block; font-size: 12.5px; color: var(--fg-dim); font-family: var(--mono); }
.chap-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--fg-dim); font-family: var(--mono); }
.chev { color: var(--fg-dim); transition: transform .2s; }
.chapter[open] .chev { transform: rotate(90deg); }

.chapter-body { border-top: 1px solid var(--line-soft); padding: 6px 0 10px; background: var(--ink-900); }
.lesson-row {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 20px 9px 26px; font-size: 14px;
  border-left: 2px solid transparent;
}
.lesson-row:hover { background: var(--ink-850); border-left-color: var(--cyan); text-decoration: none; }
.lesson-row .lt { flex: 1; color: var(--fg-mute); min-width: 0; }
.lesson-row:hover .lt { color: var(--fg); }
.lesson-row .lm { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); }
.lesson-row .tick { width: 16px; color: var(--fg-dim); font-size: 13px; }
.lesson-row.done .tick { color: var(--lime); }
.lesson-row.done .lt { color: var(--fg-dim); text-decoration: line-through; text-decoration-color: var(--ink-500); }
.lesson-row .subtag {
  font-family: var(--mono); font-size: 11px; color: var(--cyan);
  background: rgba(79,214,224,.09); padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}

/* ---------------------------------------------------------------- lesson player */
.player-head { padding: 26px 0 18px; border-bottom: 1px solid var(--line-soft); }
.crumbs { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); margin-bottom: 10px; }
.crumbs a { color: var(--fg-dim); }
.crumbs a:hover { color: var(--cyan); }
.player-head h1 { margin: 0 0 8px; font-size: clamp(23px,3.4vw,32px); letter-spacing: -.022em; line-height: 1.16; }
.player-head .hook { color: var(--gold); font-family: var(--serif); font-style: italic; font-size: 16.5px; margin: 0 0 12px; }

.stage {
  position: relative;
  background: linear-gradient(165deg, #0c1220, #080c15);
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 460px;
  padding: 34px 38px;
  margin: 26px 0 20px;
  overflow: hidden;
  box-shadow: 0 30px 70px -40px #000;
}
.stage .slide { display: none; animation: slidein .45s cubic-bezier(.2,.7,.3,1); }
.stage .slide.on { display: block; }
@keyframes slidein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.slide .kind {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.slide h2 { margin: 0 0 14px; font-size: clamp(24px, 3.2vw, 34px); letter-spacing: -.024em; line-height: 1.14; font-weight: 750; }
.slide h3 { margin: 0 0 12px; font-size: 20px; letter-spacing: -.014em; }
.slide p { margin: 0 0 14px; font-size: 17.5px; line-height: 1.62; color: #dbe4f5; max-width: 60ch; }
.slide p.big { font-size: 21px; line-height: 1.5; max-width: 34ch; font-weight: 600; }
.slide ul { margin: 0 0 14px; padding-left: 20px; font-size: 17px; color: #dbe4f5; }
.slide li { margin-bottom: 8px; }
.slide strong { color: var(--gold); font-weight: 700; }
.slide em.hi { font-style: normal; color: var(--cyan); }
.slide .lead-in { font-family: var(--serif); font-size: 19px; line-height: 1.6; color: #cfdcf2; }

.eq {
  font-family: var(--serif); font-size: 22px; text-align: center;
  padding: 22px 18px; margin: 8px 0 16px;
  background: var(--ink-900); border: 1px solid var(--line);
  border-radius: var(--radius-s); color: #e9eefc;
}
.eq .var { color: var(--violet); font-style: italic; }
.eq .op  { color: var(--fg-dim); }
.eq sub, .eq sup { font-size: .62em; }

.callout {
  border-left: 3px solid var(--gold);
  background: rgba(245,178,61,.07);
  padding: 15px 20px; border-radius: 0 var(--radius-s) var(--radius-s) 0;
  margin: 0 0 16px; font-size: 16.5px; color: #f0e4cd;
}
.callout b { color: var(--gold); }
.callout.cyan { border-color: var(--cyan); background: rgba(79,214,224,.07); color: #d3f2f5; }
.callout.cyan b { color: var(--cyan); }
.callout.rose { border-color: var(--rose); background: rgba(255,122,138,.07); color: #f6d9de; }
.callout.rose b { color: var(--rose); }
.callout .lbl {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--fg-dim); margin-bottom: 6px;
}

/* "seductive detail" guard: flag interesting-but-irrelevant tangents on screen.
   Meta-analysis (Sundararajan & Adesope 2020) shows they impair learning
   unless their irrelevance is made explicit. */
.aside-flag {
  position: absolute; top: 14px; right: 16px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  color: var(--fg-dim); border: 1px dashed var(--ink-500);
  padding: 3px 8px; border-radius: 6px;
}

/* ---------------------------------------------------------------- transport */
.transport {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border: 1px solid var(--line-soft);
  border-radius: 13px; background: var(--ink-850);
  position: sticky; bottom: 14px; z-index: 20;
  box-shadow: 0 18px 40px -26px #000;
}
.transport .spacer { flex: 1; }
.pill {
  font-family: var(--mono); font-size: 12px; color: var(--fg-dim);
  min-width: 92px; text-align: center;
}
.dots { display: flex; gap: 4px; align-items: center; }
.dots i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-500);
  transition: .2s; cursor: pointer;
}
.dots i.on { background: var(--cyan); transform: scale(1.35); }
.dots i.check { background: var(--lime); }
.dots i.pause { background: var(--gold); }

/* TTS meter: a visible speaking indicator keeps the "human presence" cue that
   Guo et al. found worth 46% vs 33% problem-attempt rate. */
.meter { width: 46px; height: 22px; display: flex; align-items: flex-end; gap: 3px; }
.meter i { flex: 1; background: var(--gold); border-radius: 2px; height: 20%; transition: height .1s; }

/* ---------------------------------------------------------------- retrieval */
.retrieval {
  border: 1px solid var(--gold-dk); border-radius: 14px;
  background: linear-gradient(170deg, rgba(245,178,61,.1), rgba(245,178,61,.03));
  padding: 26px 28px; margin: 22px 0;
}
.retrieval .rtag {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 12px;
}
.retrieval .rq { font-size: 18.5px; font-weight: 600; line-height: 1.45; margin: 0 0 8px; max-width: 58ch; }
.retrieval .rwhy { font-size: 13.5px; color: var(--fg-dim); margin: 0 0 18px; max-width: 60ch; }
.retrieval textarea {
  width: 100%; min-height: 92px; resize: vertical;
  background: var(--ink-900); color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 15px; font-family: inherit; font-size: 15.5px; line-height: 1.55;
}
.retrieval textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,178,61,.13); }
.reveal-btn { margin-top: 12px; }
.reveal {
  display: none; margin-top: 16px; padding: 16px 18px;
  background: var(--ink-900); border: 1px solid var(--line); border-radius: 10px;
  font-size: 15.5px; line-height: 1.6;
}
.reveal.on { display: block; animation: slidein .3s; }
.reveal b { color: var(--lime); }
.reveal .gapmark { color: var(--rose); }

/* ---------------------------------------------------------------- quiz */
.q-block { border: 1px solid var(--line-soft); border-radius: 13px; background: var(--ink-850); padding: 22px 24px; margin-bottom: 16px; }
.q-block .qn { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); margin-bottom: 9px; letter-spacing: .08em; }
.q-block .qtext { font-size: 17px; font-weight: 600; margin: 0 0 16px; line-height: 1.45; }
.opts { display: grid; gap: 9px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--ink-800); cursor: pointer; font-size: 15.5px; line-height: 1.5;
  transition: .14s; text-align: left; font-family: inherit; color: var(--fg); width: 100%;
}
.opt:hover:not(:disabled) { border-color: var(--cyan); background: var(--ink-700); }
.opt:disabled { cursor: default; }
.opt .mk { font-family: var(--mono); font-size: 12.5px; color: var(--fg-dim); flex: 0 0 20px; padding-top: 2px; }
.opt.correct { border-color: var(--lime); background: rgba(143,224,106,.1); }
.opt.correct .mk { color: var(--lime); }
.opt.wrong { border-color: var(--rose); background: rgba(255,122,138,.09); }
.opt.wrong .mk { color: var(--rose); }
.opt.short textarea {
  width: 100%; min-height: 70px; background: var(--ink-900); color: var(--fg);
  border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px;
  font-family: inherit; font-size: 15px; resize: vertical;
}
.fb { margin-top: 12px; padding: 14px 16px; border-radius: 10px; font-size: 15px; line-height: 1.55; display: none; }
.fb.on { display: block; animation: slidein .28s; }
.fb.good { background: rgba(143,224,106,.09); border: 1px solid var(--lime-dk); }
.fb.bad { background: rgba(255,122,138,.08); border: 1px solid var(--rose-dk); }
.fb b { color: var(--fg); }
.fb .src { display: block; margin-top: 7px; font-family: var(--mono); font-size: 11.5px; color: var(--fg-dim); }

/* ---------------------------------------------------------------- flashcards */
.fc-wrap { perspective: 1600px; }
.fc {
  position: relative; width: 100%; min-height: 260px;
  transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3,.8,.3,1);
  cursor: pointer;
}
.fc.flipped { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 16px; padding: 30px 34px;
  display: flex; flex-direction: column; justify-content: center;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.fc-front { background: linear-gradient(160deg, #101827, #0b1120); }
.fc-back  { background: linear-gradient(160deg, #17202f, #0e1522); transform: rotateY(180deg); }
.fc-term { font-size: 26px; font-weight: 750; letter-spacing: -.018em; line-height: 1.2; }
.fc-sub { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); margin-top: 9px; }
.fc-def { font-size: 16.5px; line-height: 1.6; color: #dde6f7; }
.fc-hint { font-family: var(--mono); font-size: 11.5px; color: var(--fg-dim); margin-top: auto; padding-top: 18px; }
.fc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.chip {
  font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--fg-dim); letter-spacing: .05em;
}
.chip.gold { color: var(--gold); border-color: var(--gold-dk); }
.chip.lime { color: var(--lime); border-color: var(--lime-dk); }
.chip.cyan { color: var(--cyan); border-color: var(--cyan-dk); }
.chip.rose { color: var(--rose); border-color: var(--rose-dk); }
.chip.violet { color: var(--violet); border-color: var(--violet-dk); }

.rate-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- figure host */
.figure {
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--ink-900); margin: 20px 0; overflow: hidden;
}
.figure-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft); background: var(--ink-850);
}
.figure-head .ft { font-size: 14px; font-weight: 650; }
.figure-head .fh { font-size: 12.5px; color: var(--fg-dim); flex: 1; min-width: 160px; }
.figure-body { padding: 16px; }
.figure-body svg { display: block; width: 100%; height: auto; max-width: 100%; }
.figure-ctl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 0 16px 14px; }
.figure-read {
  padding: 0 16px 16px; font-size: 14px; color: var(--fg-mute); line-height: 1.55; max-width: 70ch;
}
.figure-read b { color: var(--cyan); }

/* svg text defaults — figures must be readable, so text is signal not decoration */
svg text { font-family: var(--sans); fill: var(--fg-mute); }
svg .t-title  { font-size: 13px; font-weight: 650; fill: var(--fg); }
svg .t-label  { font-size: 11.5px; }
svg .t-small  { font-size: 10px; fill: var(--fg-dim); }
svg .t-mono   { font-size: 11px; font-family: var(--mono); }
svg .node     { fill: var(--ink-600); stroke: var(--ink-400); stroke-width: 1.4; }
svg .edge     { stroke: var(--ink-400); stroke-width: 1.5; fill: none; }
svg .hl-gold  { stroke: var(--gold); fill: none; }
svg .fill-gold { fill: rgba(245,178,61,.22); }
svg .fill-cyan { fill: rgba(79,214,224,.18); }
svg .fill-rose { fill: rgba(255,122,138,.18); }
svg .fill-lime { fill: rgba(143,224,106,.18); }
svg .s-gold { stroke: var(--gold); }
svg .s-cyan { stroke: var(--cyan); }
svg .s-rose { stroke: var(--rose); }
svg .s-lime { stroke: var(--lime); }
svg .s-violet { stroke: var(--violet); }
svg .anim { transition: all .35s cubic-bezier(.2,.7,.3,1); }

/* ---------------------------------------------------------------- misc */
.section { padding: 46px 0; }
.section h2 { font-size: 25px; letter-spacing: -.02em; margin: 0 0 8px; }
.section > .wrap > p.sub { color: var(--fg-mute); max-width: var(--measure); margin: 0 0 26px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
  text-align: left; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg-dim); font-weight: 500;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); color: var(--fg-mute); }
table.tbl tr:hover td { background: var(--ink-850); color: var(--fg); }
table.tbl td.mono { font-family: var(--mono); font-size: 13px; }

.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.filterbar input[type=search], .filterbar select {
  background: var(--ink-800); border: 1px solid var(--line); color: var(--fg);
  border-radius: 9px; padding: 9px 13px; font-family: inherit; font-size: 14px; min-width: 200px;
}
.filterbar input:focus, .filterbar select:focus { outline: none; border-color: var(--cyan); }

.empty { padding: 44px 20px; text-align: center; color: var(--fg-dim); font-size: 15px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink-700); border: 1px solid var(--line);
  padding: 12px 20px; border-radius: 11px; font-size: 14px;
  z-index: 100; box-shadow: 0 20px 50px -20px #000;
  animation: slidein .3s;
}

footer.site {
  border-top: 1px solid var(--line-soft); margin-top: 70px;
  padding: 34px 0 44px; color: var(--fg-dim); font-size: 13px;
}
footer.site .tag { font-family: var(--serif); font-style: italic; color: var(--fg-mute); }

kbd {
  font-family: var(--mono); font-size: 11.5px; background: var(--ink-700);
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 2px 6px; color: var(--fg-mute);
}

code.m { font-family: var(--mono); font-size: .92em; color: var(--cyan); }

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .stage { padding: 24px 20px; min-height: 380px; }
  .transport { flex-wrap: wrap; }
  .dots { display: none; }
  .lesson-row { padding-left: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* print: a clean handout of the whole course */
@media print {
  body { background: #fff; color: #000; }
  body::before, .masthead, .transport, .hero-actions, footer.site { display: none; }
}

/* --------------------------------------------------------------- splash ---
   The gate in front of the course. Opaque and full-viewport on purpose: a
   splash you can see the course through is not a splash. `inset: 0` plus a
   z-index above everything, and the card is the only thing that scrolls. */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg, #0b1120);
  color: var(--fg, #e6edf3);
  overflow-y: auto;
}
.splash-card {
  max-width: 46rem;
  width: 100%;
  border: 1px solid var(--ink-500, #2b3648);
  border-radius: 14px;
  background: var(--panel, #131b2b);
  padding: 28px 30px;
}
.splash-heading {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-dim, #9fb0c3);
}
.splash-notice {
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.62;
}
/* The one control. Deliberately not "Play", "Next" or a voice name: the
   end-to-end suite finds the transport buttons by those words, and a splash
   button matching one of them would be read as transport. */
.splash-ok {
  font: inherit;
  font-size: 15px;
  padding: 9px 22px;
  border-radius: 9px;
  border: 1px solid var(--gold, #f5b23d);
  background: var(--gold, #f5b23d);
  color: #0b1120;
  cursor: pointer;
}
/* Two columns: artwork beside the notice. The source image is portrait, so a
   banner across the top would stretch it; this uses the aspect it was made at
   and never upscales it. */
.splash-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 26px;
  align-items: start;
}
.splash-hero {
  display: block;
  width: auto;          /* never upscale a 270x380 source to fill a column */
  height: auto;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--ink-500, #2b3648);
}
.splash-text { min-width: 0; }
@media (max-width: 620px) {
  .splash-card { grid-template-columns: 1fr; }
  .splash-hero { justify-self: start; }
}
.splash-ok:focus-visible { outline: 2px solid var(--cyan, #4fd6e0); outline-offset: 3px; }
@media print { .splash { display: none; } }
