/* Viseena site styles: "datasheet + viewport".
   Rules: one page ground for header, sections and footer; sections are separated by space only.
   No gradients, no opacity, no shadows of any kind, no lines between sections.
   Depth = solid surface steps, the dark camera viewport panels, the keel cut on tags (never buttons) and
   bounding-box corner brackets on featured panels. Only form inputs carry a border. */

/* ---------- Tokens (light first) ---------- */
:root {
  --surface: #FFFFFF;
  --surface-raised: #F2F0F1;
  --surface-sunken: #E6E3E5;
  --ink: #161417;
  --ink-muted: #59525A;
  --brand: #C2187A;
  --brand-strong: #99105F;
  --brand-soft: #FBE4F0;
  --on-brand: #FFFFFF;
  --accent: #00708A;
  --accent-soft: #DCF1F5;
  --status-pass: #1F5BB8;
  --status-pass-soft: #E2EBFA;
  --status-reject: #B0450A;
  --status-reject-soft: #FBE8DC;
  --field-border: #857C82;
  --focus: #161417;

  /* The camera viewport: dark in both themes, like a monitor on the line */
  --vp: #111013;
  --vp-raised: #1E1B20;
  --vp-ink: #F4F1F3;
  --vp-muted: #ABA4AA;
  --vp-accent: #4FC6DE;
  --vp-brand: #F27AB8;
  --vp-reject: #FF9C66;
  --vp-pass: #8DB5F5;
  --vp-part: #BDB6BB;
  --vp-part-dark: #8E868C;
  --vp-belt: #2B282D;
  --vp-flaw: #3A2F35;

  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-data: "Azeret Mono", ui-monospace, "SF Mono", 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; --space-24: 96px;
  --keel-sm: 6px; --keel-md: 12px; --keel-lg: 24px;
  --bracket: 22px; --bracket-w: 4px;
  --radius-field: 2px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #19171B; --surface-raised: #242126; --surface-sunken: #121013;
    --ink: #F3EEF1; --ink-muted: #B5AAB1;
    --brand: #F27AB8; --brand-strong: #FFA8D3; --brand-soft: #3D1529; --on-brand: #1A0A12;
    --accent: #4FC6DE; --accent-soft: #0F2F37;
    --status-pass: #7EABF2; --status-pass-soft: #14253F; --status-reject: #FF9C66; --status-reject-soft: #3B1E0E;
    --field-border: #81757D; --focus: #F3EEF1; --vp: #0A090B; --vp-raised: #1E1B20;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #19171B; --surface-raised: #242126; --surface-sunken: #121013;
  --ink: #F3EEF1; --ink-muted: #B5AAB1;
  --brand: #F27AB8; --brand-strong: #FFA8D3; --brand-soft: #3D1529; --on-brand: #1A0A12;
  --accent: #4FC6DE; --accent-soft: #0F2F37;
  --status-pass: #7EABF2; --status-pass-soft: #14253F; --status-reject: #FF9C66; --status-reject-soft: #3B1E0E;
  --field-border: #81757D; --focus: #F3EEF1; --vp: #0A090B; --vp-raised: #1E1B20;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 400 17px/1.6 var(--font-text); overflow-x: hidden; }
img, svg, canvas { max-width: 100%; }
a { color: var(--brand-strong); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.mono, .label { font-family: var(--font-data); }
.label { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.small { font-size: 14px; line-height: 21px; }
.sel { user-select: all; color: var(--ink); }
.dia { display: inline-block; width: 8px; height: 8px; background: var(--brand); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); flex: none; }

/* ---------- Type: condensed industrial display, sentence case ---------- */
.display-xxl, .display-xl, .display, .h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -.005em; }
.display-xxl { font-size: clamp(56px, 9.6vw, 140px); line-height: .86; }
.display-xl { font-size: clamp(48px, 7.4vw, 104px); line-height: .88; }
.display { font-size: clamp(38px, 4.8vw, 64px); line-height: .92; }
.h3 { font-size: 28px; line-height: 1; font-weight: 700; }
.lead { font-size: clamp(18px, 1.6vw, 20px); line-height: 1.55; color: var(--ink-muted); max-width: 58ch; }

/* ---------- Keel: the cut from the foot of the Vantage V (controls and tags) ---------- */
.keel-sm, .tag { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--keel-sm)), calc(100% - var(--keel-sm) / 2) 100%, calc(var(--keel-sm) / 2) 100%, 0 calc(100% - var(--keel-sm))); }
.keel-sm:focus-visible { clip-path: none; }

/* ---------- Brackets: bounding-box corners, the detection motif ---------- */
.brackets { position: relative; }
.brackets > .bk { position: absolute; width: var(--bracket); height: var(--bracket); background: var(--bk, var(--brand)); pointer-events: none; }
.brackets > .bk.tl { top: 0; left: 0; clip-path: polygon(0 0, 100% 0, 100% var(--bracket-w), var(--bracket-w) var(--bracket-w), var(--bracket-w) 100%, 0 100%); }
.brackets > .bk.tr { top: 0; right: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, calc(100% - var(--bracket-w)) 100%, calc(100% - var(--bracket-w)) var(--bracket-w), 0 var(--bracket-w)); }
.brackets > .bk.bl { bottom: 0; left: 0; clip-path: polygon(0 0, var(--bracket-w) 0, var(--bracket-w) calc(100% - var(--bracket-w)), 100% calc(100% - var(--bracket-w)), 100% 100%, 0 100%); }
.brackets > .bk.br { bottom: 0; right: 0; clip-path: polygon(calc(100% - var(--bracket-w)) 0, 100% 0, 100% 100%, 0 100%, 0 calc(100% - var(--bracket-w)), calc(100% - var(--bracket-w)) calc(100% - var(--bracket-w))); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); font: 600 16px/20px var(--font-text); padding: 15px 22px; border: 0; cursor: pointer; text-decoration: none; transition: background-color .16s ease, color .16s ease; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); color: var(--on-brand); }
.btn-secondary { background: var(--surface-raised); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-sunken); color: var(--ink); }
.btn-sm { padding: 10px 14px 11px; font-size: 15px; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.plan .btn-secondary, .form .btn-secondary, .vf .btn-secondary { background: var(--surface); }
.plan .btn-secondary:hover, .vf .btn-secondary:hover { background: var(--surface-sunken); }
/* Buttons inside the dark viewport and plates */
.on-vp .btn-primary { background: var(--vp-brand); color: #1A0A12; }
.on-vp .btn-primary:hover { background: #FFA8D3; color: #1A0A12; }
.on-vp .btn-secondary { background: var(--vp-raised); color: var(--vp-ink); }
.on-vp .btn-secondary:hover { background: #2E2A30; color: var(--vp-ink); }
.on-vp :focus-visible { outline-color: var(--vp-ink); }

/* ---------- Status strip + header ---------- */
.status-strip .wrap { display: flex; justify-content: space-between; gap: var(--space-4); padding-block: 10px 0; font: 500 11px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.status-strip a { color: var(--brand-strong); text-decoration: none; }
.status-strip a:hover { text-decoration: underline; }
.status-strip .live { display: inline-flex; align-items: center; gap: 8px; }
.status-strip .live::before { content: ""; width: 7px; height: 7px; background: var(--brand); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
@media (max-width: 760px) { .status-strip .hide-sm { display: none; } }

.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--surface); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--surface); z-index: 60; }
.nav { display: flex; align-items: center; gap: var(--space-6); min-height: 68px; }
.nav-link, .nav-menu-btn, .nav-cta { white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.brand svg { width: 30px; height: 30px; color: var(--brand); flex: none; }
.brand span { font: 800 31px/1 var(--font-display); padding-bottom: 2px; }
.brand:hover { color: var(--ink); }
.nav-links { list-style: none; display: flex; align-items: center; gap: 2px; }
.nav-links > li { position: relative; }
.nav-link, .nav-menu-btn { display: inline-flex; align-items: baseline; gap: 6px; font: 500 12px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); text-decoration: none; padding: 10px 9px; background: none; border: 0; cursor: pointer; }
.nav-link i, .nav-menu-btn i { font-style: normal; color: var(--ink-muted); font-size: 10px; }
.nav-link:hover, .nav-menu-btn:hover { color: var(--brand-strong); }
.nav-link[aria-current="page"], .nav-menu-btn.is-active { background: var(--ink); color: var(--surface); }
.nav-link[aria-current="page"] i, .nav-menu-btn.is-active i { color: var(--surface); }
.nav-menu-btn svg { width: 9px; height: 9px; flex: none; align-self: center; transition: transform .16s ease; }
.nav-menu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-menu { position: absolute; top: calc(100% + 10px); left: 0; width: 560px; background: var(--vp); color: var(--vp-ink); padding: var(--space-2); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.nav-menu a { display: grid; gap: 4px; padding: 12px 14px; text-decoration: none; color: var(--vp-ink); }
.nav-menu a:hover, .nav-menu a[aria-current="page"] { background: var(--vp-raised); }
.nav-menu strong { font: 800 26px/1 var(--font-display); }
.nav-menu span { font: 400 13px/1.35 var(--font-text); color: var(--vp-muted); }
.nav-menu b { font: 500 10px/14px var(--font-data); letter-spacing: .06em; color: var(--vp-accent); }
.nav-menu :focus-visible { outline-color: var(--vp-ink); }
.nav-tools { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.icon-btn { width: 40px; height: 40px; 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: 18px; height: 18px; }
.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; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.site-header .nav-toggle { display: none; }
.site-header .nav-cta-item { display: none; }
/* Account link: a quiet text link, never a filled button */
.nav-account { font: 500 12px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); text-decoration: none; padding: 10px 8px; white-space: nowrap; }
.nav-account:hover { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 4px; }
.nav-account[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 4px; }

@media (max-width: 1239px) {
  .site-header .nav-toggle { display: inline-grid; }
  .site-header nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); display: none; padding: var(--space-2) var(--gutter-r) var(--space-8) var(--gutter-l); max-height: calc(100vh - 68px); overflow-y: auto; }
  .site-header.open nav { display: block; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link, .nav-menu-btn { width: 100%; justify-content: flex-start; padding: 14px 8px; font-size: 14px; }
  .nav-menu-btn svg { margin-left: auto; }
  .nav-menu { position: static; width: auto; grid-template-columns: minmax(0, 1fr); margin: 0 0 var(--space-3); }
  .site-header .nav-cta-item { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
  .site-header .nav-cta-item .nav-account { padding: 14px 8px; font-size: 14px; }
  .site-header .nav-cta-item .btn { width: 100%; }
}
/* Desktop nav is tight with the account link: trim spacing, and drop the link from the bar on narrow desktops
   (it stays in the footer, and in the menu panel below 1240px). */
@media (min-width: 1240px) {
  .nav { gap: var(--space-4); }
  .nav-link, .nav-menu-btn { padding-inline: 6px; letter-spacing: .04em; }
  .nav-account { padding-inline: 6px; letter-spacing: .05em; }
}
@media (min-width: 1240px) and (max-width: 1299px) { .site-header .nav-tools .nav-account-tool { display: none; } }
@media (max-width: 640px) { .site-header .nav-tools .nav-account-tool { display: none; } }
@media (max-width: 520px) { .site-header .nav-tools .nav-cta { display: none; } }

/* ---------- Sections: datasheet layout, numbered in a left rail ---------- */
main { counter-reset: sec; }
main > section { padding-block: var(--space-12); }
main > section:first-child { padding-top: var(--space-4); }
main > section:last-child { padding-bottom: var(--space-20); }
@media (min-width: 900px) { main > section { padding-block: var(--space-16); } main > section:first-child { padding-top: var(--space-4); } }
.ds { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: var(--space-6) var(--space-10); }
.ds-rail { align-self: start; position: sticky; top: 96px; display: grid; gap: var(--space-2); }
.ds-rail::before { counter-increment: sec; content: "§" counter(sec, decimal-leading-zero); font: 800 56px/.85 var(--font-display); color: var(--brand); }
.ds-rail .label { color: var(--ink); }
.ds-body { display: grid; gap: var(--space-8); min-width: 0; }
.ds-head { display: grid; gap: var(--space-4); }
@media (max-width: 860px) {
  .ds { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .ds-rail { position: static; display: flex; align-items: baseline; gap: var(--space-3); }
  .ds-rail::before { font-size: 40px; }
}

/* ---------- Grids ---------- */
.grid { display: grid; gap: var(--space-4); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- The viewport (home hero): a live camera monitor ---------- */
.viewport { background: var(--vp); color: var(--vp-ink); display: grid; padding: var(--space-4); gap: var(--space-3); --bk: var(--vp-accent); }
.vp-hud { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-6); font: 500 11px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--vp-muted); padding: 2px 6px 0; }
.vp-hud b { color: var(--vp-ink); font-weight: 500; }
.vp-hud .sim { color: var(--vp-accent); }
.vp-stage { position: relative; background: var(--vp); min-width: 0; }
.vp-stage canvas { display: block; width: 100%; height: clamp(220px, 28vw, 340px); }
.vp-pause { position: absolute; right: 30px; bottom: 30px; font: 500 11px/14px var(--font-data); letter-spacing: .06em; text-transform: uppercase; background: var(--vp-raised); color: var(--vp-ink); border: 0; padding: 7px 10px; cursor: pointer; }
.vp-pause:hover { background: #2E2A30; }
.vp-pause:focus-visible { outline: 2px solid var(--vp-ink); }
.vp-claim { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-8) var(--space-10); align-items: end; padding: var(--space-8) var(--space-4) var(--space-4); }
.vp-claim .label { grid-column: 1 / -1; color: var(--vp-accent); display: flex; align-items: center; gap: 8px; }
.vp-claim h1 { color: var(--vp-ink); }
.vp-claim h1 em { font-style: normal; color: var(--vp-brand); }
.vp-side { display: grid; gap: var(--space-5); }
.vp-side .lead { color: var(--vp-muted); }
.vp-counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.vp-counters div { background: var(--vp-raised); padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.vp-counters span { font: 500 10px/14px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--vp-muted); }
.vp-counters output { font: 500 22px/1.1 var(--font-data); color: var(--vp-ink); font-variant-numeric: tabular-nums; }
.vp-counters .c-pass output { color: var(--vp-pass); }
.vp-counters .c-rej output { color: var(--vp-reject); }
.vp-note { font-size: 13px; color: var(--vp-muted); }
@media (max-width: 900px) { .vp-claim { grid-template-columns: minmax(0, 1fr); padding-inline: var(--space-2); } }
@media (max-width: 480px) { .vp-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .viewport { padding: var(--space-2); } }

/* ---------- Plate: the inner-page hero, a dark spec plate ---------- */
.plate { background: var(--vp); color: var(--vp-ink); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-10); padding: var(--space-12) var(--space-10) var(--space-10); --bk: var(--vp-accent); }
.plate-copy { display: grid; gap: var(--space-5); align-content: end; }
.plate-copy .label { color: var(--vp-accent); display: flex; gap: 8px; align-items: center; }
.plate-copy h1 { color: var(--vp-ink); }
.plate-copy .lead { color: var(--vp-muted); }
.plate-spec { align-self: end; display: grid; gap: var(--space-3); min-width: 0; }
.plate-spec > .label { color: var(--vp-muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plate .readout dt:nth-of-type(n), .plate .readout dd:nth-of-type(n) { background: var(--vp-raised); }
.plate .readout dt:nth-of-type(n) { color: var(--vp-muted); }
.plate .readout dd:nth-of-type(n) { color: var(--vp-ink); }
.plate .readout dt:nth-of-type(even), .plate .readout dd:nth-of-type(even) { background: var(--vp); }
.plate-note { font-size: 13px; color: var(--vp-muted); }
@media (max-width: 900px) { .plate { grid-template-columns: minmax(0, 1fr); padding: var(--space-10) var(--space-5) var(--space-6); } }

/* ---------- Readout: key/value rows ---------- */
.readout { display: grid; grid-template-columns: auto 1fr; margin: 0; }
.readout dt, .readout dd { margin: 0; padding: 9px 12px; }
.readout dt { font: 500 11px/20px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.readout dd { font: 500 13px/20px var(--font-data); text-align: right; font-variant-numeric: tabular-nums; }
.readout dt:nth-of-type(odd), .readout dd:nth-of-type(odd) { background: var(--surface-raised); }

/* ---------- Tags ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 11px/14px var(--font-data); letter-spacing: .06em; text-transform: uppercase; padding: 5px 9px 8px; white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; background: currentColor; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.tag-pass { background: var(--status-pass-soft); color: var(--status-pass); }
.tag-reject { background: var(--status-reject-soft); color: var(--status-reject); }
.tag-review { background: var(--surface-sunken); color: var(--ink-muted); }
.tag-example { background: var(--accent-soft); color: var(--ink); }
.tag-brand { background: var(--brand-soft); color: var(--brand-strong); }
.tag-planned { background: var(--surface-sunken); color: var(--ink); }
.tag-core { background: var(--ink); color: var(--surface); }
.plate .tag-example, .viewport .tag-example { background: #0F2F37; color: var(--vp-ink); }

/* ---------- Spec list: numbered rows instead of card grids ---------- */
.spec { list-style: none; display: grid; }
.spec li { display: grid; grid-template-columns: 56px minmax(0, 4fr) minmax(0, 7fr) auto; gap: var(--space-2) var(--space-6); align-items: baseline; padding: 18px 16px; }
.spec li:nth-child(odd) { background: var(--surface-raised); }
.spec .n { font: 500 13px/1 var(--font-data); color: var(--brand-strong); }
.spec h3 { font: 700 28px/1 var(--font-display); }
.spec p { color: var(--ink-muted); }
.spec a { color: var(--ink); text-decoration: none; }
.spec a:hover { color: var(--brand-strong); text-decoration: underline; }
@media (max-width: 760px) { .spec li { grid-template-columns: 40px minmax(0, 1fr); } .spec p, .spec .tag { grid-column: 2; } .spec .tag { justify-self: start; } }

/* ---------- Figures: large readouts ---------- */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.figure { background: var(--surface-raised); padding: var(--space-5) var(--space-5) var(--space-6); display: grid; gap: var(--space-2); align-content: start; min-width: 0; }
.figure .note { font: 500 11px/14px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.figure .v { font: 800 clamp(56px, 6vw, 84px)/.85 var(--font-display); font-variant-numeric: tabular-nums; }
.figure .v small { font: 500 16px/1 var(--font-data); margin-left: 4px; color: var(--ink-muted); }
.figure p { font-size: 15px; line-height: 1.45; color: var(--ink-muted); }
.figures.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .figures, .figures.two { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Pipeline: the five products as stages on one line ---------- */
.pipeline { display: grid; gap: var(--space-2); }
.pipe { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pipe li { display: grid; align-content: start; min-width: 0; }
.pipe-rail { height: 28px; display: flex; align-items: center; }
.pipe-rail::before { content: ""; width: 16px; height: 16px; flex: none; background: var(--brand); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.pipe-rail::after { content: ""; height: 4px; flex: 1; background: var(--ink); }
.pipe a { display: grid; gap: 6px; align-content: start; padding: var(--space-3) var(--space-4) var(--space-5) 0; color: var(--ink); text-decoration: none; }
.pipe .label { color: var(--ink-muted); }
.pipe a:hover strong { color: var(--brand-strong); }
.pipe a[aria-current="page"] strong { color: var(--brand-strong); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.pipe strong { font: 800 42px/.9 var(--font-display); }
.pipe p { font-size: 15px; line-height: 1.45; color: var(--ink-muted); }
.pipe-return { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); align-items: center; background: var(--vp); color: var(--vp-ink); padding: var(--space-4) var(--space-5); }
.pipe-return .label { color: var(--vp-accent); }
.pipe-return p { color: var(--vp-muted); font-size: 15px; }
@media (max-width: 900px) {
  .pipe { grid-template-columns: minmax(0, 1fr); }
  .pipe li { grid-template-columns: 28px minmax(0, 1fr); }
  .pipe-rail { height: auto; flex-direction: column; align-items: center; width: 28px; }
  .pipe-rail::after { width: 4px; height: auto; flex: 1; }
  .pipe a { padding: 0 0 var(--space-5) var(--space-3); }
  .pipe-return { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Timeline: a real sequence along a rail ---------- */
.timeline { list-style: none; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
.timeline li { display: grid; gap: var(--space-2); align-content: start; min-width: 0; padding-right: var(--space-5); }
.t-rail { height: 4px; background: var(--ink); margin: 10px 0 var(--space-3); position: relative; }
.t-rail::before { content: ""; position: absolute; left: 0; top: -6px; width: 16px; height: 16px; background: var(--brand); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.t-meta { display: flex; justify-content: space-between; gap: var(--space-2); font: 500 11px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.t-meta b { color: var(--brand-strong); font-weight: 500; }
.timeline h3 { font: 700 30px/1 var(--font-display); }
.timeline p { color: var(--ink-muted); font-size: 16px; }
@media (max-width: 900px) { .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-6); } }
@media (max-width: 560px) { .timeline { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Defect gallery (canvas tiles) ---------- */
.seg { display: inline-flex; gap: 2px; background: var(--surface-sunken); padding: 2px; }
.seg button { font: 500 12px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; background: var(--surface-sunken); color: var(--ink); border: 0; padding: 8px 12px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.gallery-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; background: var(--vp); padding: 2px; }
.tile { margin: 0; background: var(--vp); display: grid; min-width: 0; }
.tile canvas { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; }
.tile figcaption { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px 10px; font: 500 11px/14px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--vp-muted); }
.tile figcaption b { color: var(--vp-ink); font-weight: 500; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Image / label compare ---------- */
.compare { display: grid; gap: var(--space-3); }
.compare-stage { position: relative; background: var(--vp); }
.compare-stage canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 7; }
.compare-stage .over { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split, 50%)); }
.compare-stage .handle { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 3px; background: var(--vp-ink); margin-left: -1px; pointer-events: none; }
.compare-stage .cap { position: absolute; top: 10px; font: 500 11px/14px var(--font-data); letter-spacing: .06em; text-transform: uppercase; background: var(--vp); color: var(--vp-ink); padding: 5px 8px; }
.compare-stage .cap.l { left: 10px; }
.compare-stage .cap.r { right: 10px; color: var(--vp-brand); }
.compare label { font-weight: 600; font-size: 15px; }
.compare input[type=range] { width: 100%; accent-color: var(--brand); }

/* ---------- Example panels ---------- */
.panel { background: var(--surface-raised); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); margin: 0; min-width: 0; --bk: var(--brand); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.panel-title { font: 700 30px/1 var(--font-display); }
.panel .readout dt:nth-of-type(odd), .panel .readout dd:nth-of-type(odd) { background: var(--surface); }
.panel-cap { font-size: 13px; line-height: 1.45; color: var(--ink-muted); }
.bars { display: grid; gap: var(--space-3); }
.bar-row { display: grid; grid-template-columns: minmax(84px, 130px) minmax(0, 1fr) minmax(52px, auto); gap: var(--space-3); align-items: center; font: 500 12px/1.2 var(--font-data); }
.bar-track { height: 10px; background: var(--surface-sunken); }
.bar-fill { display: block; height: 10px; background: var(--accent); }
.bar-fill.brand { background: var(--brand); }
.bar-row span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.verdict { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); background: var(--status-reject-soft); padding: 12px; }
.verdict strong { font-weight: 600; }

/* ticks list */
.ticks { list-style: none; display: grid; gap: var(--space-2); }
.ticks li { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: var(--space-3); align-items: baseline; }
.ticks li::before { content: ""; width: 8px; height: 8px; background: var(--brand); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); transform: translateY(-1px); }

/* ---------- Split inside a datasheet section ---------- */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-8) var(--space-10); align-items: start; }
.split-copy { display: grid; gap: var(--space-4); align-content: start; }
@media (max-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
caption { text-align: left; caption-side: bottom; padding-top: var(--space-3); color: var(--ink-muted); }
thead th { background: var(--ink); color: var(--surface); font: 500 11px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 12px 14px; }
tbody th, tbody td { padding: 12px 14px; text-align: left; vertical-align: top; }
tbody th { font-weight: 600; }
tbody tr:nth-child(odd) { background: var(--surface-raised); }
tbody tr:nth-child(even) { background: var(--surface); }

/* ---------- FAQ: numbered questions ---------- */
.faq { display: grid; gap: 2px; counter-reset: q; }
.faq details { background: var(--surface-raised); counter-increment: q; }
.faq summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 48px minmax(0, 1fr) 20px; gap: var(--space-3); align-items: baseline; padding: 18px 16px; font: 600 18px/1.35 var(--font-text); }
.faq summary::before { content: "Q" counter(q, decimal-leading-zero); font: 500 12px/1 var(--font-data); color: var(--brand-strong); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 500 20px/1 var(--font-data); color: var(--ink-muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 16px 20px 76px; color: var(--ink-muted); max-width: 78ch; }
@media (max-width: 560px) { .faq details > div { padding-left: 16px; } }

/* ---------- Viewfinder CTA ---------- */
.vf { background: var(--surface-raised); padding: var(--space-16) var(--space-12); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-8) var(--space-12); align-items: end; --bracket: 44px; --bracket-w: 6px; }
.vf .display { font-size: clamp(44px, 6vw, 84px); }
.vf-side { display: grid; gap: var(--space-5); }
.vf-side p { font-size: 18px; color: var(--ink-muted); }
.vf-tag { position: absolute; top: 16px; left: 60px; font: 500 11px/14px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--brand-strong); }
@media (max-width: 860px) { .vf { grid-template-columns: minmax(0, 1fr); padding: var(--space-16) var(--space-6) var(--space-12); } }

/* ---------- Code ---------- */
.code { background: var(--vp); color: var(--vp-ink); min-width: 0; }
.code-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: 10px 16px; background: var(--vp-raised); }
.code-bar .label { color: var(--vp-muted); }
.copy-btn { font: 500 11px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; background: var(--vp); color: var(--vp-ink); border: 0; padding: 6px 10px; cursor: pointer; }
.copy-btn:hover { color: var(--vp-brand); }
.copy-btn:focus-visible { outline-color: var(--vp-ink); }
.code pre { margin: 0; padding: 16px; overflow-x: auto; font: 400 13px/22px var(--font-data); }
.code .k { color: var(--vp-brand); }
.code .s { color: var(--vp-accent); }
.code .c { color: var(--vp-muted); }

/* ---------- Stack chips ---------- */
.stack { display: flex; flex-wrap: wrap; gap: 2px; }
.stack-item { background: var(--surface-raised); padding: 12px 16px; display: grid; gap: 4px; flex: 1 1 240px; min-width: 0; }
.stack-item strong { font: 700 24px/1 var(--font-display); }
.stack-item span { font-size: 14px; line-height: 1.4; color: var(--ink-muted); }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 2px; }
.chip { font: 500 12px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; background: var(--surface-raised); color: var(--ink); border: 0; padding: 10px 14px; cursor: pointer; }
.chip:hover { background: var(--surface-sunken); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

/* ---------- Plans + estimator ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.plan { background: var(--surface-raised); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.plan h3 { font: 800 44px/.9 var(--font-display); }
.plan p { color: var(--ink-muted); }
.plan .btn { margin-top: auto; align-self: flex-start; }
.plan-main { background: var(--vp); color: var(--vp-ink); }
.plan-main p, .plan-main .label { color: var(--vp-muted); }
@media (max-width: 900px) { .plans { grid-template-columns: minmax(0, 1fr); } }
.estimator { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 2px; }
.est-controls { background: var(--surface-raised); padding: var(--space-6); display: grid; gap: var(--space-6); }
.est-field { display: grid; gap: var(--space-2); }
.est-field label { font-weight: 600; display: flex; justify-content: space-between; gap: var(--space-3); }
.est-field output { font: 500 15px/1 var(--font-data); color: var(--brand-strong); }
.est-field input[type=range] { width: 100%; accent-color: var(--brand); }
.est-out { display: grid; gap: 2px; align-content: start; }
@media (max-width: 860px) { .estimator { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Forms (the only bordered elements) ---------- */
.form { background: var(--surface-raised); padding: var(--space-6); display: grid; gap: var(--space-5); min-width: 0; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
@media (max-width: 640px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 15px; }
.field input, .field textarea, .field select { width: 100%; font: 400 16px/24px var(--font-text); color: var(--ink); background: var(--surface); border: 1px solid var(--field-border); border-radius: var(--radius-field); padding: 10px 12px; }
.field textarea { min-height: 120px; resize: vertical; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--status-reject); }
.hint { font-size: 14px; line-height: 1.4; color: var(--ink-muted); }
.field.invalid .hint, .check.invalid .hint { color: var(--status-reject); font-weight: 500; }
.check { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 4px 10px; align-items: start; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--brand); }
.check .hint { grid-column: 2; }
.form-status { padding: 12px 14px; background: var(--accent-soft); color: var(--ink); font-size: 15px; }
.form-status.err { background: var(--status-reject-soft); }
.form-narrow { max-width: 560px; }
.field input[type=file] { padding: 8px 10px; font-size: 15px; cursor: pointer; }
.file-list { list-style: none; display: grid; gap: 2px; margin-top: 4px; font: 500 13px/20px var(--font-data); }
.file-list li { background: var(--surface); padding: 6px 10px; display: flex; justify-content: space-between; gap: var(--space-3); min-width: 0; }
.file-list li span:first-child { overflow-wrap: anywhere; }
.file-list li.file-note { background: none; padding: 4px 0 0; font: 400 14px/1.4 var(--font-text); color: var(--ink-muted); }

/* ---------- Contacts, roles ---------- */
.contacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.contact { background: var(--surface-raised); padding: 16px; display: grid; gap: 4px; min-width: 0; }
.contact strong { font: 700 26px/1 var(--font-display); }
.contact .mono { font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .contacts { grid-template-columns: minmax(0, 1fr); } }

.roles { display: grid; }
.role { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-4); padding: 16px; align-items: baseline; }
.role:nth-child(odd) { background: var(--surface-raised); }
.role strong { font: 700 26px/1 var(--font-display); }
@media (max-width: 700px) { .role { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
.defects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.defect { background: var(--surface-raised); padding: var(--space-5); display: grid; gap: var(--space-3); align-content: start; min-width: 0; }
.defect-head { display: flex; justify-content: space-between; gap: var(--space-2); align-items: start; }
.defect-head strong { font: 700 28px/1 var(--font-display); }
.defect dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.defect dt { font: 500 11px/20px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.defect dd { margin: 0; }
.filter-count { margin-top: calc(var(--space-4) * -1); }
@media (max-width: 1000px) { .defects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .defects { grid-template-columns: minmax(0, 1fr); } }
.plan-main .tag-planned, .plan-main .ticks li { color: var(--vp-ink); }

/* ---------- Footer: a giant wordmark ---------- */
.site-footer { background: var(--surface); padding-block: var(--space-12) var(--space-8); }
.foot { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: var(--space-8); }
.foot h2 { font: 500 11px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: var(--space-3); }
.foot ul { list-style: none; display: grid; gap: var(--space-2); }
.foot a { color: var(--ink); text-decoration: none; font-size: 15px; }
.foot a:hover { color: var(--brand-strong); text-decoration: underline; }
.foot-brand p { color: var(--ink-muted); font-size: 15px; max-width: 40ch; }
.foot-mark { display: flex; align-items: flex-end; gap: clamp(8px, 1.5vw, 20px); margin-top: var(--space-12); color: var(--ink); overflow: hidden; }
.foot-mark svg { width: clamp(56px, 13vw, 180px); height: auto; color: var(--brand); flex: none; }
.foot-mark span { font: 800 clamp(88px, 22vw, 300px)/.74 var(--font-display); }
.foot-base { margin-top: var(--space-6); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); font: 500 11px/16px var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.foot-base .mono { color: var(--ink); user-select: all; text-transform: none; letter-spacing: 0; font-size: 13px; }
@media (max-width: 960px) { .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .foot { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
