/* The Compute Floor of Data Mixing — project page
   Editorial-scientific theme: paper ground, ink type, one family-coded data palette.
   Data colours are validated (dataviz six-checks) in both modes; see README. */

:root {
  color-scheme: light;
  --paper: #fbfaf6;
  --paper-2: #f3f1ea;
  --paper-3: #ebe8de;
  --surface: #fbfaf6;
  --ink: #14171f;
  --ink-2: #474a54;
  --muted: #858279;
  --rule: #e2dfd4;
  --rule-strong: #c9c5b8;
  --link: #1d4e89;
  --link-hover: #0f2f57;
  --code-bg: #f1eee5;
  --shadow: 0 1px 0 rgba(20, 23, 31, 0.04), 0 12px 32px -18px rgba(20, 23, 31, 0.22);

  /* methods: warm = loss-monotone, cool = interaction / gradient, orchid = hybrid */
  --m-gdro: #c4352b;
  --m-doremi: #d98a00;
  --m-aioli: #1c5cab;
  --m-doge: #1baf7a;
  --m-skillit: #b06ad9;
  --m-strat: #8f8b80;

  /* provenance */
  --p-real: #2f63a8;
  --p-synth: #b5651d;

  /* diverging (weight relative to uniform) */
  --div-lo: #2a78d6;
  --div-mid: #efede6;
  --div-hi: #e34948;

  --floor: #14171f;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --col: 44rem;
  --wide: 70rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --paper: #111318;
    --paper-2: #171a20;
    --paper-3: #1f232a;
    --surface: #14161b;
    --ink: #ece9e1;
    --ink-2: #b9b6ad;
    --muted: #85837c;
    --rule: #2a2d34;
    --rule-strong: #3b3f47;
    --link: #8fb4ea;
    --link-hover: #b8d0f3;
    --code-bg: #1a1d23;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
    --m-gdro: #c44132;
    --m-doremi: #c38300;
    --m-aioli: #2d74ca;
    --m-doge: #249c74;
    --m-skillit: #d76aa2;
    --m-strat: #7d7a72;
    --p-real: #4d86d1;
    --p-synth: #c47a35;
    --div-lo: #3987e5;
    --div-mid: #2b2d31;
    --div-hi: #e66767;
    --floor: #ece9e1;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111318;
  --paper-2: #171a20;
  --paper-3: #1f232a;
  --surface: #14161b;
  --ink: #ece9e1;
  --ink-2: #b9b6ad;
  --muted: #85837c;
  --rule: #2a2d34;
  --rule-strong: #3b3f47;
  --link: #8fb4ea;
  --link-hover: #b8d0f3;
  --code-bg: #1a1d23;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  --m-gdro: #c44132;
  --m-doremi: #c38300;
  --m-aioli: #2d74ca;
  --m-doge: #249c74;
  --m-skillit: #d76aa2;
  --m-strat: #7d7a72;
  --p-real: #4d86d1;
  --p-synth: #c47a35;
  --div-lo: #3987e5;
  --div-mid: #2b2d31;
  --div-hi: #e66767;
  --floor: #ece9e1;
}

/* ───────────── 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(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
/* faint paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, header, footer, nav { position: relative; z-index: 1; }

a { color: var(--link); text-decoration-thickness: 0.06em; text-underline-offset: 0.18em; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); }
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { font-weight: 400; line-height: 1.12; letter-spacing: -0.012em; margin: 0; }
p { margin: 0 0 1.05em; }
em { font-style: italic; }
strong { font-weight: 600; }
sup { line-height: 0; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sans { font-family: var(--sans); }
.num { font-family: var(--mono); font-size: 0.86em; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }
.col { width: min(100%, var(--col)); }

/* ───────────── top bar ───────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.topbar.scrolled { border-bottom-color: var(--rule); }
.topbar .wrap { display: flex; align-items: center; gap: 1.5rem; height: 3.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.brand svg { width: 22px; height: 22px; }
.toc { display: flex; gap: 1.25rem; margin-left: auto; font-family: var(--sans); font-size: 0.82rem; }
.toc a { color: var(--ink-2); text-decoration: none; padding: 0.25rem 0; border-bottom: 1px solid transparent; }
.toc a:hover, .toc a.active { color: var(--ink); border-bottom-color: var(--ink); }
.theme-btn { background: none; border: 1px solid var(--rule-strong); border-radius: 999px; width: 2rem; height: 2rem; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.theme-btn:hover { color: var(--ink); border-color: var(--ink-2); }
.theme-btn svg { width: 15px; height: 15px; }
@media (max-width: 880px) { .toc { display: none; } .theme-btn { margin-left: auto; } }

/* ───────────── hero ───────────── */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow { display: inline-flex; align-items: center; gap: 0.75rem; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 1.6rem; }
.eyebrow::before { content: ""; width: 2.25rem; height: 1px; background: var(--ink); }
.eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }

.title { font-size: clamp(2.3rem, 4.5vw, 3.9rem); font-weight: 300; letter-spacing: -0.028em; line-height: 1.02; font-variation-settings: "opsz" 72; }
.title em { font-style: italic; font-weight: 300; }
.subtitle { font-size: clamp(1.2rem, 2.1vw, 1.5rem); font-style: italic; color: var(--ink-2); margin: 1.1rem 0 2rem; line-height: 1.32; font-weight: 300; max-width: 34ch; }

.authors { display: flex; flex-wrap: wrap; gap: 0.35rem 1.75rem; font-size: 1.12rem; margin-bottom: 0.4rem; }
.authors a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.authors a:hover { border-bottom-color: var(--ink); }
.authors sup { font-family: var(--mono); font-size: 0.62em; color: var(--muted); margin-left: 0.12em; }
.affils { font-family: var(--sans); font-size: 0.84rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.affils sup { font-family: var(--mono); color: var(--muted); margin-right: 0.25em; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--sans); font-size: 0.86rem; font-weight: 500; color: var(--ink); text-decoration: none; padding: 0.58rem 1rem 0.58rem 0.85rem; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--paper); transition: background 0.2s, border-color 0.2s, transform 0.2s; cursor: pointer; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { border-color: var(--ink); background: var(--paper-2); color: var(--ink); transform: translateY(-1px); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); color: var(--paper); }

/* hero figure */
figure { margin: 0; }
.hero-fig { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 1.1rem 1.1rem 0.6rem; box-shadow: var(--shadow); }
.hero-fig .fig-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem; font-family: var(--sans); font-size: 0.78rem; color: var(--ink-2); margin: 0 0.25rem 0.25rem; }
.hero-fig .fig-head b { color: var(--ink); font-weight: 600; }
.hero-fig figcaption { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); padding: 0.2rem 0.25rem 0.4rem; line-height: 1.45; }

/* key numbers */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); margin-top: clamp(2.5rem, 6vw, 4rem); }
.stat { padding: 1.35rem 1.25rem 1.3rem 0; }
.stat + .stat { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.stat .v { font-family: var(--serif); font-size: clamp(1.7rem, 3.2vw, 2.45rem); font-weight: 300; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.stat .v .arrow { color: var(--muted); font-size: 0.7em; margin: 0 0.12em; }
.stat .k { font-family: var(--sans); font-size: 0.8rem; color: var(--ink-2); margin-top: 0.55rem; line-height: 1.4; }
.stat .k i { display: inline-block; width: 0.62rem; height: 0.62rem; border-radius: 2px; margin-right: 0.35rem; vertical-align: -0.02rem; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}

/* ───────────── sections ───────────── */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0 0; scroll-margin-top: 3.5rem; }
.sec-head { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: baseline; margin-bottom: 1.75rem; }
.sec-num { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.06em; }
.sec-title { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 300; font-variation-settings: "opsz" 48; }
.sec-body { margin-left: 5.5rem; }
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; gap: 0.35rem; } .sec-body { margin-left: 0; } }

.lede { font-size: 1.3rem; line-height: 1.55; color: var(--ink); font-weight: 300; }
.lede::first-letter { font-size: 3.4em; float: left; line-height: 0.86; padding: 0.06em 0.08em 0 0; font-weight: 300; }
.prose { max-width: var(--col); }
.prose p { color: var(--ink); }
.muted { color: var(--ink-2); }
.small { font-size: 0.92rem; }

.callout { border-left: 2px solid var(--ink); padding: 0.2rem 0 0.2rem 1.25rem; margin: 1.75rem 0; font-style: italic; color: var(--ink-2); max-width: var(--col); }

/* ───────────── figures ───────────── */
.figure { margin: 2rem 0 0.5rem; }
.figure + .prose { margin-top: 1.75rem; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1.1rem 1.25rem 0.75rem; }
.figcap { font-family: var(--sans); font-size: 0.84rem; line-height: 1.55; color: var(--ink-2); margin-top: 0.85rem; max-width: 56rem; }
.figcap b { color: var(--ink); font-weight: 600; }
.figcap .fig-label { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); margin-right: 0.5rem; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-bottom: 0.9rem; font-family: var(--sans); font-size: 0.8rem; color: var(--ink-2); }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 2px; background: var(--paper-2); }
.seg button { font: inherit; font-size: 0.78rem; color: var(--ink-2); background: none; border: 0; border-radius: 999px; padding: 0.35rem 0.8rem; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button .sub { font-family: var(--mono); font-size: 0.68rem; opacity: 0.7; margin-left: 0.35rem; }
.ctrl-label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.spacer { flex: 1; }
.linkbtn { font: inherit; font-size: 0.78rem; background: none; border: 0; color: var(--link); cursor: pointer; padding: 0.3rem 0; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); }

/* dial */
.dial { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule-strong); border-radius: 12px; overflow: hidden; margin-bottom: 1rem; background: var(--paper-2); }
.dial button { font: inherit; text-align: left; border: 0; background: none; padding: 0.8rem 1rem 0.85rem; cursor: pointer; color: var(--ink-2); position: relative; transition: background 0.25s, color 0.25s; }
.dial button + button { border-left: 1px solid var(--rule-strong); }
.dial button .t { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; }
.dial button .f { display: block; font-family: var(--serif); font-size: 1.45rem; font-weight: 300; color: var(--ink); line-height: 1.15; margin-top: 0.15rem; }
.dial button .m { display: block; font-family: var(--sans); font-size: 0.74rem; margin-top: 0.15rem; }
.dial button[aria-pressed="true"] { background: var(--surface); color: var(--ink); }
.dial button[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--ink); }
.dial button .verdict { position: absolute; right: 0.9rem; top: 0.85rem; font-family: var(--sans); font-size: 0.68rem; padding: 0.12rem 0.5rem; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink-2); }
.dial button .verdict.below { border-style: dashed; }
@media (max-width: 640px) { .dial button .verdict { display: none; } .dial button .f { font-size: 1.15rem; } }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 0.35rem 0.4rem; font-family: var(--sans); font-size: 0.78rem; margin-top: 0.4rem; }
.legend .grp { display: inline-flex; align-items: center; gap: 0.25rem; padding-right: 0.65rem; margin-right: 0.15rem; }
.legend .grp + .grp { border-left: 1px solid var(--rule); padding-left: 0.75rem; }
.legend .grp-name { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 0.25rem; }
.legend button { font: inherit; display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid transparent; background: none; color: var(--ink); padding: 0.22rem 0.5rem; border-radius: 6px; cursor: pointer; }
.legend button:hover { background: var(--paper-2); border-color: var(--rule); }
.legend button[aria-pressed="false"] { color: var(--muted); }
.legend button[aria-pressed="false"] svg { opacity: 0.3; }
.legend svg { width: 22px; height: 12px; flex: none; }
.legend button { white-space: nowrap; }
@media (max-width: 640px) {
  .legend .grp { flex-wrap: wrap; width: 100%; padding: 0.15rem 0; }
  .legend .grp + .grp { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
  .legend .grp-name { width: 100%; }
}

/* svg charts */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
.axis text, .tick text { fill: var(--muted); font-size: 11px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.axis path, .axis line { stroke: var(--rule-strong); }
.grid line { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
.axis-title { fill: var(--ink-2); font-size: 11.5px; font-family: var(--sans); }
.ref-line { stroke: var(--ink-2); stroke-dasharray: 2 4; stroke-width: 1; }
.ref-label { fill: var(--ink-2); font-size: 11px; font-family: var(--sans); }
.series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.band { stroke: none; }
.direct-label { font-family: var(--sans); font-size: 11.5px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.direct-label.light { font-weight: 400; fill: var(--ink-2); }
.crosshair { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.hit { fill: transparent; cursor: crosshair; }
.dim { opacity: 0.12; transition: opacity 0.2s; }

.tooltip { position: absolute; pointer-events: none; z-index: 5; min-width: 11rem; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 8px; padding: 0.55rem 0.7rem; font-family: var(--sans); font-size: 0.76rem; color: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translateY(4px); transition: opacity 0.12s, transform 0.12s; }
.tooltip.on { opacity: 1; transform: none; }
.tooltip .tt-h { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.tooltip .tt-r { display: grid; grid-template-columns: 14px 1fr auto; gap: 0.5rem; align-items: center; padding: 0.08rem 0; }
.tooltip .tt-r .v { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.tooltip .tt-r .v small { color: var(--muted); }
.tooltip svg { width: 14px; height: 10px; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 0.86rem; }
caption { text-align: left; font-family: var(--sans); font-size: 0.8rem; color: var(--ink-2); padding-bottom: 0.6rem; }
th, td { padding: 0.55rem 0.8rem 0.55rem 0; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 500; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); white-space: nowrap; }
td.n, th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.82rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.hl td { background: color-mix(in srgb, var(--paper-3) 55%, transparent); }
.data-table { margin-top: 0.75rem; }
.data-table[hidden] { display: none; }
.swatch { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.45rem; vertical-align: -0.05rem; }

/* ───────────── pool diagram ───────────── */
.pool { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 1.25rem; align-items: stretch; margin: 2rem 0 0.5rem; }
.pool-col { border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.1rem 1.1rem; background: var(--surface); }
.pool-col h3 { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.pool-col h3 i { width: 0.7rem; height: 0.7rem; border-radius: 2px; display: inline-block; }
.pool-col h3 small { font-family: var(--mono); font-weight: 400; color: var(--muted); letter-spacing: 0; text-transform: none; margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip { font-family: var(--sans); font-size: 0.78rem; padding: 0.22rem 0.6rem; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink); background: var(--paper); }
.chip.synth { border-style: dashed; }
.template { margin-top: 0.9rem; font-family: var(--mono); font-size: 0.72rem; line-height: 1.5; color: var(--ink-2); background: var(--code-bg); border-radius: 8px; padding: 0.6rem 0.75rem; white-space: pre-wrap; }
.pool-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); text-align: center; }
.pool-mid .big { font-family: var(--serif); font-size: 2.2rem; color: var(--ink); font-weight: 300; line-height: 1; }
@media (max-width: 860px) { .pool { grid-template-columns: 1fr; } .pool-mid { flex-direction: row; } }

.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 1.5rem 0 0; border-top: 1px solid var(--rule); }
.pipeline .step { padding: 1rem 1rem 0 0; position: relative; }
.pipeline .step + .step { padding-left: 1rem; border-left: 1px solid var(--rule); }
.pipeline .k { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; }
.pipeline .t { font-family: var(--serif); font-size: 1.1rem; margin: 0.25rem 0 0.3rem; }
.pipeline .d { font-family: var(--sans); font-size: 0.8rem; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 760px) { .pipeline { grid-template-columns: 1fr 1fr; } .pipeline .step:nth-child(3) { padding-left: 0; border-left: 0; } .pipeline .step:nth-child(n + 3) { border-top: 1px solid var(--rule); margin-top: 1rem; } }

/* families */
.families { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.fam { border: 1px solid var(--rule); border-radius: 12px; padding: 1.1rem 1.15rem 1.15rem; background: var(--surface); }
.fam .tag { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.fam h3 { font-size: 1.3rem; margin: 0.35rem 0 0.5rem; }
.fam p { font-family: var(--sans); font-size: 0.84rem; color: var(--ink-2); line-height: 1.55; margin: 0 0 0.8rem; }
.fam .members { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fam .members span { font-family: var(--sans); font-size: 0.78rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.fam .eq { margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px dashed var(--rule-strong); font-size: 0.95rem; overflow-x: auto; }
@media (max-width: 900px) { .families { grid-template-columns: 1fr; } }

/* two-up figure */
.two-up { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 860px) { .two-up { grid-template-columns: 1fr; } }
.panel-title { font-family: var(--sans); font-size: 0.82rem; font-weight: 600; color: var(--ink); margin-bottom: 0.15rem; display: flex; gap: 0.5rem; align-items: baseline; }
.panel-title .pl { font-family: var(--mono); font-weight: 400; font-size: 0.72rem; color: var(--muted); }
.panel-sub { font-family: var(--sans); font-size: 0.76rem; color: var(--ink-2); margin-bottom: 0.4rem; }

/* math */
.math-block { margin: 1.5rem 0; padding: 1.1rem 1.25rem; background: var(--paper-2); border-radius: 10px; overflow-x: auto; font-size: 1.05rem; max-width: var(--col); }
.math-block .tag { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 0.4rem; }
.katex { font-size: 1.04em; }

/* findings list */
.findings { counter-reset: f; display: grid; gap: 0; border-top: 1px solid var(--rule); max-width: 52rem; }
.findings li { list-style: none; counter-increment: f; display: grid; grid-template-columns: 3rem minmax(0, 1fr); padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.findings li::before { content: counter(f, decimal-leading-zero); font-family: var(--mono); font-size: 0.78rem; color: var(--muted); padding-top: 0.32rem; }
.findings h3 { font-size: 1.22rem; margin-bottom: 0.25rem; }
.findings p { margin: 0; color: var(--ink-2); font-size: 1.04rem; }
.findings ol { padding: 0; margin: 0; }

/* code */
.code { position: relative; background: var(--code-bg); border: 1px solid var(--rule); border-radius: 10px; margin: 0.9rem 0; }
.code pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; font-family: var(--mono); font-size: 0.8rem; line-height: 1.65; color: var(--ink); }
.code .c { color: var(--muted); }
.code .k { color: var(--link); }
.copy { position: absolute; top: 0.5rem; right: 0.5rem; font-family: var(--sans); font-size: 0.72rem; color: var(--ink-2); background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 6px; padding: 0.25rem 0.6rem; cursor: pointer; }
.copy:hover { color: var(--ink); border-color: var(--ink-2); }
.code-label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 1.4rem; }

/* limitations */
.limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; max-width: 60rem; }
.limits div { padding: 1rem 0; border-top: 1px solid var(--rule); }
.limits h3 { font-family: var(--sans); font-size: 0.86rem; font-weight: 600; margin-bottom: 0.3rem; }
.limits p { font-size: 0.98rem; color: var(--ink-2); margin: 0; }
@media (max-width: 760px) { .limits { grid-template-columns: 1fr; } }

/* footer */
.footer { margin-top: clamp(4rem, 9vw, 7rem); border-top: 1px solid var(--ink); padding: 2rem 0 3rem; font-family: var(--sans); font-size: 0.82rem; color: var(--ink-2); }
.footer .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 2rem; }
.footer h4 { font-family: var(--mono); font-weight: 400; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--ink); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
@media (max-width: 760px) { .footer .wrap { grid-template-columns: 1fr; } }

/* reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal { transition-delay: calc(var(--i, 0) * 90ms); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }

@media print {
  .topbar, .theme-btn, .controls, .copy, .actions { display: none !important; }
  body::before { display: none; }
  .reveal { opacity: 1; transform: none; }
}
