/* ---------- Tokens ---------- */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #4a4f5a;
  --muted: #7a7f8a;
  --line: #e3e0d8;
  --accent: #2f4fd8;
  --accent-ink: #ffffff;
  --accent-soft: #e8ecfd;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  --wrap: 68rem;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214;
    --surface: #18191c;
    --ink: #ecebe6;
    --ink-2: #b4b6bc;
    --muted: #868992;
    --line: #2a2c31;
    --accent: #8ea2ff;
    --accent-ink: #0d0f1a;
    --accent-soft: #1d2236;
  }
}
:root[data-theme="dark"] {
  --bg: #111214;
  --surface: #18191c;
  --ink: #ecebe6;
  --ink-2: #b4b6bc;
  --muted: #868992;
  --line: #2a2c31;
  --accent: #8ea2ff;
  --accent-ink: #0d0f1a;
  --accent-soft: #1d2236;
}

/* ---------- Base ---------- */
*, *::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(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1.5rem; }
@media (max-width: 480px) { .wrap { padding-inline: 1rem; } }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 3.75rem; }
.mark {
  font: 600 1.05rem/1 var(--serif); letter-spacing: .02em; text-decoration: none;
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border: 1.5px solid var(--ink); border-radius: 50%;
}
nav { display: flex; gap: 1.5rem; margin-left: auto; }
nav a { text-decoration: none; color: var(--ink-2); font-size: .95rem; }
nav a:hover { color: var(--ink); }
@media (max-width: 560px) { nav { gap: 1rem; } .hide-sm { display: none; } }

.theme-toggle {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  background: none; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink-2); }
.theme-toggle svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.i-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; } }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(4rem, 12vw, 8.5rem) clamp(3rem, 8vw, 5rem); }
.eyebrow { font: 500 .8rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.5rem; }
.hero h1 {
  font: 500 clamp(3rem, 10vw, 6.5rem)/0.95 var(--serif);
  letter-spacing: -0.025em;
}
.lede { max-width: 38rem; margin-top: 2rem; font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--ink-2); }

.cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.25rem; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .75rem 1.25rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; font-weight: 500; font-size: .95rem;
  transition: border-color .15s, transform .15s;
  overflow-wrap: anywhere;
}
.btn:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { border-color: var(--ink); opacity: .9; }

/* ---------- Impact strip ---------- */
.impact { border-block: 1px solid var(--line); background: var(--surface); }
.stats {
  list-style: none; margin: 0 auto; padding-block: 2rem;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.5rem;
}
.stats li { display: flex; flex-direction: column; gap: .25rem; }
.stats strong { font: 500 clamp(1.75rem, 3.5vw, 2.4rem)/1 var(--serif); letter-spacing: -0.02em; }
.stats span { font-size: .85rem; color: var(--muted); line-height: 1.35; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(3, 1fr); row-gap: 2rem; } }
@media (max-width: 420px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(4rem, 9vw, 6.5rem); scroll-margin-top: 2rem; }
.section + .section { border-top: 1px solid var(--line); }
.section-title {
  display: flex; align-items: baseline; gap: 1rem;
  font: 500 clamp(1.75rem, 4vw, 2.5rem)/1.1 var(--serif); letter-spacing: -0.015em;
  margin-bottom: 2.5rem;
}
.section-title span { font: 500 .8rem/1 var(--mono); color: var(--accent); letter-spacing: .08em; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem); display: flex; flex-direction: column; gap: 1rem;
}
.card header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }
.card h3 { font: 500 1.75rem/1.1 var(--serif); }
.tag { font: 500 .75rem/1 var(--mono); color: var(--accent); background: var(--accent-soft); padding: .4rem .6rem; border-radius: 999px; }
.card-lede { font-size: 1.125rem; font-weight: 500; line-height: 1.45; }
.card p:not(.card-lede) { color: var(--ink-2); font-size: .975rem; }
.link { margin-top: auto; color: var(--accent); font-weight: 500; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 9rem 1fr; gap: 2rem;
  padding-block: 1.5rem; border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.when { font: 500 .85rem/1.9 var(--mono); color: var(--muted); }
.what h3 { font-size: 1.15rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.what h3 em { font-style: normal; font-weight: 400; color: var(--ink-2); font-size: 1rem; }
.what p { margin-top: .5rem; color: var(--ink-2); max-width: 44rem; }
.founder .what h3::after {
  content: "Founder · exit"; font: 500 .7rem/1 var(--mono); color: var(--accent);
  background: var(--accent-soft); padding: .35rem .55rem; border-radius: 999px;
}
@media (max-width: 640px) {
  .timeline li { grid-template-columns: 1fr; gap: .35rem; }
}

/* About */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.25rem 3rem; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
.kicker { font: 500 .75rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .75rem; }
.grid-2 p { color: var(--ink-2); }
.edu { margin-top: 3.5rem; padding-top: 3rem; border-top: 1px dashed var(--line); }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; color: var(--ink-2); }
.plain strong { color: var(--ink); font-weight: 600; }

/* Contact */
.contact-lede { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--ink-2); max-width: 36rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding-block: 2rem; font-size: .875rem; color: var(--ink-2); }
.muted { color: var(--muted); }

/* =========================================================
   Live experiment homepage
   ========================================================= */
:root { --live: #1f9d55; --live-soft: #e3f4ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --live: #4ade80; --live-soft: #13261b; } }
:root[data-theme="dark"] { --live: #4ade80; --live-soft: #13261b; }

.hero-x { font: 500 clamp(2.6rem, 8.5vw, 5.75rem)/1 var(--serif); letter-spacing: -0.03em; }
.hero-x em { font-style: italic; color: var(--accent); }
.hero-meta { margin-top: 1.75rem; font-size: .95rem; color: var(--muted); max-width: 42rem; }
.hero-meta a, .protocol a, .log a, .operator p a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
.hero-meta a:hover, .protocol a:hover, .log a:hover, .operator p a:hover { text-decoration-color: var(--accent); }

/* Run card */
.run-wrap { padding-bottom: clamp(3rem, 8vw, 5rem); }
.run {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 1px 0 var(--line), 0 24px 48px -32px rgb(0 0 0 / .25);
  overflow: hidden;
}
.run-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
  padding: 1rem clamp(1.25rem, 3vw, 2rem); border-bottom: 1px solid var(--line);
  font: 500 .78rem/1 var(--mono); letter-spacing: .06em; color: var(--muted);
}
.status {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--live); background: var(--live-soft); padding: .45rem .7rem; border-radius: 999px;
  text-transform: uppercase;
}
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); }
  70% { box-shadow: 0 0 0 .5rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
.run-id { color: var(--ink); }
.run-clock { margin-left: auto; }
.run-clock b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .run-clock { margin-left: 0; width: 100%; } }

.run-body { padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1.25rem, 3vw, 2rem); }
.label { font: 500 .75rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.hypothesis { font: 500 clamp(1.6rem, 4vw, 2.6rem)/1.15 var(--serif); letter-spacing: -0.015em; max-width: 48rem; }

.protocol { margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.75rem 2.5rem; }
.protocol div { border-top: 1px solid var(--line); padding-top: 1rem; }
.protocol dt { font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.protocol dd { margin: 0; color: var(--ink-2); }
.protocol dd b { color: var(--ink); font-weight: 600; }
@media (max-width: 680px) { .protocol { grid-template-columns: 1fr; } }

/* Loop stages */
.loop {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem clamp(1.25rem, 3vw, 2rem); border-top: 1px solid var(--line); background: var(--bg);
}
.loop ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; flex: 1; }
.loop li {
  font: 500 .78rem/1 var(--mono); letter-spacing: .04em; color: var(--muted);
  padding: .5rem .75rem; border: 1px dashed var(--line); border-radius: 999px;
  display: inline-flex; align-items: center; gap: .4rem;
}
.loop li:not(:last-child)::after { content: "→"; margin-left: .5rem; color: var(--line); }
.loop li.done { color: var(--ink-2); border-style: solid; }
.loop li.done::before { content: "✓"; color: var(--live); }
.loop li.now { color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent); }
.loop li.now::after { color: var(--accent-ink); opacity: .6; }
.loop-back { font-size: 1.25rem; color: var(--muted); }

/* Log */
.log { list-style: none; margin: 0; padding: 0; position: relative; }
.log::before { content: ""; position: absolute; left: 7.25rem; top: .6rem; bottom: .6rem; width: 1px; background: var(--line); }
.log li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 2rem; padding-block: 1.1rem; position: relative; }
.log li::before {
  content: ""; position: absolute; left: calc(7.25rem - 4px); top: 1.55rem;
  width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--accent);
}
.log li:first-child::before { background: var(--accent); }
.log time { font: 500 .8rem/1.9 var(--mono); color: var(--muted); }
.log-kind { font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: .35rem 0 .5rem; }
.log li p:not(.log-kind) { color: var(--ink-2); max-width: 40rem; }
@media (max-width: 560px) {
  .log::before { left: 4px; }
  .log li { grid-template-columns: 1fr; gap: .25rem; padding-left: 1.75rem; }
  .log li::before { left: 0; top: 1.5rem; }
}

/* Queue */
.queued { border-style: solid; }
.suggest { border-style: dashed; background: transparent; }
.tag-open { color: var(--live); background: var(--live-soft); }

/* Operator */
.operator { max-width: 46rem; display: grid; gap: 1.25rem; justify-items: start; }
.operator-lede { font: 400 clamp(1.25rem, 2.6vw, 1.6rem)/1.45 var(--serif); color: var(--ink); }
.operator p:not(.operator-lede) { color: var(--ink-2); }

/* Section labels as words, not numbers */
.section-title span { text-transform: uppercase; }

/* =========================================================
   Stories
   ========================================================= */
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--accent); }

.story-head { max-width: calc(42rem + 3rem); padding-block: clamp(3.5rem, 10vw, 7rem) clamp(2rem, 5vw, 3rem); }
.story-next { max-width: calc(42rem + 3rem); }
.story-head h1 { font: 500 clamp(2.4rem, 7vw, 4.75rem)/1.02 var(--serif); letter-spacing: -0.03em; max-width: 16ch; }
.story-head .lede { max-width: 36rem; }

.story-loop { list-style: none; margin: 2.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.story-loop li:not(:last-child)::after { content: "→"; margin-left: .5rem; color: var(--muted); font-size: .8rem; }
.story-loop a {
  font: 500 .75rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  color: var(--ink-2); padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 999px; display: inline-block;
}
.story-loop a:hover { border-color: var(--accent); color: var(--accent); }

.prose { max-width: calc(42rem + 3rem); padding-bottom: 3rem; }
.prose section { padding-block: 1.1rem; }
.prose section:first-child { border-top: 1px solid var(--line); padding-top: 2.5rem; }
.prose p { font-size: 1.125rem; line-height: 1.75; color: var(--ink-2); }
.prose p + p { margin-top: 1.1rem; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose .label { font-size: .75rem; line-height: 1; color: var(--accent); margin-bottom: 1.25rem; }
.prose blockquote {
  margin: 0; font: 500 clamp(1.5rem, 3.6vw, 2.1rem)/1.3 var(--serif); letter-spacing: -0.01em; color: var(--ink);
  padding-left: 1.25rem; border-left: 3px solid var(--accent);
}

/* Middlemen chain */
.chain {
  margin: 2rem 0 0; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); display: grid; gap: 1.25rem;
}
.chain-row { display: grid; grid-template-columns: 1fr; gap: .6rem; }
.chain-tag { font: 500 .7rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chain ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.chain li {
  font-size: .9rem; font-weight: 500; padding: .45rem .75rem; border-radius: 8px;
  border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.chain li:not(:last-child)::after { content: "→"; margin-left: .6rem; color: var(--muted); font-weight: 400; }
.chain li { display: inline-flex; align-items: center; }
.chain .maker { background: var(--live-soft); color: var(--live); border-color: transparent; }
.chain .mid { text-decoration: line-through; text-decoration-color: color-mix(in srgb, #d14343 70%, transparent); text-decoration-thickness: 1.5px; }
.chain .us { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chain .us::after { color: var(--accent-ink) !important; opacity: .7; }
.chain .buyer { color: var(--ink); }
.chain figcaption { font-size: .9rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 1rem; }
@media (max-width: 520px) {
  .chain { padding: 1.1rem; }
  .chain li { font-size: .82rem; padding: .4rem .6rem; }
}

.story-stats { list-style: none; margin: 0 0 1.75rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.story-stats li { display: flex; flex-direction: column; gap: .3rem; padding: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.story-stats strong { font: 500 clamp(1.6rem, 4vw, 2.2rem)/1 var(--serif); }
.story-stats span { font-size: .85rem; color: var(--muted); line-height: 1.3; }
@media (max-width: 520px) { .story-stats { grid-template-columns: 1fr 1fr; } }

.todo-note { font-style: italic; color: var(--muted) !important; border: 1px dashed var(--line); border-radius: 12px; padding: 1rem 1.25rem; font-size: 1rem !important; }

.story-next { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-block: 2rem 4rem; border-top: 1px solid var(--line); }
.story-next a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.story-next a:hover { color: var(--accent); }

/* Story list */
.story-list-wrap { padding-top: 0; }
.story-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.story-list li { border-bottom: 1px solid var(--line); }
.story-item {
  display: grid; grid-template-columns: 3.5rem 1fr auto; align-items: center; gap: 1.25rem;
  padding: 1.6rem .25rem; text-decoration: none; color: inherit; transition: padding .2s;
}
a.story-item:hover { padding-left: .75rem; }
a.story-item:hover .story-go { color: var(--accent); transform: translateX(4px); }
.story-no { font: 500 .85rem/1 var(--mono); color: var(--accent); }
.story-main { display: grid; gap: .35rem; }
.story-co { font-size: .95rem; font-weight: 600; }
.story-co em { font-style: normal; font-weight: 400; color: var(--muted); margin-left: .5rem; font-family: var(--mono); font-size: .8rem; }
.story-q { font: 500 clamp(1.25rem, 3vw, 1.75rem)/1.25 var(--serif); }
.story-go { font-size: 1.4rem; color: var(--muted); transition: transform .2s, color .2s; }
.soon { opacity: .5; }
.soon .story-q { font-family: var(--sans); font-size: 1rem; font-weight: 400; color: var(--muted); }
@media (max-width: 520px) { .story-item { grid-template-columns: 2.25rem 1fr auto; gap: .75rem; } }

/* Flowing story text: one continuous column, no breaks */
.flow { border-top: 1px solid var(--line); padding-top: 2.75rem; padding-bottom: 4rem; }
.flow p { font-size: 1.2rem; line-height: 1.85; color: var(--ink); }
.flow p + p { margin-top: 1.35rem; }
.flow p:first-of-type::first-letter {
  float: left; font: 500 3.6rem/0.9 var(--serif); margin: .35rem .6rem 0 0; color: var(--accent);
}
.flow p:last-of-type { font-family: var(--serif); font-size: 1.35rem; font-style: italic; color: var(--ink-2); margin-top: 2.25rem; }
@media (max-width: 520px) { .flow p { font-size: 1.1rem; } }

/* =========================================================
   Story illustrations (inline SVG line drawings)
   ========================================================= */
:root { --silk: #a8326e; --gold: #c08a1e; --lit: #f4d58a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --silk: #f08bbd; --gold: #e3b04b; --lit: #6b5520; } }
:root[data-theme="dark"] { --silk: #f08bbd; --gold: #e3b04b; --lit: #6b5520; }

.flow .ill { margin: 2.75rem 0 2.5rem; }
.ill svg { display: block; width: 100%; height: auto; overflow: visible; }
.ill .ln { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill .thin { stroke-width: 1.4; }
.ill .thick { stroke-width: 3.5; }
.ill .soft { stroke: var(--muted); stroke-dasharray: 4 5; }
.ill .silk { stroke: var(--silk); }
.ill .tag { fill: var(--surface); }
.ill .silk-fill { fill: var(--silk); stroke: none; }
.ill .gold { fill: var(--gold); stroke: none; }
.ill .gold-ln { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }
.ill .dashed { stroke-dasharray: 2 7; }
.ill .warp { fill: none; stroke: var(--silk); stroke-width: 1.2; opacity: .75; }
.ill .sun { fill: var(--gold); opacity: .85; }
.ill .lit { fill: var(--lit); }
.ill .arrow-head { fill: var(--muted); }
.ill .arrow-head.gold { fill: var(--gold); }
.ill .thread { fill: none; stroke: var(--silk); stroke-width: 3; stroke-linecap: round; }
.ill text { font-family: var(--mono); font-size: 15px; fill: var(--muted); text-anchor: middle; }
.ill text.strong { fill: var(--ink); font-weight: 600; }
.ill text.silk-text { fill: var(--silk); font-weight: 600; }
.flow .ill figcaption {
  margin-top: 1.1rem; text-align: center;
  font: italic 400 1.1rem/1.5 var(--serif); color: var(--ink-2);
}
@media (max-width: 520px) {
  .flow .ill { margin-inline: -.25rem; }
  .ill text { font-size: 17px; }
}

/* Gentle reveal: only when JS is running and motion is welcome */
.anim .ill { opacity: 0; transform: translateY(14px); transition: opacity .9s ease, transform .9s ease; }
.anim .ill.in { opacity: 1; transform: none; }
.anim .ill .draw { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.anim .ill.in .draw { animation: draw-thread 2.6s ease .3s forwards; }
@keyframes draw-thread { to { stroke-dashoffset: 0; } }
.ill .tags text { font-family: var(--sans); font-size: 17px; }

/* Story chapters */
.flow .chapter {
  font: 500 clamp(1.5rem, 3.2vw, 1.9rem)/1.2 var(--serif); letter-spacing: -0.01em; color: var(--ink);
  margin: 3.5rem 0 1.25rem;
}
.flow .chapter:first-child { margin-top: 0; }

/* Map of clusters */
.flow .ill-map { max-width: 440px; margin-inline: auto; }
.ill .land { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.ill .pin { fill: var(--silk); }
.ill .pin-ring { fill: none; stroke: var(--silk); stroke-width: 1.5; opacity: .45; }
.ill text[text-anchor="start"] { text-anchor: start; }
.ill text[text-anchor="end"] { text-anchor: end; }
.anim .ill-map .pins > * { opacity: 0; transition: opacity .6s ease; }
.anim .ill-map.in .pins > * { opacity: 1; }
.anim .ill-map.in .pins > :nth-child(n+4) { transition-delay: .5s; }
.anim .ill-map.in .pins > :nth-child(n+7) { transition-delay: 1s; }
.anim .ill-map.in .pins > :nth-child(n+10) { transition-delay: 1.5s; }
.anim .ill-map.in .pin-ring { opacity: .45; }

/* Cash gap */
.ill .gap { fill: var(--silk); opacity: .14; }

/* Real photos inside a story */
.flow .photo { margin: 2.5rem 0; }
.flow .photo img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.flow .photo figcaption { margin-top: 1rem; text-align: center; font: italic 400 1.1rem/1.5 var(--serif); color: var(--ink-2); }

/* In the news */
.news { max-width: calc(42rem + 3rem); padding-bottom: 3.5rem; }
.news-title { font: 500 .78rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 1.25rem; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .news-list { grid-template-columns: 1fr; } }
.news-card {
  position: relative; display: flex; flex-direction: column; gap: .75rem; height: 100%;
  padding: 1.35rem 3rem 1.4rem 1.35rem; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s, transform .2s;
}
.news-card:hover { border-color: var(--silk); transform: translateY(-2px); }
.news-src { font: 500 .75rem/1.3 var(--mono); letter-spacing: .04em; color: var(--muted); }
.news-head { font: 500 1.2rem/1.35 var(--serif); color: var(--ink); }
.news-go { position: absolute; top: 1.2rem; right: 1.25rem; font-size: 1.2rem; color: var(--muted); transition: color .2s; }
.news-card:hover .news-go { color: var(--silk); }
.anim .ill-map.in .pins > :nth-child(n+13) { transition-delay: 1.8s; }
.anim .ill-map.in .pins > :nth-child(n+16) { transition-delay: 2.1s; }
.anim .ill-map.in .pins > :nth-child(n+19) { transition-delay: 2.4s; }
@media (max-width: 520px) { .ill-map svg text { font-size: 15px; } }

/* Picksilk brand: always on white so the logo's face (negative space) reads correctly */
.brand-tile {
  display: block; width: 64px; height: auto; margin-bottom: 1.5rem;
  background: #fff; padding: 10px; border-radius: 16px; border: 1px solid var(--line);
  box-sizing: content-box;
}
.brand-chip {
  display: inline-block; width: 22px; height: auto; vertical-align: -5px; margin-right: .5rem;
  background: #fff; padding: 3px; border-radius: 6px; border: 1px solid var(--line); box-sizing: content-box;
}
.logo-fig { margin: 2.5rem 0; text-align: center; }
.logo-card {
  display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 1.75rem 2.25rem;
}
.logo-card img { display: block; width: 150px; height: auto; }
.flow .logo-fig figcaption {
  margin: 1rem auto 0; max-width: 30rem; text-align: center;
  font: italic 400 1.1rem/1.5 var(--serif); color: var(--ink-2);
}
.inline-link { color: var(--accent); text-decoration: none; font-weight: 500; white-space: nowrap; }
.inline-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Video: click-to-load YouTube (no requests to YouTube until play) */
.flow .video { margin: 2.5rem 0; }
.yt { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #1a0d14; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer;
  background: radial-gradient(120% 90% at 30% 20%, #ef6a3a 0%, #e8455a 45%, #c8195f 100%);
  color: #fff; font: inherit;
}
.yt-poster { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; }
.yt-mark { width: 54px; height: auto; background: #fff; padding: 9px; border-radius: 14px; box-sizing: content-box; box-shadow: 0 10px 30px -10px rgb(0 0 0 / .35); }
.yt-title { font: italic 500 clamp(1.5rem, 4.5vw, 2.4rem)/1.1 var(--serif); letter-spacing: -0.01em; margin-top: .5rem; text-shadow: 0 2px 18px rgb(0 0 0 / .2); }
.yt-sub { font: 500 .75rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.yt-btn {
  position: absolute; right: 1.1rem; bottom: 1.1rem; width: 3.6rem; height: 3.6rem; border-radius: 50%;
  display: grid; place-items: center; background: rgb(255 255 255 / .95); color: #c8195f;
  box-shadow: 0 10px 30px -8px rgb(0 0 0 / .4); transition: transform .2s;
}
.yt-btn svg { width: 1.5rem; height: 1.5rem; fill: currentColor; margin-left: 3px; }
.yt-play:hover .yt-btn, .yt-play:focus-visible .yt-btn { transform: scale(1.08); }
.yt-play:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.flow .video figcaption { margin-top: 1rem; text-align: center; font: italic 400 1.1rem/1.5 var(--serif); color: var(--ink-2); }
.flow .video figcaption a { color: var(--accent); font-style: normal; font-family: var(--sans); font-size: .95rem; text-decoration: none; margin-left: .35rem; }
@media (max-width: 520px) { .yt-mark { width: 40px; padding: 7px; } .yt-btn { width: 3rem; height: 3rem; right: .8rem; bottom: .8rem; } }

/* Per-story thread colour: NEURAi blue instead of Picksilk silk */
.story-neurai { --silk: #3f57f5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .story-neurai { --silk: #8fa0ff; } }
:root[data-theme="dark"] .story-neurai { --silk: #8fa0ff; }
.ill .bar-soft { fill: var(--muted); opacity: .3; }
.ill text.code { font-size: 13px; fill: var(--muted); }
.logo-card.wide img { width: 240px; }
@media (max-width: 520px) { .logo-card.wide { padding: 1.25rem 1.5rem; } .logo-card.wide img { width: 200px; } }
/* labels that must stay inside a shape: never enlarge on phones */
.ill svg text.fit { font-size: 15px; }

/* NEURAi video poster in its brand blue */
.story-neurai .yt-play { background: radial-gradient(120% 90% at 30% 20%, #6f84ff 0%, #4057f8 45%, #2a3cc4 100%); }
.story-neurai .yt-btn { color: #3f57f5; }

/* Side projects */
.section-lede { margin: -1.25rem 0 2rem; max-width: 40rem; color: var(--ink-2); font-size: 1.05rem; }
.tag .live-dot { display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: var(--live); margin-right: .4rem; vertical-align: 1px; animation: pulse 2s infinite; }
@media (prefers-reduced-motion: reduce) { .tag .live-dot { animation: none; } }

/* Social links in the footer */
.social { display: flex; gap: .5rem; align-items: center; }
.social a {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink-2); transition: color .2s, border-color .2s, transform .2s;
}
.social a:hover { color: var(--ink); border-color: var(--ink-2); transform: translateY(-1px); }
.social svg { width: 15px; height: 15px; fill: currentColor; }
.footer-inner { align-items: center; }

/* Primary menu: label + small caption */
.menu { gap: 1.75rem; }
.menu-item { display: flex; flex-direction: column; gap: .2rem; padding: .35rem 0; position: relative; }
.menu-k { font-size: .95rem; font-weight: 500; color: var(--ink-2); line-height: 1.1; transition: color .2s; }
.menu-s { font: 500 .6rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.menu-item:hover .menu-k { color: var(--ink); }
.menu-item[aria-current="page"] .menu-k { color: var(--ink); }
.menu-item[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.15rem; height: 2px; border-radius: 2px; background: var(--accent);
}
@media (max-width: 640px) {
  .menu { gap: 1.1rem; }
  .menu-s { display: none; }
  .menu-k { font-size: .9rem; }
}

/* At scale: the road */
.road { list-style: none; margin: 0; padding: 0; position: relative; }
.road::before { content: ""; position: absolute; left: 9.25rem; top: .5rem; bottom: .5rem; width: 2px; background: var(--line); }
.stop { display: grid; grid-template-columns: 8rem 1fr; gap: 2.5rem; padding-block: 1.6rem; position: relative; }
.stop::before {
  content: ""; position: absolute; left: calc(9.25rem - 5px); top: 2.05rem; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--ink-2);
}
.stop-when { font: 500 .85rem/1.9 var(--mono); color: var(--muted); text-align: right; }
.stop-body h2 { font-size: 1.2rem; display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.stop-body h2 em { font-style: normal; font-weight: 400; font-size: 1rem; color: var(--ink-2); }
.stop-num { font: 500 clamp(1.9rem, 4.5vw, 2.6rem)/1.1 var(--serif); letter-spacing: -0.02em; margin: .6rem 0 .5rem; color: var(--ink); }
.stop-num span { font: 500 .78rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-left: .5rem; }
.stop-body > p:last-child { color: var(--ink-2); max-width: 42rem; }

.detour { padding: .6rem 0 .6rem 10.75rem; position: relative; }
.detour::before {
  content: ""; position: absolute; left: calc(9.25rem + 1px); top: 50%; width: 1.5rem; border-top: 2px dashed var(--accent);
}
.detour a {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; text-decoration: none; color: inherit;
  border: 1.5px dashed var(--accent); border-radius: 14px; padding: .9rem 1.1rem; background: var(--accent-soft);
  transition: transform .2s;
}
.detour a:hover { transform: translateX(4px); }
.detour-tag { font: 500 .7rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.detour-what { font: 500 1.15rem/1.2 var(--serif); color: var(--ink); }
.detour-go { margin-left: auto; font-size: .9rem; font-weight: 500; color: var(--accent); }
.road-foot { margin-top: 2.5rem; color: var(--ink-2); }

@media (max-width: 640px) {
  .road::before { left: 5px; }
  .stop { grid-template-columns: 1fr; gap: .2rem; padding-left: 1.75rem; }
  .stop::before { left: 0; top: 1.95rem; }
  .stop-when { text-align: left; }
  .detour { padding-left: 1.75rem; }
  .detour::before { display: none; }
  .detour-go { margin-left: 0; }
}
.menu-k { white-space: nowrap; }
@media (max-width: 640px) {
  .menu-item.hide-sm { display: none; }
  .header-inner { gap: 1rem; }
}
