/*
 * ClearFund narrated deck: look and layout.
 *
 * Colours, faces, radii and motion come from design/00-foundation/design-system.md
 * Appendix A (mirrored in apps/web/src/app/globals.css). Tokens are scoped to the
 * player and the standalone page so the deck can sit inside a host page without
 * redefining that page's :root.
 *
 * Sizing: slides are sized in em off one base font size. At stage widths above
 * 600px the base is 1/64 of the stage width (20px at 1280), so a slide is a fixed
 * 16:9 composition that scales as one picture. At 600px and below the slide
 * reflows into a stacked, readable phone layout with real pixel sizes.
 */

.cf-page,
.cf-player {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --surface-hover: #fafbfc;
  --surface-active: #eef1f4;
  --border: #e3e8ee;
  --border-strong: #d0d7de;
  --hairline: #eef1f4;
  --sh-1: 0 1px 2px rgba(16, 24, 40, 0.04);
  --sh-btn: 0 1px 1px rgba(16, 24, 40, 0.08);
  --sh-2: 0 8px 24px rgba(16, 24, 40, 0.12);
  --sh-3: 0 16px 48px rgba(16, 24, 40, 0.18);
  --ink-900: #1a1f24;
  --ink-700: #374151;
  --ink-600: #4b5563;
  --ink-500: #6b7280;
  --ink-400: #9ca3af;
  --brand-700: #243a21;
  --brand-600: #2e4a2a;
  --brand-500: #3a5a36;
  --brand-400: #7f9b76;
  --brand-200: #c3d3bd;
  --brand-tint: #e4ebe1;
  --accent-pink: #e89cb1;
  --cream: #efe7d4;
  --warn-600: #b54708;
  --warn-700: #913906;
  --warn-tint: #fff4e5;
  --warn-dot: #f79009;
  --ok-600: #027a48;
  --ok-700: #016339;
  --ok-tint: #ecfdf3;
  --ok-dot: #12b76a;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --r-1: 4px;
  --r-2: 6px;
  --r-3: 8px;
  --r-4: 12px;
  --r-pill: 999px;
  --t-fast: 120ms;
  --t-base: 200ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  /* Deck-only: slide and reveal motion. Slower than app motion on purpose,
     the deck is a brand moment (design-system.md §8). */
  --t-slide: 600ms;
  --t-reveal: 550ms;
}

/* ---------- Standalone page ---------- */
.cf-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink-900);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}
/* Fit the whole player in the window height; never narrower than the 16:9 floor. */
.cf-page .cf-player {
  width: min(100%, 1280px, max(640px, calc((100svh - 250px) * 16 / 9)));
}
@supports not (height: 100svh) {
  .cf-page .cf-player { width: min(100%, 1280px, max(640px, calc((100vh - 250px) * 16 / 9))); }
}
/* ?embed: the host page sizes the iframe; no padding, no height fit. */
.cf-page.cf-embed { padding: 0; min-height: 0; background: transparent; justify-content: flex-start; }
.cf-page.cf-embed .cf-player { width: 100%; }
@media (max-width: 640px) {
  .cf-page { justify-content: flex-start; padding: 12px 10px 20px; }
}

/* ---------- Player shell ---------- */
.cf-player {
  container: player / inline-size;
  position: relative;
  width: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--sans);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
.cf-player *, .cf-player *::before, .cf-player *::after { box-sizing: border-box; }
.cf-player [hidden] { display: none !important; }
.cf-player:fullscreen {
  background: var(--bg);
  padding: 24px;
  justify-content: center;
  overflow: auto;
}
.cf-player:fullscreen > * { width: min(100%, calc((100vh - 230px) * 16 / 9)); margin-inline: auto; }
.cf-player:fullscreen > .picker { width: min(380px, calc(100% - 48px)); }

.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Stage and deck ---------- */
.stage {
  container: stage / inline-size;
  position: relative;
  border-radius: var(--r-4);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-2);
}
.deck {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.slide {
  grid-area: 1 / 1;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  font-size: calc(100cqw / 64);
  line-height: 1.4;
  padding: 3.2em 3.8em 4.4em;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.015);
  transition:
    opacity var(--t-slide) var(--ease),
    transform calc(var(--t-slide) * 1.4) var(--ease),
    visibility 0s linear var(--t-slide);
}
.slide.on {
  opacity: 1;
  visibility: visible;
  transform: none;
  z-index: 2;
  transition:
    opacity var(--t-slide) var(--ease),
    transform calc(var(--t-slide) * 1.4) var(--ease),
    visibility 0s;
}
.slide > * { position: relative; }

/* Themes. light: the app's quiet ground with white cards. cream: brand paper.
   dark: deep brand green with cream ink. Red is never a ground in any of them. */
.slide.light {
  --fg: var(--ink-900); --muted: var(--ink-600); --kick: var(--brand-600); --bar: var(--brand-400);
  --card: var(--surface); --line: var(--border); --dots: var(--brand-600);
  background: var(--bg); color: var(--fg);
}
.slide.cream {
  --fg: var(--ink-900); --muted: var(--ink-700); --kick: var(--brand-600); --bar: var(--brand-400);
  --card: var(--surface); --line: rgba(46, 74, 42, 0.16); --dots: var(--brand-600);
  background: var(--cream); color: var(--fg);
}
.slide.dark {
  --fg: var(--cream); --muted: rgba(239, 231, 212, 0.82); --kick: var(--brand-200); --bar: var(--brand-400);
  --card: rgba(255, 255, 255, 0.06); --line: rgba(239, 231, 212, 0.16); --dots: var(--cream);
  background: var(--brand-600); color: var(--fg);
}
/* Paper texture: a faint dot grid fading in from the right. Pure CSS, no asset. */
.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--dots) 0.07em, transparent 0.09em);
  background-size: 1.3em 1.3em;
  opacity: 0.1;
  -webkit-mask-image: linear-gradient(to left, #000 0%, transparent 62%);
  mask-image: linear-gradient(to left, #000 0%, transparent 62%);
}
.slide.dark::before { opacity: 0.14; }

/* Placeholder badge: any slide with data-placeholder. */
.slide[data-placeholder]::after {
  content: "Placeholder";
  position: absolute;
  top: 1.4em;
  right: 1.6em;
  z-index: 4;
  font: 600 0.6em/1.6 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2em 0.8em;
  border-radius: var(--r-pill);
  color: var(--warn-700);
  background: var(--warn-tint);
}

/* ---------- Slide type: shared pieces ---------- */
.kicker {
  margin: 0 0 0.8em;
  font: 600 0.75em/1.4 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--kick);
  display: flex;
  align-items: center;
  gap: 0.8em;
}
.kicker::before {
  content: "";
  width: 1.8em;
  height: 0.22em;
  border-radius: 1em;
  background: var(--bar);
}
.slide h1, .slide h2, .slide h3 { margin: 0; text-wrap: balance; }
.slide h1 {
  font: 600 3.6em/1.06 var(--serif);
  letter-spacing: -0.015em;
}
.slide h2 {
  font: 600 2.6em/1.1 var(--serif);
  letter-spacing: -0.012em;
  max-width: 22em;
}
.slide .lede, .slide .sub {
  margin: 0.8em 0 0;
  font-size: 1.15em;
  line-height: 1.45;
  color: var(--muted);
  max-width: 34em;
  text-wrap: pretty;
}
.slide .meta {
  margin: 1.4em 0 0;
  font-size: 0.8em;
  font-weight: 500;
  color: var(--muted);
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  grid-auto-flow: column;
  gap: 1em;
  margin-top: auto;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.6em;
  box-shadow: var(--sh-1);
  padding: 1.2em 1.25em 1.3em;
}
.card .step {
  display: block;
  margin-bottom: 0.7em;
  font: 500 0.7em/1.4 var(--mono);
  color: var(--kick);
}
.card h3 {
  font: 600 1.15em/1.25 var(--sans);
  letter-spacing: -0.008em;
  margin-bottom: 0.45em;
}
.card p { margin: 0; font-size: 0.9em; line-height: 1.5; color: var(--muted); }
.slide .note {
  margin: 1.2em 0 0;
  font-size: 0.8em;
  color: var(--muted);
}
.slide .note b { color: var(--fg); font-weight: 600; }

/* Wordmark, per design-system.md §3.3: rounded square, pink dot, "ClearFund". */
.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin: 0;
  font: 600 0.8em/1 var(--sans);
  letter-spacing: -0.003em;
}
.brandmark i {
  width: 1.5em;
  height: 1.5em;
  border-radius: 0.3em;
  background: var(--brand-600);
  display: grid;
  place-items: center;
}
.brandmark i::after {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--accent-pink);
}
.slide.dark .brandmark i { background: var(--cream); }

/* Footer: injected by deck.js unless the slide says data-foot="none". */
.foot {
  position: absolute;
  left: 3.8em;
  right: 3.8em;
  bottom: 1.5em;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1em;
  font-size: 0.65em;
  color: var(--muted);
}
.foot .brandmark { font-size: 1em; color: var(--fg); }
.title .foot .brandmark { visibility: hidden; } /* the title slide already carries it */
.foot .ch { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* Reveal: elements with class rv appear at their data-at second. */
.rv {
  opacity: 0;
  transform: translateY(0.7em);
  transition:
    opacity var(--t-reveal) var(--ease),
    transform calc(var(--t-reveal) * 1.2) var(--ease);
}
.rv.in { opacity: 1; transform: none; }

/* ---------- Slide type: title ---------- */
.slide.title {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto auto auto 1fr;
  column-gap: 3em;
}
.title > .brandmark { grid-column: 1 / -1; grid-row: 1; font-size: 1em; justify-self: start; }
.title > h1 { grid-column: 1; grid-row: 3; }
.title > .sub { grid-column: 1; grid-row: 4; }
.title > .meta { grid-column: 1; grid-row: 5; }
.title > .title-art { grid-column: 2; grid-row: 2 / 7; align-self: center; }

.title-art { display: flex; flex-direction: column; gap: 0.7em; }
.txn {
  background: var(--surface);
  color: var(--ink-900);
  border-radius: 0.6em;
  box-shadow: var(--sh-2);
  padding: 0.9em 1.1em;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25em 1em;
  font-size: 0.85em;
}
.txn .what { font-weight: 500; }
.txn .amt { font: 500 1em/1.4 var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.txn .ref { font: 400 0.8em/1.5 var(--mono); color: var(--ink-500); }
.txn .pill { justify-self: end; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font: 500 0.8em/1.5 var(--sans);
  padding: 0.1em 0.7em;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.pill::before { content: ""; width: 0.45em; height: 0.45em; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok-600); background: var(--ok-tint); }
.pill.ok::before { background: var(--ok-dot); }
.pill.warn { color: var(--warn-600); background: var(--warn-tint); }
.pill.warn::before { background: var(--warn-dot); }

/* ---------- Slide type: chapter divider ---------- */
.slide.divider { justify-content: center; }
.divider .chapter-n {
  margin: 0 0 0.1em;
  font: 600 7em/1 var(--serif);
  letter-spacing: -0.03em;
  color: var(--kick);
  font-variant-numeric: lining-nums;
}
.divider h2 { font-size: 3.4em; }
.divider .sub { font-size: 1.3em; }

/* ---------- Slide type: screenshot ---------- */
.slide.shot {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 2.05fr);
  column-gap: 2.4em;
  align-items: center;
}
.shot-copy h2 { font-size: 1.9em; }
.notes {
  list-style: none;
  margin: 1.4em 0 0;
  padding: 0;
  counter-reset: note;
  display: flex;
  flex-direction: column;
  gap: 0.9em;
}
.notes li {
  counter-increment: note;
  position: relative;
  padding-left: 2.1em;
  font-size: 0.85em;
  line-height: 1.5;
  color: var(--muted);
}
.notes li b { color: var(--fg); font-weight: 600; }
.notes li::before {
  content: counter(note);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 0.85em/1 var(--sans);
  background: var(--brand-600);
  color: #fff;
}
.slide.dark .notes li::before { background: var(--cream); color: var(--brand-700); }

.shot-frame { margin: 0; min-width: 0; }
/* The device: an ink bezel around a fixed 16:10 screen. */
.shot-device {
  container: shot / size;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 0.9em;
  background: var(--ink-900);
  padding: 0.55em;
  box-shadow: var(--sh-3);
}
.shot-device::before {
  /* camera dot */
  content: "";
  position: absolute;
  top: 0.18em;
  left: 50%;
  width: 0.2em;
  height: 0.2em;
  margin-left: -0.1em;
  border-radius: 50%;
  background: #3a4048;
}
.shot-well {
  container: well / size;
  width: 100%;
  height: 100%;
  border-radius: 0.35em;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
}
/* The screen takes the image's own ratio inside the 16:10 well, so highlight
   percentages are always percentages of the image, letterboxed or not. */
.shot-screen {
  --ar: 1.6;
  position: relative;
  width: min(100cqw, calc(100cqh * var(--ar)));
  aspect-ratio: var(--ar);
}
.shot-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}
.shot-screen.missing img { visibility: hidden; }
.shot-screen.missing::before {
  content: "Screenshot pending: " attr(data-missing);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1em;
  text-align: center;
  font: 400 0.75em/1.5 var(--mono);
  color: var(--ink-500);
  background:
    repeating-linear-gradient(135deg, transparent 0 0.6em, rgba(16, 24, 40, 0.035) 0.6em 1.2em),
    var(--surface-2);
}
.hl {
  position: absolute;
  border: 0.14em solid var(--brand-600);
  border-radius: 0.3em;
  box-shadow: 0 0 0 0.3em rgba(232, 156, 177, 0.55), 0 0.4em 1.2em rgba(16, 24, 40, 0.18);
  pointer-events: none;
}
.hl.rv { transform: scale(1.06); }
.hl.rv.in { transform: none; }
.hl::after {
  content: attr(data-n);
  position: absolute;
  top: -0.75em;
  left: -0.75em;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 0.75em/1 var(--sans);
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 0 0 0.15em var(--surface);
}
.shot-frame figcaption {
  margin-top: 0.7em;
  font-size: 0.7em;
  color: var(--muted);
  text-align: center;
}

/* ---------- Cover (big play) ---------- */
.cover {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(26, 31, 36, 0.38);
  transition: opacity var(--t-base) var(--ease), visibility 0s;
}
.cover.hide {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease), visibility 0s linear var(--t-base);
}
.bigplay {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--brand-600);
  color: #fff;
  font: 600 clamp(15px, 2cqw, 22px) / 1 var(--sans);
  padding: clamp(10px, 1.4cqw, 16px) clamp(18px, 2.4cqw, 30px) clamp(10px, 1.4cqw, 16px) clamp(10px, 1.4cqw, 16px);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-3);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.bigplay:hover { background: var(--brand-500); transform: translateY(-1px); }
.bigplay:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.bigplay .pi {
  width: clamp(30px, 3.6cqw, 44px);
  height: clamp(30px, 3.6cqw, 44px);
  border-radius: 50%;
  background: #fff;
  color: var(--brand-600);
  display: grid;
  place-items: center;
}
.bigplay .pi svg { width: 44%; height: 44%; margin-left: 8%; }
.bigplay .len { font-weight: 500; opacity: 0.85; font-size: 0.85em; font-variant-numeric: tabular-nums; }

/* ---------- Caption ---------- */
.caption {
  margin: 0;
  min-height: calc(2 * 1.5em);
  padding: 0 12px;
  font-size: clamp(15px, 1.5cqw, 18px);
  line-height: 1.5;
  text-align: center;
  color: var(--ink-900);
  text-wrap: pretty;
}

/* ---------- Chapter rail ---------- */
.rail {
  display: flex;
  gap: 6px;
  min-width: 0;
}
.chap {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  min-width: 0;
  flex: var(--w, 1) 1 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 2px;
  text-align: left;
  font: 500 12px/16px var(--sans);
  color: var(--ink-500);
  border-radius: var(--r-1);
}
.chap .lbl { display: flex; gap: 6px; min-width: 0; white-space: nowrap; }
.chap .n { font-variant-numeric: tabular-nums; flex: none; }
.chap .t { overflow: hidden; text-overflow: ellipsis; }
.chap .track {
  display: block;
  position: relative;
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.chap .fill {
  position: absolute;
  inset: 0;
  background: var(--brand-400);
  transform-origin: left;
  transform: scaleX(0);
}
.chap:hover { color: var(--ink-900); }
.chap[aria-current="true"] { color: var(--ink-900); font-weight: 600; }
.chap[aria-current="true"] .fill { background: var(--brand-600); }

/* ---------- Control bar ---------- */
.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  box-shadow: var(--sh-1);
  padding: 6px 10px 6px 6px;
}
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  flex: none;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--r-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--ink-700);
  font: 500 13px/20px var(--sans);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { background: var(--surface-active); color: var(--ink-900); }
.btn.main {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--sh-btn);
}
.btn.main:hover { background: var(--brand-500); }
.btn:disabled { opacity: 0.4; cursor: default; background: transparent; }
.btn[aria-pressed="false"].toggle { color: var(--ink-500); }
.btn[aria-pressed="true"].toggle.cc { background: var(--brand-tint); color: var(--brand-700); }

.prog {
  flex: 1 1 200px;
  min-width: 0;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.seg {
  appearance: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  min-width: 6px;
  flex: var(--w, 1) 1 0;
  height: 6px;
  border-radius: 6px;
  background: var(--surface-active);
  overflow: hidden;
  transition: height var(--t-fast) var(--ease);
}
.seg.ch-start:not(:first-child) { margin-left: 7px; }
.seg:hover, .seg[aria-current="true"] { height: 10px; }
.seg i {
  position: absolute;
  inset: 0;
  background: var(--brand-600);
  transform-origin: left;
  transform: scaleX(0);
}
.time, .count {
  font: 500 13px/20px var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink-500);
  white-space: nowrap;
}
.count { min-width: 3.2em; text-align: center; }

/* Focus: 2px brand ring, offset 2px, keyboard only (design-system.md §2.6). */
.cf-player :focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.cf-player .seg:focus-visible { outline-offset: 4px; }

/* ---------- Chapter picker ---------- */
.picker {
  position: absolute;
  right: 0;
  bottom: 64px;
  z-index: 20;
  width: min(380px, 100%);
  max-height: min(70vh, 520px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--sh-2);
  padding: 8px;
}
.picker h2 {
  margin: 4px 8px 8px;
  font: 600 14px/20px var(--sans);
  letter-spacing: -0.003em;
}
.picker ol { list-style: none; margin: 0; padding: 0; }
.picker > ol > li + li { border-top: 1px solid var(--hairline); margin-top: 4px; padding-top: 4px; }
.pk {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  text-align: left;
  border-radius: var(--r-2);
  color: var(--ink-700);
  font: 400 13px/20px var(--sans);
}
.pk:hover { background: var(--surface-hover); color: var(--ink-900); }
.pk.chapter { font-weight: 600; color: var(--ink-900); font-size: 14px; }
.pk.slide-link { padding-left: 26px; }
.pk .tm { font: 400 12px/16px var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-500); }
.pk[aria-current="true"] { background: var(--brand-tint); color: var(--brand-700); }
.pk[aria-current="true"] .tm { color: var(--ink-600); }

/* ---------- Narrow player (controls) ---------- */
@container player (max-width: 600px) {
  /* Row 1: transport and toggles. Row 2: scrubber and time. */
  .bar { padding: 6px; gap: 2px; }
  .btn { min-width: 38px; padding: 0 8px; }
  .btn .txt, .count { display: none; }
  #next { margin-right: auto; }
  .prog { order: 9; flex: 1 1 60%; padding: 0 8px; }
  .time { order: 10; padding-right: 8px; }
  .chap { flex: 0 0 auto; min-width: 28px; }
  .chap .t { display: none; }
  .chap[aria-current="true"] { flex: 1 1 0; }
  .chap[aria-current="true"] .t { display: inline; }
  .picker { width: 100%; bottom: 104px; }
}

/* ---------- Narrow stage: reflowed phone layout ---------- */
@container stage (max-width: 600px) {
  .deck {
    aspect-ratio: auto;
    grid-template: auto / minmax(0, 1fr);
    min-height: 120cqw;
  }
  .slide {
    font-size: 15px;
    padding: 22px 20px 52px;
  }
  .slide h1 { font-size: 30px; line-height: 1.12; }
  .slide h2 { font-size: 25px; line-height: 1.15; }
  .slide .lede, .slide .sub { font-size: 16px; }
  .kicker { font-size: 11px; }
  .slide[data-placeholder]::after { top: 12px; right: 12px; font-size: 10px; }
  .cards { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 20px; }
  .card { padding: 14px 16px; }
  .card h3 { font-size: 16px; }
  .card p { font-size: 14px; }
  .foot { left: 20px; right: 20px; bottom: 16px; font-size: 12px; grid-template-columns: auto 1fr auto; }
  .slide.title { display: flex; justify-content: center; }
  .title > .brandmark { font-size: 14px; margin-bottom: 28px; }
  .title-art { margin-top: 26px; }
  .txn { font-size: 13px; }
  .divider .chapter-n { font-size: 72px; }
  .divider h2 { font-size: 32px; }
  .slide.shot { display: flex; justify-content: flex-start; }
  .shot-copy h2 { font-size: 22px; }
  .notes { margin-top: 14px; }
  .notes li { font-size: 14px; }
  .shot-frame { order: 2; margin-top: 18px; }
  .shot-device { padding: 5px; border-radius: 10px; }
  .hl::after { font-size: 11px; }
  .shot-frame figcaption { font-size: 12px; }
}

/* ---------- Reduced motion: transitions effectively off (§8) ---------- */
@media (prefers-reduced-motion: reduce) {
  .cf-player {
    --t-slide: 1ms;
    --t-reveal: 1ms;
    --t-fast: 1ms;
    --t-base: 1ms;
  }
  .slide, .rv, .hl.rv { transform: none !important; }
  .bigplay:hover { transform: none; }
}
