/* ==========================================================================
   The Simulation Semester — site styles
   ========================================================================== */

:root {
  --ink: #0b1220;
  --ink-2: #121b2d;
  --ink-3: #1b2740;
  --ink-line: rgba(160, 200, 230, 0.14);
  --paper: #f6f1e6;
  --paper-2: #ede5d4;
  --paper-line: #d9cfba;
  --text: #1c2029;
  --text-soft: #4a505c;
  --on-ink: #e9eef6;
  --on-ink-soft: #a5b1c4;
  --teal: #137a72;
  --teal-bright: #5fe0d3;
  --brick: #a5422a;
  --gold: #d8a443;
  --claude: #c46a43;
  --gemini: #4a78d6;
  --you: #137a72;

  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-read: "Source Serif 4", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(10, 18, 32, .06), 0 10px 30px -12px rgba(10, 18, 32, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--brick); }
::selection { background: var(--teal-bright); color: var(--ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- type ---------- */
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 .5em; font-variation-settings: "opsz" 96; }
h2 { font-size: clamp(2rem, 4.4vw, 3.3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-variation-settings: "opsz" 36; }
p { margin: 0 0 1.1em; }
.kicker {
  font-family: var(--f-mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal); margin: 0 0 1.1rem; display: flex; align-items: center; gap: .6rem;
}
.kicker::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.lede { font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.55; color: var(--text-soft); max-width: 46em; }
.mono { font-family: var(--f-mono); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s, box-shadow .3s, transform .3s;
}
.nav.is-solid { background: rgba(11, 18, 32, .92); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--ink-line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--on-ink); text-decoration: none; font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.nav-links { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--on-ink-soft); text-decoration: none; font-size: .9rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.is-active { color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid var(--ink-line); color: var(--on-ink); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .85rem; cursor: pointer; }
@media (max-width: 920px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: rgba(11, 18, 32, .97); padding: .5rem var(--gutter) 1rem; display: none;
  }
  .nav.is-open .nav-links { display: flex; }
  .nav.is-open { background: rgba(11, 18, 32, .97); }
  .nav-links a { display: block; padding: .7rem 0; border-bottom: 1px solid var(--ink-line); font-size: 1rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem; padding: .85rem 1.35rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none; transition: transform .15s, background .2s, color .2s, border-color .2s;
  border: 1px solid transparent; cursor: pointer; font-family: var(--f-body);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--teal-bright); color: var(--ink); }
.btn-primary:hover { background: #8ff0e6; color: var(--ink); }
.btn-ghost { border-color: rgba(233, 238, 246, .35); color: var(--on-ink); }
.btn-ghost:hover { border-color: var(--on-ink); color: #fff; }
.btn-dark { background: var(--ink); color: var(--on-ink); }
.btn-dark:hover { background: var(--ink-3); color: #fff; }
.btn svg { width: 16px; height: 16px; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; background: var(--ink); color: var(--on-ink);
  display: flex; align-items: center; overflow: hidden; isolation: isolate; padding: 110px 0 80px;
}
.hero-wall {
  position: absolute; inset: -10% -20%; z-index: -2; display: grid; gap: 14px; align-content: center;
  transform: rotate(-7deg); opacity: .55;
}
.hero-row { display: flex; gap: 14px; width: max-content; animation: drift 120s linear infinite; }
.hero-row:nth-child(2) { animation-direction: reverse; animation-duration: 150s; }
.hero-row:nth-child(3) { animation-duration: 135s; }
.hero-row img { width: 420px; height: 229px; object-fit: cover; border-radius: 6px; filter: saturate(.85); }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .hero-row { animation: none; } }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 80% 70% at 30% 50%, rgba(11, 18, 32, .92) 0%, rgba(11, 18, 32, .78) 55%, rgba(11, 18, 32, .55) 100%),
    linear-gradient(180deg, rgba(11, 18, 32, .3) 0%, rgba(11, 18, 32, 0) 30%, rgba(11, 18, 32, .95) 100%);
}
.hero-inner { max-width: 820px; }
.hero .kicker { color: var(--teal-bright); }
.hero h1 {
  font-size: clamp(3rem, 9vw, 7rem); line-height: .95; letter-spacing: -0.03em; margin-bottom: 1.6rem;
  font-variation-settings: "opsz" 144; font-weight: 600;
}
.hero h1 .glitch { position: relative; display: inline-block; }
.hero h1 .glitch::before, .hero h1 .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; opacity: 0; pointer-events: none;
}
.hero h1 .glitch::before { color: var(--teal-bright); }
.hero h1 .glitch::after { color: #ff6b6b; }
.hero h1 .glitch.is-glitching::before { opacity: .8; transform: translate(-3px, 1px); clip-path: inset(10% 0 55% 0); }
.hero h1 .glitch.is-glitching::after { opacity: .8; transform: translate(3px, -1px); clip-path: inset(60% 0 8% 0); }
.hero .lede { color: var(--on-ink-soft); margin-bottom: 2rem; font-size: clamp(1.1rem, 1.9vw, 1.35rem); }
.hero .lede strong { color: var(--on-ink); font-weight: 600; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 3rem; }
.terminal {
  display: inline-flex; align-items: center; gap: .7rem; font-family: var(--f-mono); font-size: .85rem;
  color: var(--teal-bright); background: rgba(10, 20, 36, .7); border: 1px solid rgba(95, 224, 211, .25);
  border-radius: 8px; padding: .6rem .95rem; max-width: 100%;
}
.terminal .who { color: var(--on-ink-soft); white-space: nowrap; }
.terminal .caret { display: inline-block; width: .55em; height: 1.05em; background: var(--teal-bright); vertical-align: -2px; animation: blink 1.1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hero-meta {
  position: absolute; bottom: 26px; left: 0; right: 0; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--on-ink-soft);
}
.hero-meta .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- stats ---------- */
.stats { background: var(--ink-2); color: var(--on-ink); border-top: 1px solid var(--ink-line); }
.stats ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.stats li { padding: 1.7rem 1rem; border-left: 1px solid var(--ink-line); }
.stats li:first-child { border-left: 0; }
.stats b { display: block; font-family: var(--f-display); font-size: clamp(2rem, 3.4vw, 2.7rem); font-weight: 600; color: #fff; line-height: 1; margin-bottom: .45rem; }
.stats span { font-size: .85rem; color: var(--on-ink-soft); line-height: 1.35; display: block; }
@media (max-width: 760px) {
  .stats ul { grid-template-columns: repeat(2, 1fr); }
  .stats li { border-left: 0; border-top: 1px solid var(--ink-line); }
  .stats li:nth-child(even) { border-left: 1px solid var(--ink-line); }
  .stats li:last-child { grid-column: 1 / -1; }
}

/* ---------- sections ---------- */
section { position: relative; }
.section { padding: clamp(72px, 10vw, 130px) 0; }
.section-dark { background: var(--ink); color: var(--on-ink); }
.section-dark .lede, .section-dark p { color: var(--on-ink-soft); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .kicker { color: var(--teal-bright); }
.section-dark a:not(.btn) { color: var(--teal-bright); }
.dot-neutral { background: var(--on-ink-soft); }
.section-alt { background: var(--paper-2); }
.section-head { margin-bottom: clamp(40px, 6vw, 64px); }

/* idea */
.idea-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.idea-grid .body p { font-size: 1.1rem; }
.idea-grid .body p:first-child::first-letter {
  font-family: var(--f-display); float: left; font-size: 4.2em; line-height: .82; padding: .06em .1em 0 0; color: var(--brick); font-weight: 600;
}
.pull {
  margin: 0; padding: 2rem 2rem 1.8rem; background: var(--ink); color: var(--on-ink); border-radius: var(--radius); position: relative;
  box-shadow: var(--shadow);
}
.pull blockquote { margin: 0 0 1rem; font-family: var(--f-display); font-size: clamp(1.45rem, 2.4vw, 1.85rem); line-height: 1.25; font-weight: 500; color: #fff; }
.pull blockquote::before { content: "\201C"; display: block; font-size: 3.5rem; line-height: .6; color: var(--teal-bright); margin-bottom: .5rem; }
.pull figcaption { font-size: .85rem; color: var(--on-ink-soft); }
.idea-note { margin-top: 1.5rem; padding: 1.2rem 1.4rem; border: 1px solid var(--paper-line); border-radius: var(--radius); font-size: .95rem; color: var(--text-soft); background: rgba(255,255,255,.4); }
.idea-note b { color: var(--text); }
.thinkers { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.thinkers span { font-size: .78rem; padding: .25rem .6rem; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--paper-line); color: var(--text); }
@media (max-width: 860px) { .idea-grid { grid-template-columns: 1fr; } }

/* ---------- build pipeline ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 1.2rem; margin: 1.5rem 0 0; padding: 0; list-style: none; font-size: .88rem; color: var(--on-ink-soft); }
.legend li { display: flex; align-items: center; gap: .5rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot-you { background: var(--teal-bright); }
.dot-claude { background: var(--claude); }
.dot-gemini { background: var(--gemini); }

.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps::before { content: ""; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 1px; background: linear-gradient(var(--ink-line), rgba(95,224,211,.4), var(--ink-line)); }
.step { display: grid; grid-template-columns: 56px 1fr; gap: clamp(16px, 3vw, 34px); padding-bottom: clamp(34px, 5vw, 54px); position: relative; }
.step:last-child { padding-bottom: 0; }
.step-num {
  width: 56px; height: 56px; border-radius: 50%; background: var(--ink-2); border: 1px solid var(--ink-line);
  display: grid; place-items: center; font-family: var(--f-mono); font-size: .9rem; color: #fff; position: relative; z-index: 1;
}
.step-body { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: start; padding-top: .4rem; }
.step h3 { margin-bottom: .35rem; }
.step p { font-size: 1rem; }
.who-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.who-tag { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: .28rem .6rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--ink-line); color: var(--on-ink); }
.step-aside { background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: var(--radius); padding: 1.2rem 1.3rem; font-size: .92rem; }
.step-aside .label { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-ink-soft); margin-bottom: .6rem; display: block; }
.step-aside p { margin-bottom: .6rem; color: var(--on-ink); }
.step-aside p:last-child { margin-bottom: 0; }
.step-aside .chat { font-family: var(--f-read); font-size: 1rem; line-height: 1.55; }
.step-aside .chat em { color: var(--teal-bright); font-style: normal; font-family: var(--f-mono); font-size: .8rem; display: block; margin-bottom: .2rem; }
.step-aside ul { margin: 0; padding-left: 1.1rem; color: var(--on-ink); }
.step-aside li { margin-bottom: .25rem; }
.step-aside img { border-radius: 8px; }
.step-aside .sys { font-family: var(--f-mono); font-size: .82rem; color: var(--teal-bright); line-height: 1.6; }
@media (max-width: 860px) {
  .step-body { grid-template-columns: 1fr; }
  .steps::before { left: 21px; }
  .step { grid-template-columns: 44px 1fr; }
  .step-num { width: 44px; height: 44px; font-size: .8rem; }
}

/* triptych */
.triptych-wrap { margin-top: clamp(64px, 9vw, 110px); }
.triptych-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.triptych-head h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; }
.triptych { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 18px; }
.tri {
  background: var(--paper); color: var(--text); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.3rem; display: flex; flex-direction: column;
  box-shadow: var(--shadow); position: relative;
}
.tri .stage { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.tri h4 { font-size: 1.15rem; margin-bottom: .8rem; color: var(--ink); }
.tri .excerpt { font-family: var(--f-read); font-size: 1rem; line-height: 1.6; color: var(--text); flex: 1; }
.tri .excerpt p { margin-bottom: .7rem; color: var(--text); }
.tri .excerpt .beat { padding-left: .9rem; border-left: 2px solid var(--claude); }
.tri .excerpt .hl { background: linear-gradient(transparent 58%, rgba(216, 164, 67, .45) 58%); }
.tri .note { font-size: .82rem; color: var(--text-soft); border-top: 1px dashed var(--paper-line); padding-top: .8rem; margin-top: .6rem; }
.tri-img { padding: 10px; }
.tri-img .stage { padding: .5rem .5rem 0; }
.tri-img button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden; display: block; width: 100%; }
.tri-img img { width: 100%; border-radius: 8px; transition: transform .4s; }
.tri-img button:hover img { transform: scale(1.02); }
.tri-img .note { margin: .6rem .5rem .3rem; }
.tri .arrow { position: absolute; right: -15px; top: 50%; width: 30px; height: 30px; border-radius: 50%; background: var(--teal-bright); color: var(--ink); display: grid; place-items: center; z-index: 2; transform: translateY(-50%); font-weight: 700; }
@media (max-width: 960px) {
  .triptych { grid-template-columns: 1fr; }
  .tri .arrow { right: 50%; top: auto; bottom: -15px; transform: translateX(50%) rotate(90deg); }
}

/* ---------- season ---------- */
.acts { display: grid; gap: clamp(48px, 7vw, 80px); }
.act-head { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1.4rem; align-items: baseline; margin-bottom: 1.4rem; padding-bottom: 1rem; border-bottom: 1px solid var(--paper-line); }
.act-num { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brick); grid-row: span 2; align-self: start; padding-top: .5rem; }
.act-head h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0; }
.act-head p { margin: 0; color: var(--text-soft); font-size: .95rem; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.ep-card {
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  border: 1px solid rgba(0,0,0,.04); transition: transform .25s, box-shadow .25s; text-align: left; padding: 0; font: inherit; color: inherit; cursor: pointer;
}
.ep-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(10,18,32,.06), 0 22px 40px -16px rgba(10,18,32,.4); }
.ep-thumb { position: relative; aspect-ratio: 2816 / 1536; overflow: hidden; background: var(--ink-2); }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.ep-card:hover .ep-thumb img { transform: scale(1.04); }
.ep-badge { position: absolute; left: 10px; top: 10px; font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; background: rgba(11,18,32,.85); color: #fff; padding: .3rem .55rem; border-radius: 6px; }
.ep-info { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.ep-theme { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.ep-title { font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; line-height: 1.15; color: var(--ink); }
.ep-q { font-family: var(--f-read); font-style: italic; font-size: .97rem; color: var(--text-soft); line-height: 1.45; }
.ep-read { margin-top: auto; padding-top: .5rem; font-size: .8rem; color: var(--text-soft); }

/* dialog */
.ep-dialog {
  width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 18px;
  background: var(--paper); color: var(--text); box-shadow: 0 40px 100px -20px rgba(0,0,0,.6); overflow: hidden;
}
.ep-dialog[open] { display: flex; flex-direction: column; animation: pop .25s ease-out; }
.ep-dialog::backdrop { background: rgba(5, 10, 20, .78); backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.dlg-scroll { overflow-y: auto; }
.dlg-img { background: var(--ink); position: relative; }
.dlg-img a { display: block; cursor: zoom-in; }
.dlg-img img { width: 100%; }
.dlg-close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(11,18,32,.85);
  color: #fff; font-size: 1.4rem; cursor: pointer; display: grid; place-items: center; z-index: 3; line-height: 1;
}
.dlg-close:hover { background: var(--brick); }
.dlg-body { padding: clamp(20px, 4vw, 40px); display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(20px, 4vw, 48px); }
.dlg-body h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .3rem; }
.dlg-body .ep-theme { margin-bottom: .6rem; display: block; }
.dlg-q { font-family: var(--f-display); font-size: 1.25rem; font-style: italic; color: var(--brick); margin: .8rem 0 1rem; line-height: 1.35; font-weight: 500; }
.dlg-meta { font-size: .92rem; }
.dlg-meta dt { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); margin-top: 1rem; }
.dlg-meta dt:first-child { margin-top: 0; }
.dlg-meta dd { margin: .25rem 0 0; }
.dlg-nav { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .9rem clamp(20px, 4vw, 40px); border-top: 1px solid var(--paper-line); background: var(--paper-2); flex-wrap: wrap; }
.dlg-nav button { background: none; border: 1px solid var(--paper-line); border-radius: 999px; padding: .5rem 1rem; font: inherit; font-size: .88rem; cursor: pointer; color: var(--text); }
.dlg-nav button:hover:not(:disabled) { border-color: var(--ink); }
.dlg-nav button:disabled { opacity: .35; cursor: default; }
@media (max-width: 760px) { .dlg-body { grid-template-columns: 1fr; } }

/* ---------- cast ---------- */
.cast-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2.5vw, 28px); }
.cast-card { margin: 0; }
.cast-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); margin-bottom: .9rem; box-shadow: var(--shadow); background: var(--ink-2); }
.cast-card h3 { font-size: 1.2rem; margin-bottom: .1rem; }
.cast-card .role { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); display: block; margin-bottom: .45rem; }
.cast-card p { font-size: .93rem; color: var(--text-soft); margin: 0; line-height: 1.55; }
.cast-foot { margin-top: 2.5rem; font-size: .95rem; color: var(--text-soft); }
@media (max-width: 900px) { .cast-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- glitches ---------- */
.slip-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.slip { background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: var(--radius); padding: 1.1rem; display: flex; flex-direction: column; grid-column: span 2; }
.slip.wide { grid-column: span 3; }
.slip-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 1rem; }
.slip-imgs.one { grid-template-columns: 1fr; }
.slip-imgs.three { grid-template-columns: 1fr 1fr 1fr; }
.slip-imgs.four { grid-template-columns: repeat(4, 1fr); }
.slip.full { grid-column: 1 / -1; }
.slip.full p { max-width: 62em; }
.slip-imgs figure { margin: 0; position: relative; }
.slip-imgs img { width: 100%; border-radius: 8px; aspect-ratio: 1; object-fit: cover; }
.slip-imgs.one img { aspect-ratio: auto; height: 250px; object-fit: contain; background: var(--ink); }
.slip-imgs figcaption { position: absolute; left: 6px; bottom: 6px; font-family: var(--f-mono); font-size: .65rem; letter-spacing: .06em; background: rgba(11,18,32,.88); color: #fff; padding: .2rem .45rem; border-radius: 4px; }
.slip h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.slip p { font-size: .93rem; margin: 0; }
.slip-tag { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: #ff9d8a; margin-bottom: .5rem; display: block; }
.kept { margin-top: clamp(48px, 7vw, 80px); display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(24px, 5vw, 64px); align-items: start; padding-top: clamp(40px, 6vw, 64px); border-top: 1px solid var(--ink-line); }
.kept h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.kept p { font-size: 1.05rem; }
@media (max-width: 960px) {
  .slip-grid { grid-template-columns: 1fr 1fr; }
  .slip, .slip.wide { grid-column: span 1; }
  .slip.full { grid-column: 1 / -1; }
  .kept { grid-template-columns: 1fr; }
}
@media (max-width: 620px) { .slip-grid { grid-template-columns: 1fr; } .slip-imgs.four { grid-template-columns: 1fr 1fr; } }

/* ---------- assessment ---------- */
.assess-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.specs { display: grid; gap: 10px; margin: 1.6rem 0; }
.spec { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: .9rem; background: #fff; border-radius: 10px; padding: .7rem .9rem; box-shadow: var(--shadow); }
.spec b { font-family: var(--f-display); font-size: 1.4rem; text-align: center; }
.spec span { font-size: .93rem; }
.spec .m1 { color: var(--teal); } .spec .m2 { color: var(--gold); } .spec .m3 { color: var(--brick); }
.mw-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--paper-line); counter-reset: mw; }
.mw-list li { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: .8rem; align-items: baseline; padding: .8rem 0; border-bottom: 1px solid var(--paper-line); }
.mw-list .n { font-family: var(--f-mono); font-size: .78rem; color: var(--text-soft); }
.mw-list .t { font-weight: 600; font-size: .98rem; }
.mw-list .t small { display: block; font-weight: 400; color: var(--text-soft); font-size: .86rem; margin-top: .1rem; line-height: 1.45; }
.mw-list .s { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; padding: .22rem .5rem; border-radius: 999px; white-space: nowrap; background: var(--paper-2); border: 1px solid var(--paper-line); }
@media (max-width: 900px) { .assess-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .mw-list li { grid-template-columns: 2rem 1fr; } .mw-list .s { grid-column: 2; justify-self: start; } }

/* ---------- lessons ---------- */
.lessons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(32px, 5vw, 64px); counter-reset: l; }
.lesson { padding: 1.8rem 0; border-top: 1px solid var(--paper-line); display: grid; grid-template-columns: 3rem 1fr; gap: .4rem 1rem; }
.lesson::before { counter-increment: l; content: counter(l, decimal-leading-zero); font-family: var(--f-mono); font-size: .85rem; color: var(--brick); padding-top: .3rem; grid-row: span 2; }
.lesson h3 { font-size: 1.3rem; margin: 0; }
.lesson p { margin: 0; color: var(--text-soft); font-size: .98rem; }
.lesson.big { grid-column: 1 / -1; }
@media (max-width: 820px) { .lessons { grid-template-columns: 1fr; } }

.prompts { margin-top: clamp(48px, 6vw, 72px); display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.prompt { background: var(--ink); color: var(--on-ink); border-radius: var(--radius); padding: 1.3rem 1.4rem; position: relative; }
.prompt .label { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-ink-soft); display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: .8rem; }
.prompt pre { margin: 0; white-space: pre-wrap; font-family: var(--f-mono); font-size: .8rem; line-height: 1.65; color: #d7e3f2; }
.prompt pre .v { color: var(--gold); }
.copy-btn { background: none; border: 1px solid var(--ink-line); color: var(--on-ink-soft); border-radius: 6px; padding: .25rem .6rem; font: inherit; font-size: .7rem; cursor: pointer; letter-spacing: .08em; }
.copy-btn:hover { color: #fff; border-color: var(--on-ink-soft); }
.prompts-note { grid-column: 1 / -1; font-size: .88rem; color: var(--text-soft); margin: 0; }
@media (max-width: 860px) { .prompts { grid-template-columns: 1fr; } }

/* ---------- CTA + footer ---------- */
.cta { text-align: center; }
.cta h2 { max-width: 16em; margin-left: auto; margin-right: auto; }
.cta .lede { margin: 0 auto 2rem; }
.cta-strip { display: flex; gap: 10px; justify-content: center; margin-bottom: 2.4rem; overflow: hidden; }
.cta-strip img { width: 160px; border-radius: 6px; opacity: .85; flex: none; }
@media (max-width: 700px) { .cta-strip img:nth-child(n+3) { display: none; } }
.footer { background: #070c16; color: var(--on-ink-soft); padding: 56px 0 40px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; }
.footer h4 { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #fff; font-weight: 500; margin-bottom: .9rem; }
.footer p { margin-bottom: .5rem; }
.footer a { color: var(--on-ink); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .45rem; }
.footer .credit-row { display: flex; gap: .6rem; align-items: baseline; }
.footer .fine { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--ink-line); font-size: .8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ==========================================================================
   Episodes reader page
   ========================================================================== */
.reader-hero { background: var(--ink); color: var(--on-ink); padding: 130px 0 64px; }
.reader-hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); letter-spacing: -0.02em; }
.reader-hero .lede { color: var(--on-ink-soft); }
.reader-hero .kicker { color: var(--teal-bright); }
.reader { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); padding-top: 56px; padding-bottom: 100px; }
.toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: .5rem; }
.toc h2 { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-soft); font-weight: 500; margin-bottom: .8rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: grid; grid-template-columns: 2rem 1fr; padding: .42rem .5rem; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .9rem; line-height: 1.3; }
.toc a span { font-family: var(--f-mono); font-size: .72rem; color: var(--text-soft); padding-top: .12rem; }
.toc a:hover { background: var(--paper-2); color: var(--ink); }
.toc a.is-active { background: var(--ink); color: #fff; }
.toc a.is-active span { color: var(--teal-bright); }
.toc .act-label { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brick); margin: 1rem 0 .3rem .5rem; }
.toc .act-label:first-child { margin-top: 0; }
.toc-mobile { display: none; }
@media (max-width: 900px) {
  .reader { grid-template-columns: 1fr; padding-top: 24px; }
  .toc { display: none; }
  .toc-mobile { display: block; position: sticky; top: 64px; z-index: 20; background: var(--paper); padding: .7rem 0; border-bottom: 1px solid var(--paper-line); }
  .toc-mobile select { width: 100%; font: inherit; font-size: .95rem; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--paper-line); background: #fff; color: var(--text); }
}

.episode { padding-bottom: 72px; margin-bottom: 72px; border-bottom: 1px solid var(--paper-line); scroll-margin-top: 80px; }
.episode:last-child { border-bottom: 0; margin-bottom: 0; }
.episode-head { margin-bottom: 1.4rem; }
.episode-head .ep-theme { display: block; margin-bottom: .5rem; }
.episode-head h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: .6rem; }
.episode-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; font-size: .9rem; color: var(--text-soft); }
.episode-meta b { color: var(--text); font-weight: 600; }
.episode-comic { margin: 1.6rem 0 2.2rem; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: var(--ink); }
.episode-comic a { display: block; cursor: zoom-in; }
.episode-comic figcaption { font-size: .78rem; color: var(--on-ink-soft); padding: .55rem .9rem; font-family: var(--f-mono); letter-spacing: .03em; }
.prose { font-family: var(--f-read); font-size: 1.16rem; line-height: 1.75; max-width: 40em; }
.prose p { margin-bottom: 1.05em; }
.prose strong { font-family: var(--f-body); font-size: .92em; }
.prose blockquote {
  margin: 2rem 0; padding: 1.4rem 1.6rem; background: #fffdf6; border-left: 4px solid var(--teal); border-radius: 0 10px 10px 0;
  font-style: italic; box-shadow: var(--shadow);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose pre {
  font-family: var(--f-mono); font-size: .86rem; line-height: 1.6; background: var(--ink); color: var(--teal-bright);
  padding: 1.1rem 1.3rem; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; margin: 1.6rem 0;
}
.prose hr { border: 0; text-align: center; margin: 2rem 0; }
.prose hr::after { content: "\2022 \2022 \2022"; color: var(--text-soft); letter-spacing: .6em; }
.episode-foot { margin-top: 2rem; display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; font-size: .9rem; }
.episode-foot .mw { background: var(--paper-2); border: 1px solid var(--paper-line); border-radius: 10px; padding: .8rem 1rem; flex: 1 1 340px; }
.episode-foot .mw b { display: block; font-size: .7rem; font-family: var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: .2rem; font-weight: 500; }
.to-top { font-size: .85rem; }

@media (max-width: 560px) {
  .terminal { display: flex; align-items: flex-start; min-height: 4.6em; }
  .terminal .who { display: none; }
  .hero-meta { display: none; }
  .hero { padding-bottom: 56px; }
  .hero-ctas .btn { justify-content: center; }
}

/* ---------- student quotes ---------- */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.quote { margin: 0; background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: var(--radius); padding: 1.5rem 1.5rem 1.3rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1.2rem; }
.quote blockquote { margin: 0; font-family: var(--f-display); font-size: 1.3rem; line-height: 1.35; font-weight: 500; color: #fff; font-variation-settings: "opsz" 36; }
.quote blockquote::before { content: "\201C"; color: var(--teal-bright); margin-right: .05em; }
.quote blockquote::after { content: "\201D"; color: var(--teal-bright); margin-left: .02em; }
.quote figcaption { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--on-ink-soft); }
.quote-lead { grid-column: span 2; grid-row: span 2; background: linear-gradient(160deg, var(--ink-3), var(--ink-2)); padding: 2.2rem; }
.quote-lead blockquote { font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.2; font-variation-settings: "opsz" 96; }
.quote-suggest { grid-column: 1 / -1; border-style: dashed; border-color: rgba(216, 164, 67, .45); background: transparent; }
.quote-suggest blockquote { font-size: 1.35rem; max-width: 46em; }
.quote-tag { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.quotes-note { margin-top: 1.4rem; font-size: .85rem; }
@media (max-width: 900px) {
  .quotes { grid-template-columns: 1fr 1fr; }
  .quote-lead { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 560px) { .quotes { grid-template-columns: 1fr; } }

/* ---------- link back to tomwilk.net ---------- */
.nav-links .nav-home { padding-left: 1.4rem; border-left: 1px solid var(--ink-line); }
.nav-links .nav-home a { color: var(--teal-bright); }
.nav-links .nav-home a:hover { color: #fff; }
@media (max-width: 920px) { .nav-links .nav-home { padding-left: 0; border-left: 0; } }
.nav-links a { white-space: nowrap; }
@media (min-width: 921px) and (max-width: 1220px) {
  .nav-links { gap: 1.05rem; }
  .nav-links a { font-size: .84rem; }
  .nav-links .nav-home { padding-left: 1rem; }
}
@media (min-width: 921px) and (max-width: 1040px) {
  .nav-links { gap: .75rem; }
  .nav-links a { font-size: .8rem; }
  .nav-links .nav-home { padding-left: .75rem; }
}
