/* Turbokern site. Built on the Turbokern design system (redline red, Turbo T, 14-degree lean).
   Rules: every section, header and footer share one ground; sections are separated by space only;
   no gradients, transparency or shadows; only form inputs carry a border; depth comes from
   solid surface steps. Dark is the default theme; the header toggle switches to light. */

/* ---------- Tokens: dark first ---------- */
:root {
  --surface: #121010; --surface-raised: #1D1918; --surface-sunken: #0A0808;
  --ink: #F2ECE8; --ink-muted: #B3A9A3;
  --brand: #C4161C; --brand-strong: #FF8178; --brand-soft: #3A1513; --on-brand: #FFFFFF;
  --accent: #F2BE22; --accent-soft: #33290C;
  --kept: #86B4FF; --kept-soft: #14233D; --rejected: #FF9E57; --rejected-soft: #3A220F;
  --term: #0A0808; --term-raised: #1D1918; --term-ink: #EFE8E3; --term-muted: #A99E97;
  --field-border: #7C726C; --focus: #86B4FF;
  --btn-hover: #F2ECE8; --btn-hover-ink: #121010;
  color-scheme: dark;

  --font-display: "Anybody", "Arial Narrow", system-ui, sans-serif;
  --font-text: "Onest", system-ui, sans-serif;
  --font-data: "Spline Sans Mono", ui-monospace, Menlo, monospace;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px;
  --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px; --space-20: 80px;
  --radius-field: 2px;
  --lean-sm: 4px; --lean-md: 8px; --lean-lg: 14px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="light"] {
  --surface: #F4F2F0; --surface-raised: #FFFFFF; --surface-sunken: #E8E4E1;
  --ink: #17120F; --ink-muted: #574E49;
  --brand: #C4161C; --brand-strong: #9A0E13; --brand-soft: #F9DEDB; --on-brand: #FFFFFF;
  --accent: #7A5800; --accent-soft: #F6EAC2;
  --kept: #1F5DBA; --kept-soft: #DDE7F8; --rejected: #A64600; --rejected-soft: #F8E3D2;
  --term: #1A1513; --term-raised: #2A2321;
  --field-border: #857B75; --focus: #1F5DBA;
  --btn-hover: #9A0E13; --btn-hover-ink: #FFFFFF;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 400 17px/27px var(--font-text); overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--surface); }
img, svg { max-width: 100%; }
a { color: var(--brand-strong); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
figure { margin: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.skip { position: absolute; left: 8px; top: -60px; background: var(--brand); color: var(--on-brand); padding: 10px 14px; z-index: 100; font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; }
.mono, code, pre, kbd { font-family: var(--font-data); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); }
.small { font-size: 15px; line-height: 23px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.d-hero, .d-1, .d-2, .d-3 { font-family: var(--font-display); font-style: italic; letter-spacing: -0.01em; }
.d-hero { font-weight: 800; font-stretch: 125%; font-size: clamp(42px, 7.2vw, 88px); line-height: .92; }
.d-1 { font-weight: 800; font-stretch: 125%; font-size: clamp(36px, 5.4vw, 60px); line-height: .96; }
.d-2 { font-weight: 750; font-stretch: 115%; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.02; }
.d-3 { font-weight: 700; font-stretch: 110%; font-style: normal; font-size: 22px; line-height: 1.15; letter-spacing: 0; }
.d-hero em, .d-1 em { font-style: italic; color: var(--brand-strong); }
.lead { font-size: 20px; line-height: 31px; color: var(--ink-muted); max-width: 60ch; }
.kicker { display: inline-flex; align-items: center; gap: var(--space-3); font: 500 12px/16px var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.kicker::before { content: ""; width: 20px; height: 10px; background: var(--brand); clip-path: polygon(var(--lean-sm) 0, 100% 0, calc(100% - var(--lean-sm)) 100%, 0 100%); flex: none; }
.kicker b { color: var(--ink); font-weight: 600; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--surface); }
.nav { display: flex; align-items: center; gap: var(--space-6); min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 italic 23px/1 var(--font-display); font-stretch: 125%; letter-spacing: -0.01em; }
.brand svg { width: 32px; height: 32px; color: var(--brand); flex: none; }
.site-header nav { margin-left: auto; }
.nav-links { list-style: none; display: flex; align-items: center; gap: var(--space-1); }
.nav-links > li { position: relative; }
.nav-link, .nav-menu-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; color: var(--ink); text-decoration: none; font: 500 15px/20px var(--font-text); background: none; border: 0; cursor: pointer; }
.nav-link:hover, .nav-menu-btn:hover { background: var(--surface-raised); }
.nav-link[aria-current="page"], .nav-menu-btn.is-active { color: var(--brand-strong); }
.nav-link[aria-current="page"]::after { content: ""; display: inline-block; width: 10px; height: 6px; background: var(--brand); clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%); }
.nav-menu-btn svg { width: 10px; height: 10px; transition: transform .16s var(--ease); }
.nav-menu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-menu { position: absolute; top: calc(100% + 8px); left: -12px; width: 560px; background: var(--surface-raised); padding: var(--space-3); display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); z-index: 70; }
.nav-menu[hidden] { display: none; }
.nav-menu a { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-3); padding: var(--space-3); text-decoration: none; color: var(--ink); }
.nav-menu a:hover, .nav-menu a[aria-current="page"] { background: var(--surface-sunken); }
.nav-menu b { grid-row: span 2; font: 500 11px/20px var(--font-data); color: var(--brand-strong); letter-spacing: .06em; }
.nav-menu strong { font: 700 16px/20px var(--font-display); font-stretch: 110%; }
.nav-menu span { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.nav-tools { display: flex; align-items: center; gap: var(--space-2); }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; background: var(--surface-raised); color: var(--ink); border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--surface-sunken); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
.site-header .nav-toggle { display: none; }
.nav-links .nav-cta-item, .nav-links .nav-account-item { display: none; }
/* Account link: quiet text, never a filled button */
.nav-account { display: inline-flex; align-items: center; padding: 10px 12px; color: var(--ink); text-decoration: none; font: 500 15px/20px var(--font-text); white-space: nowrap; }
.nav-account:hover { background: var(--surface-raised); }
.nav-account[aria-current="page"] { color: var(--brand-strong); }
.nav-link, .nav-menu-btn, .nav-cta { white-space: nowrap; }
@media (min-width: 1080px) and (max-width: 1359px) {
  .nav { gap: var(--space-4); }
  .nav-link, .nav-menu-btn { padding-inline: 8px; }
  .nav-account { padding-inline: 8px; }
  .nav-tools { gap: 4px; }
}
@media (min-width: 1080px) and (max-width: 1199px) {
  .nav-link, .nav-menu-btn, .nav-account { font-size: 14px; padding-inline: 6px; }
  .brand { font-size: 20px; }
  .brand svg { width: 28px; height: 28px; }
}

/* ---------- Buttons (square: the lean is for data, not chrome) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); padding: 14px 22px; font: 600 16px/20px var(--font-text); text-decoration: none; border: 0; cursor: pointer; transition: background-color .16s var(--ease), color .16s var(--ease); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--btn-hover); color: var(--btn-hover-ink); }
.btn-secondary { background: var(--surface-raised); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-sunken); }
.btn-quiet { padding-inline: 0; color: var(--brand-strong); background: none; }
.btn-quiet:hover { text-decoration: underline; }
.btn-sm { padding: 10px 16px; font-size: 15px; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.btn .arrow { font-family: var(--font-data); }

/* ---------- Tags (leaned) ---------- */
.tag { display: inline-flex; align-items: center; font: 500 12px/16px var(--font-data); letter-spacing: .08em; text-transform: uppercase; padding: 4px 14px; white-space: nowrap; clip-path: polygon(var(--lean-sm) 0, 100% 0, calc(100% - var(--lean-sm)) 100%, 0 100%); }
.tag-kept { background: var(--kept-soft); color: var(--kept); }
.tag-rejected { background: var(--rejected-soft); color: var(--rejected); }
.tag-running { background: var(--surface-sunken); color: var(--ink-muted); }
.tag-brand { background: var(--brand-soft); color: var(--brand-strong); }
.tag-example { background: var(--accent-soft); color: var(--ink); }
.tag-planned { background: var(--surface-sunken); color: var(--ink); }
.tag-target { background: var(--accent-soft); color: var(--ink); }

/* ---------- Sections: same ground, separated by space only ---------- */
main > section { padding-block: var(--space-20); }
main > section:first-child { padding-top: var(--space-12); }
.sec-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-6); row-gap: var(--space-4); align-items: end; margin-bottom: var(--space-10); }
.sec-head .sh-title { grid-column: 1 / span 7; display: flex; flex-direction: column; gap: var(--space-4); }
.sec-head .lead { grid-column: 8 / span 5; font-size: 18px; line-height: 28px; }
.sec-head.solo .sh-title { grid-column: 1 / span 9; }
.grid { display: grid; gap: var(--space-6); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-12); align-items: start; }
.split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split.flip > :first-child { order: 2; }
.split-copy { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-v { display: flex; flex-direction: column; gap: var(--space-4); }

/* ---------- Hero (home): headline across, run log left, claim right ---------- */
.hero-top { display: flex; flex-direction: column; gap: var(--space-5); margin-bottom: var(--space-10); }
.hero-top h1 { max-width: 15ch; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-10); align-items: start; }
.hero-side { display: flex; flex-direction: column; gap: var(--space-6); padding-top: var(--space-2); }
.hero-side .lead { font-size: 19px; line-height: 30px; }
.targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.targets div { background: var(--surface-raised); padding: var(--space-4); display: flex; flex-direction: column; gap: 6px; }
.targets b { font: 800 italic 28px/1 var(--font-display); font-stretch: 120%; font-variant-numeric: tabular-nums; }
.targets span { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.targets i { font: 500 11px/14px var(--font-data); letter-spacing: .08em; text-transform: uppercase; font-style: normal; color: var(--accent); }

/* ---------- Inner hero: claim left, run-card right ---------- */
.ihero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-12); align-items: end; }
.ihero-copy { display: flex; flex-direction: column; gap: var(--space-5); }
.ihero-copy .lead { margin-top: var(--space-1); }
.ihero-copy .btn-row { margin-top: var(--space-3); }
.pmark { display: inline-flex; align-items: center; gap: var(--space-3); font: 500 12px/16px var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- Terminal / run log ---------- */
.term { background: var(--term); color: var(--term-ink); font: 400 14px/22px var(--font-data); min-width: 0; }
.term-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: 12px var(--space-4); background: var(--term-raised); font-size: 12px; line-height: 16px; letter-spacing: .04em; color: var(--term-muted); }
.term-bar b { color: var(--term-ink); font-weight: 500; }
.term-bar .tag { margin-left: auto; }
.term-bar .tag-example { background: #F2BE22; color: #17120F; }
.term-body { padding: var(--space-4); overflow-x: auto; }
.term-body pre { margin: 0; font: inherit; white-space: pre; }
.log { list-style: none; display: flex; flex-direction: column; }
.log { font-size: 13px; line-height: 21px; }
.log li { display: grid; grid-template-columns: 44px minmax(0, 1fr) 84px; gap: var(--space-3); }
.log li > span:nth-child(2) { white-space: normal; overflow-wrap: anywhere; }
.log li > span:last-child { text-align: right; }
.log .t { color: var(--term-muted); }
.log .k { color: #FF8178; }
.log .ok { color: #86B4FF; }
.log .no { color: #FF9E57; }
.log .hi { color: #F2BE22; }
.log .m { color: var(--term-muted); }
.log li.typing { visibility: hidden; }
.term-chart { padding: var(--space-4); padding-top: var(--space-2); }
.term-chart .tc-head { display: flex; justify-content: space-between; gap: var(--space-3); font-size: 12px; line-height: 16px; color: var(--term-muted); letter-spacing: .04em; margin-bottom: var(--space-3); }
.term-chart .tc-head b { color: #F2BE22; font-weight: 500; }
.iters { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; height: 120px; }
.iters span { display: block; background: #4A403C; clip-path: polygon(var(--lean-md) 0, 100% 0, calc(100% - var(--lean-md)) 100%, 0 100%); transform-origin: bottom; }
.iters span.base { background: #6B605A; }
.iters span.best { background: #C4161C; }
.iters .target-line { position: absolute; left: 0; right: 0; height: 2px; background: #F2BE22; }
.iters .target-line::after { content: attr(data-label); position: absolute; right: 0; top: -18px; font-size: 11px; line-height: 14px; color: #F2BE22; letter-spacing: .04em; }
.tc-axis { display: flex; justify-content: space-between; margin-top: var(--space-2); font-size: 11px; line-height: 14px; color: var(--term-muted); }
.term-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding: 10px var(--space-4) var(--space-4); font-size: 12px; line-height: 18px; color: var(--term-muted); }
.term-foot button { font: 500 12px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; background: var(--term-raised); color: var(--term-ink); border: 0; padding: 8px 12px; cursor: pointer; }
.term-foot button:hover { background: #3A3230; }
.cap { font-size: 14px; line-height: 21px; color: var(--ink-muted); margin-top: var(--space-3); }

/* ---------- Run card (inner hero readout) ---------- */
.runcard { background: var(--surface-raised); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.runcard-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.readout { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; }
.readout dt, .readout dd { margin: 0; padding: 9px 12px; font-size: 15px; line-height: 22px; }
.readout dt { font: 500 12px/22px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.readout dd { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.readout dt:nth-of-type(odd), .readout dd:nth-of-type(odd) { background: var(--surface-sunken); }

/* ---------- Metrics (targets and examples) ---------- */
.figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.fig { background: var(--surface-raised); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.fig .note { font: 500 12px/16px var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.fig .v { font: 800 italic clamp(36px, 4vw, 52px)/.95 var(--font-display); font-stretch: 120%; font-variant-numeric: tabular-nums; }
.fig .v small { font-size: .45em; font-stretch: 100%; margin-left: 4px; color: var(--ink-muted); }
.fig p { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.meter { height: 10px; background: var(--surface-sunken); }
.meter i { display: block; height: 100%; background: var(--brand); clip-path: polygon(0 0, 100% 0, calc(100% - var(--lean-sm)) 100%, 0 100%); }

/* ---------- Cards ---------- */
.card { background: var(--surface-raised); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.card .kicker { margin-bottom: var(--space-1); }
.card p { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.card .btn-quiet { margin-top: auto; align-self: flex-start; padding-top: var(--space-2); }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--brand-strong); }
.card-foot { margin-top: auto; padding-top: var(--space-2); display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ---------- The loop: leaned stage blocks ---------- */
.loop { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stage { background: var(--surface-raised); padding: var(--space-5) var(--space-6) var(--space-6); clip-path: polygon(var(--lean-lg) 0, 100% 0, calc(100% - var(--lean-lg)) 100%, 0 100%); display: flex; flex-direction: column; gap: var(--space-2); text-decoration: none; color: var(--ink); min-height: 196px; }
.stage:hover { background: var(--surface-sunken); }
.stage:focus-visible { clip-path: none; }
.stage b { font: 500 12px/16px var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--brand-strong); }
.stage strong { font: 800 italic 26px/1 var(--font-display); font-stretch: 115%; }
.stage span { font-size: 14px; line-height: 21px; color: var(--ink-muted); }
.stage.on { background: var(--brand); color: var(--on-brand); }
.stage.on b, .stage.on span { color: var(--on-brand); }
.brain { margin-top: 6px; background: var(--surface-sunken); padding: var(--space-5) var(--space-6); display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: var(--space-6); align-items: center; color: var(--ink); text-decoration: none; }
.brain:hover { background: var(--surface-raised); }
.brain strong { font: 800 italic 26px/1 var(--font-display); font-stretch: 115%; }
.brain span { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.brain b { font: 500 12px/16px var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--brand-strong); }
.brain.on { background: var(--brand); color: var(--on-brand); }
.brain.on span, .brain.on b { color: var(--on-brand); }

/* ---------- Steps: a real sequence with timing ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: var(--space-4); counter-reset: s; }
.steps li { background: var(--surface-raised); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.steps .s-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.steps .s-n { font: 800 italic 40px/1 var(--font-display); font-stretch: 120%; color: var(--brand-strong); }
.steps .s-t { font: 500 12px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); text-align: right; }
.steps p { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.steps .speed { height: 8px; background: var(--surface-sunken); }
.steps .speed i { display: block; height: 100%; background: var(--brand); clip-path: polygon(0 0, 100% 0, calc(100% - var(--lean-sm)) 100%, 0 100%); }

/* ---------- Candidate ledger ---------- */
.ledger-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.chip { font: 500 13px/18px var(--font-data); letter-spacing: .04em; padding: 9px 14px; background: var(--surface-raised); color: var(--ink); border: 0; cursor: pointer; }
.chip:hover { background: var(--surface-sunken); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.ledger-count { margin-left: auto; font: 400 13px/18px var(--font-data); color: var(--ink-muted); }
.ledger { list-style: none; display: flex; flex-direction: column; }
.ledger li { display: grid; grid-template-columns: 56px minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.6fr) 120px; gap: var(--space-4); align-items: center; padding: 12px var(--space-4); }
.ledger li:nth-child(odd) { background: var(--surface-raised); }
.ledger li:nth-child(even) { background: var(--surface-sunken); }
.ledger li[hidden] { display: none; }
.ledger .id { font: 500 13px/20px var(--font-data); color: var(--ink-muted); }
.ledger .what { font-weight: 600; font-size: 15px; line-height: 22px; }
.ledger .what small { display: block; font-weight: 400; color: var(--ink-muted); font-size: 14px; }
.ledger .why { font-size: 14px; line-height: 21px; color: var(--ink-muted); }
.ledger .delta { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--space-2); align-items: center; font: 500 14px/20px var(--font-data); font-variant-numeric: tabular-nums; }
.ledger .delta .bar { height: 10px; background: var(--surface); position: relative; }
.ledger .delta .bar i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--kept); clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 100%, 0 100%); }
.ledger .delta.worse .bar i { background: var(--rejected); }
.ledger .tag { justify-self: end; }
.ledger-head { display: grid; grid-template-columns: 56px minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.6fr) 120px; gap: var(--space-4); padding: 0 var(--space-4) var(--space-2); font: 500 12px/16px var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.ledger-head span:last-child { text-align: right; }

/* ---------- Bench bars (before / after) ---------- */
.bench { display: flex; flex-direction: column; gap: var(--space-4); }
.bench-row { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr); gap: var(--space-4); align-items: center; }
.bench-row > span { font-size: 15px; line-height: 21px; }
.bench-bars { display: flex; flex-direction: column; gap: 4px; }
.bench-bar { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: var(--space-3); align-items: center; font: 500 13px/18px var(--font-data); font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.bench-bar i { display: block; height: 14px; background: var(--surface-sunken); clip-path: polygon(var(--lean-sm) 0, 100% 0, calc(100% - var(--lean-sm)) 100%, 0 100%); }
.bench-bar.after i { background: var(--brand); }
.bench-bar.after { color: var(--ink); }
.bench-legend { display: flex; gap: var(--space-6); flex-wrap: wrap; font: 500 12px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.bench-legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.bench-legend span::before { content: ""; width: 18px; height: 10px; background: var(--surface-sunken); clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%); }
.bench-legend span.a::before { background: var(--brand); }
.bench-wrap { background: var(--surface-raised); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); }
.bench-wrap .bench-bar i { background: var(--surface-sunken); }
.bench-wrap .bench-bar.after i { background: var(--brand); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.panel-title { font: 700 18px/24px var(--font-text); }

/* ---------- Trace strip (Profyle) ---------- */
.trace { background: var(--term); color: var(--term-ink); padding: var(--space-5); font: 400 12px/16px var(--font-data); display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.trace-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--space-3); align-items: center; }
.trace-row > span { color: var(--term-muted); letter-spacing: .04em; }
.lane { position: relative; height: 22px; background: var(--term-raised); }
.lane i { position: absolute; top: 3px; bottom: 3px; background: #6B605A; }
.lane i.hot { background: #C4161C; }
.lane i.mem { background: #F2BE22; }
.lane i.ok { background: #86B4FF; }
.trace-axis { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--space-3); color: var(--term-muted); }
.trace-axis div { display: flex; justify-content: space-between; }
.trace-key { display: flex; flex-wrap: wrap; gap: var(--space-4); color: var(--term-muted); margin-top: var(--space-2); }
.trace-key span { display: inline-flex; align-items: center; gap: 6px; }
.trace-key span::before { content: ""; width: 12px; height: 10px; background: var(--k); }

/* ---------- Pareto (Quantra) ---------- */
.pareto { background: var(--surface-raised); padding: var(--space-6); display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--space-8); align-items: start; }
.pareto svg { width: 100%; height: auto; display: block; }
.pareto .ax { fill: var(--ink-muted); font: 400 11px var(--font-data); }
.pareto .grid-l { fill: var(--surface-sunken); }
.pareto .pt { fill: var(--surface-sunken); }
.pareto .pt.in { fill: var(--kept); }
.pareto .pt.best { fill: var(--brand); }
.pareto .budget { fill: var(--rejected); }
.pareto .budget-l { fill: var(--rejected); font: 500 11px var(--font-data); }
.pareto-side { display: flex; flex-direction: column; gap: var(--space-4); }
.pareto-side output { font: 800 italic 34px/1 var(--font-display); font-stretch: 120%; font-variant-numeric: tabular-nums; }
.pareto-legend { display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.pareto-legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.pareto-legend span::before { content: ""; width: 12px; height: 12px; background: var(--k); }

/* ---------- Range inputs ---------- */
input[type="range"] { width: 100%; accent-color: var(--brand); height: 28px; margin: 0; }
.range-field { display: flex; flex-direction: column; gap: var(--space-2); }
.range-field label { display: flex; justify-content: space-between; gap: var(--space-3); font: 600 15px/20px var(--font-text); }
.range-field output { font: 500 15px/20px var(--font-data); font-variant-numeric: tabular-nums; color: var(--brand-strong); }

/* ---------- Edge envelope (Edgyn) ---------- */
.envelope { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.env { background: var(--surface-raised); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.env .env-v { display: flex; justify-content: space-between; align-items: baseline; font: 500 14px/20px var(--font-data); color: var(--ink-muted); }
.env .env-v b { font: 800 italic 30px/1 var(--font-display); font-stretch: 120%; color: var(--ink); }
.env .track { position: relative; height: 14px; background: var(--surface-sunken); }
.env .track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--kept); clip-path: polygon(0 0, 100% 0, calc(100% - var(--lean-sm)) 100%, 0 100%); }
.env .track s { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--rejected); text-decoration: none; }
.env p { font-size: 14px; line-height: 21px; color: var(--ink-muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; min-width: 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
caption { text-align: left; color: var(--ink-muted); padding-bottom: var(--space-3); caption-side: bottom; padding-top: var(--space-3); }
th, td { text-align: left; padding: 12px var(--space-4); vertical-align: top; }
thead th { font: 500 12px/16px var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); background: var(--surface); padding-bottom: var(--space-3); }
tbody tr:nth-child(odd) { background: var(--surface-raised); }
tbody tr:nth-child(even) { background: var(--surface-sunken); }
tbody th { font-weight: 600; min-width: 160px; }
td.num, td .num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.yes { color: var(--kept); font-family: var(--font-data); }
.part { color: var(--ink-muted); font-family: var(--font-data); }

/* ---------- Code ---------- */
.code { background: var(--term); color: var(--term-ink); min-width: 0; }
.code-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: 8px 8px 8px var(--space-4); background: var(--term-raised); font: 500 12px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--term-muted); }
.copy-btn { font: 500 12px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; background: var(--term); color: var(--term-ink); border: 0; padding: 8px 12px; cursor: pointer; }
.copy-btn:hover { background: #3A3230; }
.code pre { margin: 0; padding: var(--space-4); overflow-x: auto; font: 400 14px/22px var(--font-data); }
.code .k { color: #FF8178; } .code .s { color: #F2BE22; } .code .c { color: var(--term-muted); } .code .n { color: #86B4FF; }

/* ---------- Lists ---------- */
.ticks { list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 9px; width: 18px; height: 9px; background: var(--brand); clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%); }
.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.pair { background: var(--surface-raised); padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); }
.pair strong { font: 700 17px/24px var(--font-text); }
.pair span { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.stackgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.stackgrid div { background: var(--surface-raised); padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: 4px; }
.stackgrid b { font: 500 12px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--brand-strong); }
.stackgrid strong { font-size: 16px; line-height: 22px; }
.stackgrid span { font-size: 14px; line-height: 20px; color: var(--ink-muted); }

/* ---------- Segment blocks (solutions) ---------- */
.seg { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-12); }
.seg + .seg { margin-top: var(--space-16); }
.seg-copy { display: flex; flex-direction: column; gap: var(--space-4); }

/* ---------- Plans ---------- */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.plan { background: var(--surface-raised); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.plan.feature { background: var(--brand); color: var(--on-brand); }
.plan.feature p, .plan.feature li, .plan.feature .kicker { color: var(--on-brand); }
.plan.feature .kicker::before, .plan.feature .ticks li::before { background: var(--on-brand); }
.plan.feature .btn-primary { background: var(--on-brand); color: #9A0E13; }
.plan.feature .btn-primary:hover { background: #17120F; color: #FFFFFF; }
.plan p { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.plan .price { font: 800 italic 28px/1 var(--font-display); font-stretch: 115%; }
.plan .ticks { font-size: 15px; line-height: 22px; gap: var(--space-2); }
.plan .btn { margin-top: auto; }
.plan .btn-secondary { background: var(--surface-sunken); }
.plan .btn-secondary:hover { background: var(--ink); color: var(--surface); }

/* ---------- Estimator ---------- */
.estimator { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: var(--space-6); }
.est-in { background: var(--surface-raised); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); }
.est-out { background: var(--term); color: var(--term-ink); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); }
.est-out .big { font: 800 italic clamp(44px, 5vw, 64px)/.95 var(--font-display); font-stretch: 120%; font-variant-numeric: tabular-nums; color: #FFFFFF; }
.est-out .big small { font-size: .35em; font-stretch: 100%; color: var(--term-muted); margin-left: 6px; }
.est-out dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0; font: 400 14px/20px var(--font-data); }
.est-out dt, .est-out dd { margin: 0; padding: 8px 0; color: var(--term-muted); }
.est-out dd { color: var(--term-ink); text-align: right; font-variant-numeric: tabular-nums; }
.est-out .lbl { font: 500 12px/16px var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: #F2BE22; }
.est-out p { font-size: 14px; line-height: 21px; color: var(--term-muted); }

/* ---------- Timeline (pilot weeks, roadmap) ---------- */
.weeks { list-style: none; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 6px; }
.weeks li { display: flex; flex-direction: column; gap: var(--space-3); }
.weeks .wk { background: var(--brand); color: var(--on-brand); font: 500 12px/16px var(--font-data); letter-spacing: .08em; text-transform: uppercase; padding: 10px var(--space-5); clip-path: polygon(var(--lean-sm) 0, 100% 0, calc(100% - var(--lean-sm)) 100%, 0 100%); }
.weeks li:nth-child(even) .wk { background: var(--surface-raised); color: var(--ink); }
.weeks h3 { font: 700 18px/24px var(--font-text); padding-inline: var(--space-1); }
.weeks p { font-size: 15px; line-height: 23px; color: var(--ink-muted); padding-inline: var(--space-1); }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 6px; max-width: 880px; }
.faq details { background: var(--surface-raised); }
.faq summary { list-style: none; cursor: pointer; padding: var(--space-5) var(--space-6); display: flex; justify-content: space-between; gap: var(--space-4); font: 600 17px/25px var(--font-text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 500 20px/25px var(--font-data); color: var(--brand-strong); flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { background: var(--surface-sunken); }
.faq details > div { padding: 0 var(--space-6) var(--space-6); color: var(--ink-muted); max-width: 70ch; }

/* ---------- CTA band ---------- */
.cta { background: var(--brand); color: var(--on-brand); padding: var(--space-12) var(--space-10); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-8); align-items: end; position: relative; overflow: hidden; }
.cta .kicker { color: var(--on-brand); }
.cta .kicker::before { background: var(--on-brand); }
.cta h2 { margin-top: var(--space-4); }
.cta p { color: var(--on-brand); font-size: 18px; line-height: 28px; }
.cta .cta-side { display: flex; flex-direction: column; gap: var(--space-5); }
.cta .btn-primary { background: var(--on-brand); color: #9A0E13; }
.cta .btn-primary:hover { background: #17120F; color: #FFFFFF; }
.cta .btn-secondary { background: #9A0E13; color: #FFFFFF; }
.cta .btn-secondary:hover { background: #17120F; }
.cta .dashes { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: var(--space-8); }
.cta .dashes i { display: block; height: 10px; background: #FFFFFF; clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%); }

.card .kicker, .cta .kicker, .plan .kicker { font-size: 12px; line-height: 16px; }

/* ---------- Forms ---------- */
.form { background: var(--surface-raised); padding: var(--space-8); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.field label { font: 600 15px/20px var(--font-text); }
.field label .opt { font-weight: 400; color: var(--ink-muted); }
.field input, .field select, .field textarea { font: 400 17px/24px var(--font-text); color: var(--ink); background: var(--surface); border: 1px solid var(--field-border); border-radius: var(--radius-field); padding: 10px 12px; width: 100%; }
.field textarea { min-height: 128px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.field .hint { font-size: 14px; line-height: 21px; color: var(--ink-muted); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--rejected); }
.field.invalid .hint { color: var(--rejected); font-weight: 500; }
.check { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 15px; line-height: 23px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.check.invalid { color: var(--rejected); }
.form-status { padding: var(--space-4) var(--space-5); background: var(--kept-soft); color: var(--ink); font-size: 15px; line-height: 23px; }
.form-status.err { background: var(--rejected-soft); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.form .btn-secondary { background: var(--surface-sunken); }
.form .btn-secondary:hover { background: var(--ink); color: var(--surface); }
.email-list { display: flex; flex-direction: column; gap: 6px; }
.email-list div { background: var(--surface-raised); padding: var(--space-4) var(--space-5); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-4); align-items: center; }
.email-list strong { font-size: 16px; }
.email-list span { font-size: 14px; color: var(--ink-muted); grid-column: 1; }
.email-list code { grid-row: 1 / span 2; grid-column: 2; font-size: 15px; color: var(--brand-strong); user-select: all; }

/* ---------- Roles ---------- */
.roles { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.roles li { background: var(--surface-raised); padding: var(--space-5) var(--space-6); display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: var(--space-6); align-items: center; }
.roles strong { font-size: 17px; }
.roles span { font-size: 15px; line-height: 23px; color: var(--ink-muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); padding-block: var(--space-16) var(--space-10); padding-bottom: max(var(--space-10), env(safe-area-inset-bottom, 0px)); }
.foot { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: var(--space-8); }
.foot-brand { display: flex; flex-direction: column; gap: var(--space-4); }
.foot-brand p { font-size: 15px; line-height: 23px; color: var(--ink-muted); max-width: 36ch; }
.foot h2 { font: 500 12px/16px var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: var(--space-4); }
.foot ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.foot a { color: var(--ink); text-decoration: none; font-size: 15px; line-height: 22px; }
.foot a:hover { color: var(--brand-strong); text-decoration: underline; }
.foot-speed { display: flex; gap: 6px; margin-top: var(--space-12); }
.foot-speed i { height: 12px; background: var(--surface-raised); flex: 1; clip-path: polygon(var(--lean-sm) 0, 100% 0, calc(100% - var(--lean-sm)) 100%, 0 100%); }
.foot-speed i:last-child { background: var(--brand); flex: 3; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.foot-base .mono { user-select: all; }

/* ---------- Motion ---------- */
@keyframes grow { from { transform: scaleY(.04); } to { transform: scaleY(1); } }
.iters.animate span { animation: grow .24s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1079px) {
  .site-header nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); padding: var(--space-2) var(--gutter-r) var(--space-6) var(--gutter-l); display: none; max-height: calc(100vh - 72px); overflow-y: auto; }
  .site-header.open nav { display: block; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link, .nav-menu-btn { width: 100%; padding: 14px 8px; font-size: 17px; }
  .nav-menu { position: static; width: auto; grid-template-columns: 1fr; padding: 0 0 var(--space-2) var(--space-4); background: var(--surface); }
  .site-header .nav-toggle { display: inline-grid; }
  .nav-tools .nav-cta, .nav-tools .nav-account { display: none; }
  .nav-links .nav-account-item { display: block; }
  .nav-links .nav-cta-item { display: block; padding-top: var(--space-4); }
  .nav-links .nav-cta-item .btn { width: 100%; }
  .loop { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stackgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid, .ihero, .split, .split.flip, .seg, .estimator, .pareto, .cta { grid-template-columns: minmax(0, 1fr); }
  .split.flip > :first-child { order: 0; }
  .sec-head .sh-title, .sec-head .lead, .sec-head.solo .sh-title { grid-column: 1 / -1; }
  .cols-3, .cols-4, .steps, .weeks, .envelope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger li, .ledger-head { grid-template-columns: 44px minmax(0, 1fr) 110px; }
  .ledger .why, .ledger-head .h-why, .ledger .delta, .ledger-head .h-delta { display: none; }
  .roles li { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .cta { padding: var(--space-10) var(--space-6); }
}
@media (max-width: 640px) {
  body { font-size: 16px; line-height: 25px; }
  main > section { padding-block: var(--space-16); }
  main > section:first-child { padding-top: var(--space-8); }
  .cols-2, .cols-3, .cols-4, .steps, .weeks, .envelope, .figs, .plans, .pairs, .stackgrid, .form, .loop { grid-template-columns: minmax(0, 1fr); }
  .stage { clip-path: polygon(var(--lean-sm) 0, 100% 0, calc(100% - var(--lean-sm)) 100%, 0 100%); min-height: 0; }
  .brain { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .targets { grid-template-columns: minmax(0, 1fr); }
  .targets div { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .bench-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .form { padding: var(--space-5); }
  .lead { font-size: 18px; line-height: 28px; }
  .log li { grid-template-columns: 40px minmax(0, 1fr) 64px; gap: var(--space-2); }
  .brand { font-size: 21px; }
  .cta .dashes { display: none; }
}
