/* Whencery: the series look. Colours from the title sting and wordmark (the strata layers, the pale
   haze, the wordmark ink and the timeline's orange); Georgia for display type, as on the on-screen
   labels; Gill Sans for the spaced wordmark. No web fonts, no third-party requests. */

:root {
  --s0: #c2cabc; /* the thin modern ground, top layer */
  --s1: #d4c29c;
  --s2: #bea882;
  --s3: #a28c6e;
  --s4: #827260;
  --s5: #605852;
  --s6: #3e424a; /* bedrock */

  --bg: #e4e7e9;
  --bg-2: #d5dce3;
  --surface: #f4f4f1;
  --ink: #1f242c;
  --muted: #4f5764;
  --rule: #c0c7ce;
  --accent: #8f4b12;
  --accent-ink: #ffffff;
  --link: #7a3f0e;
  --focus: #b8601c;
  --shadow: 0 1px 2px rgba(24, 28, 36, .08), 0 6px 24px rgba(24, 28, 36, .08);
  --label-bg: #2a3240;
  --label-ink: #f1efe8;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: "Gill Sans", "Gill Sans MT", Seravek, "Trebuchet MS", Calibri, sans-serif;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 72rem;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181c24;
    --bg-2: #1f2430;
    --surface: #232934;
    --ink: #ebe9e2;
    --muted: #a7aeb9;
    --rule: #39414e;
    --accent: #e09a52;
    --accent-ink: #181c24;
    --link: #eaa863;
    --focus: #f0b170;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .3);
    --label-bg: #e6e2d6;
    --label-ink: #1d222b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #181c24;
  --bg-2: #1f2430;
  --surface: #232934;
  --ink: #ebe9e2;
  --muted: #a7aeb9;
  --rule: #39414e;
  --accent: #e09a52;
  --accent-ink: #181c24;
  --link: #eaa863;
  --focus: #f0b170;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .3);
  --label-bg: #e6e2d6;
  --label-ink: #1d222b;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--bg) 0, var(--bg-2) 100%);
  background-repeat: no-repeat;
  min-height: 100vh;
  color: var(--ink);
  font: 1.0625rem/1.65 var(--serif);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: normal; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin-top: 2.2em; }
h3 { font-size: 1.25rem; margin-top: 1.6em; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 44rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.ui { font-family: var(--ui); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--surface); color: var(--ink); padding: .5rem .8rem; border-radius: 4px; }
.skip:focus { top: 8px; }

/* the strata band: the sting's seven layers, modern ground on top */
.strata { display: grid; grid-template-rows: repeat(7, 1fr); height: 14px; }
.strata span:nth-child(1) { background: var(--s0); }
.strata span:nth-child(2) { background: var(--s1); }
.strata span:nth-child(3) { background: var(--s2); }
.strata span:nth-child(4) { background: var(--s3); }
.strata span:nth-child(5) { background: var(--s4); }
.strata span:nth-child(6) { background: var(--s5); }
.strata span:nth-child(7) { background: var(--s6); }

/* header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: .7rem; padding-bottom: .7rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.wordmark { font-family: var(--sans); font-size: 1.15rem; letter-spacing: .32em; text-transform: uppercase; padding-left: .1em; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: .25rem 1rem; flex-wrap: wrap; font-family: var(--ui); font-size: .95rem; }
.site-nav a { color: var(--ink); text-decoration: none; padding: .35rem 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .3em; }
.theme-toggle { font: inherit; font-family: var(--ui); font-size: .85rem; background: transparent; color: var(--ink); border: 1px solid var(--rule); border-radius: 999px; padding: .3rem .7rem; cursor: pointer; min-height: 32px; }
.theme-toggle:hover { border-color: var(--muted); }

/* buttons */
.button { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--ui); font-size: 1rem; font-weight: 600; text-decoration: none; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: .7rem 1.1rem; min-height: 44px; cursor: pointer; }
.button:hover { filter: brightness(1.06); text-decoration: none; }
.button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.button svg { width: 1.2em; height: 1.2em; flex: none; }

/* hero */
.hero { padding: 2.5rem 0 1rem; }
.hero .promise { font-size: clamp(1.9rem, 5.2vw, 3.2rem); line-height: 1.12; max-width: 22ch; margin-bottom: .4em; }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.eyebrow { font-family: var(--sans); text-transform: uppercase; letter-spacing: .22em; font-size: .8rem; color: var(--muted); margin: 0 0 .6rem; }

/* video */
.video { position: relative; aspect-ratio: 16 / 9; background: #11151b; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.video iframe, .video .facade, .video > img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video > img { object-fit: cover; }
.facade { padding: 0; margin: 0; background: #11151b; cursor: pointer; display: block; border: 0; }
.facade img { width: 100%; height: 100%; object-fit: cover; }
.facade .play { position: absolute; left: 50%; top: 50%; width: 76px; height: 54px; transform: translate(-50%, -50%); border-radius: 14px; background: rgba(24, 28, 36, .82); display: grid; place-items: center; transition: background .15s; }
.facade:hover .play, .facade:focus-visible .play { background: #c4302b; }
.facade .play svg { width: 28px; height: 28px; fill: #fff; margin-left: 4px; }
.facade .note { position: absolute; right: 8px; bottom: 8px; font: .75rem/1.3 var(--ui); color: #f1efe8; background: rgba(24, 28, 36, .72); padding: .25rem .5rem; border-radius: 4px; }
.coming-soon .badge { position: absolute; left: 12px; top: 12px; font: 600 .85rem/1 var(--ui); letter-spacing: .04em; background: var(--label-bg); color: var(--label-ink); padding: .5rem .7rem; border-radius: 4px; }

/* latest */
.latest { display: grid; gap: 1.5rem; align-items: start; margin-top: 1.5rem; }
@media (min-width: 900px) { .latest { grid-template-columns: 1.6fr 1fr; } }
.latest h2 { margin-top: 0; }
.meta { font-family: var(--ui); font-size: .9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .2rem .9rem; margin: 0 0 1rem; padding: 0; list-style: none; }

/* sections */
.section { padding: 1rem 0 1.5rem; }
.band { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: 2.5rem; padding-bottom: 2rem; }
.band h2:first-child { margin-top: 1.6em; }

/* the season timeline: one segment per part, each as wide as its episode count */
.timeline { display: flex; gap: 3px; margin: 1.25rem 0 .4rem; font-family: var(--ui); }
.timeline .seg { min-width: 0; padding: .55rem .5rem; color: #fff; border-radius: 3px; display: flex; flex-direction: column; gap: .1rem; text-decoration: none; }
.timeline .seg b { font-weight: 600; font-size: .85rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.timeline .seg span { font-size: .75rem; opacity: .92; }
.timeline .seg:nth-child(1) { background: var(--s6); }
.timeline .seg:nth-child(2) { background: var(--s5); }
.timeline .seg:nth-child(3) { background: #75664f; }
.timeline .seg:nth-child(4) { background: #7a6447; }
.timeline .seg:nth-child(5) { background: #6d6a5a; }
.timeline .seg:nth-child(6) { background: #56606b; }
.timeline-ends { display: flex; justify-content: space-between; font: .8rem/1 var(--ui); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 640px) {
  .timeline { flex-direction: column; }
  .timeline .seg { flex: none !important; flex-direction: row; justify-content: space-between; }
}

.part { margin-top: 1.8rem; }
.part h3 { margin: 0 0 .6rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; }
.part h3 small { font: .85rem var(--ui); color: var(--muted); }
.episodes { list-style: none; margin: 0; padding: 0; display: grid; align-items: start; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.ep { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.band .ep { background: var(--bg); }
.ep a.cover { display: block; position: relative; }
.ep a.cover img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.ep .body { padding: .7rem .8rem .8rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.ep .num { font: .8rem var(--ui); color: var(--muted); }
.ep .title { font-size: 1.1rem; line-height: 1.25; }
.ep .title a { color: var(--ink); text-decoration: none; }
.ep .title a:hover { text-decoration: underline; }
.status { align-self: flex-start; font: 600 .72rem/1 var(--ui); letter-spacing: .05em; text-transform: uppercase; padding: .32rem .45rem; border-radius: 3px; margin-top: auto; }
.status.live { background: var(--accent); color: var(--accent-ink); }
.status.soon { background: var(--label-bg); color: var(--label-ink); }
.status.planned { border: 1px solid var(--rule); color: var(--muted); }
.ep.planned { background: transparent; border-style: dashed; }
.ep.planned .title { color: var(--muted); font-size: 1rem; }

/* subscribe and newsletter */
.cta { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
@media (min-width: 820px) { .cta { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1.25rem; }
.panel h2 { margin-top: 0; font-size: 1.45rem; }
.newsletter form { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.newsletter label { width: 100%; font: .9rem var(--ui); }
.newsletter input[type="email"] { flex: 1 1 14rem; min-height: 44px; font: 1rem var(--ui); padding: .55rem .7rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); color: var(--ink); }
.form-note { width: 100%; font: .85rem var(--ui); color: var(--muted); margin: .3rem 0 0; }
.form-status { width: 100%; font: .9rem var(--ui); margin: .3rem 0 0; min-height: 1.2em; }

/* episode page */
.crumbs { font: .9rem var(--ui); color: var(--muted); margin: 1.5rem 0 .6rem; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.crumbs li + li::before { content: "/"; margin-right: .3rem; color: var(--rule); }
.crumbs a { color: var(--muted); }
.ep-head h1 { margin-bottom: .3rem; }
.ep-grid { display: grid; gap: 2rem; margin-top: 1.5rem; }
@media (min-width: 1000px) { .ep-grid { grid-template-columns: minmax(0, 1fr) 20rem; } }
.summary { font-size: 1.15rem; }
.chapters { list-style: none; margin: 0; padding: 0; font-family: var(--ui); font-size: .95rem; }
.chapters li { display: flex; gap: .8rem; padding: .45rem 0; border-bottom: 1px solid var(--rule); }
.chapters .t { font-variant-numeric: tabular-nums; min-width: 3.2rem; }
.aside h2 { font-size: 1.2rem; margin-top: 0; }
.aside .panel + .panel { margin-top: 1rem; }
.toc { list-style: none; margin: 0; padding: 0; font: .95rem/1.4 var(--ui); }
.toc li { padding: .3rem 0; }

figure { margin: 0; }
figcaption { font: .9rem/1.45 var(--ui); color: var(--muted); padding-top: .5rem; }
figure img { border-radius: 6px; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-2); }
.pair { display: grid; gap: 1rem; }
@media (min-width: 720px) { .pair { grid-template-columns: 1fr 1fr; } }
.recon { font: .82rem/1.4 var(--ui); color: var(--muted); margin-top: .6rem; }

/* transcript */
.transcript { max-width: 44rem; }
.transcript h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; font-size: 1.15rem; margin: 2rem 0 .7rem; }
.transcript h3 .t { font: .85rem var(--ui); }
.transcript .para { position: relative; }
.transcript .seg:target { background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 2px; }
.ts { font: .78rem var(--ui); color: var(--muted); text-decoration: none; margin-right: .35rem; font-variant-numeric: tabular-nums; }
a.ts:hover { color: var(--link); text-decoration: underline; }
sup.cite { font: .68rem/0 var(--ui); margin-left: .1em; }
sup.cite a { text-decoration: none; padding: 0 .12em; }
sup.cite a:hover { text-decoration: underline; }

/* How We Know */
.sources { list-style: none; margin: 0; padding: 0; }
.sources li { padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.sources .count { font: .82rem var(--ui); color: var(--muted); }
.notes { font: .92rem/1.5 var(--ui); padding-left: 2.6rem; }
.notes li { padding: .25rem 0; scroll-margin-top: 1rem; }
.notes li:target { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.notes .back { text-decoration: none; margin-left: .3rem; }
details.notes-wrap > summary { cursor: pointer; font: 600 1rem var(--ui); padding: .6rem 0; }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 3rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--ui); }
.pager a { text-decoration: none; }
.pager span { display: block; font-size: .8rem; color: var(--muted); }

/* teachers */
.lesson { border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 2rem; }
.lesson ol { padding-left: 1.4rem; }
.lesson li { margin-bottom: .6rem; }
.links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font: .95rem var(--ui); padding: 0; list-style: none; }

/* footer */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; font: .9rem/1.6 var(--ui); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header nav, .theme-toggle, .video, .cta, .pager, .skip { display: none !important; }
  body { background: #fff; color: #000; }
}

/* timeline widths, one class per episode count (no inline styles, so the CSP stays strict) */
.grow-1 { flex: 1 1 0; } .grow-2 { flex: 2 1 0; } .grow-3 { flex: 3 1 0; } .grow-4 { flex: 4 1 0; }
.grow-5 { flex: 5 1 0; } .grow-6 { flex: 6 1 0; } .grow-7 { flex: 7 1 0; } .grow-8 { flex: 8 1 0; }
.grow-9 { flex: 9 1 0; } .grow-10 { flex: 10 1 0; } .grow-11 { flex: 11 1 0; } .grow-12 { flex: 12 1 0; }
.soon-note { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
