/* Thimble Dx: a quiet, Apple-like system. White and pale gray planes, near-black type,
   one brand accent used sparingly, large confident headlines, rounded cards. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --hair: #d2d2d7;
  --hair-2: #e8e8ed;
  --link: #0066cc;
  --accent: #d0213b;
  --accent-soft: #fdecee;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Geist", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Geist", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", "Geist Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --sch-font: var(--font-sans);
  /* chart roles (validated on white and on #1c1c1e) */
  --surface-1: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #424245;
  --text-muted: #86868b;
  --gridline: #ececf0;
  --baseline: #c7c7cc;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --viz-neutral: #d2d2d7;
  --series-1-soft: #dbe9fb;
  --hm-full: #1c5cab; --hm-full-ink: #ffffff;
  --hm-part: #6da7ec; --hm-part-ink: #0b0b0b;
  --hm-none: #ffffff; --hm-none-ink: #86868b;
  /* schematic roles */
  --sch-bg: transparent;
  --sch-fill: #ffffff;
  --sch-soft: #f2f2f5;
  --sch-soft-2: #e6e6eb;
  --sch-line: #1d1d1f;
  --sch-line-2: #a1a1a6;
  --sch-ink: #1d1d1f;
  --sch-ink-2: #6e6e73;
  --sch-accent: #d0213b;
  --sch-accent-soft: #fdecee;
  --cap-edta: #8c7bc6; --cap-hep: #3e8e63; --cap-sst: #c9a227;
  color-scheme: light;
}

/* Dark values: one block of custom properties, applied by OS preference, by the toggle, and to dark sections. */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --bg: #000000; --bg-alt: #161617; --card: #1c1c1e; --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #86868b;
    --hair: #424245; --hair-2: #2c2c2e; --link: #2997ff; --accent: #ff4d62; --accent-soft: #3a1418;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 28px rgba(0,0,0,.45);
    --surface-1: #1c1c1e; --text-primary: #f5f5f7; --text-secondary: #c7c7cc; --text-muted: #8e8e93;
    --gridline: #2c2c2e; --baseline: #48484a;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --viz-neutral: #48484a; --series-1-soft: #1b3554;
    --hm-full: #86b6ef; --hm-full-ink: #0b0b0b; --hm-part: #256abf; --hm-part-ink: #ffffff; --hm-none: #1c1c1e; --hm-none-ink: #8e8e93;
    --sch-fill: #1c1c1e; --sch-soft: #2c2c2e; --sch-soft-2: #3a3a3c; --sch-line: #e5e5ea; --sch-line-2: #636366;
    --sch-ink: #f5f5f7; --sch-ink-2: #a1a1a6; --sch-accent: #ff4d62; --sch-accent-soft: #3a1418;
    --cap-edta: #a796e0; --cap-hep: #5db585; --cap-sst: #d9b44a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"], .dark {
  --bg: #000000; --bg-alt: #161617; --card: #1c1c1e; --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #86868b;
  --hair: #424245; --hair-2: #2c2c2e; --link: #2997ff; --accent: #ff4d62; --accent-soft: #3a1418;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 28px rgba(0,0,0,.45);
  --surface-1: #1c1c1e; --text-primary: #f5f5f7; --text-secondary: #c7c7cc; --text-muted: #8e8e93;
  --gridline: #2c2c2e; --baseline: #48484a;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --viz-neutral: #48484a; --series-1-soft: #1b3554;
  --hm-full: #86b6ef; --hm-full-ink: #0b0b0b; --hm-part: #256abf; --hm-part-ink: #ffffff; --hm-none: #1c1c1e; --hm-none-ink: #8e8e93;
  --sch-fill: #1c1c1e; --sch-soft: #2c2c2e; --sch-soft-2: #3a3a3c; --sch-line: #e5e5ea; --sch-line-2: #636366;
  --sch-ink: #f5f5f7; --sch-ink-2: #a1a1a6; --sch-accent: #ff4d62; --sch-accent-soft: #3a1418;
  --cap-edta: #a796e0; --cap-hep: #5db585; --cap-sst: #d9b44a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: 17px; line-height: 1.53; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }

/* ---------- Global nav ---------- */
.gnav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--hair) 60%, transparent);
}
.gnav-inner { max-width: 1080px; margin: 0 auto; height: 52px; padding: 0 22px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 650; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 22px; height: 22px; }
.brand .logo path { fill: var(--accent); }
.brand .dx { color: var(--ink-2); font-weight: 500; }
.gnav nav { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.brand, .theme-toggle { flex-shrink: 0; }
.status-line b { white-space: nowrap; }
@media (max-width: 760px) { .status-line { flex-wrap: wrap; justify-content: center; border-radius: 18px; } }
.gnav nav::-webkit-scrollbar { display: none; }
.gnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; justify-content: flex-end; }
.gnav li a { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; letter-spacing: 0; }
.gnav li a:hover { color: var(--ink); text-decoration: none; }
.gnav li a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.theme-toggle {
  border: 1px solid var(--hair); background: transparent; color: var(--ink-2); border-radius: 980px;
  font: 500 12px var(--font-sans); padding: 5px 11px; cursor: pointer; white-space: nowrap;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.tt-dark { display: none; }
:root[data-theme="dark"] .tt-light { display: none; }
:root[data-theme="dark"] .tt-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .tt-light { display: none; }
  :root:where(:not([data-theme="light"])) .tt-dark { display: inline; }
}

/* ---------- Shared building blocks ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 22px; }
.section { padding: clamp(72px, 11vw, 140px) 0; background: var(--bg); color: var(--ink); }
.section.alt { background: var(--bg-alt); }
.section.dark { background: var(--bg); }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--accent); letter-spacing: 0; margin: 0 0 10px; }
.headline { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.035em; line-height: 1.04; margin: 0; font-size: clamp(36px, 5.6vw, 64px); }
.subhead { font-size: clamp(19px, 2.1vw, 24px); line-height: 1.38; color: var(--ink-2); font-weight: 500; letter-spacing: -0.015em; margin: 18px 0 0; max-width: 760px; }
.center { text-align: center; }
.center .subhead { margin-left: auto; margin-right: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 980px; padding: 11px 22px;
  font-size: 17px; font-weight: 500; border: 1px solid transparent; letter-spacing: -0.01em; cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { opacity: .86; }
.btn-ghost { color: var(--link); border-color: var(--link); }
.btn-ghost:hover { background: color-mix(in srgb, var(--link) 8%, transparent); }
.more { font-size: 17px; font-weight: 500; }
.more::after { content: " \203A"; font-weight: 600; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: 30px; }
.center .cta-row { justify-content: center; }

/* Reveal on scroll (only when scripting is on). */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: .08s; } .js .reveal.d2 { transition-delay: .16s; } .js .reveal.d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Home: hero ---------- */
.hero { padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 80px); background: var(--bg); color: var(--ink); text-align: center; overflow: hidden; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: auto 0 -10% 0; height: 70%;
  background: radial-gradient(50% 60% at 50% 70%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 72%);
  pointer-events: none;
}
.hero .eyebrow { font-size: 17px; }
.hero h1 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.045em; line-height: 1.0; font-size: clamp(46px, 8.4vw, 96px); margin: 0 auto; max-width: 14ch; }
.hero h1 .soft { color: var(--ink-2); }
.hero .subhead { margin: 24px auto 0; }
.hero-figure { position: relative; max-width: 1000px; margin: clamp(40px, 6vw, 70px) auto 0; padding: 0 22px; }
.hero-figure .schem { width: 100%; height: auto; display: block; }
.hero-figure figcaption { color: var(--ink-3); font-size: 14px; margin-top: 14px; }
.hero .s-flow[data-flow] { stroke-dasharray: 7 7; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -28; } }
@media (prefers-reduced-motion: reduce) { .hero .s-flow[data-flow] { animation: none; } }
.status-line {
  display: inline-flex; gap: 10px; align-items: center; margin-top: 26px; font-size: 14px; color: var(--ink-2);
  border: 1px solid var(--hair); border-radius: 980px; padding: 7px 16px; background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.status-line b { color: var(--accent); font-weight: 600; }

/* ---------- Home: stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 56px; }
.stat { background: var(--card); border-radius: 22px; padding: 28px 24px; box-shadow: var(--shadow); }
.section.alt .stat { box-shadow: none; }
.stat .num { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 5vw, 58px); letter-spacing: -0.04em; line-height: 1; }
.stat .num.accent { color: var(--accent); }
.stat .lbl { display: block; margin-top: 12px; color: var(--ink-2); font-size: 15px; line-height: 1.4; }

/* ---------- Home: first-principles bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; margin-top: 56px; }
.tile { background: var(--card); border-radius: 26px; padding: 30px 30px 28px; display: flex; flex-direction: column; gap: 12px; min-height: 280px; overflow: hidden; position: relative; }
.section:not(.alt) .tile { background: var(--bg-alt); }
.tile.w2 { grid-column: span 2; } .tile.w3 { grid-column: span 3; } .tile.w4 { grid-column: span 4; } .tile.w6 { grid-column: span 6; }
.tile .n { font: 600 13px var(--font-mono); color: var(--accent); letter-spacing: .02em; }
.tile h3 { margin: 0; font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; }
.tile p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.45; }
.tile .art { margin-top: auto; padding-top: 10px; }
.tile .art svg { display: block; width: 100%; height: auto; max-height: 130px; }
.section .bento .tile.conclusion { background: var(--ink); color: var(--bg); min-height: 0; }
.section .bento .tile.conclusion h3 { color: var(--bg); }
.section .bento .tile.conclusion p { color: color-mix(in srgb, var(--bg) 72%, var(--ink)); }
.art .a-ink { fill: var(--ink); } .art .a-ink2 { fill: var(--ink-3); } .art .a-acc { fill: var(--accent); }
.art .a-line { fill: none; stroke: var(--ink); stroke-width: 2.2; } .art .a-grid { stroke: var(--hair); stroke-width: 1; }
.art .a-blue { fill: var(--series-1); } .art .a-soft { fill: var(--hair-2); }
.art text { font: 600 12px var(--font-sans); fill: var(--ink-2); }
.art .big { font: 700 44px var(--font-display); fill: var(--ink); letter-spacing: -0.04em; }
.art .cap-edta { fill: var(--cap-edta); } .art .cap-hep { fill: var(--cap-hep); } .art .cap-sst { fill: var(--cap-sst); }

/* ---------- Home: engines ---------- */
.engines { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 56px; }
.engine { background: var(--card); border-radius: 24px; padding: 26px 24px; display: flex; flex-direction: column; gap: 10px; }
.section:not(.alt) .engine { background: var(--bg-alt); }
.engine .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; }
.engine .ico svg { width: 26px; height: 26px; }
.engine .ico .i-a { fill: var(--accent); } .engine .ico .i-l { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.engine h3 { margin: 6px 0 0; font-size: 21px; letter-spacing: -0.02em; font-weight: 700; }
.engine p { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.45; }
.engine .spec { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--hair-2); font: 500 13px var(--font-mono); color: var(--ink-2); letter-spacing: -0.01em; }
.hub-band { margin-top: 18px; background: var(--card); border-radius: 24px; padding: 24px 28px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.section:not(.alt) .hub-band { background: var(--bg-alt); }
.hub-band h3 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.hub-band p { margin: 4px 0 0; color: var(--ink-2); font-size: 15.5px; }

/* ---------- Home: steps ---------- */
.steps { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: s; }
.steps li { position: relative; padding-top: 20px; border-top: 2px solid var(--hair); }
.steps li.on { border-top-color: var(--accent); }
.steps .t { display: block; font: 600 13px var(--font-mono); color: var(--ink-3); }
.steps b { display: block; font-size: 21px; letter-spacing: -0.02em; margin-top: 6px; }
.steps span.d { display: block; color: var(--ink-2); font-size: 15.5px; margin-top: 6px; line-height: 1.45; }

/* ---------- Home: answers ---------- */
.answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; }
.answer { background: var(--card); border-radius: 24px; padding: 30px 28px; }
.section:not(.alt) .answer { background: var(--bg-alt); }
.answer .k { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.answer h3 { margin: 8px 0 10px; font-family: var(--font-display); font-size: 30px; letter-spacing: -0.03em; line-height: 1.08; }
.answer p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.home-chart { margin-top: 30px; }

/* ---------- Home: comparison ---------- */
.versus { margin-top: 56px; border-radius: 24px; overflow: hidden; background: var(--card); }
.section:not(.alt) .versus { background: var(--bg-alt); }
.versus .row { display: grid; grid-template-columns: 1.1fr 1.6fr 1.6fr; gap: 0; border-top: 1px solid var(--hair-2); }
.versus .row:first-child { border-top: 0; }
.versus .row > div { padding: 18px 22px; font-size: 15.5px; line-height: 1.45; }
.versus .row.head > div { font-size: 13px; font-weight: 600; color: var(--ink-3); padding-top: 16px; padding-bottom: 12px; }
.versus .who { font-weight: 700; }
.versus .them { color: var(--ink-2); }
.honest-note { margin-top: 22px; color: var(--ink-2); font-size: 16px; }

/* ---------- Home: charter ---------- */
.charter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; }
.charter div { background: var(--card); border-radius: 22px; padding: 24px; }
.section:not(.alt) .charter div { background: var(--bg-alt); }
.charter b { display: block; font-size: 18px; letter-spacing: -0.02em; }
.charter span { display: block; color: var(--ink-2); font-size: 15px; margin-top: 6px; line-height: 1.45; }

/* ---------- Home: plan numbers ---------- */
.rounds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 56px; }
.round { border-top: 2px solid var(--ink); padding-top: 18px; }
.round .amt { display: block; font-family: var(--font-display); font-size: clamp(34px, 4vw, 46px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.round .nm { display: block; font-weight: 600; margin-top: 10px; }
.round .wh { display: block; color: var(--ink-2); font-size: 15px; margin-top: 4px; line-height: 1.45; }

/* ---------- Home: go deeper ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 48px; }
.card { display: flex; flex-direction: column; gap: 8px; background: var(--card); border-radius: 22px; padding: 26px; color: var(--ink); transition: transform .3s ease, box-shadow .3s ease; box-shadow: var(--shadow); }
.section.alt .card { box-shadow: none; }
.card:hover { text-decoration: none; transform: translateY(-3px); }
.card .k { font-size: 13px; font-weight: 600; color: var(--accent); }
.card b { font-size: 21px; letter-spacing: -0.02em; line-height: 1.2; }
.card span { color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.card .more { margin-top: auto; padding-top: 8px; color: var(--link); font-size: 15px; }
.card.feature { grid-column: span 2; background: var(--ink); color: var(--bg); }
.card.feature span { color: color-mix(in srgb, var(--bg) 70%, var(--ink)); }
.card.feature .k { color: var(--accent); }

/* ---------- Document pages ---------- */
.doc-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(28px, 4vw, 40px); background: var(--bg); }
.doc-hero .eyebrow { font-size: 15px; }
.doc-hero h1 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.04em; line-height: 1.04; font-size: clamp(38px, 5.6vw, 64px); margin: 0; max-width: 18ch; }
.doc-hero .lede { font-size: clamp(19px, 2vw, 23px); line-height: 1.42; color: var(--ink-2); margin: 20px 0 0; max-width: 760px; letter-spacing: -0.015em; }
.doc-hero .tools { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.doc-layout { max-width: 1080px; margin: 0 auto; padding: 0 22px 96px; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 56px; }
.toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; padding-top: 6px; font-size: 13px; }
.toc p { font-weight: 600; color: var(--ink); margin: 0 0 10px; font-size: 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; color: var(--ink-3); padding: 5px 0 5px 12px; border-left: 2px solid var(--hair-2); line-height: 1.35; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.on { color: var(--ink); border-left-color: var(--accent); }
.doc { min-width: 0; max-width: 760px; }
.doc > *:first-child { margin-top: 0; }
.doc h2 { font-family: var(--font-display); font-size: clamp(27px, 3vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; margin: 72px 0 18px; scroll-margin-top: 76px; }
.doc h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin: 40px 0 10px; scroll-margin-top: 76px; }
.doc p, .doc li { font-size: 17px; line-height: 1.6; }
.doc p { margin: 0 0 18px; }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 22px; }
.doc li { margin: 0 0 10px; }
.doc li::marker { color: var(--ink-3); }
.doc strong { font-weight: 650; }
.doc code { font: 500 0.88em var(--font-mono); background: var(--bg-alt); padding: 2px 6px; border-radius: 6px; }
.doc blockquote { margin: 0 0 34px; padding: 22px 26px; background: var(--bg-alt); border-radius: 20px; border: 0; }
.doc blockquote p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink); }
.doc blockquote strong:first-child { display: block; color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 6px; letter-spacing: 0; }
.doc hr { border: 0; border-top: 1px solid var(--hair); margin: 48px 0; }

.table-wrap { margin: 10px 0 30px; border-radius: 18px; border: 1px solid var(--hair-2); overflow-x: auto; background: var(--card); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
.table-wrap th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-2); background: var(--bg-alt); padding: 12px 16px; border-bottom: 1px solid var(--hair-2); white-space: nowrap; }
.table-wrap td { padding: 12px 16px; border-top: 1px solid var(--hair-2); vertical-align: top; font-variant-numeric: tabular-nums; }
.table-wrap tr:first-child td { border-top: 0; }
.table-wrap td:first-child { font-weight: 600; }
.table-wrap td strong { font-weight: 700; }
.doc .table-wrap { margin-right: min(0px, calc((760px - 100%) * 0)); }

.sc { text-align: center; font-size: 15px; }
.sc .sym { font-weight: 700; }
.sc-full .sym { color: var(--hm-full); }
.sc-part .sym { color: var(--hm-part); }
.sc-none .sym, .sc-unk .sym, .sc-na .sym { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.scorecard { margin: 18px 0 30px; }
.scorecard .table-wrap { max-height: 70vh; }
.scorecard thead th { position: sticky; top: 0; z-index: 1; cursor: pointer; }
.sc-controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-bottom: 14px; }
.sc-search { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.sc-search input { font: 15px var(--font-sans); border: 1px solid var(--hair); background: var(--card); color: var(--ink); border-radius: 980px; padding: 7px 14px; width: 230px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 13px var(--font-sans); border: 1px solid var(--hair); background: var(--card); color: var(--ink-2); border-radius: 980px; padding: 5px 12px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sc-count { margin: 0; font-size: 13px; color: var(--ink-3); }

pre { margin: 10px 0 26px; padding: 20px 22px; background: var(--bg-alt); border-radius: 18px; overflow-x: auto; font: 12.5px/1.45 var(--font-mono); color: var(--ink); }
pre code { background: none; padding: 0; font: inherit; }

/* Figures */
figure { margin: 30px 0 36px; }
.schematic { background: var(--card); border: 1px solid var(--hair-2); border-radius: 22px; padding: 18px; }
.schematic .schem { width: 100%; height: auto; display: block; }
.schematic figcaption, .viz-note { color: var(--ink-3); font-size: 13.5px; line-height: 1.45; margin-top: 12px; }
.schematic details, .viz-data { margin-top: 10px; }
.schematic summary, .viz-data summary { cursor: pointer; color: var(--link); font-size: 13.5px; }
.schematic details pre { margin: 12px 0 0; background: var(--bg-alt); }
.schematic.ascii-only { padding: 0; border: 0; background: none; }
.schematic.ascii-only pre { margin: 0; }
.schematic.ascii-only figcaption { padding: 0 4px; }

.viz { background: var(--surface-1); border: 1px solid var(--hair-2); border-radius: 22px; padding: 22px 22px 16px; }
.viz-title { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--text-primary); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 8px 0 12px; font-size: 13px; color: var(--text-secondary); }
.viz-legend li { display: inline-flex; align-items: center; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 7px; }
.sw.c1 { background: var(--series-1); } .sw.c2 { background: var(--series-2); } .sw.c3 { background: var(--series-3); } .sw.cn { background: var(--viz-neutral); }
.sw.hm-full-sw { background: var(--hm-full); } .sw.hm-part-sw { background: var(--hm-part); }
.sw.hm-none-sw { background: var(--hm-none); border: 1px solid var(--baseline); }
.sw.hm-target-sw { background: transparent; border: 1.5px dashed var(--accent); }
.viz-svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-grid { stroke: var(--gridline); stroke-width: 1; }
.viz-axis { stroke: var(--baseline); stroke-width: 1; }
.viz-stem { stroke: var(--baseline); stroke-width: 1; }
.viz-tick { font: 500 11px var(--font-sans); fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.viz-lab { font: 400 12.5px var(--font-sans); fill: var(--text-secondary); }
.viz-lab-b { font: 700 12.5px var(--font-sans); fill: var(--text-primary); }
.viz-val { font: 600 12px var(--font-sans); fill: var(--text-primary); font-variant-numeric: tabular-nums; }
.viz-inlab { font: 600 12px var(--font-sans); fill: #ffffff; }
.viz-inlab.on-neutral { fill: var(--text-primary); }
.viz .c1 { fill: var(--series-1); } .viz .c2 { fill: var(--series-2); } .viz .c3 { fill: var(--series-3); } .viz .cn { fill: var(--viz-neutral); }
.viz-dot { stroke: var(--surface-1); stroke-width: 2; }
.viz [data-tip] { outline: none; }
.viz [data-tip]:hover, .viz [data-tip]:focus-visible { opacity: .82; }
.viz [data-tip]:focus-visible { stroke: var(--text-primary); stroke-width: 2; }
.hm-cell rect { stroke: var(--hair-2); stroke-width: 1; }
.hm-cell text { font: 700 14px var(--font-sans); }
.hm-full rect { fill: var(--hm-full); } .hm-full text { fill: var(--hm-full-ink); }
.hm-part rect { fill: var(--hm-part); } .hm-part text { fill: var(--hm-part-ink); }
.hm-none rect { fill: var(--hm-none); } .hm-none text { fill: var(--hm-none-ink); }
.hm-target rect { fill: transparent; stroke: var(--accent); stroke-dasharray: 4 3; stroke-width: 1.5; }
.hm-target text { fill: var(--accent); }
.viz-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 10px; }
.viz-table th, .viz-table td { text-align: left; padding: 7px 10px; border-top: 1px solid var(--hair-2); }
.viz-table th { color: var(--ink-2); font-weight: 600; }

.tip { position: fixed; z-index: 90; pointer-events: none; max-width: 320px; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.4; padding: 8px 11px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }

/* Pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 72px; }
.pager a { display: block; background: var(--bg-alt); border-radius: 20px; padding: 20px 22px; color: var(--ink); }
.pager a:hover { text-decoration: none; background: var(--hair-2); }
.pager small { display: block; color: var(--ink-3); font-size: 13px; }
.pager b { display: block; font-size: 18px; letter-spacing: -0.02em; margin-top: 4px; }
.pager .next { text-align: right; grid-column: 2; }

/* Footer */
.footer { background: var(--bg-alt); color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 28px 22px 40px; }
.footer p { margin: 0 0 8px; }
.footer .fine { color: var(--ink-3); max-width: 820px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 0 14px; margin-bottom: 14px; border-bottom: 1px solid var(--hair); }
.footer nav a { color: var(--ink-2); }

/* Print cover (plan page only) */
.print-cover { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .engines { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile.w2, .tile.w3, .tile.w4 { grid-column: span 1; }
  .tile.w6 { grid-column: span 2; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .charter { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .gnav-inner { gap: 14px; }
  .gnav ul { justify-content: flex-start; gap: 16px; }
  .stats, .engines, .bento, .answers, .cards, .charter, .rounds, .steps { grid-template-columns: minmax(0, 1fr); }
  .tile.w6, .card.feature { grid-column: span 1; }
  .tile { min-height: 0; }
  .versus .row { grid-template-columns: 1fr; }
  .versus .row.head { display: none; }
  .versus .row > div { padding: 10px 20px; }
  .versus .row > div:first-child { padding-top: 18px; }
  .versus .row > div:last-child { padding-bottom: 18px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; text-align: left; }
  .doc h2 { margin-top: 56px; }
  .sc-search input { width: 100%; }
  .sc-search { width: 100%; }
}

/* ---------- Print ---------- */
@media print {
  @page { size: Letter; margin: 16mm 15mm 18mm; }
  :root, :root[data-theme="dark"] {
    --bg: #fff; --bg-alt: #f5f5f7; --card: #fff; --ink: #1d1d1f; --ink-2: #48484a; --ink-3: #6e6e73; --hair: #d2d2d7; --hair-2: #e5e5ea;
    --surface-1: #fff; --text-primary: #1d1d1f; --text-secondary: #424245; --text-muted: #6e6e73; --gridline: #ececf0; --baseline: #c7c7cc;
    --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --viz-neutral: #d2d2d7;
    --sch-fill: #fff; --sch-soft: #f2f2f5; --sch-soft-2: #e6e6eb; --sch-line: #1d1d1f; --sch-ink: #1d1d1f; --sch-ink-2: #6e6e73;
    --accent: #d0213b; --link: #1d1d1f;
  }
  body { font-size: 10.5pt; line-height: 1.45; }
  .gnav, .toc, .pager, .footer nav, .viz-data, .schematic details, .doc-hero .tools, .theme-toggle, .skip, .tip, .sc-controls { display: none !important; }
  .doc-layout { display: block; padding: 0; }
  .doc { max-width: none; }
  .doc h2 { break-after: avoid; margin-top: 26pt; font-size: 17pt; }
  .doc h3 { break-after: avoid; font-size: 12.5pt; }
  .doc p, .doc li { font-size: 10.5pt; }
  .table-wrap, figure, .viz, .schematic, blockquote { break-inside: avoid; }
  .table-wrap { border-radius: 8px; }
  .table-wrap table { font-size: 8.8pt; }
  .table-wrap th, .table-wrap td { padding: 5pt 7pt; }
  .doc-hero { padding: 0 0 12pt; }
  .doc-hero h1 { font-size: 26pt; }
  .print-cover { display: flex; flex-direction: column; justify-content: center; min-height: 240mm; break-after: page; }
  .print-cover .pc-brand { display: flex; align-items: center; gap: 10px; font-size: 16pt; font-weight: 700; }
  .print-cover .pc-brand svg { width: 34px; height: 34px; }
  .print-cover .pc-brand path { fill: #d0213b; }
  .print-cover h1 { font-size: 44pt; letter-spacing: -0.04em; margin: 22pt 0 8pt; line-height: 1; }
  .print-cover .pc-sub { font-size: 16pt; color: #48484a; margin: 0 0 36pt; max-width: 150mm; }
  .print-cover dl { display: grid; grid-template-columns: 40mm 1fr; gap: 6pt 12pt; font-size: 11pt; margin: 0; }
  .print-cover dt { color: #6e6e73; }
  .print-cover dd { margin: 0; }
  .footer { background: none; }
  a { color: inherit; }
}
