/* Forgite site. Lab-notebook layout: entries with a right-hand margin for notes.
   Rules: one page ground for every section, header and footer; sections separated by spacing only;
   no gradients, no transparency effects, no shadows of any kind; only form inputs carry a border;
   depth comes from surface steps and the facet (bottom-right cut, run:rise 2:3). */

:root {
  --surface: #F1F2EC; --surface-raised: #FFFFFF; --surface-sunken: #E3E6DA;
  --ink: #171A12; --ink-muted: #4B5142;
  --brand: #5B7014; --brand-strong: #45550B; --brand-soft: #E2EAC6; --on-brand: #FFFFFF;
  --accent: #E9C41C; --on-accent: #171A12; --accent-ink: #6B5600; --accent-soft: #F7EDBE;
  --stable: #1D5AA6; --stable-soft: #DCE7F6; --off-hull: #A44800; --off-hull-soft: #F7E2D0;
  --field-border: #7B8170; --focus: #1D5AA6; --plot-grid: #C9CDBD;
  --font-display: "Geologica", "Avenir Next", system-ui, sans-serif;
  --font-text: "Literata", Georgia, "Times New Roman", serif;
  --font-data: "Geist Mono", ui-monospace, Menlo, monospace;
  --facet-sm: 8px; --facet-md: 16px; --facet-lg: 32px;
  --wrap: 1200px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --sec: 80px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --surface: #121410; --surface-raised: #1C1F18; --surface-sunken: #0A0B08;
  --ink: #ECEEE5; --ink-muted: #AEB4A2;
  --brand: #B4CC58; --brand-strong: #CDE07C; --brand-soft: #2A3314; --on-brand: #121410;
  --accent-ink: #EBCB45; --accent-soft: #342C0A;
  --stable: #86B6F2; --stable-soft: #15253B; --off-hull: #FF9D57; --off-hull-soft: #3A2410;
  --field-border: #7E8572; --focus: #86B6F2; --plot-grid: #353A2D;
  color-scheme: dark;
}

*, *::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 18px/29px var(--font-text); font-optical-sizing: auto; }
img, svg { max-width: 100%; }
a { color: var(--brand-strong); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-variation-settings: "SHRP" 100; text-wrap: balance; }
sub, sup { font-size: .72em; line-height: 0; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--brand); color: var(--on-brand); padding: 10px 14px; z-index: 50; font: 500 14px/20px var(--font-data); }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: calc(var(--wrap) + 32px); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
main > section { padding-block: calc(var(--sec) / 2); }
main > section:first-child { padding-top: 48px; }
main > section:last-child { padding-bottom: var(--sec); }

/* ---------------- type */
.d-hero { font-size: clamp(40px, 6.2vw, 72px); line-height: 1.0; font-weight: 650; letter-spacing: -.028em; }
.d-1 { font-size: clamp(36px, 4.8vw, 54px); line-height: 1.04; font-weight: 650; letter-spacing: -.022em; }
.d-2 { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.1; font-weight: 600; letter-spacing: -.016em; }
.d-3 { font-size: 22px; line-height: 1.22; font-weight: 600; letter-spacing: -.005em; font-variation-settings: "SHRP" 60; }
.lead { font-size: 21px; line-height: 33px; max-width: 62ch; }
.muted { color: var(--ink-muted); }
.small { font-size: 15px; line-height: 24px; }
.mono, .label { font-family: var(--font-data); }
.label { font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: .04em; color: var(--ink-muted); }
.label b { color: var(--brand-strong); font-weight: 600; }
.aside { font-style: italic; font-size: 16px; line-height: 26px; color: var(--ink-muted); }
.prose { max-width: 68ch; display: grid; gap: 16px; }
.prose p { color: var(--ink); }
mark, .hl { background: var(--accent); color: var(--on-accent); padding: 0 4px; }
.f { font-family: var(--font-data); font-size: .9em; white-space: nowrap; }

/* ---------------- facet */
.facet-sm { clip-path: polygon(0 0, 100% 0, calc(100% - var(--facet-sm)) 100%, 0 100%); }
.facet-md, .card, .metric, .tile, .entry-card, .plan, .note-box { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.5 * var(--facet-md)), calc(100% - var(--facet-md)) 100%, 0 100%); }
.facet-lg, .fig, .cta { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.5 * var(--facet-lg)), calc(100% - var(--facet-lg)) 100%, 0 100%); }
a.tile:focus-visible, a.card:focus-visible { clip-path: none; }

/* ---------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 15px/20px var(--font-data); letter-spacing: .01em; padding: 14px 20px; border: 0; border-radius: 0; cursor: pointer; text-decoration: none; transition: background-color .16s ease-out, color .16s ease-out; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); color: var(--on-brand); }
:root[data-theme="dark"] .btn-primary:hover { background: var(--ink); color: var(--surface); }
.btn-secondary { background: var(--surface-raised); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-sunken); }
.btn-quiet { background: none; color: var(--brand-strong); padding-inline: 0; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.btn-quiet:hover { text-decoration-thickness: 2px; }
.btn-sm { padding: 10px 14px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.fig .btn-secondary, .plan .btn-secondary, .form .btn-secondary, .card .btn-secondary { background: var(--surface-sunken); }
.fig .btn-secondary:hover, .plan .btn-secondary:hover { background: var(--brand-soft); }
.btn[disabled] { background: var(--surface-sunken); color: var(--ink-muted); cursor: not-allowed; }

/* ---------------- tags */
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/18px var(--font-data); letter-spacing: .04em; padding: 3px 18px 3px 10px; clip-path: polygon(0 0, 100% 0, calc(100% - var(--facet-sm)) 100%, 0 100%); white-space: nowrap; }
.tag-stable { background: var(--stable-soft); color: var(--stable); }
.tag-off-hull { background: var(--off-hull-soft); color: var(--off-hull); }
.tag-pending { background: var(--surface-sunken); color: var(--ink-muted); }
.tag-brand { background: var(--brand-soft); color: var(--brand-strong); }
.tag-example { background: var(--accent); color: var(--on-accent); }
.tag-planned { background: var(--surface-sunken); color: var(--ink); }

/* ---------------- header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); }
.nav { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand svg { width: 30px; height: 30px; color: var(--brand); }
.brand span { font: 650 25px/1 var(--font-display); font-variation-settings: "SHRP" 100; letter-spacing: -.02em; }
.site-header nav { flex: 1; min-width: 0; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.nav-links > li { position: relative; }
.nav-link, .nav-menu-btn { display: inline-flex; align-items: center; gap: 6px; font: 400 14px/20px var(--font-data); color: var(--ink); text-decoration: none; padding: 10px 10px; 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 { background: var(--brand-soft); color: var(--brand-strong); }
.nav-menu-btn svg { width: 10px; height: 10px; transition: transform .16s ease-out; }
.nav-menu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-menu { position: absolute; top: calc(100% + 8px); left: -8px; background: var(--surface-raised); padding: 16px; display: grid; grid-template-columns: repeat(5, 132px); gap: 8px; z-index: 25; }
.nav-menu[hidden] { display: none; }
.nav-menu-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; padding-top: 8px; }
.nav-menu .tile { width: auto; }
.nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; background: none; border: 0; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--surface-raised); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.site-header .nav-tools .nav-toggle { display: none; }
.nav-account { font: 400 14px/20px var(--font-data); color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; padding: 10px 8px; white-space: nowrap; }
.nav-account:hover { text-decoration-thickness: 2px; color: var(--brand-strong); }
.nav-account[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); text-decoration: none; }
.nav-links .nav-cta-item { display: none; }

.nav-link, .nav-menu-btn { white-space: nowrap; }
@media (max-width: 1240px) and (min-width: 1081px) {
  .nav { gap: 14px; }
  .nav-link, .nav-menu-btn { padding: 10px 6px; font-size: 13px; }
  .nav-account { font-size: 13px; padding: 10px 4px; }
  .brand span { font-size: 22px; }
}
@media (max-width: 1080px) {
  .site-header .nav-tools .nav-toggle { display: inline-grid; }
  .site-header .nav-tools .nav-account { display: none; }
  .site-header nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); padding: 8px var(--gutter-r) 24px var(--gutter-l); display: none; max-height: calc(100vh - 72px); overflow-y: auto; }
  .site-header.is-open nav { display: block; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link, .nav-menu-btn { width: 100%; justify-content: space-between; padding: 14px 12px; font-size: 16px; }
  .nav-menu { position: static; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); margin: 4px 0 8px; }
  .nav-links .nav-cta-item { display: block; padding-top: 12px; }
  .nav-links .nav-cta-item .btn { width: 100%; }
}
@media (max-width: 520px) { .site-header .nav-tools .nav-cta { display: none; } }

/* ---------------- element tiles */
.tile { background: var(--surface-raised); color: var(--ink); width: 132px; min-height: 148px; padding: 10px 12px 14px; display: grid; grid-template-rows: auto 1fr auto auto; gap: 2px; text-decoration: none; transition: background-color .16s ease-out; }
.tile .n { font: 500 13px/16px var(--font-data); color: var(--ink-muted); }
.tile .sym { font: 700 44px/1 var(--font-display); font-variation-settings: "SHRP" 100; letter-spacing: -.02em; color: var(--brand-strong); align-self: center; padding-block: 6px; }
.tile .nm { font: 600 15px/18px var(--font-display); }
.tile .rl { font: 400 11px/15px var(--font-data); letter-spacing: .02em; color: var(--ink-muted); min-height: 30px; }
a.tile:hover { background: var(--brand-soft); }
.tile.is-on { background: var(--brand); color: var(--on-brand); }
.tile.is-on .n, .tile.is-on .sym, .tile.is-on .rl { color: var(--on-brand); }
.tile-lg { width: 168px; min-height: 188px; }
.tile-lg .sym { font-size: 64px; }

.loop { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.loop .tile { width: auto; }
.loop-step { display: grid; gap: 12px; align-content: start; }
.loop-step p { font-size: 15px; line-height: 24px; color: var(--ink-muted); }
.loop-arrow { font: 500 13px/18px var(--font-data); color: var(--ink-muted); }
.loop-return { margin-top: 20px; background: var(--surface-sunken); padding: 14px 16px; font: 400 14px/22px var(--font-data); color: var(--ink); display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.loop-return b { color: var(--brand-strong); font-weight: 600; }

/* ---------------- entry layout: heading, then main column + right margin notes */
.entry-head { display: grid; gap: 10px; margin-bottom: 32px; max-width: 820px; }
.entry-head .lead { color: var(--ink-muted); }
.entry-body { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 48px; align-items: start; }
.entry-body.full { grid-template-columns: minmax(0, 1fr); }
.margin { display: grid; gap: 20px; padding-top: 4px; }
.mnote { display: grid; gap: 6px; }
.mnote .label { color: var(--accent-ink); }
.mnote p { font-style: italic; font-size: 16px; line-height: 26px; color: var(--ink-muted); }
.mnote p.label { font: 500 13px/18px var(--font-data); letter-spacing: .04em; font-style: normal; color: var(--accent-ink); }

/* ---------------- hero */
.hero { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 24px 48px; }
.hero-title { display: grid; gap: 18px; align-content: start; }
.hero-meta { display: grid; gap: 14px; align-content: end; }
.hero-meta dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font: 400 13px/20px var(--font-data); }
.hero-meta dt { color: var(--ink-muted); }
.hero-meta dd { margin: 0; }
.triad { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.triad > div { background: var(--surface-raised); padding: 18px 20px 26px; display: grid; gap: 8px; align-content: start; }
.triad > div:last-child { background: var(--brand-soft); }
.triad p { font-size: 17px; line-height: 27px; }
.hero-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }

.ihero { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 24px 48px; align-items: start; }
.ihero-title { display: grid; gap: 18px; }
.ihero-side { display: grid; gap: 16px; justify-items: start; }
.abstract { background: var(--surface-raised); padding: 18px 20px 28px; display: grid; gap: 10px; width: 100%; }
.abstract dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font: 400 13px/20px var(--font-data); }
.abstract dt { color: var(--ink-muted); }
.abstract dd { margin: 0; }
.ihero-fig { grid-column: 1 / -1; margin-top: 16px; }
.ptitle { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }

/* ---------------- figures */
.fig { margin: 0; background: var(--surface-raised); padding: 20px 20px 40px; display: grid; gap: 14px; min-width: 0; }
.fig-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.fig-head .label { color: var(--ink); }
.fig figcaption, .cap { font: italic 400 15px/24px var(--font-text); color: var(--ink-muted); }
.fig figcaption b, .cap b { font-style: normal; font-family: var(--font-data); font-weight: 500; font-size: 13px; color: var(--ink); }
.plot { display: block; width: 100%; height: auto; font-family: var(--font-data); }
.plot .grid line { stroke: var(--plot-grid); stroke-width: 1; }
.plot .axis text, .plot text { fill: var(--ink-muted); font-size: 12px; }
.plot .axis-title { fill: var(--ink); font-size: 12px; }
.plot .thr { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
.plot .pt-kept { fill: var(--brand); }
.plot .pt-stable { fill: var(--stable); }
.plot .pt-off { fill: var(--off-hull); }
.plot .pt-best { fill: var(--accent); stroke: var(--ink); stroke-width: 1.5; }
.plot .pt .tri, .plot .pt .dia { display: none; }
.plot .pt-off .sq, .plot .pt-best .sq { display: none; }
.plot .pt-off .tri, .plot .pt-best .dia { display: inline; }
.plot .zone { fill: var(--brand-soft); }
.plot .line-a { fill: none; stroke: var(--brand); stroke-width: 2.5; }
.plot .line-b { fill: none; stroke: var(--stable); stroke-width: 2.5; stroke-dasharray: 6 4; }
.plot .hull { fill: none; stroke: var(--ink); stroke-width: 2; }
.plot .diag { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 4 4; }
.plot .lbl { fill: var(--ink); font-size: 12px; }
.screen { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.screen-side { display: grid; gap: 16px; }
.counts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.count { background: var(--surface-sunken); padding: 10px 12px; display: grid; gap: 2px; }
.count .v { font: 650 28px/1.1 var(--font-display); font-variation-settings: "SHRP" 100; font-variant-numeric: tabular-nums; }
.count .k { font: 400 12px/16px var(--font-data); color: var(--ink-muted); }
.count.is-kept { background: var(--brand-soft); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font: 400 13px/18px var(--font-data); }
.legend li { display: flex; gap: 8px; align-items: center; }
.legend svg { width: 14px; height: 14px; flex: none; }
.legend .sw-kept, .legend .sw-kept-tri { fill: var(--brand); } .legend .sw-stable { fill: var(--stable); } .legend .sw-off { fill: var(--off-hull); } .legend .sw-best { fill: var(--accent); stroke: var(--ink); stroke-width: 1.5; }
.legend .sw-a { fill: var(--brand); } .legend .sw-b { fill: var(--stable); }
.best { background: var(--accent-soft); padding: 12px 14px; font: 400 13px/20px var(--font-data); display: grid; gap: 2px; }
.range { display: grid; gap: 6px; }
.range label { font: 500 13px/18px var(--font-data); display: flex; justify-content: space-between; gap: 8px; }
.range output { font-weight: 600; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--brand); height: 28px; margin: 0; }

/* ---------------- metrics */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metrics.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.entry-body:not(.full) .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric { background: var(--surface-raised); padding: 18px 20px 30px; display: grid; gap: 6px; align-content: start; }
.metric .note { font: 500 13px/18px var(--font-data); letter-spacing: .04em; color: var(--accent-ink); }
.metric .v { font: 650 44px/1.02 var(--font-display); font-variation-settings: "SHRP" 100; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric .v small { font: 400 15px/20px var(--font-data); color: var(--ink-muted); margin-left: 6px; letter-spacing: 0; }
.metric p { font-size: 15px; line-height: 24px; color: var(--ink-muted); }

/* ---------------- cards and grids */
.grid { display: grid; gap: 12px; }
.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)); }
.card { background: var(--surface-raised); padding: 22px 22px 34px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.card p { font-size: 16px; line-height: 26px; color: var(--ink-muted); }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--brand-strong); text-decoration: underline; }
.card.sunken { background: var(--surface-sunken); }
.card .label { color: var(--ink-muted); }

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 10px; width: 14px; height: 10px; background: var(--brand); clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }

/* ---------------- steps: a real sequence */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 72px minmax(0, 1fr) 200px; gap: 20px; background: var(--surface-raised); padding: 20px 22px; align-items: start; }
.steps li:nth-child(even) { background: var(--surface-sunken); }
.steps .s-n { font: 650 34px/1 var(--font-display); font-variation-settings: "SHRP" 100; color: var(--brand-strong); }
.steps h3 { margin-bottom: 6px; }
.steps p { font-size: 16px; line-height: 26px; color: var(--ink-muted); }
.steps .s-meta { font: 400 13px/20px var(--font-data); color: var(--ink-muted); display: grid; gap: 4px; }
.steps .s-meta b { color: var(--ink); font-weight: 500; }

/* ---------------- ledger: screening funnel */
.ledger { display: grid; gap: 6px; }
.ledger-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) 110px; gap: 16px; align-items: center; background: var(--surface-raised); padding: 12px 16px; }
.ledger-row:nth-child(even) { background: var(--surface-sunken); }
.ledger-row .what { font-size: 15px; line-height: 22px; }
.ledger-row .what b { display: block; font: 500 13px/18px var(--font-data); color: var(--ink-muted); }
.ledger-row .bar { height: 14px; background: var(--brand); clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%); min-width: 8px; }
.ledger-row:last-child .bar { background: var(--accent); }
.ledger-row .n { font: 500 15px/20px var(--font-data); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- tables: rows separated by fills */
.table-wrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 16px; line-height: 24px; }
caption { text-align: left; padding-bottom: 10px; color: var(--ink-muted); font: italic 400 15px/24px var(--font-text); }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; }
thead th { font: 500 13px/18px var(--font-data); letter-spacing: .04em; color: var(--ink-muted); background: var(--surface); }
tbody tr:nth-child(odd) { background: var(--surface-raised); }
tbody tr:nth-child(even) { background: var(--surface-sunken); }
tbody th { font: 600 16px/24px var(--font-display); font-variation-settings: "SHRP" 60; }
td.num, th.num { text-align: right; font-family: var(--font-data); font-variant-numeric: tabular-nums; }

/* ---------------- code */
.code { background: var(--surface-sunken); min-width: 0; }
.code-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; background: var(--surface-raised); }
.code-bar span { font: 500 13px/18px var(--font-data); color: var(--ink-muted); }
.copy-btn { font: 500 13px/18px var(--font-data); background: var(--surface-sunken); color: var(--ink); border: 0; padding: 6px 12px; cursor: pointer; }
.copy-btn:hover { background: var(--brand-soft); }
.code pre { margin: 0; padding: 18px 16px; overflow-x: auto; font: 400 14px/22px var(--font-data); color: var(--ink); }
.code .k { color: var(--brand-strong); font-weight: 600; } .code .s { color: var(--stable); } .code .c { color: var(--ink-muted); font-style: italic; } .code .n { color: var(--off-hull); }

/* ---------------- faq */
.faq { display: grid; gap: 6px; max-width: 880px; }
.faq details { background: var(--surface-raised); }
.faq details:nth-child(even) { background: var(--surface-sunken); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; font: 600 18px/26px var(--font-display); font-variation-settings: "SHRP" 60; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 14px; font: 400 22px/28px var(--font-data); color: var(--brand-strong); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 20px 20px; max-width: 72ch; }
.faq details p { color: var(--ink-muted); font-size: 17px; line-height: 28px; }

/* ---------------- cta */
.cta { background: var(--brand); color: var(--on-brand); padding: 44px 44px 64px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: end; }
.cta .label { color: var(--on-brand); }
.cta h2 { margin-top: 10px; }
.cta p { font-size: 18px; line-height: 29px; }
.cta .btn-primary { background: var(--surface); color: var(--ink); }
.cta .btn-primary:hover { background: var(--ink); color: var(--surface); }
.cta .btn-quiet { color: var(--on-brand); }
.cta-side { display: grid; gap: 20px; }

/* ---------------- splits, pairs, stacks */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.split-copy { display: grid; gap: 16px; }
.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pair { background: var(--surface-raised); padding: 14px 16px; display: grid; gap: 4px; }
.pair strong { font: 600 16px/22px var(--font-display); font-variation-settings: "SHRP" 60; }
.pair span { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.stack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stack > div { background: var(--surface-raised); padding: 14px 16px 18px; display: grid; gap: 4px; align-content: start; }
.stack b { font: 500 12px/16px var(--font-data); color: var(--ink-muted); letter-spacing: .04em; }
.stack strong { font: 600 17px/22px var(--font-display); font-variation-settings: "SHRP" 60; }
.stack span { font-size: 14px; line-height: 21px; color: var(--ink-muted); }
.note-box { background: var(--accent-soft); padding: 16px 18px 28px; display: grid; gap: 6px; }
.note-box .label { color: var(--accent-ink); }
.note-box p { font-size: 16px; line-height: 26px; }

/* ---------------- panels (example product artifacts) */
.panel-rows { display: grid; gap: 4px; }
.prow { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: center; padding: 10px 12px; background: var(--surface-sunken); font: 400 14px/20px var(--font-data); }
.prow > :last-child { margin-left: auto; text-align: right; }
.prow:nth-child(even) { background: var(--surface); }
.prow .meta { color: var(--ink-muted); }
.chat { display: grid; gap: 10px; }
.chat .q { background: var(--surface-sunken); padding: 12px 14px; font: 400 14px/22px var(--font-data); }
.chat .a { padding: 2px 2px; font-size: 16px; line-height: 26px; }
.chat .a sup a { font-family: var(--font-data); text-decoration: none; }
.chat .act { background: var(--brand-soft); padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; font: 400 14px/20px var(--font-data); }
.refs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font: 400 13px/20px var(--font-data); color: var(--ink-muted); }

/* ---------------- filters (Inventa catalogue) */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.filters .label { margin-right: 4px; }
.chip { font: 500 13px/18px var(--font-data); background: var(--surface-raised); color: var(--ink); border: 0; padding: 8px 14px; cursor: pointer; }
.chip:hover { background: var(--surface-sunken); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.empty { padding: 16px; background: var(--surface-sunken); font: 400 14px/20px var(--font-data); }

/* ---------------- plans and estimator */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan { background: var(--surface-raised); padding: 24px 24px 40px; display: grid; gap: 14px; align-content: start; }
.plan.is-featured { background: var(--brand-soft); }
.plan .price { font: 600 22px/28px var(--font-display); font-variation-settings: "SHRP" 100; }
.estimator { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; background: var(--surface-raised); padding: 24px; }
.est-in { display: grid; gap: 18px; }
.est-out { display: grid; gap: 12px; align-content: start; }
.est-total { background: var(--brand-soft); padding: 18px 20px 28px; display: grid; gap: 4px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.5 * var(--facet-md)), calc(100% - var(--facet-md)) 100%, 0 100%); }
.est-total .v { font: 650 48px/1 var(--font-display); font-variation-settings: "SHRP" 100; font-variant-numeric: tabular-nums; }
.est-lines { display: grid; gap: 4px; font: 400 14px/20px var(--font-data); }
.est-lines div { display: flex; justify-content: space-between; gap: 12px; background: var(--surface-sunken); padding: 8px 12px; }

/* ---------------- forms */
.form { display: grid; gap: 18px; background: var(--surface-raised); padding: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label { font: 500 13px/18px var(--font-data); letter-spacing: .04em; }
.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: 2px; padding: 10px 12px; width: 100%; }
.field textarea { min-height: 120px; resize: vertical; }
.field .hint { font-size: 14px; line-height: 21px; color: var(--ink-muted); }
.field .err { font-size: 14px; line-height: 21px; color: var(--off-hull); }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--off-hull); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 24px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.form-status { padding: 14px 16px; font-size: 16px; line-height: 26px; }
.form-status.is-ok { background: var(--brand-soft); }
.form-status.is-err { background: var(--off-hull-soft); }
.emails { display: grid; gap: 8px; }
.email { background: var(--surface-raised); padding: 14px 16px; display: grid; gap: 2px; }
.email span { font: 500 16px/24px var(--font-data); user-select: all; color: var(--ink); }

/* ---------------- roadmap and roles */
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.roles { display: grid; gap: 6px; }
.role { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; background: var(--surface-raised); padding: 14px 18px; }
.role:nth-child(even) { background: var(--surface-sunken); }
.role h3 { font-size: 18px; }
.role .mono { font-size: 13px; color: var(--ink-muted); }

/* ---------------- footer */
.site-footer { background: var(--surface); padding-top: 40px; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
.foot { display: grid; grid-template-columns: minmax(0, 2.2fr) repeat(4, minmax(0, 1fr)); gap: 32px; }
.foot-brand { display: grid; gap: 14px; align-content: start; }
.foot-brand p { font-size: 15px; line-height: 24px; color: var(--ink-muted); max-width: 36ch; }
.foot h2 { font: 500 13px/18px var(--font-data); letter-spacing: .04em; color: var(--ink-muted); margin-bottom: 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.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-tiles { display: flex; gap: 6px; margin-top: 40px; flex-wrap: wrap; }
.foot-tiles .tile { width: 92px; min-height: 104px; padding: 8px 10px 12px; }
.foot-tiles .tile .sym { font-size: 30px; padding-block: 4px; }
.foot-tiles .tile .rl { display: none; }
.foot-base { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-top: 24px; font: 400 13px/20px var(--font-data); color: var(--ink-muted); }
.foot-base .mono { color: var(--ink); user-select: all; }

/* ---------------- responsive */
@media (max-width: 1000px) {
  .hero, .ihero, .entry-body, .split, .cta, .screen, .estimator { grid-template-columns: minmax(0, 1fr); }
  .margin { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .metrics, .cols-4, .stack, .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3, .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
  .steps li { grid-template-columns: 56px minmax(0, 1fr); }
  .steps .s-meta { grid-column: 2; }
}
@media (max-width: 640px) {
  :root { --sec: 64px; }
  body { font-size: 17px; line-height: 28px; }
  .lead { font-size: 19px; line-height: 30px; }
  .triad, .metrics, .metrics.cols-3, .cols-2, .cols-3, .cols-4, .plans, .pairs, .stack, .timeline, .form-row, .counts { grid-template-columns: minmax(0, 1fr); }
  .counts { grid-template-columns: 1fr 1fr; }
  .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-row { grid-template-columns: minmax(0, 1fr) 80px; }
  .ledger-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .role { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .steps li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .steps .s-meta { grid-column: auto; }
  .cta { padding: 28px 22px 56px; }
  .fig { padding: 16px 14px 40px; }
  .foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tile-lg { width: 132px; min-height: 148px; }
  .tile-lg .sym { font-size: 44px; }
  .nav-menu .tile .rl { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
