/* ── Fonts (self-hosted, Latin subset; SIL Open Font License) ─── */
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/fraunces-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Fraunces"; font-style: italic; font-weight: 400 800; font-display: swap;
  src: url(/fonts/fraunces-italic-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/inter-latin.woff2) format("woff2");
}

/* ── Theme tokens (PRD §3.5) ─────────────────────────────────── */
:root {
  --ink: #111418;
  --paper: #F7F5F0;
  --accent: #00B3A4;
  --muted: #6B7280;

  --bg: var(--paper);
  --fg: var(--ink);
  /* #6B7280 is 4.4:1 on paper, just under AA; this darker step passes */
  --fg-muted: #5B616D;
  --surface: #EEEBE4;
  --rule: rgba(17, 20, 24, 0.16);
  --rule-strong: var(--ink);
  /* Teal at full strength is 2.4:1 on paper, so text uses a deeper teal */
  --accent-text: #00796F;
  --on-accent: var(--ink);
  --thumb-bg: var(--ink);
  --thumb-fg: var(--paper);
  --thumb-grid: rgba(247, 245, 240, 0.08);
  /* page background as RGB channels, for translucent overlays */
  --bg-rgb: 247 245 240;
  --map-dot: rgba(17, 20, 24, 0.34);

  --font-serif: "Fraunces", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 16px;
  --max: 1120px;
  --radius: 4px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--ink);
    --fg: #ECEAE4;
    --fg-muted: #9CA3AF;
    --surface: #1A1E24;
    --rule: rgba(247, 245, 240, 0.14);
    --rule-strong: #ECEAE4;
    --accent-text: var(--accent);
    --thumb-bg: #1F242B;
    --thumb-grid: rgba(247, 245, 240, 0.06);
    --bg-rgb: 17 20 24;
    --map-dot: rgba(247, 245, 240, 0.26);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: var(--ink);
  --fg: #ECEAE4;
  --fg-muted: #9CA3AF;
  --surface: #1A1E24;
  --rule: rgba(247, 245, 240, 0.14);
  --rule-strong: #ECEAE4;
  --accent-text: var(--accent);
  --thumb-bg: #1F242B;
  --thumb-grid: rgba(247, 245, 240, 0.06);
  --bg-rgb: 17 20 24;
  --map-dot: rgba(247, 245, 240, 0.26);
  color-scheme: dark;
}

@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; } }

/* ── Base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  font-optical-sizing: auto;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 8vw, 4.25rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.45rem); }
p { margin: 0 0 1em; text-wrap: pretty; }
.num, time, .tabular { font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 8px 14px; font-weight: 600;
}
.skip-link:focus { top: 8px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 720px; }

/* ── Motifs ──────────────────────────────────────────────────── */
.label {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-sans);
  font-size: 0.75rem; font-weight: 650;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.label--accent { color: var(--accent-text); }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule--strong { border-top: 2px solid var(--rule-strong); }
.section { padding: clamp(40px, 8vw, 72px) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  border-top: 2px solid var(--rule-strong); padding-top: 12px; margin-bottom: 24px;
}
.section-head h2 { margin: 0; }
.section-head a { font-size: 0.9rem; font-weight: 600; white-space: nowrap; padding: 6px 0; }
.muted { color: var(--fg-muted); }
.lede { font-size: clamp(1.05rem, 2.6vw, 1.25rem); line-height: 1.5; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-text); text-decoration: none;
}
.tag::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex: none; }
a.tag { min-height: 28px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  font: 600 1rem/1 var(--font-sans);
  border-radius: var(--radius); border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: #00C9B8; color: var(--on-accent); }
.btn--ghost { border-color: var(--rule-strong); color: var(--fg); background: transparent; }
.btn--ghost:hover { background: var(--fg); color: var(--bg); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--fg); text-decoration: none;
}
.icon-link:hover { color: var(--accent-text); background: var(--surface); }
.socials { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }

/* ── Header ──────────────────────────────────────────────────── */
.site-header { border-bottom: 1px solid var(--rule); background: var(--bg); }
.site-header__inner {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 4px 12px; padding-top: 10px; padding-bottom: 10px;
}
.wordmark {
  font-family: var(--font-serif); font-weight: 750; font-size: 1.35rem;
  letter-spacing: -0.02em; text-decoration: none; line-height: 1.1;
  display: inline-flex; align-items: center; min-height: 44px;
}
.wordmark img { height: 32px; width: auto; }
.site-nav { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.site-nav ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.site-nav a.nav-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  font-weight: 550; font-size: 0.95rem; text-decoration: none;
}
.site-nav a.nav-link:first-child { padding-left: 0; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--rule); background: transparent; color: var(--fg); cursor: pointer;
}
.theme-toggle:hover { background: var(--surface); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
@media (min-width: 720px) {
  .site-header__inner { grid-template-columns: auto 1fr auto; }
  .site-nav { grid-column: auto; justify-content: flex-end; gap: 16px; }
  .theme-toggle { order: 3; }
  .site-nav a.nav-link:first-child { padding-left: 10px; }
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer { border-top: 2px solid var(--rule-strong); margin-top: 48px; padding: 32px 0 40px; font-size: 0.92rem; }
.site-footer__grid { display: grid; gap: 20px; }
.site-footer__mission { max-width: 52ch; margin: 0; }
.site-footer__meta { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--fg-muted); font-size: 0.85rem; }
.site-footer .wordmark { font-size: 1.15rem; min-height: 32px; }
@media (min-width: 720px) {
  .site-footer__grid { grid-template-columns: 1fr auto; align-items: start; }
}

/* ── Hero ────────────────────────────────────────────────────── */
/* Phones & tablets: the visual sits in a band at the top and the text overlaps
   its lower edge. Desktop: text on the left, visual across the full width.
   The overlay keeps every line of hero text over ≥85% page background (AA). */
.hero { position: relative; isolation: isolate; overflow: hidden; --map-w: min(200vw, 1300px); }
.hero__visual { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.hero__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__overlay {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom,
    rgb(var(--bg-rgb) / 0) 0,
    rgb(var(--bg-rgb) / 0) calc(var(--map-w) * 0.15),
    rgb(var(--bg-rgb) / 0.86) calc(var(--map-w) * 0.22),
    rgb(var(--bg-rgb) / 0.95) calc(var(--map-w) * 0.29),
    rgb(var(--bg-rgb)) 100%);
}
.hero--video .hero__overlay, .hero--image .hero__overlay {
  background: linear-gradient(to bottom,
    rgb(var(--bg-rgb) / 0.3) 0,
    rgb(var(--bg-rgb) / 0.9) calc(var(--map-w) * 0.22),
    rgb(var(--bg-rgb) / 0.95) 100%);
}
.hero__content { padding-top: calc(var(--map-w) * 0.22); padding-bottom: 36px; }
.hero h1 { margin-bottom: 12px; }
.hero .tagline { font-family: var(--font-serif); font-size: clamp(1.15rem, 3.6vw, 1.6rem); font-weight: 450; line-height: 1.3; margin-bottom: 12px; font-style: italic; }
.hero .mission-short { color: var(--fg-muted); max-width: 56ch; margin-bottom: 20px; }
.hero .btn-row { margin-bottom: 12px; }
.hero + .section { padding-top: 8px; }

@media (min-width: 1200px) {
  /* --text-end: right edge of the hero text column (the container is centered) */
  .hero { --text-end: calc(max(0px, (100% - var(--max)) / 2) + 620px); display: flex; align-items: center; min-height: 540px; }
  .hero__content { padding-top: 96px; padding-bottom: 88px; }
  .hero__content > * { max-width: 560px; }
  .hero__overlay {
    background: linear-gradient(90deg,
      rgb(var(--bg-rgb) / 0.95) 0,
      rgb(var(--bg-rgb) / 0.9) var(--text-end),
      rgb(var(--bg-rgb) / 0.12) calc(var(--text-end) + 60px),
      rgb(var(--bg-rgb) / 0) calc(var(--text-end) + 200px));
  }
  .hero--video .hero__overlay, .hero--image .hero__overlay {
    background: linear-gradient(90deg,
      rgb(var(--bg-rgb) / 0.95) 0,
      rgb(var(--bg-rgb) / 0.9) var(--text-end),
      rgb(var(--bg-rgb) / 0.35) calc(var(--text-end) + 260px),
      rgb(var(--bg-rgb) / 0.2) 100%);
  }
}

/* Default hero: dot-grid world map with trade flows out of China */
.hero-map { position: absolute; top: 4px; left: 50%; width: var(--map-w); aspect-ratio: 1440 / 524; transform: translateX(-57%); }
.hero-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-map__flows { will-change: transform; }
@media (min-width: 1200px) {
  /* China (40% across the map) lands just right of the text; the US still fits on screen */
  .hero-map { top: 50%; left: calc(var(--text-end) + 80px - 480px); width: 1200px; transform: translateY(-50%); }
}
.hero-map__land { fill: none; stroke: var(--map-dot); stroke-width: 4.4; stroke-linecap: round; }
.hero-map .flow-base { fill: none; stroke: var(--accent-text); stroke-opacity: 0.55; stroke-width: 3; }
.hero-map .flow {
  fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 12 100; stroke-dashoffset: 12;
  animation: hero-flow 3.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.hero-map .node { fill: var(--accent-text); }
.hero-map .node--origin { stroke: var(--bg); stroke-width: 3; }
.hero-map .pulse {
  fill: none; stroke: var(--accent); stroke-width: 3; opacity: 0;
  transform-box: fill-box; transform-origin: center;
  animation: hero-pulse 3.6s ease-out infinite;
}
@keyframes hero-flow { from { stroke-dashoffset: 12; } to { stroke-dashoffset: -100; } }
@keyframes hero-pulse {
  0%, 55% { transform: scale(1); opacity: 0; }
  60% { opacity: 0.9; }
  100% { transform: scale(3.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-map .flow { animation: none; stroke-dasharray: none; stroke-width: 3.5; }
  .hero-map .pulse { display: none; }
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  position: relative; display: block;
  border: 1px solid var(--rule); border-top: 3px solid var(--rule-strong);
  background: var(--bg); padding: 20px; border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none; color: inherit;
}
a.card:hover { border-top-color: var(--accent); color: inherit; }
a.card:hover :is(h2, h3) { color: var(--accent-text); }
.card :is(h2, h3) { margin: 8px 0; font-size: clamp(1.2rem, 3vw, 1.45rem); }
.card p:last-child { margin-bottom: 0; }
.card-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .card-grid--2 { grid-template-columns: repeat(2, 1fr); } }

.series-card { padding: 0; overflow: hidden; }
.page-head__cta { margin-top: 20px; }
/* Jump links land with a little breathing room above the part heading */
.part { scroll-margin-top: 16px; }
.series-card__body { padding: 20px; }
.series-card .thumb--wide { border-radius: 0; }
.series-card .question { font-family: var(--font-serif); font-size: clamp(1.15rem, 3vw, 1.4rem); line-height: 1.35; margin: 4px 0 16px; }
.series-card__thesis { color: var(--fg-muted); margin: -6px 0 16px; max-width: 60ch; }
@media (min-width: 900px) {
  .series-card--feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .series-card--feature .thumb--wide { aspect-ratio: auto; height: 100%; min-height: 260px; }
  .series-card--feature .series-card__body { padding: 28px; }
}
.series-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 0.88rem; color: var(--fg-muted); }
.status { font-size: 0.72rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; border: 1px solid currentColor; border-radius: 2px; }
.status--ongoing { color: var(--accent-text); }

/* Chart-like progress: one bar per part */
.progress { display: flex; gap: 4px; margin: 12px 0 8px; }
.progress span { flex: 1; height: 8px; background: var(--rule); }
.progress span.is-out { background: var(--accent); }

/* ── Thumbnails ──────────────────────────────────────────────── */
/* Shapes: sq 1:1 (lists, cropped), wide 16:9 (series).
   Without an image, the same box draws a branded fallback; sizes scale with the box. */
.thumb {
  position: relative; width: 100%; container-type: inline-size;
  background-color: var(--thumb-bg); color: var(--thumb-fg);
  background-image:
    linear-gradient(var(--thumb-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--thumb-grid) 1px, transparent 1px);
  background-size: 100% 12.5%, 12.5% 100%;
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; gap: 4cqw; padding: 7cqw;
}
.thumb--wide { aspect-ratio: 16 / 9; justify-content: space-between; padding: 5cqw; }
.thumb--sq { aspect-ratio: 1; width: 56px; flex: none; justify-content: center; align-items: center; padding: 0; background-size: 100% 25%, 25% 100%; }
@media (min-width: 640px) { .thumb--sq { width: 72px; } }
.thumb::after {
  /* a rising "chart line" accent */
  content: ""; position: absolute; left: 0; right: 0; bottom: 22%; height: 2px;
  background: var(--accent); transform: skewY(-12deg); transform-origin: left; opacity: 0.9;
}
.thumb--wide::after { transform: skewY(-6deg); bottom: 30%; }
.thumb--img { padding: 0; }
.thumb--img::after { display: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb__label { position: relative; z-index: 1; font-size: max(10px, 3.6cqw); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.8; }
.thumb__title { position: relative; z-index: 1; font-family: var(--font-serif); font-weight: 650; font-size: 8cqw; line-height: 1.15; text-wrap: balance; }
.thumb--wide .thumb__label { font-size: max(10px, 2.2cqw); }
.thumb--wide .thumb__title { font-size: 6.4cqw; max-width: 80%; }
.thumb--sq .thumb__mark { position: relative; z-index: 1; font-family: var(--font-serif); font-size: 30cqw; font-weight: 700; line-height: 1; }

.empty-state { border: 1px dashed var(--rule); padding: 28px 20px; text-align: center; color: var(--fg-muted); border-radius: var(--radius); }
.empty-state p { margin: 0; }

/* ── Mission & principles ────────────────────────────────────── */
.mission-text { font-family: var(--font-serif); font-size: clamp(1.15rem, 3vw, 1.45rem); line-height: 1.5; max-width: 62ch; }
.principles { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 0; counter-reset: p; }
.principles li { counter-increment: p; display: grid; grid-template-columns: 3rem 1fr; gap: 4px 12px; padding: 16px 0; border-top: 1px solid var(--rule); }
.principles li::before { content: counter(p, decimal-leading-zero); grid-row: span 2; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: var(--accent-text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.principles strong { font-size: 1.05rem; }
.principles span { color: var(--fg-muted); font-size: 0.95rem; }
@media (min-width: 900px) {
  .principles { grid-template-columns: repeat(4, 1fr); gap: 0 24px; }
  .principles li { grid-template-columns: 1fr; border-top: 2px solid var(--rule-strong); }
  .principles li::before { grid-row: auto; margin-bottom: 8px; }
}

/* ── Series abstract ("The argument") ────────────────────────── */
.abstract { margin-top: 32px; padding-top: clamp(28px, 5vw, 48px); border-top: 2px solid var(--rule-strong); }
.abstract .label { display: flex; margin: 0; }
.abstract__thesis { font-family: var(--font-serif); font-size: clamp(1.3rem, 3.6vw, 1.85rem); line-height: 1.4; max-width: 34em; margin: 14px 0 16px; text-wrap: pretty; }
.abstract__why { font-size: 1.06rem; color: var(--fg-muted); max-width: 62ch; margin-bottom: 0; }
.abstract__issues-label { margin-top: 32px !important; }
.principles--issues { margin-top: 12px; }
.issue-summary { display: block; }
@media (min-width: 900px) {
  .principles--issues { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}

.prose { max-width: 66ch; }
.prose p { font-size: 1.06rem; }
.prose h2 { font-size: 1.6rem; margin-top: 1.5em; }

/* ── Page headers ────────────────────────────────────────────── */
.page-head { padding: 32px 0 24px; }
@media (min-width: 720px) { .page-head { padding: 56px 0 32px; } }
.page-head .question { font-family: var(--font-serif); font-size: clamp(1.2rem, 3.4vw, 1.6rem); line-height: 1.35; max-width: 40ch; font-style: italic; }

/* ── Series page: parts ──────────────────────────────────────── */
.part { padding: 24px 0; border-top: 2px solid var(--rule-strong); }
.part__head { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: baseline; margin-bottom: 12px; }
.part__num { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; line-height: 1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.part__head h3 { margin: 0; }
.part--soon .part__num, .part--soon h3 { color: var(--fg-muted); }
.part__soon { font-size: 0.72rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); grid-column: 2; }
.ep-list { list-style: none; margin: 0; padding: 0; }
.ep-list li + li { border-top: 1px solid var(--rule); }
.ep-list--compact { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ep-row { display: grid; grid-template-columns: auto 2.25rem 1fr; align-items: center; gap: 0 14px; padding: 12px 0; text-decoration: none; color: inherit; }
.ep-row:hover .ep-row__title { color: var(--accent-text); }
.ep-row__num { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.ep-row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ep-row__title { font-weight: 650; font-size: 1.02rem; line-height: 1.3; }
.ep-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; font-size: 0.85rem; color: var(--fg-muted); }

/* ── Episode page ────────────────────────────────────────────── */
.episode-layout { display: grid; gap: 32px; padding-bottom: 24px; }
@media (min-width: 900px) { .episode-layout { grid-template-columns: minmax(280px, 360px) 1fr; gap: 56px; align-items: start; } }
.video-frame { width: 100%; max-width: 280px; margin: 0 auto; }
@media (min-width: 900px) { .video-frame { max-width: 360px; } }
@media (min-width: 900px) { .video-frame { position: sticky; top: 24px; } }
.video-frame .btn { width: 100%; margin-top: 12px; }

.embed { position: relative; }
/* A part's full-length video (YouTube, 16:9) on the series page */
.embed--youtube { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--thumb-bg); margin: 4px 0 20px; }
.embed--youtube iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed--youtube.is-loaded .yt-poster { visibility: hidden; }
.yt-poster { position: absolute; inset: 0; display: block; color: #fff; text-decoration: none; }
.yt-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0.05) 60%); }
.yt-poster__status { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.yt-poster .play { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; transition: transform 0.15s ease; }
.yt-poster .play::before { content: ""; border-left: 14px solid currentColor; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 4px; }
.yt-poster:hover .play, .yt-poster:focus-visible .play { transform: scale(1.08); }
.embed .yt-poster strong, .embed .yt-poster:hover strong { color: #fff; font-family: var(--font-serif); font-size: 1.15rem; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.yt-poster:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
@media (min-width: 900px) { .embed--youtube { max-width: 760px; } }
/* Vertical full videos: a 9:16 frame like the clips. YouTube's thumbnail for these is the
   tall frame centred in a wide image, so cropping to the frame shows just the video */
.embed--youtube.embed--vertical { aspect-ratio: 9 / 16; max-width: 340px; }
.thumb--yt-vertical img { transform: scale(1.78); }
.key-claim { border-left: 4px solid var(--accent); padding: 4px 0 4px 18px; margin: 0 0 32px; }
.key-claim p { font-family: var(--font-serif); font-size: clamp(1.25rem, 3.4vw, 1.6rem); line-height: 1.35; margin: 6px 0 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-bottom: 12px; font-size: 0.9rem; color: var(--fg-muted); }

.sources { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.sources li { counter-increment: s; display: grid; grid-template-columns: 2.25rem 1fr; padding: 12px 0; border-top: 1px solid var(--rule); }
.sources li::before { content: "[" counter(s) "]"; font-weight: 650; color: var(--accent-text); font-variant-numeric: tabular-nums; font-size: 0.92rem; padding-top: 2px; }
.sources .src-title { font-weight: 600; }
.sources .src-meta { display: block; color: var(--fg-muted); font-size: 0.9rem; }
.sources a.src-title { text-decoration: underline; text-decoration-color: var(--rule); }
.sources a.src-title:hover { text-decoration-color: var(--accent); }


/* ── Dev-only helpers ────────────────────────────────────────── */
.todo { border: 2px dashed #D97706; background: rgba(217, 119, 6, 0.08); color: var(--fg); padding: 12px 14px; border-radius: var(--radius); font-size: 0.92rem; }
.todo::before { content: "TODO · dev only — "; font-weight: 700; color: #B45309; }
:root[data-theme="dark"] .todo::before { color: #F59E0B; }
.todo-chip { display: inline-block; font: 700 0.62rem/1 var(--font-sans); letter-spacing: 0.08em; background: #D97706; color: #111418; padding: 3px 5px; border-radius: 2px; vertical-align: 0.2em; font-style: normal; }
.principles .todo-chip { font-size: 0.62rem; color: #111418; }
.is-todo { outline: 2px dashed #D97706; outline-offset: 6px; border-radius: 2px; }

/* ── 404 ─────────────────────────────────────────────────────── */
.not-found { padding: 64px 0 32px; }
.not-found .big { font-family: var(--font-serif); font-size: clamp(5rem, 24vw, 10rem); font-weight: 700; line-height: 0.9; color: var(--accent-text); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
