/* Lesson player. Same type, colours and rules as the landing page and the session deck:
   type set bare over the sky, hairlines between things, HUD blue glows, gold is the one
   warm number. The sky starts at dusk behind the picture and turns to night as you read. */

:root {
  --edge: clamp(24px, 5vw, 80px);
  --foot: clamp(28px, 4.5vh, 44px);
  --wide: min(1440px, calc(100vw - var(--edge) * 2));
  --ink: #f1f4f7;
  --ink-dim: rgba(231, 238, 245, 0.78);
  --ink-muted: rgba(231, 238, 245, 0.52);
  --ink-faint: rgba(231, 238, 245, 0.3);
  --hud: #a9e6ff;
  --hud-dim: rgba(169, 230, 255, 0.3);
  --hud-glow: 0 0 16px rgba(169, 230, 255, 0.45);
  --gold: #e6c68a;
  --gold-dim: rgba(230, 198, 138, 0.38);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --panel: rgba(6, 11, 18, 0.6);
  --display: "Michroma", "Eurostile", "Arial Black", sans-serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --night: 0;
  /* the study surfaces (rail, notes, menus): frosted glass with soft corners */
  --radius: 18px;
  --glass-bg: linear-gradient(180deg, rgba(26, 34, 50, 0.52), rgba(10, 15, 24, 0.46));
  --glass-line: rgba(255, 255, 255, 0.1);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #05080d; color: var(--ink); -webkit-font-smoothing: antialiased; scroll-behavior: smooth; overflow-x: clip; }
body { font-family: var(--sans); font-size: 16px; line-height: 1.6; overflow-x: clip; position: relative; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.gold { color: var(--gold); }

kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0; color: var(--ink-dim);
  border: 1px solid var(--line-strong);
}

/* ---------- sky + grading ---------- */
.sky { position: fixed; inset: 0; z-index: -3; pointer-events: none; background: linear-gradient(to bottom, #1a2140, #f2a066 68%, #05080d); }
.ambient {
  position: absolute; z-index: -2; left: 50%; top: -10vh; width: 120vw; height: 110vh; transform: translateX(-50%);
  filter: blur(100px) saturate(1.6); opacity: 0; transition: opacity 1.4s ease; pointer-events: none;
}
.is-lit .ambient { opacity: 0.7; }
.fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
/* dusk at the top of the page, night by the time you are reading the transcript */
.fx-shade {
  z-index: -1;
  background:
    linear-gradient(rgba(3, 5, 9, calc(0.35 + var(--night) * 0.55)), rgba(3, 5, 9, calc(0.35 + var(--night) * 0.55))),
    radial-gradient(ellipse 85% 75% at 50% 40%, rgba(3, 5, 9, 0.15), rgba(3, 5, 9, 0.75));
}
.fx-grain {
  z-index: 30; inset: -50%; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 28px var(--edge); padding-top: max(28px, env(safe-area-inset-top));
}
.nav-brand { font-family: var(--display); font-size: 15px; letter-spacing: 0.04em; text-decoration: none; }
.nav-brand span { color: var(--hud); }
.nav-actions { display: flex; align-items: center; gap: 22px; min-width: 0; }
.nav-left { display: flex; align-items: baseline; min-width: 0; }
/* breadcrumb: each step carries its own slash, so dropping a step never leaves two words touching */
.nav-brand { display: block; line-height: 1; }
.crumbs { display: flex; align-items: baseline; min-width: 0; margin-left: 18px; white-space: nowrap; line-height: 1; color: var(--ink-muted); }
.crumb-item { display: inline-flex; align-items: baseline; min-width: 0; }
.crumb-item + .crumb-item { margin-left: 16px; }
.crumb-sep { margin-right: 16px; color: var(--ink-faint); }
.crumb { display: block; overflow: hidden; text-overflow: ellipsis; padding: 4px 0; }
.crumb--here { color: var(--ink); }
.crumb--link { color: var(--ink-muted); text-decoration: none; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.crumb--link:hover { color: var(--hud); border-color: var(--hud-dim); }
.nav-cta {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none;
  color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.4); padding: 9px 16px; white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav-cta:hover { background: var(--ink); color: #05080d; }
.nav-blur { position: fixed; top: 0; left: 0; right: 0; height: 130px; z-index: 19; pointer-events: none; }
.nav-blur::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(3, 6, 12, 0.78), rgba(8, 14, 26, 0.42) 40%, rgba(12, 20, 36, 0.12) 72%, transparent); }
.nav-blur i { position: absolute; inset: 0; }
.nav-blur i:nth-child(1) { backdrop-filter: blur(1px); -webkit-backdrop-filter: blur(1px); -webkit-mask: linear-gradient(to bottom, #000 0 55%, transparent); mask: linear-gradient(to bottom, #000 0 55%, transparent); }
.nav-blur i:nth-child(2) { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); -webkit-mask: linear-gradient(to bottom, #000 0 35%, transparent 72%); mask: linear-gradient(to bottom, #000 0 35%, transparent 72%); }
.nav-blur i:nth-child(3) { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); -webkit-mask: linear-gradient(to bottom, #000 0 15%, transparent 45%); mask: linear-gradient(to bottom, #000 0 15%, transparent 45%); }

/* ---------- type ---------- */
.kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--hud);
  margin-bottom: 18px; text-shadow: var(--hud-glow), 0 1px 12px rgba(0, 0, 0, 0.6);
}
.kicker--gold { color: var(--gold); text-shadow: 0 0 16px rgba(230, 198, 138, 0.45), 0 1px 12px rgba(0, 0, 0, 0.6); }
.title {
  font-family: var(--display); font-weight: 400; text-transform: uppercase; color: var(--ink);
  font-size: clamp(24px, 3.2vw, 46px); line-height: 1.12; letter-spacing: 0.02em;
  text-shadow: 0 0 40px rgba(169, 230, 255, 0.22), 0 2px 34px rgba(0, 0, 0, 0.35);
}
.title--sm { font-size: clamp(16px, 1.6vw, 22px); line-height: 1.3; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase;
  text-decoration: none; padding: 14px 24px; border: 0; cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.btn-light { background: var(--ink); color: #0a0d12; }
.btn-light:hover { background: #fff; box-shadow: 0 0 24px rgba(169, 230, 255, 0.45); }
.btn-line { border: 1px solid rgba(255, 255, 255, 0.45); color: var(--ink); background: rgba(6, 10, 16, 0.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-line:hover { border-color: var(--hud); box-shadow: 0 0 18px rgba(169, 230, 255, 0.25); }

/* ---------- player ---------- */
.lesson { padding-top: 96px; }
.stage { width: var(--wide); margin: 0 auto; }
/* Two thirds picture with the lesson and its chapters under it; one third for transcript,
   outcomes and notes, held in view as you scroll the chapters. */
.theatre {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); grid-template-areas: "player rail" "strip rail";
  column-gap: 20px; align-items: start; transition: grid-template-columns 0.5s var(--ease);
}
.theatre > .player { grid-area: player; }
.theatre > .strip { grid-area: strip; }
.theatre > .rail { grid-area: rail; position: sticky; top: 96px; height: max(520px, calc(100vh - 120px)); }
/* Wide: notes get half the room; the picture keeps its shape */
.theatre.is-wide { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }

.player {
  position: relative; aspect-ratio: 16 / 9; margin: 0;
  background: #000; overflow: hidden; outline: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 50px 140px -40px rgba(0, 0, 0, 0.9), 0 0 80px -20px rgba(169, 230, 255, 0.08);
}
.player:focus-visible { border-color: var(--hud-dim); }
.player[data-idle="true"] { cursor: none; }
.player:fullscreen { border: 0; border-radius: 0; max-height: none; }

.player video#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

.cover {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none;
  opacity: 0; transform: scale(1.06); filter: saturate(0.9);
  transition: opacity 1.4s ease, transform 8s var(--ease);
}
.cover.ready { opacity: 1; transform: scale(1); }
.player.has-played .cover { opacity: 0; transition-duration: 0.6s; }

.player-scrim {
  position: absolute; inset: 0; pointer-events: none; transition: opacity 0.5s ease;
  background:
    linear-gradient(to bottom, rgba(3, 5, 9, 0.7), transparent 26%),
    linear-gradient(to top, rgba(3, 5, 9, 0.88), rgba(3, 5, 9, 0.4) 22%, transparent 42%);
}
.player:not(.has-played) .player-scrim { background: linear-gradient(to bottom, rgba(3, 5, 9, 0.6), transparent 30%), radial-gradient(ellipse 70% 70% at 50% 55%, transparent, rgba(3, 5, 9, 0.55)), linear-gradient(to top, rgba(3, 5, 9, 0.9), transparent 40%); }

.player-head { position: absolute; top: clamp(18px, 3vw, 36px); left: clamp(18px, 3vw, 40px); right: 34%; pointer-events: none; transition: opacity 0.6s ease, transform 0.8s var(--ease), visibility 0s 0.6s; }
.player-head .kicker { margin-bottom: 12px; font-size: 10.5px; }
.player-title {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.02em;
  font-size: clamp(18px, 2.3vw, 34px); line-height: 1.12; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}
.player-meta { margin-top: 14px; color: var(--ink-dim); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7); }
/* once the lesson starts the picture is the point; the name lives under it */
.player.has-played .player-head { opacity: 0; transform: translateY(-10px); visibility: hidden; }

/* the chrome steps back while you watch */
.player[data-state="playing"][data-idle="true"] .player-scrim,
.player[data-state="playing"][data-idle="true"] .player-head { opacity: 0; }
.player[data-state="playing"][data-idle="true"] .player-head { transform: translateY(-8px); }
.player[data-state="playing"][data-idle="true"] .controls { opacity: 0; transform: translateY(10px); pointer-events: none; }

.start {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 12px; transition: opacity 0.4s ease, transform 0.6s var(--ease);
}
.player.has-played .start { opacity: 0; transform: translate(-50%, -50%) scale(0.94); pointer-events: none; }
.big-play { display: grid; justify-items: center; gap: 14px; background: none; border: 0; cursor: pointer; }
.big-play-ring {
  width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55); background: rgba(6, 10, 16, 0.35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s, border-color 0.3s;
  animation: ring 2.8s ease-out infinite;
}
.big-play-ring svg { width: 26px; height: 26px; margin-left: 4px; }
.big-play-label { color: var(--ink); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7); }
.big-play:hover .big-play-ring { background: var(--ink); color: #05080d; border-color: var(--ink); box-shadow: 0 0 34px rgba(169, 230, 255, 0.55); }
.player.has-played .big-play-ring { animation: none; }
@keyframes ring {
  0% { box-shadow: 0 0 0 0 rgba(169, 230, 255, 0.35); }
  70% { box-shadow: 0 0 0 22px rgba(169, 230, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(169, 230, 255, 0); }
}

.resume-chip {
  padding: 3px 0; background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.3); cursor: pointer;
  color: var(--ink-muted); font-size: 9.5px; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); transition: color 0.2s, border-color 0.2s;
}
.resume-chip:hover { color: var(--hud); border-color: var(--hud); }

.flash {
  position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(3, 5, 9, 0.45); opacity: 0; pointer-events: none;
  font: 500 12px var(--mono); letter-spacing: 0.1em;
}
.flash svg { width: 26px; height: 26px; }
.flash.go { animation: flash 0.6s ease-out; }
@keyframes flash { 0% { opacity: 1; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.25); } }

.caption {
  position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); max-width: min(820px, 86%);
  text-align: center; font-size: clamp(14px, 1.6vw, 20px); line-height: 1.45; pointer-events: none;
  transition: bottom 0.5s var(--ease), opacity 0.3s;
}
.caption span { background: rgba(3, 5, 9, 0.66); padding: 3px 10px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.caption em { font: 500 0.62em var(--mono); font-style: normal; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-right: 8px; vertical-align: 0.15em; }
.caption:empty { opacity: 0; }
/* step aside while you scrub, so the preview reads cleanly */
.player:has(.timeline:hover) .caption, .player:has(.timeline.dragging) .caption { opacity: 0; }
.player[data-state="playing"][data-idle="true"] .caption { bottom: 36px; }

.chapter-toast {
  position: absolute; right: clamp(18px, 3vw, 40px); top: clamp(18px, 3vw, 36px); max-width: 40%;
  padding-left: 14px; border-left: 1px solid var(--hud); text-align: left;
  font-family: var(--display); font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.4;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
  opacity: 0; transform: translateX(10px); transition: opacity 0.5s ease, transform 0.6s var(--ease); pointer-events: none;
}
.chapter-toast b { display: block; font: 400 10px var(--mono); letter-spacing: 0.3em; color: var(--hud); margin-bottom: 4px; text-shadow: var(--hud-glow); }
.chapter-toast.show { opacity: 1; transform: none; }

.spinner {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14); border-top-color: var(--hud);
  animation: spin 0.8s linear infinite; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.player[data-state="waiting"] .spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- controls: bare on the shade, no box ---------- */
.controls {
  position: absolute; left: clamp(14px, 2.6vw, 36px); right: clamp(14px, 2.6vw, 36px); bottom: clamp(10px, 1.6vw, 22px);
  transition: opacity 0.4s ease, transform 0.5s var(--ease);
}
.ctl-row { display: flex; align-items: center; gap: 2px; height: 44px; }
.spacer { flex: 1; }

.ctl {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 0; color: var(--ink-dim); cursor: pointer; transition: color 0.2s, transform 0.2s;
}
.ctl svg { width: 20px; height: 20px; }
.ctl:hover { color: #fff; filter: drop-shadow(0 0 8px rgba(169, 230, 255, 0.6)); }
.ctl:active { transform: scale(0.9); }
.ctl:focus-visible { outline: 1px solid var(--hud); outline-offset: -4px; }
.ctl[aria-pressed="true"] { color: var(--hud); filter: drop-shadow(0 0 8px rgba(169, 230, 255, 0.6)); }
.ctl--play { color: var(--ink); margin-left: -8px; }
.ctl--play svg { width: 22px; height: 22px; }
.ctl--text { width: auto; padding: 0 10px; font-size: 10.5px; }

.time { margin: 0 12px 0 10px; color: var(--ink); letter-spacing: 0.08em; white-space: nowrap; }
.time-sep { margin: 0 6px; color: var(--ink-faint); }
#timeTotal { color: var(--ink-muted); }
.ctl-chapter {
  min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  padding-left: 14px; border-left: 1px solid var(--line-strong); font-size: 13px; color: var(--ink-dim);
}

.vol { display: flex; align-items: center; }
.vol input { width: 0; opacity: 0; accent-color: var(--hud); height: 2px; cursor: pointer; transition: width 0.3s var(--ease), opacity 0.3s; }
.vol:hover input, .vol input:focus-visible { width: 72px; opacity: 1; margin-right: 8px; }

/* timeline: one hairline per chapter, gaps between them, gold ticks for key moments */
.timeline { position: relative; height: 26px; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; }
.timeline:focus-visible .segments { outline: 1px solid var(--hud-dim); outline-offset: 8px; }
.segments { position: relative; display: flex; gap: 4px; width: 100%; height: 3px; transition: height 0.25s var(--ease); }
.timeline:hover .segments, .timeline.dragging .segments { height: 6px; }
.seg { position: relative; height: 100%; background: rgba(255, 255, 255, 0.2); overflow: hidden; transition: background 0.2s, transform 0.25s var(--ease); }
.seg.hover { background: rgba(255, 255, 255, 0.34); transform: scaleY(1.5); }
.seg i, .seg b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.seg i { background: rgba(255, 255, 255, 0.24); }
.seg b { background: var(--ink); }
.seg.current b { background: var(--hud); box-shadow: 0 0 12px rgba(169, 230, 255, 0.8); }

.playhead {
  position: absolute; top: 50%; left: 0; width: 2px; height: 16px; margin: -8px 0 0 -1px; background: #fff;
  box-shadow: 0 0 10px rgba(169, 230, 255, 0.9); pointer-events: none; transition: height 0.25s var(--ease), margin 0.25s var(--ease);
}
.timeline:hover .playhead, .timeline.dragging .playhead { height: 22px; margin-top: -11px; }

.moments { position: absolute; inset: 0; pointer-events: none; }
.moment {
  position: absolute; top: 50%; width: 9px; height: 9px; margin: -15px 0 0 -4.5px; padding: 0; border: 0; background: none;
  pointer-events: auto; cursor: pointer;
}
.moment::before { content: ""; position: absolute; left: 4px; top: 0; width: 1px; height: 7px; background: var(--gold); box-shadow: 0 0 8px rgba(230, 198, 138, 0.8); transition: height 0.2s var(--ease), top 0.2s var(--ease); }
.moment:hover::before { height: 11px; top: -4px; }

.preview {
  position: absolute; bottom: 30px; left: 0; width: 280px; text-align: left; pointer-events: none;
  opacity: 0; transform: translateX(-50%) translateY(6px); transition: opacity 0.18s ease, transform 0.3s var(--ease);
}
.timeline:hover .preview, .timeline.dragging .preview { opacity: 1; transform: translateX(-50%); }
.preview-frame {
  position: relative; width: 100%; aspect-ratio: var(--ar, 16 / 9); overflow: hidden; background: #0b1016;
  border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7), 0 0 30px -6px rgba(169, 230, 255, 0.35);
}
.preview-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-meta {
  margin-top: 6px; padding: 10px 12px 11px; background: rgba(3, 5, 9, 0.88); border-left: 1px solid var(--hud);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.preview-time { color: var(--hud); letter-spacing: 0.16em; }
.preview-time .gold { color: var(--gold); }
.preview-chapter {
  margin-top: 5px; font-family: var(--display); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.4;
  color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* what is being said at that point: the timeline reads like the transcript */
.preview-line {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.45; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.preview-line:empty { display: none; }
.preview-line b { font: 500 9.5px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--hud); margin-right: 8px; }

/* muted by default: one quiet line says so */
.sound-chip {
  position: absolute; top: clamp(18px, 3vw, 36px); right: clamp(18px, 3vw, 40px); z-index: 2;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer;
  color: var(--ink); background: rgba(6, 10, 16, 0.5); border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: border-color 0.2s, box-shadow 0.2s, opacity 0.4s;
}
.sound-chip svg { width: 14px; height: 14px; }
.sound-chip:hover { border-color: var(--hud); box-shadow: 0 0 18px rgba(169, 230, 255, 0.25); }
.player.is-muted .chapter-toast { top: calc(clamp(18px, 3vw, 36px) + 46px); }

/* ---------- under the picture: the lesson, your progress, the chapters ---------- */
/* one compact line: the lesson, who teaches it, and your progress; the summary waits behind "More" */
.strip { padding: 22px 2px 56px; min-width: 0; }
.strip-head { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.strip-line { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.strip-title { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 16px; letter-spacing: 0.04em; line-height: 1.3; color: var(--ink); text-shadow: 0 0 24px rgba(169, 230, 255, 0.2); }
.strip-by { color: var(--ink-muted); font-size: 9.5px; }
.stats { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.stats div { display: flex; align-items: center; gap: 9px; }
.stats dt { color: var(--ink-faint); font-size: 9px; }
.stats dd { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink); white-space: nowrap; }
.strip-summary { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; font-size: 14px; line-height: 1.55; color: var(--ink-muted); }
.strip-summary > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-summary.open > span { white-space: normal; }
.more-link { flex: none; padding: 0; background: none; border: 0; border-bottom: 1px solid var(--hud-dim); color: var(--hud); font-size: 9.5px; cursor: pointer; }
.more-link:hover { border-color: var(--hud); text-shadow: var(--hud-glow); }
.stats .meta-bar { flex: none; width: 96px; }
.stats #metaProgress { min-width: 32px; text-align: right; }
.meta-bar { flex: 1; height: 2px; min-width: 40px; background: var(--line); border-radius: 2px; }
.meta-bar span { display: block; height: 100%; width: 0; background: var(--gold); box-shadow: 0 0 10px rgba(230, 198, 138, 0.6); border-radius: inherit; transition: width 0.8s var(--ease); }

.syllabus-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 6px; color: var(--ink-muted); }
.row-hint { display: flex; align-items: center; gap: 6px; color: var(--ink-faint); }
.row-hint kbd { border-radius: 5px; }
.syllabus { list-style: none; margin: 0 -14px; }

/* rows sit on hairlines; the hovered row lifts into a soft glass tile and its hairlines step aside */
.ch-card { position: relative; }
.ch-card + .ch-card::before { content: ""; position: absolute; top: 0; left: 14px; right: 14px; height: 1px; background: var(--line); transition: opacity 0.3s; }
.ch-card:hover::before, .ch-card:hover + .ch-card::before, .ch-card:focus-within::before, .ch-card:focus-within + .ch-card::before { opacity: 0; }
.ch-row {
  width: 100%; display: grid; grid-template-columns: 120px minmax(0, 1fr) 88px; gap: 20px; align-items: center;
  padding: 14px; background: none; border: 0; text-align: left; cursor: pointer; color: inherit; border-radius: 16px;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}
.ch-card:hover .ch-row, .ch-card:focus-within .ch-row {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.ch-row:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--hud-dim) !important; }
.ch-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: #0b1016; border: 1px solid var(--line); transition: border-color 0.3s, box-shadow 0.4s; }
.ch-thumb canvas { width: 100%; height: 100%; display: block; object-fit: cover; filter: saturate(0.85) brightness(0.75); transition: transform 1s var(--ease), filter 0.5s; }
.ch-card:hover .ch-thumb canvas { transform: scale(1.06); filter: saturate(1.05) brightness(0.95); }
.ch-card.current .ch-thumb { border-color: var(--hud); box-shadow: 0 0 22px -4px rgba(169, 230, 255, 0.5); }
.ch-play {
  position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: rgba(6, 10, 16, 0.45); border: 1px solid rgba(255, 255, 255, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transform: scale(0.85); transition: opacity 0.25s, transform 0.4s var(--ease);
}
.ch-play svg { width: 12px; height: 12px; margin-left: 2px; }
.ch-card:hover .ch-play { opacity: 1; transform: none; }

.ch-main { min-width: 0; }
/* the text fades out under the actions instead of sitting behind a dark block */
.ch-card:hover .ch-main, .ch-card:focus-within .ch-main {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 150px), transparent calc(100% - 80px));
  mask-image: linear-gradient(90deg, #000 calc(100% - 150px), transparent calc(100% - 80px));
}
.ch-time { display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-size: 9.5px; }
.ch-no { color: var(--gold); }
.ch-now { display: none; color: var(--hud); text-shadow: var(--hud-glow); }
.ch-card.current .ch-now { display: inline; }
.ch-title { display: block; margin-top: 5px; font-size: 16px; font-weight: 500; line-height: 1.3; letter-spacing: -0.015em; color: #fff; }
.ch-blurb { display: block; margin-top: 3px; font-size: 13.5px; color: rgba(235, 240, 246, 0.52); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ch-side { display: grid; justify-items: end; gap: 9px; transition: opacity 0.2s; }
.ch-dur { color: var(--ink-muted); font-size: 10px; }
.ch-progress { display: block; width: 64px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.ch-progress span { display: block; height: 100%; width: 0; background: var(--ink-dim); transition: width 0.5s ease; }
.ch-progress.done span { background: var(--gold); box-shadow: 0 0 8px rgba(230, 198, 138, 0.6); }
.ch-card.current .ch-progress span { background: var(--hud); }

/* on hover, the row offers its transcript and outcomes where the duration was */
.ch-links {
  position: absolute; right: 14px; top: 50%; display: flex; gap: 6px;
  opacity: 0; transform: translate(8px, -50%); pointer-events: none; transition: opacity 0.25s ease, transform 0.4s var(--ease);
}
.ch-card:hover .ch-links, .ch-card:focus-within .ch-links { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
.ch-card:hover .ch-side, .ch-card:focus-within .ch-side { opacity: 0; }
.ch-link {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  font-size: 9.5px; letter-spacing: 0.14em; color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.ch-link:hover { color: #05080d; background: var(--hud); border-color: var(--hud); box-shadow: 0 0 18px rgba(169, 230, 255, 0.4); }
.ch-link .n { color: var(--gold); margin-left: 7px; }
.ch-link:hover .n { color: inherit; }

.scarcity-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #6ef0a0; margin-right: 8px; }

/* ---------- rail: transcript + outcomes beside the picture ---------- */
.rail {
  contain: size; container-type: inline-size; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--glass-line); border-radius: var(--radius); background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: var(--glass-hi), 0 30px 80px -30px rgba(0, 0, 0, 0.7);
}
.rail-head { flex: none; height: 50px; display: flex; align-items: stretch; justify-content: space-between; gap: 10px; padding: 0 16px 0 18px; border-bottom: 1px solid var(--line); }
.rail-tabs { display: flex; gap: 18px; }
.rail-tabs button {
  background: none; border: 0; border-bottom: 1px solid transparent; margin-bottom: -1px; padding: 0; cursor: pointer;
  color: var(--ink-muted); font: inherit; letter-spacing: inherit; text-transform: inherit; transition: color 0.2s;
}
.rail-tabs button:hover { color: var(--ink); }
.rail-tabs button[aria-selected="true"] { color: var(--hud); border-bottom-color: var(--hud); text-shadow: var(--hud-glow); }
.rail-tabs .n { color: var(--gold); margin-left: 4px; }
.rail-head > .follow, .rail-wide { align-self: center; }
.rail:not([data-tab="transcript"]) .rail-head > .follow { display: none; }
.rail-wide {
  display: none; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-line); color: var(--ink-dim); transition: all 0.2s;
}
.rail-wide svg { width: 12px; height: 12px; }
.rail-wide:hover, .rail-wide[aria-pressed="true"] { color: var(--hud); border-color: var(--hud-dim); background: rgba(169, 230, 255, 0.08); }
.rail[data-tab="notes"] .rail-wide { display: inline-flex; }
@container (max-width: 470px) { .rail-head > .follow { font-size: 0; gap: 0; } .rail-wide span { display: none; } }
.rail .panel { display: none; }
.rail[data-tab="transcript"] .panel--transcript, .rail[data-tab="notes"] .panel--notes { display: flex; }
.rail[data-tab="outcomes"] .panel--outcomes { display: block; }

.panel { position: relative; flex: 1; min-height: 0; }
.panel--transcript, .panel--notes { flex-direction: column; }
.panel--outcomes { overflow-y: auto; padding: 20px 22px 24px; scrollbar-width: none; }
.panel--outcomes::-webkit-scrollbar { display: none; }
.rail.ping { animation: rail-ping 1.2s var(--ease); }
@keyframes rail-ping { 30% { border-color: var(--hud); box-shadow: 0 0 30px -4px rgba(169, 230, 255, 0.45); } }

/* ---------- notes ---------- */
.now-speaking {
  flex: none; margin: 2px 14px 4px; padding: 10px 12px 11px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(169, 230, 255, 0.07), rgba(169, 230, 255, 0.03)); border: 1px solid rgba(169, 230, 255, 0.13);
}
.ns-prev { margin-bottom: 6px; font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-prev:empty { display: none; }
.ns-prev b { font: 500 9px var(--mono); letter-spacing: 0.18em; text-transform: uppercase; margin-right: 8px; }
.ns-now { display: flex; gap: 10px; align-items: flex-start; }
.ns-line {
  flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink); cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ns-line b { display: block; margin-bottom: 3px; font: 500 9px var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--hud); text-shadow: var(--hud-glow); }
.ns-line:hover { color: #fff; }
.now-speaking.tick .ns-line { animation: ns-in 0.6s var(--ease); }
@keyframes ns-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ns-clip {
  flex: none; margin-top: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer; font-size: 9px; letter-spacing: 0.14em;
  color: var(--hud); background: rgba(10, 16, 26, 0.5); border: 1px solid rgba(169, 230, 255, 0.3); transition: background 0.2s, color 0.2s;
}
.ns-clip:hover { background: var(--hud); color: #05080d; }
.notes { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.notes-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 10px 20px; }
.notes-status { color: var(--ink-faint); font-size: 9.5px; letter-spacing: 0.18em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notes-actions { display: flex; gap: 6px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  font: 500 11px var(--mono); letter-spacing: 0.06em; color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-line); transition: all 0.2s var(--ease);
}
.pill svg { width: 14px; height: 14px; }
.pill:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.pill--hud { color: var(--hud); background: rgba(169, 230, 255, 0.1); border-color: rgba(169, 230, 255, 0.28); }
.pill--hud:hover { color: #05080d; background: var(--hud); box-shadow: 0 0 22px rgba(169, 230, 255, 0.45); }
.pill--icon { width: 30px; padding: 0; justify-content: center; }
.pill--static { height: 22px; padding: 0 8px; font-size: 10px; cursor: default; pointer-events: none; }

.notes-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 40px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; }
.notes-empty { display: none; margin: 6px 0 16px; padding: 16px 16px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px dashed rgba(255, 255, 255, 0.12); }
.notes.is-empty .notes-empty { display: block; }
.notes-empty-title { font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 10px; letter-spacing: -0.01em; }
.notes-empty ul { list-style: none; display: grid; gap: 9px; }
.notes-empty li { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.4; color: var(--ink-muted); }
.notes-empty li > :first-child { flex: none; }
.notes-empty kbd { border-radius: 6px; }

.notes-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 12px 20px; border-top: 1px solid var(--line); }
.notes-foot .follow { font-size: 9.5px; letter-spacing: 0.16em; }
.notes-foot .switch, .rail-head .switch { border-radius: 999px; }
.notes-foot .switch::after, .rail-head .switch::after { border-radius: 50%; }
.notes-count { color: var(--ink-faint); font-size: 9.5px; letter-spacing: 0.14em; white-space: nowrap; }

.notes-toast {
  position: absolute; left: 50%; bottom: 54px; transform: translate(-50%, 8px); padding: 8px 14px; border-radius: 999px; pointer-events: none;
  font-size: 10px; color: var(--ink); background: rgba(14, 19, 28, 0.85); border: 1px solid var(--glass-line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); opacity: 0; white-space: nowrap;
}
.notes-toast.show { animation: toast 2.2s var(--ease); }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 8px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }

/* the writing itself */
.prose { outline: none; font-size: 15px; line-height: 1.65; color: var(--ink); caret-color: var(--hud); letter-spacing: -0.006em; }
.prose > * + * { margin-top: 0.55em; }
.prose h1, .prose h2, .prose h3 { font-weight: 600; letter-spacing: -0.022em; line-height: 1.25; color: #fff; }
.prose h1 { font-size: 22px; margin-top: 1.1em; }
.prose h2 { font-size: 18px; margin-top: 1.2em; }
.prose h3 { font-size: 15.5px; margin-top: 1em; color: var(--ink-dim); }
.prose > :first-child { margin-top: 0; }
.prose strong { font-weight: 600; color: #fff; }
.prose a { color: var(--hud); text-decoration: underline; text-decoration-color: var(--hud-dim); text-underline-offset: 3px; }
.prose mark { background: rgba(230, 198, 138, 0.26); color: inherit; padding: 0 2px; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.prose code { font: 0.86em var(--mono); padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: var(--gold); }
.prose pre { padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.32); border: 1px solid var(--glass-line); overflow-x: auto; }
.prose pre code { padding: 0; background: none; color: var(--ink-dim); font-size: 12.5px; line-height: 1.6; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.2em; }
.prose li::marker { color: var(--ink-muted); }
.prose blockquote {
  padding: 10px 14px; border-radius: 12px; color: var(--ink-dim);
  background: linear-gradient(90deg, rgba(169, 230, 255, 0.08), rgba(169, 230, 255, 0.02)); box-shadow: inset 2px 0 0 var(--hud);
}
.prose blockquote em { color: var(--ink-muted); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 1.2em 0; }
.prose hr.ProseMirror-selectednode { background: var(--hud); }
.prose ul[data-type="taskList"] { list-style: none; padding-left: 0; }
.prose ul[data-type="taskList"] li { display: flex; gap: 10px; align-items: flex-start; }
.prose ul[data-type="taskList"] li > label { flex: none; margin-top: 3px; user-select: none; }
.prose ul[data-type="taskList"] li > div { flex: 1; min-width: 0; }
.prose ul[data-type="taskList"] input {
  appearance: none; -webkit-appearance: none; width: 17px; height: 17px; margin: 0; border-radius: 6px; cursor: pointer; display: grid; place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.03); transition: all 0.25s var(--ease);
}
.prose ul[data-type="taskList"] input:checked { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 12px rgba(230, 198, 138, 0.5); }
.prose ul[data-type="taskList"] input:checked::after { content: ""; width: 8px; height: 4px; border: solid #17120a; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.prose ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--ink-muted); text-decoration: line-through; text-decoration-color: var(--gold-dim); }
.prose .is-empty::before { content: attr(data-placeholder); float: left; height: 0; pointer-events: none; color: var(--ink-faint); }
.prose .ProseMirror-selectednode.moment-chip { box-shadow: 0 0 0 2px var(--hud); }
.prose ::selection { background: rgba(169, 230, 255, 0.28); }

.moment-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px 0 7px; margin: 0 2px; vertical-align: 1px;
  border-radius: 999px; border: 1px solid rgba(169, 230, 255, 0.3); background: rgba(169, 230, 255, 0.12); color: var(--hud);
  font: 500 11px/1 var(--mono); letter-spacing: 0.04em; cursor: pointer; transition: all 0.2s var(--ease); user-select: none;
}
.moment-chip::before { content: ""; border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.moment-chip:hover { background: var(--hud); color: #05080d; box-shadow: 0 0 16px rgba(169, 230, 255, 0.5); }
.prose h1 .moment-chip, .prose h2 .moment-chip { vertical-align: 2px; }

/* glass menus: slash commands, the selection bar, more */
.glass {
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 22, 33, 0.74); backdrop-filter: blur(26px) saturate(1.6); -webkit-backdrop-filter: blur(26px) saturate(1.6);
  box-shadow: var(--glass-hi), 0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 0 0 0.5px rgba(0, 0, 0, 0.4);
  color: var(--ink); font-family: var(--sans);
}
.pop {
  position: fixed; z-index: 60; width: 280px; max-height: 360px; overflow-y: auto; padding: 6px; scrollbar-width: none;
  opacity: 0; transform: translateY(4px) scale(0.98); transform-origin: top left; pointer-events: none;
  transition: opacity 0.16s ease, transform 0.22s var(--ease);
}
.pop.show { opacity: 1; transform: none; pointer-events: auto; }
.glass-label { padding: 8px 10px 4px; color: var(--ink-faint); font-size: 9px; letter-spacing: 0.2em; }
.pop button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 10px 7px 7px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); text-align: left; cursor: pointer;
}
.pop button.on, .more button:hover { background: rgba(255, 255, 255, 0.08); }
.pop b { display: block; font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em; }
.pop small { display: block; font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.slash-icon {
  flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  font: 500 12px var(--mono); color: var(--ink-dim); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-line);
}
.pop button.on .slash-icon { color: var(--hud); border-color: var(--hud-dim); background: rgba(169, 230, 255, 0.1); }
.more button.danger:hover b { color: #ff9a8a; }

.bubble { display: flex; align-items: center; gap: 2px; padding: 4px; z-index: 60; }
.bubble button {
  min-width: 30px; height: 30px; padding: 0 7px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--ink-dim); font-size: 13px; transition: background 0.15s, color 0.15s;
}
.bubble button:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.bubble button.on { color: var(--hud); background: rgba(169, 230, 255, 0.12); }
.bubble .hl { background: rgba(230, 198, 138, 0.35); padding: 0 3px; border-radius: 3px; color: #fff; }
.bubble .sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 3px; }

/* transcript lines can be clipped into notes */
.tr-line { position: relative; }
.tr-clip {
  position: absolute; right: 0; top: 7px; padding: 4px 9px; border-radius: 999px; cursor: pointer; font-size: 9px; letter-spacing: 0.14em;
  color: var(--hud); background: rgba(10, 16, 26, 0.9); border: 1px solid rgba(169, 230, 255, 0.3);
  opacity: 0; transform: translateX(4px); transition: opacity 0.2s, transform 0.3s var(--ease), background 0.2s, color 0.2s;
}
.tr-line:hover .tr-clip, .tr-line:focus-within .tr-clip { opacity: 1; transform: none; }
.tr-clip:hover { background: var(--hud); color: #05080d; }

/* your notes on the timeline: blue dots under the track */
.note-marks { position: absolute; inset: 0; pointer-events: none; }
.note-mark {
  position: absolute; top: 50%; width: 7px; height: 7px; margin: 7px 0 0 -3.5px; padding: 0; border: 0; border-radius: 50%;
  background: var(--hud); box-shadow: 0 0 8px rgba(169, 230, 255, 0.9); pointer-events: auto; cursor: pointer; transition: transform 0.2s var(--ease);
}
.note-mark:hover { transform: scale(1.6); }
.preview-note { margin-top: 8px; padding: 7px 9px; border-radius: 8px; font-size: 12.5px; line-height: 1.4; color: var(--ink); background: rgba(169, 230, 255, 0.1); }
.preview-note:empty { display: none; }
.preview-note b { display: block; font: 500 9px var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--hud); margin-bottom: 2px; }

.follow { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-muted); cursor: pointer; user-select: none; }
.follow input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 26px; height: 14px; border: 1px solid var(--line-strong); transition: border-color 0.2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; background: var(--ink-muted); transition: transform 0.3s var(--ease), background 0.2s; }
.follow input:checked + .switch { border-color: var(--hud-dim); }
.follow input:checked + .switch::after { transform: translateX(12px); background: var(--hud); box-shadow: 0 0 8px rgba(169, 230, 255, 0.8); }
.follow input:checked ~ * { color: var(--ink-dim); }
.follow input:focus-visible + .switch { outline: 1px solid var(--hud); outline-offset: 3px; }

/* the transcript reads like the phone reference: now in full white, the past dimmed, the future faint */
.transcript {
  flex: 1; min-height: 0; overflow-y: auto; padding: 0 18px 40px; scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 64px), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 64px), transparent);
  scrollbar-width: none;
}
.transcript::-webkit-scrollbar { display: none; }
.tr-chapter { display: flex; align-items: center; gap: 12px; margin: 30px 0 6px; scroll-margin-top: 12px; }
.tr-chapter:first-child { margin-top: 22px; }
.tr-chapter span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; color: var(--gold); flex: none; }
.tr-chapter h3 { font-family: var(--display); font-weight: 400; font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-muted); flex: none; max-width: 70%; }
.tr-chapter::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.tr-line {
  display: block; width: calc(100% + 14px); text-align: left; background: none; border: 0; padding: 9px 0 9px 14px; margin-left: -15px;
  border-left: 1px solid transparent; cursor: pointer; color: var(--ink-faint);
  transition: color 0.5s ease, border-color 0.4s;
}
.tr-line:hover { color: var(--ink-dim); }
.tr-line.past { color: var(--ink-muted); }
.tr-line.active { color: #fff; border-left-color: var(--hud); }
/* hovering the timeline points at the line that will play there */
.tr-line.peek { color: var(--ink); border-left-color: var(--gold); background: linear-gradient(90deg, rgba(230, 198, 138, 0.1), transparent 70%); }
.tr-line.peek .tr-meta { color: var(--gold); }
.tr-meta { display: flex; gap: 12px; align-items: baseline; margin-bottom: 3px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; }
.tr-at { letter-spacing: 0.08em; }
.tr-line.active .tr-meta { color: var(--hud); text-shadow: var(--hud-glow); }
.tr-text { display: block; font-size: 15px; line-height: 1.5; letter-spacing: -0.008em; }

.jump-now {
  position: absolute; left: 18px; bottom: 14px; padding: 8px 12px; cursor: pointer;
  color: var(--hud); background: rgba(5, 8, 13, 0.85); border: 1px solid var(--hud-dim); text-shadow: var(--hud-glow);
}

.out-steps { display: flex; gap: 5px; margin-bottom: 22px; }
.out-step {
  flex: 1; padding: 0 0 10px; background: none; border: 0; border-bottom: 1px solid var(--line-strong); cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-muted); text-align: left;
  transition: color 0.2s, border-color 0.2s;
}
.out-step:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.5); }
.out-step.done { color: var(--gold); border-color: var(--gold-dim); }
.out-step[aria-current="true"] { color: var(--hud); border-bottom: 2px solid var(--hud); padding-bottom: 9px; text-shadow: var(--hud-glow); }

.panel--outcomes .kicker { margin-bottom: 10px; font-size: 10px; }
.panel--outcomes .title--sm { font-size: 15px; line-height: 1.4; }
.out-blurb { font-size: 14px; line-height: 1.55; color: var(--ink-dim); margin: 12px 0 20px; }
.out-sub { color: var(--ink-muted); margin-bottom: 6px; }

.outcomes { list-style: none; margin-bottom: 22px; }
.outcome label { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; line-height: 1.45; }
.outcome input { position: absolute; opacity: 0; pointer-events: none; }
.outcome .box { flex: none; width: 18px; height: 18px; margin-top: 2px; display: grid; place-items: center; border: 1px solid var(--line-strong); color: transparent; transition: all 0.3s var(--ease); }
.outcome .box svg { width: 12px; height: 12px; }
.outcome label:hover .box { border-color: rgba(255, 255, 255, 0.6); }
.outcome input:checked + .box { background: var(--gold); border-color: var(--gold); color: #17120a; box-shadow: 0 0 14px rgba(230, 198, 138, 0.55); }
.outcome input:checked ~ span:last-child { color: var(--ink-muted); }
.outcome input:focus-visible + .box { outline: 1px solid var(--hud); outline-offset: 3px; }

.exercise { padding-left: 14px; border-left: 1px solid var(--gold); margin-bottom: 22px; }
.exercise p:first-child { color: var(--gold); margin-bottom: 6px; }
.exercise p:last-child { font-size: 14px; line-height: 1.5; color: var(--ink); }
.out-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.out-actions .btn { padding: 11px 16px; }

/* ---------- footer ---------- */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 40px var(--edge) var(--foot); border-top: 1px solid var(--line); color: rgba(245, 247, 250, 0.5);
}
.footer p { font-size: 13px; }
.footer .credit { flex: 1; text-align: center; }
.kbd-legend { display: flex; align-items: center; gap: 6px; font-size: 10px !important; }
.kbd-legend kbd + kbd { margin-left: -2px; }
.kbd-legend kbd:not(:first-child) { margin-left: 8px; }
.kbd-legend kbd + kbd { margin-left: 2px; }

/* ---------- narrow screens ---------- */
@media (max-width: 1240px) {
  .crumb-item:not(:last-child) { display: none; }
  .stats { margin-left: 0; width: 100%; gap: 18px; }
}

/* the rail drops under the picture once there's no room beside it */
@media (max-width: 1000px) {
  .theatre, .theatre.is-wide { grid-template-columns: 1fr; grid-template-areas: "player" "rail" "strip"; }
  .theatre > .rail { position: relative; top: 0; contain: none; height: min(560px, 62vh); margin-top: 16px; }
}

@media (max-width: 720px) {
  :root { --edge: 22px; }
  .nav { padding: 18px var(--edge); }
  .crumbs { display: none; }
  .lesson { padding-top: 76px; }
  .stage { width: 100%; }
  /* phones get a 16:9 frame: wide films letterbox, and the bars hold the captions and controls */
  .player { border-left: 0; border-right: 0; max-height: none; aspect-ratio: 16 / 9; }
  .player-head { right: 16px; }
  .player-head .kicker, .player-meta { display: none; }
  .start { top: 50%; }
  .chapter-toast, .ctl-chapter, .hide-sm { display: none; }
  .controls { left: 10px; right: 10px; bottom: 4px; }
  .ctl-row { height: 38px; }
  .time { margin-left: 4px; }
  .big-play-ring { width: 64px; height: 64px; }
  .big-play-label { display: none; }
  .caption { bottom: 64px; font-size: 13px; max-width: 92%; }
  .caption em { display: none; }
  .player[data-state="playing"][data-idle="true"] .caption { bottom: 10px; }
  .preview { width: 180px; }
  .preview-line { -webkit-line-clamp: 2; font-size: 12px; }
  .sound-chip { top: 10px; right: 10px; padding: 6px 10px; }
  .strip { padding: 28px var(--edge) 48px; }
  .stats { flex-wrap: wrap; gap: 10px 18px; }
  .row-hint { display: none; }
  .ch-row { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 12px 14px; }
  .ch-side { display: none; }
  .ch-links { display: none; }

  .theatre > .rail { margin: 12px 10px 0; height: 60vh; }
  .footer { flex-direction: column; align-items: flex-start; }
  .footer .credit { text-align: left; }
  .kbd-legend { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  html, .transcript { scroll-behavior: auto; }
}

/* softer corners on the hover preview, to match the glass */
.preview-frame { border-radius: 10px; }
.preview-meta { border-radius: 0 10px 10px 0; }

/* before the first play, keep the frame clean: no captions over the cover */
.player:not(.has-played) .caption { display: none; }
@media (max-width: 1000px) { .rail-wide { display: none !important; } }
[hidden] { display: none !important; }

/* ---------- evidence: outcome ladder, checks, missions ---------- */
:root { --proven: #6ef0a0; --miss: #ff8a7a; }

.ladder-key { display: flex; gap: 14px; margin: 2px 0 6px; color: var(--ink-faint); font-size: 8.5px; letter-spacing: 0.16em; }
.ladder-key span::before { content: ""; display: inline-block; width: 10px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.k-seen::before { background: var(--ink-dim); }
.k-recalled::before { background: var(--hud); }
.k-applied::before { background: var(--gold); }
.k-proven::before { background: var(--proven); }

.ev { padding: 12px 0 13px; border-bottom: 1px solid var(--line); list-style: none; }
.ev-text { font-size: 14px; line-height: 1.45; color: var(--ink); }
.ev-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.rungs { display: flex; gap: 4px; }
.r { display: block; width: 30px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.09); transition: background 0.4s, box-shadow 0.4s; }
.r-seen.on { background: var(--ink-dim); }
.r-recalled.on { background: var(--hud); box-shadow: 0 0 8px rgba(169, 230, 255, 0.6); }
.r-applied.on { background: var(--gold); box-shadow: 0 0 8px rgba(230, 198, 138, 0.6); }
.r-proven.on { background: var(--proven); box-shadow: 0 0 8px rgba(110, 240, 160, 0.6); }
.r.pending { background: transparent; box-shadow: inset 0 0 0 1px rgba(110, 240, 160, 0.6); animation: pending 1.6s ease-in-out infinite; }
@keyframes pending { 50% { opacity: 0.35; } }
.ev-next { font-size: 9px; letter-spacing: 0.14em; color: var(--ink-faint); white-space: nowrap; }
.ev[data-level="1"] .ev-next { color: var(--hud); }
.ev[data-level="2"] .ev-next { color: var(--gold); }
.ev[data-level="4"] .ev-next { color: var(--proven); }
.out-step[data-level="2"]:not([aria-current="true"]) { color: var(--hud); }

.proofs { display: grid; gap: 8px; margin: 16px 0 20px; }
.proof {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px 11px 11px; text-align: left; cursor: pointer; color: var(--ink);
  border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--glass-line); transition: background 0.2s, border-color 0.2s, transform 0.3s var(--ease);
}
.proof:hover { background: rgba(255, 255, 255, 0.075); border-color: var(--hud-dim); transform: translateY(-1px); }
.proof-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 500 14px var(--mono); color: var(--hud); border: 1px solid rgba(169, 230, 255, 0.35); background: rgba(169, 230, 255, 0.07); }
.proof-icon--gold { color: var(--gold); border-color: var(--gold-dim); background: rgba(230, 198, 138, 0.07); }
.proof-icon--green { color: var(--proven); border-color: rgba(110, 240, 160, 0.4); background: rgba(110, 240, 160, 0.07); }
.proof-main { flex: 1; min-width: 0; }
.proof-main b { display: block; font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em; }
.proof-main small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-muted); }
.proof-state { flex: none; font-size: 9.5px; color: var(--hud); }
.proof.is-done .proof-state { color: var(--gold); }
.proof--ask.is-done .proof-state { color: var(--proven); }
.proof.is-done .proof-icon { background: currentColor; }
.proof.is-done .proof-icon { color: #05080d; background: var(--hud); border-color: var(--hud); }
.proof.is-done .proof-icon--gold { background: var(--gold); border-color: var(--gold); }
.proof.is-done .proof-icon--green { background: var(--proven); border-color: var(--proven); }

/* the check sits over the picture, so feedback can point back into the video */
.check {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 12px;
  background: rgba(3, 5, 9, 0.6); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2);
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.check.open { opacity: 1; pointer-events: auto; }
.player.is-checking .controls, .player.is-checking .start, .player.is-checking .sound-chip, .player.is-checking .caption { opacity: 0 !important; pointer-events: none; }
.check-card {
  width: min(580px, 100%); max-height: 100%; overflow-y: auto; scrollbar-width: none; padding: 20px 22px 16px; border-radius: var(--radius);
  background: var(--glass-bg); border: 1px solid var(--glass-line); box-shadow: var(--glass-hi), 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  transform: translateY(10px) scale(0.98); transition: transform 0.5s var(--ease);
}
.check.open .check-card { transform: none; }
.check-head { display: flex; justify-content: space-between; align-items: center; }
.check-head .kicker { margin: 0; font-size: 10px; }
.check-dots { display: flex; gap: 4px; }
.check-dots i { width: 18px; height: 3px; border-radius: 2px; background: var(--line-strong); }
.check-dots i.done { background: var(--hud); }
.check-dots i.now { background: var(--ink); }
.check-q { margin: 12px 0 14px; font-size: 17px; font-weight: 500; line-height: 1.38; letter-spacing: -0.012em; color: #fff; }
.check-opts { display: grid; gap: 6px; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; text-align: left; cursor: pointer; font-size: 14px; line-height: 1.35; color: var(--ink);
  border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-line); transition: background 0.2s, border-color 0.2s, opacity 0.3s;
}
.opt:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.22); }
.opt:focus-visible { outline: 1px solid var(--hud); outline-offset: 2px; }
.opt-key { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 10px; letter-spacing: 0; color: var(--ink-muted); border: 1px solid var(--line-strong); }
.opt:disabled { cursor: default; }
.opt.right { border-color: var(--hud); background: rgba(169, 230, 255, 0.12); }
.opt.right .opt-key { background: var(--hud); border-color: var(--hud); color: #05080d; }
.opt.wrong { border-color: rgba(255, 138, 122, 0.5); background: rgba(255, 138, 122, 0.08); opacity: 0.8; }
.opt.wrong .opt-key { color: var(--miss); border-color: rgba(255, 138, 122, 0.5); }
.check-opts:has(.right) .opt:not(.right) { opacity: 0.45; }
.check-why { margin-top: 12px; padding: 12px 14px; border-radius: 12px; animation: why-in 0.4s var(--ease); }
@keyframes why-in { from { opacity: 0; transform: translateY(4px); } }
.check-why.is-right { background: rgba(169, 230, 255, 0.07); box-shadow: inset 2px 0 0 var(--hud); }
.check-why.is-wrong { background: rgba(255, 138, 122, 0.07); box-shadow: inset 2px 0 0 var(--miss); }
.check-why p { font-size: 13.5px; line-height: 1.5; color: var(--ink-dim); }
.check-why b { color: #fff; font-weight: 600; }
.check-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.check .btn, .sheet .btn { border-radius: 999px; padding: 10px 16px; }
.xp-chip { margin-right: auto; font-size: 10px; color: var(--gold); text-shadow: 0 0 12px rgba(230, 198, 138, 0.6); }
.check-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 14px; }
.check-skip { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-muted); font-size: 9.5px; }
.check-skip:hover { color: var(--ink); }
.check-outcome { min-width: 0; font-size: 8.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-card--done { text-align: left; }
.check-score { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.check-score .num { font-size: 46px; line-height: 1; color: #fff; }
.check-score .of { font: 12px var(--mono); color: var(--ink-muted); letter-spacing: 0.08em; }
.xp-big { margin-top: 8px; font-size: 13px; color: var(--gold); text-shadow: 0 0 16px rgba(230, 198, 138, 0.7); }
.check-got { list-style: none; margin: 14px 0 12px; display: grid; gap: 8px; }
.check-got li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink); }
.check-got .r { flex: none; }
.check-next { font-size: 13.5px; line-height: 1.5; color: var(--ink-muted); }
.check-next b { color: var(--gold); font-weight: 500; }

/* the mission: a sheet over the page */
.sheet {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px;
  background: rgba(3, 5, 9, 0.62); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet-card {
  width: min(960px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 24px 26px 20px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(26, 34, 50, 0.85), rgba(10, 15, 24, 0.85)); border: 1px solid var(--glass-line);
  box-shadow: var(--glass-hi), 0 40px 100px -20px rgba(0, 0, 0, 0.85); transform: translateY(14px) scale(0.98); transition: transform 0.5s var(--ease);
}
.sheet.open .sheet-card { transform: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.sheet-head .kicker { margin-bottom: 10px; font-size: 10px; }
.sheet-x { font-size: 18px; line-height: 1; }
.sheet-brief { margin: 12px 0 18px; font-size: 15px; line-height: 1.55; color: var(--ink-dim); max-width: 70ch; }
.sheet-body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; }
.sheet-write textarea {
  width: 100%; min-height: 300px; resize: vertical; padding: 14px 16px; border-radius: 14px; outline: none;
  font: 15px/1.6 var(--sans); color: var(--ink); background: rgba(0, 0, 0, 0.28); border: 1px solid var(--glass-line); transition: border-color 0.2s;
}
.sheet-write textarea:focus { border-color: var(--hud-dim); }
.sheet-write textarea::placeholder { color: var(--ink-faint); }
.sheet-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.sheet-count { font-size: 9.5px; color: var(--ink-faint); }
.sheet-list { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--glass-line); align-self: start; }
.sheet-label { font-size: 9.5px; color: var(--ink-muted); margin-bottom: 6px; }
.sheet-list ul { list-style: none; }
.sheet-list li { display: flex; gap: 11px; padding: 10px 0; border-top: 1px solid var(--line); }
.sheet-list li:first-child { border-top: 0; }
.sheet-list li i { flex: none; position: relative; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.25); transition: all 0.3s var(--ease); }
.sheet-list li.ok i { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 12px rgba(230, 198, 138, 0.55); }
.sheet-list li.ok i::after { content: ""; position: absolute; left: 5px; top: 3px; width: 4px; height: 8px; border: solid #17120a; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.sheet-list b { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink-dim); transition: color 0.2s; }
.sheet-list li.ok b { color: #fff; }
.sheet-list small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--ink-muted); }
.sheet-rule { margin-top: 10px; font-size: 9.5px; color: var(--ink-faint); }
.sheet-rule.ok { color: var(--gold); }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sheet-note { font-size: 12px; line-height: 1.5; color: var(--ink-faint); max-width: 62ch; }
.sheet .btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

.xp-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 80; padding: 12px 16px; border-radius: 14px; pointer-events: none;
  background: rgba(16, 22, 33, 0.85); border: 1px solid var(--gold-dim); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px -10px rgba(230, 198, 138, 0.5);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); opacity: 0;
}
.xp-toast b { display: block; font: 500 13px var(--mono); letter-spacing: 0.1em; color: var(--gold); text-shadow: 0 0 12px rgba(230, 198, 138, 0.6); }
.xp-toast span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-dim); }
.xp-toast.show { animation: xp 3.2s var(--ease); }
@keyframes xp { 0% { opacity: 0; transform: translateY(10px); } 10%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-4px); } }

.stats .xp { color: var(--gold); }

@media (max-width: 720px) {
  .check { position: fixed; z-index: 75; padding: 16px; }
  .sheet-body { grid-template-columns: 1fr; }
  .sheet-write textarea { min-height: 200px; }
  .sheet-foot { flex-direction: column; align-items: stretch; }
  .xp-toast { left: 16px; right: 16px; bottom: 16px; }
}

/* ---------- formats: video, slides, or both ---------- */
/* the format sits on the lesson line, quiet unless it's more than a video */
.fmt-badge:empty { display: none; }
.fmt-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 9px; letter-spacing: 0.16em;
  color: var(--ink-dim); border: 1px solid var(--line-strong); white-space: nowrap;
}
.fmt-badge[data-format="slides"] { color: var(--gold); border-color: var(--gold-dim); }
.fmt-badge[data-format="both"] { color: var(--hud); border-color: var(--hud-dim); text-shadow: var(--hud-glow); }

/* ---------- slides ---------- */
/* The slides themselves are the talk's deck, in a frame (below). A slide-card is its title card,
   set in the deck's type on the learn night sky: Geist Mono kicker with the ROPES letter,
   Michroma caps title, HUD blue and gold for emphasis. Every size is in container units, so it
   reads the same as a chapter thumbnail, in the timeline's hover preview or on a catalog card. */
.slide-card {
  position: absolute; inset: 0; overflow: hidden; container-type: size; text-align: left; color: var(--ink);
  background:
    radial-gradient(120% 70% at 50% 122%, rgba(242, 160, 102, 0.3), transparent 60%),
    radial-gradient(70% 60% at 92% -12%, rgba(169, 230, 255, 0.12), transparent 62%),
    linear-gradient(180deg, #151c38 0%, #0d1426 56%, #0b1016 100%);
}
/* a faint horizon, as on the landing page */
.slide-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 18%; height: 1px; background: linear-gradient(90deg, transparent, rgba(242, 160, 102, 0.22), transparent); pointer-events: none; }
.sl-inner {
  /* one unit: a hundredth of the width on a 16:9 box, grown a little on taller boxes so a narrow pane stays readable */
  --u: min(calc((1cqw + 1.78cqh) / 2), 1.6cqw);
  position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--u) * 5) calc(var(--u) * 6) calc(var(--u) * 5);
  overflow-y: auto; scrollbar-width: none;
}
.sl-inner::-webkit-scrollbar { display: none; }
.sl-kicker {
  display: flex; align-items: center; font: 400 max(9px, calc(var(--u) * 1.15)) / 1.4 var(--mono); letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--hud); text-shadow: var(--hud-glow); margin-bottom: calc(var(--u) * 2.2);
}
.sl-mark {
  flex: none; display: inline-grid; place-items: center; width: 2em; height: 2em; margin-right: 1.1em; letter-spacing: 0;
  border: 1px solid var(--hud-dim);
}
.sl-title {
  font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink);
  font-size: max(15px, calc(var(--u) * 4)); line-height: 1.1; text-wrap: balance;
  text-shadow: 0 0 40px rgba(169, 230, 255, 0.22), 0 2px 34px rgba(0, 0, 0, 0.35);
}
.sl-title .hl { color: var(--hud); }
.sl-title .gold { color: var(--gold); }
/* the three jobs keep the deck's colours, lifted for the dark */
.slide-card .c-ask { color: var(--hud); }
.slide-card .c-make { color: var(--gold); }
.slide-card .c-do { color: #7fe0b0; }
/* thumbnails: the shape of the slide, no floors on the type */
.slide-card--mini .sl-inner { justify-content: center; padding: calc(var(--u) * 6); overflow: hidden; }
.slide-card--mini .sl-kicker { font-size: calc(var(--u) * 2.4); margin-bottom: calc(var(--u) * 3); text-shadow: none; }
.slide-card--mini .sl-title { font-size: calc(var(--u) * 6.4); text-shadow: none; }

/* the slide stage: the talk's own deck in a frame (slides.js), drawn at its own size and scaled
   to the pane; the deck animates its slides itself */
.slides { position: absolute; inset: 0; background: #f4f5f7; overflow: hidden; }
.deck-frame { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #f4f5f7; }
/* while the slide is the small one, a click on it swaps it large instead of reaching the deck */
.player[data-format="both"][data-big="video"] .deck-frame { pointer-events: none; }

.ctl-slide { flex: none; margin-right: 12px; padding-left: 14px; border-left: 1px solid var(--line-strong); color: var(--ink-dim); font-size: 9.5px; white-space: nowrap; }
.ctl-slide + .ctl-chapter { border-left: 0; padding-left: 0; }
.ctl--swap { display: inline-flex; align-items: center; gap: 7px; }
.ctl--swap svg { width: 18px; height: 18px; }
.ctl--swap span { font-size: 9.5px; }
.ch-thumb .slide-card { transition: transform 1s var(--ease), filter 0.5s; filter: brightness(0.85); }
.ch-card:hover .ch-thumb .slide-card { transform: scale(1.06); filter: none; }
.preview-slide { position: absolute; inset: 0; }
.preview-slide:empty { display: none; }

/* Slides alone: a slide viewer, not a video. Nothing plays, so there's no play button, clock, speed,
   captions or sound; previous / next, the slide count, the chapter and full screen stay, over a
   shade only as deep as the controls. */
.player[data-format="slides"] :is(.start, .caption, .spinner, #btnPlay, .time, #btnSpeed, #btnCC, .vol, .playhead) { display: none; }
.player[data-format="slides"] .player-scrim { background: linear-gradient(to top, rgba(3, 5, 9, 0.82), rgba(3, 5, 9, 0.32) 11%, transparent 20%); }
.player[data-format="slides"] .preview-frame video { display: none; }
.ctl:disabled { color: var(--ink-faint); filter: none; transform: none; cursor: default; }
/* the timeline is a row of steps, one per slide, grouped by chapter: behind you filled, here lit */
.seg--steps { display: flex; gap: 2px; background: none; overflow: visible; }
.seg--steps.hover { background: none; }
.seg--steps > .step { flex: 1; min-width: 0; height: 100%; background: rgba(255, 255, 255, 0.2); transition: background 0.2s; }
.seg--steps > .step.seen { background: rgba(255, 255, 255, 0.34); }
.seg--steps > .step.on { background: var(--ink); }
.seg--steps > .step.now { background: var(--hud); box-shadow: 0 0 12px rgba(169, 230, 255, 0.8); }
.seg--steps > .step.hover { background: rgba(255, 255, 255, 0.6); }
.seg--steps > .step.now.hover { background: var(--hud); }

/* Both: the slide pane pages on its own. Previous / next sit on its edges, shown on hover or focus
   (always on touch); while it's off the video's slide, "Back to video" waits at the top, as the
   live deck's "Back to live slide" does. */
.slide-ctl { position: absolute; z-index: 2; }
.slide-step {
  top: 50%; width: 40px; height: 40px; margin-top: -20px; display: grid; place-items: center; padding: 0; border-radius: 50%; cursor: pointer;
  color: var(--ink); background: rgba(6, 10, 16, 0.55); border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.25s ease, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.slide-step svg { width: 18px; height: 18px; }
.slide-step--prev { left: 12px; }
.slide-step--next { right: 12px; }
.slides:hover .slide-step, .slides:focus-within .slide-step { opacity: 1; }
.slide-step:hover { border-color: var(--hud); box-shadow: 0 0 18px rgba(169, 230, 255, 0.25); }
.slide-step:active { transform: scale(0.92); }
.slide-step:focus-visible { outline: 1px solid var(--hud); outline-offset: 2px; }
.slides .slide-step:disabled { opacity: 0; pointer-events: none; }
@media (hover: none) { .slide-step { opacity: 1; } }
.player.is-checking .slide-ctl { opacity: 0 !important; pointer-events: none; }
.follow-chip {
  top: 12px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; white-space: nowrap;
  color: var(--hud); background: rgba(5, 8, 13, 0.85); border: 1px solid var(--hud-dim); text-shadow: var(--hud-glow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: border-color 0.2s, box-shadow 0.2s;
}
.follow-chip:hover { border-color: var(--hud); box-shadow: 0 0 18px rgba(169, 230, 255, 0.25); }
.follow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hud); box-shadow: 0 0 8px rgba(169, 230, 255, 0.9); }

/* Both: one thing in focus. The large one fills the stage; the other waits in a corner window,
   as in a recorded call: slide large with the speaker in the corner, or the other way round.
   Click the corner (or s) to swap; hide it (p) to see only the large one. */
.player[data-format="both"] { --pip-w: clamp(150px, 22%, 300px); --pip-gap: clamp(12px, 2vw, 24px); --pip-bottom: clamp(84px, 13%, 116px); }
.player[data-format="both"] :is(video#video, .cover, .slides) {
  transition: inset 0.55s var(--ease), width 0.55s var(--ease), height 0.55s var(--ease), border-radius 0.55s var(--ease), opacity 0.35s ease, box-shadow 0.25s;
}
/* the corner window: same corner whichever is small */
.player[data-format="both"][data-big="slides"] :is(video#video, .cover),
.player[data-format="both"][data-big="video"] .slides {
  inset: auto var(--pip-gap) var(--pip-bottom) auto; width: var(--pip-w); height: auto; aspect-ratio: 16 / 9; z-index: 3;
  border-radius: 12px; overflow: hidden; cursor: pointer; background: #05080d;
  box-shadow: 0 0 0 1px var(--line-strong), 0 18px 40px rgba(0, 0, 0, 0.55);
}
.player[data-format="both"][data-big="slides"] video#video { object-fit: cover; }
.player[data-format="both"][data-big="slides"] video#video:hover,
.player[data-format="both"][data-big="video"] .slides:hover { box-shadow: 0 0 0 1px var(--hud-dim), 0 0 24px rgba(169, 230, 255, 0.25), 0 18px 40px rgba(0, 0, 0, 0.55); }
/* hidden corner: only the large one */
.player[data-format="both"][data-pip="off"][data-big="slides"] :is(video#video, .cover),
.player[data-format="both"][data-pip="off"][data-big="video"] .slides { opacity: 0; pointer-events: none; }
/* the slide's own previous / next and "Back to video" only make sense while it's large */
.player[data-format="both"][data-big="video"] .slide-ctl { display: none; }
/* with the slide large, the controls' shade stays low so the slide reads */
.player[data-format="both"][data-big="slides"] .player-scrim { background: linear-gradient(to top, rgba(3, 5, 9, 0.82), rgba(3, 5, 9, 0.32) 11%, transparent 20%); }
.player[data-format="both"][data-big="slides"] .cover { display: none; }
.ctl--pip.off { color: var(--ink-faint); }
/* over a light slide, the "play" and "continue" words need a dark ground to read */
.player[data-format="both"][data-big="slides"] :is(.big-play-label, .resume-chip) { padding: 8px 14px; background: rgba(5, 8, 13, 0.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

@media (max-width: 720px) {
  /* a phone keeps the corner window, a little larger so it can be tapped */
  .player[data-format="both"] { --pip-w: 34%; --pip-gap: 10px; --pip-bottom: 64px; }
  /* slides need more height than a 16:9 strip gives them on a phone */
  .player[data-format="slides"], .player[data-format="both"][data-big="slides"] { aspect-ratio: 4 / 5; }
  .player[data-format="slides"] #btnBack, .player[data-format="slides"] #btnFwd { display: grid !important; }
  .ctl-slide { display: none; }
  /* slides alone: the count is all the bar has to say */
  .player[data-format="slides"] .ctl-slide { display: inline; }
  .fmt-badge { order: 1; }
}

/* a mission whose answer goes on somewhere: a link, not a button */
.proof--send { text-decoration: none; }
.proof--send:hover .proof-state { color: var(--gold); }
.proofs-none { font-size: 13px; line-height: 1.55; color: var(--ink-muted); }

/* ---------- account (account.js): quiet, beside "Apply to join" ---------- */
.acct { position: relative; display: flex; align-items: center; }
.acct-in { color: var(--ink-muted); text-decoration: none; padding: 9px 0; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; white-space: nowrap; }
.acct-in:hover { color: var(--hud); border-color: var(--hud-dim); }
.acct-me { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; color: var(--ink-muted); padding: 4px 0; }
.acct-me:hover, .acct-me[aria-expanded="true"] { color: var(--ink); }
.acct-initial {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font-family: var(--mono); font-size: 11px; color: var(--hud); border: 1px solid var(--hud-dim);
}
.acct-me:hover .acct-initial { box-shadow: var(--hud-glow); }
.acct-name { font-size: 13px; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 200px; padding: 8px; z-index: 40;
  background: var(--glass-bg); border: 1px solid var(--glass-line); box-shadow: var(--glass-hi), 0 18px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-radius: 12px;
}
.acct-who { padding: 6px 10px 10px; font-size: 12.5px; color: var(--ink-muted); border-bottom: 1px solid var(--line); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-item { display: block; width: 100%; text-align: left; padding: 9px 10px; background: none; border: 0; cursor: pointer; color: var(--ink-dim); text-decoration: none; border-radius: 8px; }
.acct-item:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
@media (max-width: 720px) { .acct-name { display: none; } }

/* ---------- resources: files and links to take away, under the chapters ---------- */
.resources { margin-top: 26px; }
.resources .syllabus-head span { color: var(--ink-faint); }
.rs-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 10px; }
.rs-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px;
  text-decoration: none; color: inherit; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--glass-line);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}
.rs-card:hover, .rs-card:focus-visible { background: rgba(169, 230, 255, 0.06); border-color: var(--hud-dim); box-shadow: 0 0 30px -12px rgba(169, 230, 255, 0.5); transform: translateY(-2px); outline: none; }
.rs-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; font-size: 9px; letter-spacing: 0.12em; color: var(--gold); background: rgba(230, 198, 138, 0.07); border: 1px solid var(--gold-dim); }
.rs-ic--link { color: var(--hud); font-size: 16px; letter-spacing: 0; background: rgba(169, 230, 255, 0.07); border-color: var(--hud-dim); }
.rs-body { min-width: 0; display: grid; gap: 2px; }
.rs-t { font-size: 14.5px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.rs-n { font-size: 12.5px; color: var(--ink-muted); line-height: 1.45; }
.rs-meta { font-size: 9px; color: var(--ink-faint); white-space: nowrap; }
