/*
  Knoten Technologies design tokens. Single source of truth: every Knoten surface reads these
  values and defines no colour, size, space, duration or easing of its own. tokens.json is
  exported from this file by export_tokens.py; edit here, then run the export.
  Font paths are relative to this file; builds that move the CSS rewrite them.
*/

/* Type: Schibsted Grotesk, OFL 1.1 (fonts/OFL.txt). Variable wght 400 to 700, Latin subset. */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin-var.a311e9414f.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20AC, U+2122, U+2190-2193, U+2212, U+2215;
}

/* Metric-matched fallback: Arial (or its metric twin Liberation Sans) scaled to Schibsted's
   average Latin advance (45.39 vs 43.54 em per sample, 104.26%), with Schibsted's ascent
   (2000/2048) and descent (528/2048) divided by that scale, so the swap moves no line. */
@font-face {
  font-family: "Schibsted Grotesk Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans");
  size-adjust: 104.26%;
  ascent-override: 93.67%;
  descent-override: 24.73%;
  line-gap-override: 0%;
}

:root {
  /* Colour: raw palette. Never used directly by components; use the roles below. */
  --c-black: #0E0E0C;
  --c-ink: #161613;
  --c-paper: #F1EEE5;
  --c-white: #FAFAF7;
  --c-stone: #A8A59A;
  --c-graphite: #6B6960;
  --c-citron: #C9DA45;
  --c-moss: #2F3D2A; /* Optional second theme colour, undecided. Reserved: no surface uses it yet. */
  --c-white-rgb: 250 250 247;
  --c-ink-rgb: 22 22 19;
  --c-black-rgb: 14 14 12;
  --c-paper-rgb: 241 238 229;

  /* Colour roles, dark theme (the default). Measured WCAG contrast against --bg in brackets. */
  --bg: var(--c-black);
  --surface: var(--c-ink);                          /* raised area, 1.07 on bg: separate with a hairline, never by fill alone */
  --fg: var(--c-white);                             /* body and display text (18.48) */
  --fg-muted: var(--c-stone);                       /* labels, secondary text (7.83) */
  --fg-subtle: var(--c-graphite);                   /* non-text only: rules, ticks, inactive marks (3.51) */
  --line: rgb(var(--c-white-rgb) / .14);            /* hairline divider */
  --line-strong: rgb(var(--c-white-rgb) / .32);     /* diagram strokes, link underline */
  --accent: var(--c-citron);                        /* one point per view (12.51) */
  --on-accent: var(--c-black);                      /* text on a citron fill (12.51) */
  --focus: var(--c-white);                          /* focus ring (18.48) */
  --scrim: rgb(var(--c-black-rgb) / .72);           /* floor under text laid over the field */

  /* Type: one family. */
  --font-sans: "Schibsted Grotesk", "Schibsted Grotesk Fallback", Arial, sans-serif;
  --font-features: "kern" 1, "liga" 1;
  --font-features-caps: "kern" 1, "case" 1;
  --font-features-figures: "kern" 1, "tnum" 1;

  /* Type scale: perfect fourth, ratio 4:3 from 16 px, rounded to whole pixels.
     12 / 16 / 21 / 28 / 38 / 50 / 67. Fluid roles interpolate between the scale steps named as their bounds. */
  --step--1: 12px;
  --step-0: 16px;
  --step-1: 21px;
  --step-2: 28px;
  --step-3: 38px;
  --step-4: 50px;
  --step-5: 67px;

  /* Type roles: size, line height, tracking, weight. Line heights land on the 4 px half-grid at the base size. */
  --type-label-size: var(--step--1);
  --type-label-leading: 1.333;         /* 16 px */
  --type-label-tracking: .14em;        /* uppercase only */
  --type-label-weight: 500;

  --type-body-size: var(--step-0);
  --type-body-leading: 1.5;            /* 24 px */
  --type-body-tracking: 0em;
  --type-body-weight: 400;

  --type-lead-size: var(--step-1);
  --type-lead-leading: 1.333;          /* 28 px */
  --type-lead-tracking: -.006em;
  --type-lead-weight: 400;

  --type-heading-size: clamp(var(--step-2), 1.4rem + 1.25vw, var(--step-3));
  --type-heading-leading: 1.15;
  --type-heading-tracking: -.018em;
  --type-heading-weight: 500;

  --type-display-size: clamp(var(--step-2), 1rem + 3.2vw, var(--step-4));
  --type-display-leading: 1.08;
  --type-display-tracking: -.024em;
  --type-display-weight: 450;

  --measure-text: 60ch;                /* body copy line length */
  --measure-display: 22ch;             /* display line length */

  /* Space: 8 px scale, with 4 px only for optical offsets inside components. */
  --space-0: 4px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;
  --space-8: 128px;
  --space-9: 192px;
  --gutter: clamp(var(--space-2), 4vw, var(--space-6));       /* page side margin */
  --section-gap: clamp(var(--space-7), 12vw, var(--space-9)); /* between page sections */
  --content-max: 1312px;                                     /* 1440 minus two 64 px gutters */

  /* Shape. Corners are square; the only radius is the point. */
  --radius-0: 0;
  --radius-point: 50%;
  --hairline: 1px;
  --rule: 1px solid var(--line);
  --rule-strong: 1px solid var(--line-strong);
  --focus-ring: 1px solid var(--focus);
  --focus-offset: var(--space-0);
  --point-size: 6px;                   /* junction dot in diagrams */

  /* Motion: one curve for arrivals, one for state changes. Nothing moves without a reason. */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur-1: 160ms;                      /* hover, focus */
  --dur-2: 320ms;                      /* state change, underline */
  --dur-3: 720ms;                      /* scroll reveal */
  --dur-4: 1200ms;                     /* signature: wordmark, one per page */
  --reveal-distance: var(--space-2);
  --stagger: 80ms;

  /* Grain: SVG fractal noise tinted white, fixed over the page, never animated faster than 60 s. */
  --grain-frequency: .85;
  --grain-octaves: 2;
  --grain-opacity: .06;
  --grain-drift: 90s;

  /* Layers. */
  --z-field: 0;
  --z-content: 1;
  --z-header: 10;
  --z-grain: 100;

  /* Breakpoints, mirrored by literal values in media queries (custom properties cannot be used there). */
  --bp-sm: 640px;
  --bp-md: 960px;
  --bp-lg: 1280px;
  --bp-short: 480px;                   /* height below which landscape layouts compress */
}

/* Light theme roles, for print, documents and any future light surface. */
:root[data-theme="light"], .theme-light {
  --bg: var(--c-paper);
  --surface: var(--c-white);
  --fg: var(--c-ink);                               /* 15.63 */
  --fg-muted: var(--c-graphite);                    /* 4.75 */
  --fg-subtle: var(--c-graphite);                   /* non-text only (4.75) */
  --line: rgb(var(--c-ink-rgb) / .14);
  --line-strong: rgb(var(--c-ink-rgb) / .32);
  --accent: var(--c-citron);                        /* fill only on light: 1.33 as a mark, 11.74 under ink text */
  --on-accent: var(--c-ink);
  --focus: var(--c-ink);
  --scrim: rgb(var(--c-paper-rgb) / .72);
  --grain-opacity: .05;
}

/* One block per product. Each remaps the site's role names to the product's own brand values and adds the brand
   roles used by plates and product pages. Every value is copied from the product's own files; a brand change
   there is copied here. Raw values are allowed in this file only, and only inside these blocks. */

/* Kelter. Source: docs/brand/IDENTITY.md and apps/web/brand in joshuaoben/outreach-engine (origin/main). */
[data-brand="kelter"] {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --fg-muted: #525252;
  --line: #e5e5e5;
  --focus: #0a0a0a;
  --brand-font: "Inter", Arial, sans-serif;
  --brand-heading-weight: 600;
  --brand-heading-track: -0.02em;
  --brand-accent: #0a0a0a;
  --brand-button-bg: #0a0a0a;
  --brand-button-fg: #ffffff;
  --brand-radius-control: 8px;
  --brand-radius-frame: 12px;
  --kelter-outreach: #4338ca;
  --kelter-social: #be185d;
  --kelter-studio: #0f766e;
  --brand-stage: #fafafa;
  --brand-elev: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px rgb(0 0 0 / .10);
  --brand-elev-stage: 0 24px 64px rgb(0 0 0 / .45);
}

/* Plainwing. Source: plainwing.com css (b-4ccf2429e8.css; verdict hues from b-70d6a74e95.css, which draws no shadow outside overlays) and Knoten-Tech/plainwing-site public/brand7. */
[data-brand="plainwing"] {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --fg-muted: #3f3f46;
  --line: #e8e8e6;
  --focus: #2b5cf0;
  --brand-font: "Inter", Arial, sans-serif;
  --brand-heading-weight: 600;
  --brand-heading-track: -0.02em;
  --brand-accent: #2b5cf0;
  --brand-button-bg: #0a0a0a;
  --brand-button-fg: #ffffff;
  --brand-radius-control: 6px;
  --brand-radius-frame: 12px;
  --brand-stage: #fafafa;
  --brand-elev: none;
  --brand-elev-stage: 0 24px 64px rgb(0 0 0 / .45);
  --pw-verified: #16a34a;
  --pw-not-tested: #b45309;
  --pw-failed: #dc2626;
  --pw-unverified: #71717a;
}

/* Knoten Boards. Source: brand/brand.json and brand/BRAND.md in Knoten-Tech/boardkit (origin/main); stage is core/ui/tokens.css --bg-2, and shadows sit only on floating layers, so the window has none. */
[data-brand="boards"] {
  --bg: #ffffff;
  --fg: #111111;
  --fg-muted: #555555;
  --line: #e8e8e6;
  --focus: #111111;
  --brand-font: "Schibsted Grotesk", "Schibsted Grotesk Fallback", Arial, sans-serif;
  --brand-heading-weight: 650;
  --brand-heading-track: -0.02em;
  --brand-accent: #111111;
  --brand-button-bg: #111111;
  --brand-button-fg: #ffffff;
  --brand-radius-control: 6px;
  --brand-radius-frame: 12px;
  --brand-stage: #fafafa;
  --brand-elev: none;
  --brand-elev-stage: none;
}

/* Knoten site styles. Knoten tokens (../brand/system/tokens.css) and the brand blocks (brands.css) come first.
   Outside :root and the media query lines, every colour, size and duration is a token. VISUAL-SPEC.md owns the values. */

:root {
  --control-h: 44px;
  --mark-w: 32px;
  --mark-h: 20px;
  --lockup-h: 28px;
  --lockup-site: 20px;
  --header-h: 56px;
  --gap: 16px;
  --rule-hover: 2px;
  --focus-w: 2px;
  --stroke-w: 1;
  --stroke-w-more: 2;

  /* Type scale (VISUAL-SPEC 3.2): fluid from the 390 value to the 1440 value. */
  --t-display: clamp(44px, 27.29px + 4.286vw, 89px);
  --t-product: clamp(38px, 27.23px + 2.762vw, 67px);
  --t-show: clamp(32px, 25.31px + 1.714vw, 50px);
  --t-section: clamp(28px, 24.29px + .952vw, 38px);
  --t-figure: clamp(34px, 28.06px + 1.524vw, 50px);
  --t-lead: clamp(18px, 16.89px + .286vw, 21px);
  --t-body: 16px;
  --t-cap: 14px;
  --lead-size: var(--t-lead);

  /* Rhythm (VISUAL-SPEC 3.3). */
  --plate-pad: 64px;
  --seam: 24px;
  --stack-head: 20px;
  --stack-stage: 40px;
  --opening-pad: 48px;
  --index-gap: 40px;
  --hero-gap: 48px;

  /* Windows and stages. */
  --bar-h: 36px;
  --win-dot: 8px;
  --radius-ring: 8px;
  --row-h: 48px;
  --bracket-w: 12px;
  --cn-w: 24px;
  --cn-h: 28px;
  --node-pad: 12px;
  --jn: 6px;
  --tok: 6px;
  --diff-bar: 6px;
  --gut: 24px;
  --tile-h: 96px;
  --mark-index: 20px;
  --mark-tl: 16px;
  --nf-mark: 40px;
  --viewer-btn: 44px;
  --btn-pad: 22px;

  /* Devices: Mac and phone frames drawn in CSS, and the card and icon sizes shared by every product section. */
  --device-body: #1b1b1a;
  --device-rim: #3b3b39;
  --device-base-a: #dcdbd6;
  --device-base-b: #b4b3ad;
  --shadow-dev: 0 32px 64px -24px rgb(0 0 0 / .38), 0 12px 24px -12px rgb(0 0 0 / .22);
  --mac-bezel: 10px;
  --mac-r: 14px;
  --mac-sr: 6px;
  --mac-base-h: 14px;
  --mac-base-r: 14px;
  --cam: 5px;
  --phone-r: 38px;
  --phone-bezel: 8px;
  --phone-w: 358px;
  --side-w: 358px;
  --par: 340 / 660;
  --gal-w: min(360px, calc(100vw - var(--gutter) * 2));
  --gal-ar: 4 / 5;
  --fold-h: 56px;
  --icon-tile: 44px;
  --foot-icon: 44px;


  /* Motion (VISUAL-SPEC 3.4). */
  --ease-ui: cubic-bezier(.23, 1, .32, 1);
  --dur-press: 120ms;
  --dur-hover: 160ms;
  --dur-tab: 240ms;
  --dur-enter: 480ms;
  --dur-hero: 720ms;
  --tab-dwell: 6s;
  --hop: 360ms;
  --failsafe: 4s;
  --enter-rise: 24px;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var-latin.c940764593.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20AC, U+2122, U+2190-2193, U+2212, U+2215;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-feature-settings: var(--font-features);
  font-size: var(--t-body);
  line-height: var(--type-body-leading);
  overflow-wrap: break-word;
}
img, svg, video { display: block; max-width: 100%; }
p, li, dd, dt, figcaption { text-wrap: pretty; margin: 0; }
h1, h2, h3 { text-wrap: balance; margin: 0; font-size: var(--t-section); line-height: 1.12; letter-spacing: -.02em; font-weight: var(--type-heading-weight); }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
dd { margin: 0; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--t-body); }

a { color: inherit; text-decoration-line: underline; text-decoration-thickness: var(--hairline); text-underline-offset: var(--space-0); transition: text-decoration-thickness var(--dur-hover) var(--ease-ui); }
a:hover, a:focus-visible { text-decoration-thickness: var(--rule-hover); }
a:visited { color: inherit; }
:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-w); }

.wrap { width: 100%; max-width: calc(var(--content-max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: var(--space-2); top: var(--space-2); z-index: var(--z-header); padding: var(--space-1) var(--space-2); background: var(--fg); color: var(--bg); transform: translateY(-300%); }
.skip:focus { transform: none; }
.vh { position: absolute; width: var(--hairline); height: var(--hairline); overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header and footer: Knoten ground on every page. The header sticks; its hairline shows once the page has scrolled under it. */
.site-header { position: sticky; top: 0; background: var(--c-black); color: var(--c-white); z-index: var(--z-header); }
.site-header.scrolled { border-bottom: var(--rule); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--space-3); }
.brand { display: block; text-decoration: none; }
.brand .lockup { height: var(--lockup-site); width: auto; fill: currentColor; }
.primary { display: none; }
.primary ul { display: flex; gap: var(--space-4); }
.primary a, .menu nav a { text-decoration: none; display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-h); position: relative; }
.primary a::after { content: ""; position: absolute; left: 0; right: 0; bottom: var(--space-1); height: var(--hairline); background: currentColor; transform: scaleY(0); transform-origin: bottom; transition: transform var(--dur-hover) var(--ease-ui); }
.primary a:hover::after, .primary a:focus-visible::after { transform: scaleY(var(--rule-hover)); }
[aria-current="page"]::before { content: ""; width: var(--point-size); height: var(--point-size); border-radius: var(--radius-point); background: var(--accent); flex: none; }
.menu summary { list-style: none; cursor: pointer; min-height: var(--control-h); display: inline-flex; align-items: center; padding-inline: var(--space-1); }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--c-black); border-bottom: var(--rule); padding: var(--space-1) var(--gutter) var(--space-3); }
.menu nav li + li { border-top: var(--rule); }
.menu nav a { display: flex; width: 100%; }
.site-header .bar > .menu { position: static; }

.site-footer { background: var(--c-black); color: var(--c-white); border-top: var(--rule); padding-block: var(--space-6); }
.site-footer a { color: var(--c-white); }

/* Type roles. */
.lead { font-size: var(--t-lead); line-height: 1.4; letter-spacing: -.006em; }
.muted { color: var(--fg-muted); }
.page .muted { color: var(--c-stone); }
.display, .opening h1 { font-size: var(--t-display); line-height: 1; letter-spacing: -.035em; font-weight: 500; }
.section-h { font-size: var(--t-section); }
.cap, figcaption { font-size: var(--t-cap); line-height: 1.43; letter-spacing: .005em; color: var(--fg-muted); }
.textbtn { font: inherit; font-size: var(--t-cap); font-weight: 600; color: inherit; background: transparent; border: 0; padding: 0 var(--space-1); min-height: var(--control-h); cursor: pointer; text-decoration: underline; text-decoration-thickness: var(--hairline); text-underline-offset: var(--space-0); }
.textbtn:hover { text-decoration-thickness: var(--rule-hover); }
.textbtn[hidden] { display: none; }

/* Knoten pages. */
.page { padding-block: var(--opening-pad) var(--section-gap); background: var(--c-black); color: var(--c-white); }
.ledger { display: grid; grid-template-columns: 1fr; row-gap: var(--space-3); padding-block: var(--space-6); border-top: var(--rule); }
.intro { display: grid; grid-template-columns: 1fr; row-gap: var(--stack-head); padding-bottom: var(--space-6); }

/* Home opening and hero stage. */
.opening { padding-top: var(--opening-pad); background: var(--c-black); color: var(--c-white); overflow: hidden; }
.opening-grid { display: grid; grid-template-columns: 1fr; row-gap: var(--stack-head); }
.index { position: relative; margin-top: var(--index-gap); display: grid; grid-template-columns: 1fr; }
.index .point { position: absolute; left: 0; top: 0; width: var(--point-size); height: var(--point-size); border-radius: var(--radius-point); background: var(--accent); transform: translateY(-50%); }
.index li { border-top: var(--rule); }
.index li.on { border-top: var(--rule-hover) solid var(--accent); margin-top: calc(var(--hairline) - var(--rule-hover)); }
.index a { display: grid; grid-template-columns: var(--mark-index) 1fr var(--space-2); column-gap: var(--space-2); padding-block: var(--space-2); text-decoration: none; color: var(--c-white); align-items: start; height: 100%; }
.index img { height: var(--mark-index); width: auto; max-width: var(--mark-w); margin-top: var(--space-0); }
.index .name { display: block; font-size: var(--t-lead); font-weight: 600; line-height: 1.4; }
.index .what { display: block; color: var(--c-stone); }
.index .arrow { margin-top: var(--space-1); color: var(--c-white); transition: transform var(--dur-hover) var(--ease-ui); }
.index a:hover .arrow, .index a:focus-visible .arrow { transform: translateX(var(--space-0)); }
.index a:hover .name, .index a:focus-visible .name { text-decoration: underline; text-decoration-thickness: var(--hairline); text-underline-offset: var(--space-0); }


/* Windows: a product's own frame around a real screen. */

/* Entrance: once per stage. The start state exists only when the script has marked the page. */
.js [data-enter]:not(.in) { opacity: .001; transform: translateY(var(--enter-rise)); animation: failsafe var(--hop) var(--ease-out) var(--failsafe) forwards; }
.js [data-enter] { transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out); }
@keyframes failsafe { to { opacity: 1; transform: none; } }

/* Plates and product pages: the product's own ground, type and colour. */
[data-brand] { background: var(--bg); color: var(--fg); font-family: var(--brand-font); }
[data-brand] h1, [data-brand] h2, [data-brand] h3 { font-weight: var(--brand-heading-weight); letter-spacing: var(--brand-heading-track); }
[data-brand] a { text-decoration-color: currentColor; }
[data-brand] ::selection { background: var(--line); }
.plate { padding-block: var(--plate-pad); }
.plate + .plate { border-top: var(--hairline) solid var(--line); }
.plate-head { display: grid; grid-template-columns: 1fr; row-gap: var(--stack-head); }
.head-main { display: contents; }
.plate-head .lead { order: 3; }
.plate-head .actions { order: 5; }
.h-show { font-size: var(--t-show); line-height: 1.08; }
.plate h2.h-show, .product h1 { text-wrap: balance; }
.lockup-link { display: block; align-self: start; justify-self: start; text-decoration: none; }
.lockup-img { height: var(--lockup-h); width: auto; }
.stage-slot, .diagram-slot { margin-top: var(--stack-stage); }
.accent { color: var(--brand-accent); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-h); padding-inline: var(--btn-pad); background: var(--brand-button-bg); color: var(--brand-button-fg); border-radius: var(--brand-radius-control); font-weight: 600; text-decoration: none; transition: background-color var(--dur-hover) var(--ease-ui), transform var(--dur-press) var(--ease-ui); }
.btn:visited { color: var(--brand-button-fg); }
.btn:hover { background: color-mix(in srgb, var(--brand-button-bg), var(--c-black) 8%); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline-offset: var(--focus-w); }
.cmd { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.cmd code { padding: var(--space-1) var(--space-2); border: var(--hairline) solid var(--line); border-radius: var(--brand-radius-control); }
.copy { min-height: var(--control-h); padding-inline: var(--space-2); background: transparent; color: var(--fg); border: var(--hairline) solid var(--line); border-radius: var(--brand-radius-control); font: inherit; cursor: pointer; transition: background-color var(--dur-hover) var(--ease-ui); }
.copy:hover { background: var(--line); }
.page .copy { color: var(--c-white); border-color: var(--line); }
.copy[hidden] { display: none; }

/* Showcase stage: tabs. */
.stage { display: block; }
.tabrow { display: flex; align-items: flex-end; gap: var(--space-2); }
.tabs { display: flex; flex: 1; gap: var(--space-4); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.tabs li { scroll-snap-align: start; flex: none; }
.tab { display: block; text-decoration: none; font-size: var(--t-cap); font-weight: 600; letter-spacing: .005em; color: var(--fg-muted); padding-top: var(--space-1); min-height: var(--control-h); }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"], .js-tabs .tab.on { color: var(--fg); }
.track { display: block; height: var(--rule-hover); background: var(--line); margin-top: var(--space-1); overflow: hidden; }
.track i { display: block; width: 100%; height: 100%; background: var(--fg); transform: scaleX(0); transform-origin: left; }
.tab.on .track i { transform: none; }
.stage[data-run="on"] .tab.on .track i { animation: fill var(--tab-dwell) linear forwards; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.shot { position: absolute; inset: 0; }
.js .stage-tabs .shot { opacity: 0; transition: opacity var(--dur-tab) var(--ease-ui); }
.js .stage-tabs .shot.on { opacity: 1; }
.js .stage-tabs .shot { z-index: 0; }
.stage .cap { margin-top: var(--space-2); }

/* Showcase stage: clip. */
.stage-main { min-width: 0; }
.clip .mac-screen picture, .clip .mac-screen img, .clip .mac-screen video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: left top; }
.clip video { opacity: 0; }
.clip.live video { opacity: 1; }
.clipbtn { position: absolute; right: var(--space-1); bottom: var(--space-1); background: var(--brand-stage); border: var(--hairline) solid var(--line); border-radius: var(--brand-radius-control); color: var(--fg); }
.scale { display: grid; grid-template-columns: 1fr var(--bracket-w) auto; grid-template-rows: repeat(5, var(--row-h)); column-gap: var(--space-1); margin-top: var(--stack-head); align-content: start; }
.verdict-list { display: contents; }
.verdict-list li { grid-column: 1; display: flex; align-items: center; gap: var(--space-1); font-size: var(--t-body); }
.verdict-list b { font-weight: var(--brand-heading-weight); }
.vd { width: var(--win-dot); height: var(--win-dot); border-radius: var(--radius-point); background: var(--vd); flex: none; }
.vd-ring { background: transparent; border: var(--hairline) solid var(--vd); }
.vd-none { background: transparent; }
.br { grid-column: 2; border: var(--hairline) solid var(--fg); margin-block: var(--space-0); }
.br { border-left-width: 0; }
.br-pass { grid-row: 1; }
.br-not { grid-row: 2 / span 4; }
.bl { grid-column: 3; align-self: center; font-size: var(--t-cap); font-weight: 600; }
.bl-pass { grid-row: 1; }
.bl-not { grid-row: 2 / span 4; }

/* Mechanism diagram. */
.diagram { margin-top: 0; }
.dhead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-4); }
.dtitle { font-size: var(--t-lead); line-height: 1.3; }
.dgrid { position: relative; display: flex; flex-direction: column; }
.dgrid .cn { display: none; }
.dgrid .cn.stopcell { display: block; padding-block: var(--space-1); }
.dgrid .cn.stopcell svg, .dgrid .cn.stopcell .jn { display: none; }
.cl { display: block; font-size: var(--t-cap); font-weight: 600; text-align: center; }
.node { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-1); align-items: start; padding: var(--node-pad) var(--space-2); border: var(--hairline) solid var(--fg); border-radius: var(--brand-radius-control); font-size: var(--t-cap); line-height: 1.43; background: var(--bg); }
.node .lab { grid-column: 2; font-weight: 600; display: inline-flex; align-items: center; gap: var(--space-1); }
.node:not(:has(.step)) .lab { grid-column: 1 / -1; }
.node .step { font-feature-settings: var(--font-features-figures); font-weight: 600; }
.node .sub { grid-column: 2; display: block; color: var(--fg-muted); font-weight: 400; }
.node:not(:has(.step)) .sub { grid-column: 1 / -1; }
.node.fill { background: var(--fg); color: var(--bg); }
.node.fill .sub { color: var(--bg); }
.node.outl { border-width: var(--rule-hover); }
.node code { font-size: inherit; }
.proofs { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--space-0) var(--space-1); margin-top: var(--space-0); }
.proofs span { padding: 0 var(--space-1); border: var(--hairline) solid var(--line); border-radius: var(--brand-radius-control); color: var(--fg-muted); font-weight: 400; }
.vc { display: block; height: var(--cn-h); }
.vc:last-child { display: none; }
.vc svg { width: 100%; height: 100%; overflow: visible; }
.cn svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.vc path, .cn path { stroke: var(--fg); stroke-width: var(--stroke-w); fill: none; vector-effect: non-scaling-stroke; }
.vc svg { width: var(--space-3); margin-inline: auto; }
.cn { position: relative; }
.jn { position: absolute; left: 50%; top: 50%; width: var(--jn); height: var(--jn); margin: calc(var(--jn) / -2) 0 0 calc(var(--jn) / -2); border-radius: var(--radius-point); background: var(--fg); }
.tok { position: absolute; left: 0; top: 0; width: var(--tok); height: var(--tok); margin: calc(var(--tok) / -2) 0 0 calc(var(--tok) / -2); border-radius: var(--radius-point); background: var(--fg); opacity: 0; z-index: 3; transition: transform var(--hop) var(--ease-in-out), opacity var(--dur-hover) linear; }
.tok.show { opacity: 1; }
.diff { display: block; grid-column: 1 / -1; }
.diff-lines { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-2); }
.cl-line { display: flex; align-items: center; gap: var(--space-1); }
.gut { width: var(--gut); display: flex; justify-content: center; }
.gd { width: var(--jn); height: var(--jn); border-radius: var(--radius-point); }
.gd-ran { background: var(--fg); }
.gd-no { border: var(--hairline) solid var(--fg); }
.dbar { height: var(--diff-bar); background: var(--line); display: block; }
.cl-line.chg .dbar { background: var(--fg-muted); }
.diff-cap { display: block; margin-top: var(--space-1); font-size: var(--t-cap); color: var(--fg-muted); }
.js .dgrid:not(.drawn) .node { opacity: 0; animation: failsafe var(--hop) var(--ease-out) var(--failsafe) forwards; }
.dgrid.drawn .node { opacity: 1; transition: opacity var(--dur-hover) var(--ease-ui) calc(var(--i, 0) * var(--stagger)); }

/* In brief strip. */
.figs { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4) var(--gap); padding-top: var(--space-4); border-top: var(--hairline) solid var(--line); margin-bottom: var(--space-5); }
.fig { display: block; font-size: var(--t-figure); line-height: 1; letter-spacing: -.03em; font-weight: var(--brand-heading-weight); font-feature-settings: var(--font-features-figures); }
.figlab { display: block; margin-top: var(--space-1); color: var(--fg-muted); }

/* Gallery and viewer. */
.gallery { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.thumb { display: block; text-decoration: none; }
.thumb-frame { position: relative; display: block; border: var(--hairline) solid var(--line); border-radius: var(--brand-radius-frame); overflow: hidden; background: var(--brand-stage); aspect-ratio: 16 / 10; box-shadow: var(--brand-elev); transition: transform var(--dur-hover) var(--ease-ui); }
.thumb:hover .thumb-frame { transform: translateY(calc(var(--space-0) * -1)); }
.thumb .g-d img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.g-m { display: none; }
.viewer { border: 0; padding: 0; margin: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; background: var(--c-black); color: var(--c-white); }
.viewer::backdrop { background: var(--c-black); }
.viewer-in { position: relative; display: flex; flex-direction: column; height: 100%; padding: var(--space-3); gap: var(--space-2); }
.viewer img { flex: 1; min-height: 0; width: 100%; height: 100%; object-fit: contain; transition: transform var(--dur-tab) var(--ease-out); touch-action: pan-y; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.viewer-bar p { color: var(--c-stone); }
.viewer button { min-width: var(--viewer-btn); min-height: var(--viewer-btn); background: transparent; color: var(--c-white); border: var(--hairline) solid var(--line-strong); font: inherit; cursor: pointer; }

/* Product page. */
.product { padding-bottom: var(--section-gap); }
.product-head { padding-block: var(--opening-pad) 0; display: flex; flex-direction: column; gap: var(--stack-head); }
.product h1 { font-size: var(--t-product); line-height: 1.04; }
.product .ledger { border-top: var(--hairline) solid var(--line); }
.product .stage-slot { margin-top: var(--stack-stage); }
.product .diagram-slot { margin-top: var(--stack-stage); }
.rows > div { padding-block: var(--space-2); border-top: var(--hairline) solid var(--line); }
.rows > div:first-child { border-top: 0; padding-top: 0; }
.rows dt { font-size: var(--t-lead); line-height: 1.3; font-weight: var(--brand-heading-weight); }
.foldbtn-facts { display: none; }
.facts > div { display: grid; grid-template-columns: 1fr; padding-block: var(--space-1); border-top: var(--hairline) solid var(--line); }
.facts > div:first-child { border-top: 0; }
.page .facts > div { border-top: var(--rule); }
.facts dt { color: var(--fg-muted); }
.page .facts dt { color: var(--c-stone); }
.foot-note { margin-top: var(--space-3); }
.closing { padding-block: var(--space-6) 0; display: flex; flex-direction: column; gap: var(--space-3); border-top: var(--hairline) solid var(--line); }
.closing-line { font-size: var(--t-section); line-height: 1.12; letter-spacing: -.02em; font-weight: var(--brand-heading-weight); }

/* Company: house diagram and release timeline. */
.house { display: grid; justify-items: center; margin-bottom: var(--space-6); }
.house-top .lockup { height: var(--space-4); width: auto; fill: currentColor; }
.house-lines { width: 100%; height: var(--space-7); }
.house-lines path { stroke: var(--line-strong-c, var(--c-stone)); stroke-width: var(--stroke-w); fill: none; vector-effect: non-scaling-stroke; }
.hl-d { display: none; }
.hl-m { width: var(--space-3); height: var(--space-5); }
.house-tiles { display: grid; grid-template-columns: 1fr; gap: var(--space-3); width: 100%; }
.house-tiles li { display: flex; flex-direction: column; gap: var(--space-1); }
.tile { display: flex; align-items: center; justify-content: center; min-height: var(--tile-h); background: var(--c-white); }
.tile img { height: var(--space-4); width: auto; max-width: 70%; }
.since { color: var(--c-stone); }
.timeline { margin-top: var(--space-5); }
.timeline li { display: grid; grid-template-columns: 1fr; column-gap: var(--gap); padding-block: var(--space-3); }
.timeline time { font-feature-settings: var(--font-features-figures); font-size: var(--t-lead); line-height: 1.4; }
.rel-node { display: none; position: relative; justify-content: center; align-items: center; }
.rel-rule { position: absolute; left: 50%; top: calc(var(--space-3) * -1); bottom: calc(var(--space-3) * -1); width: var(--hairline); background: var(--c-graphite); }
.timeline li:first-child .rel-rule { top: 50%; }
.timeline li:last-child .rel-rule { bottom: 50%; }
.rel-node img { position: relative; background: var(--c-black); padding-block: var(--space-0); height: calc(var(--mark-tl) + var(--space-1)); width: auto; }
.rel-product { font-weight: 600; font-size: var(--t-lead); }
.rel-text { font-size: var(--t-lead); line-height: 1.4; display: block; }
.nf-links, .nf-marks { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); }
.nf-marks img { height: var(--nf-mark); width: auto; }
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.display-link { font-size: var(--t-display); line-height: 1; letter-spacing: -.035em; font-weight: 500; text-decoration-thickness: var(--hairline); overflow-wrap: anywhere; }
.facts.big dd, .facts.big dt { font-size: var(--t-lead); line-height: 1.4; }
.facts.big dd .copy { margin-left: var(--space-1); font-size: var(--t-body); }

@keyframes rise { from { transform: translateY(var(--reveal-distance)); } to { transform: none; } }
@keyframes resolve { from { opacity: 0; } to { opacity: 1; } }
.opening .rise { animation: rise var(--dur-hero) var(--ease-out) backwards; }
.opening .lead.rise { animation-delay: var(--stagger); }
.opening .index.rise { animation-delay: calc(var(--stagger) * 2); }
.opening .index .point { animation: resolve var(--dur-hero) var(--ease-out) calc(var(--stagger) * 5) backwards; }

/* Footer: wordmark and line, then grouped columns on the page grid. */
.site-footer { background: var(--c-black); color: var(--c-white); border-top: var(--rule); padding-block: var(--space-6) var(--space-4); }
.foot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--gap); }
.foot-brand, .fc-3 { grid-column: 1 / -1; }
.foot-brand .brand { display: inline-block; }
.foot-brand p { margin-top: var(--space-2); color: var(--c-stone); }
.foot-h { font-size: var(--t-cap); font-weight: 500; line-height: 1.4; color: var(--c-stone); margin-bottom: var(--space-1); letter-spacing: 0; }
.foot-col a { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-h); text-decoration: none; color: var(--c-white); transition: color var(--dur-hover) var(--ease-ui); }
.foot-col a:hover, .foot-col a:focus-visible { color: var(--accent); }
.fmark { display: inline-grid; place-items: center; width: var(--space-4); }
.fmark img { height: var(--mark-tl); width: auto; }
.foot-social { display: flex; gap: var(--space-1); margin-bottom: var(--space-1); }
.foot-col a.soc { justify-content: center; width: var(--foot-icon); height: var(--foot-icon); border: var(--hairline) solid var(--line); border-radius: var(--brand-radius-control, var(--space-1)); }
.foot-col a.soc:hover, .foot-col a.soc:focus-visible { border-color: var(--accent); }
.foot-year { margin-top: var(--space-5); padding-top: var(--space-3); border-top: var(--rule); color: var(--c-stone); font-size: var(--t-cap); }

/* Devices: a Mac frame with a cropped screen, and a phone frame, drawn in CSS. */
.dev { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); align-items: end; }
.dev-mac { min-width: 0; }
.dev-phone, .dev-legend { display: none; }
.mac { position: relative; }
.mac-lid { position: relative; background: var(--device-body); border-radius: var(--mac-r) var(--mac-r) var(--mac-sr) var(--mac-sr); padding: calc(var(--mac-bezel) * 1.4) var(--mac-bezel) var(--mac-bezel); box-shadow: var(--shadow-dev), inset 0 0 0 var(--hairline) var(--device-rim); }
.mac-lid::after { content: ""; position: absolute; top: calc(var(--mac-bezel) * .6); left: 50%; width: var(--cam); height: var(--cam); border-radius: var(--radius-point); background: var(--device-rim); transform: translateX(-50%); }
.mac-screen { position: relative; overflow: hidden; border-radius: var(--mac-sr); aspect-ratio: var(--ar); background: var(--brand-stage, var(--c-white)); }
.mac-base { position: relative; height: var(--mac-base-h); margin-inline: calc(var(--mac-bezel) * -.5); border-radius: 0 0 var(--mac-base-r) var(--mac-base-r); background: linear-gradient(var(--device-base-a), var(--device-base-b)); box-shadow: 0 var(--space-3) var(--space-4) calc(var(--space-1) * -1) color-mix(in srgb, var(--c-black) 40%, transparent); }
.mac-base::after { content: ""; position: absolute; top: 0; left: 50%; width: 16%; height: 50%; transform: translateX(-50%); border-radius: 0 0 var(--space-0) var(--space-0); background: color-mix(in srgb, var(--device-base-b) 78%, var(--c-black)); }
.crop { position: absolute; inset: 0; display: block; overflow: hidden; }
.win-body .crop picture { position: absolute; display: block; width: calc(100% / var(--cw)); height: auto; left: calc(var(--cx) / var(--cw) * -100%); top: calc(var(--cy) / var(--cw) * -100%); }
.win-body .crop img { display: block; width: 100%; height: auto; max-width: none; object-fit: fill; }
.phone { width: 100%; max-width: var(--phone-w); margin-inline: auto; padding: var(--phone-bezel); border-radius: var(--phone-r); background: var(--device-body); box-shadow: var(--shadow-dev), inset 0 0 0 var(--hairline) var(--device-rim); }
.phone-screen { position: relative; aspect-ratio: var(--par); overflow: hidden; border-radius: calc(var(--phone-r) - var(--phone-bezel)); background: var(--c-white); }
.zoom { position: absolute; inset: 0; display: block; overflow: hidden; }
.zoom picture { position: absolute; display: block; width: calc(var(--zs) / var(--zw) * 100%); left: calc(var(--zx) / var(--zw) * -100%); top: calc(var(--zy) / var(--zh) * -100%); }
.zoom img { display: block; width: 100%; height: auto; max-width: none; }
.dev-legend { padding: var(--space-3); border: var(--hairline) solid var(--line); border-radius: var(--brand-radius-frame); align-self: center; }
.dev-legend h3 { font-size: var(--t-lead); line-height: 1.25; margin-bottom: var(--space-2); }
.dev-legend .scale { margin-top: 0; }
.states > div + div { margin-top: var(--space-2); }
.states dd { margin-top: var(--space-1); color: var(--fg-muted); }
.chip { display: inline-block; padding: var(--space-0) var(--space-1); border: var(--hairline) solid var(--line); border-radius: var(--brand-radius-control); font-size: var(--t-cap); font-weight: 600; }
.chip-proved { background: var(--fg); color: var(--bg); border-color: var(--fg); }

@media (max-width: 639px) {
  :root { --plate-pad: 48px; }
  :root { --t-display: 40px; }
  .card { padding: var(--space-2); }
  .card p { font-size: var(--t-cap); line-height: 1.45; }
  .plate .cmd { display: none; }
  .tabrow { flex-wrap: wrap; }
  .tabs { flex-wrap: wrap; overflow: visible; gap: 0 var(--space-3); }
  .index .what { display: none; }
  .index a { align-items: center; min-height: var(--control-h); }
  .index .arrow { margin-top: 0; }
  .dev-mac { display: none; }
  .dev-phone { display: block; }
  .plate-dev { display: none; }
}
@media (min-width: 1280px) {
  .dev { grid-template-columns: minmax(0, 1fr) var(--side-w); }
  .dev-phone:not(.small-only), .dev-legend { display: block; }
  .dev.dev-solo { grid-template-columns: minmax(0, 1fr); }
}

/* Hero: one product at a time, chosen in the index above; every product is shown whole when script is off. */
.hero-devices { margin-top: var(--hero-gap); padding-bottom: var(--space-6); }
.dev-panel + .dev-panel { margin-top: var(--stack-stage); }
.js .dev-panel:not(.on) { display: none; }
.js .dev-panel.on.swap { animation: panel-in var(--dur-tab) var(--ease-ui); }
@keyframes panel-in { from { opacity: .001; } to { opacity: 1; } }
.dev-panel .cap { margin-top: var(--space-2); color: var(--c-stone); }
.plate-dev { margin-top: var(--stack-stage); }

/* Product sections: three cards, one icon language, equal size. */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); margin-top: var(--space-4); }
.card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-2); align-items: start; padding: var(--space-3); border: var(--hairline) solid var(--line); border-radius: var(--brand-radius-frame); background: var(--brand-stage); }
.ico { display: grid; place-items: center; width: var(--icon-tile); height: var(--icon-tile); border-radius: var(--brand-radius-control); background: color-mix(in srgb, var(--c) 10%, var(--bg)); color: var(--c); }
.card h3 { font-size: var(--t-lead); line-height: 1.25; }
.card p { margin-top: var(--space-0); color: var(--fg-muted); }
.card .num { position: absolute; top: var(--space-3); right: var(--space-3); font-size: var(--t-cap); font-feature-settings: var(--font-features-figures); color: var(--fg-muted); }
.cards-slot { margin-top: var(--space-4); }
.cards-slot .cards { margin-top: 0; }
@media (min-width: 960px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--space-5); }
  .card { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-2); padding: var(--space-4); }
  .cards-slot { margin-top: var(--space-5); }
}

/* Mechanism on phones and tablets: a numbered step strip in place of the diagram. */
.mech .diagram { display: none; }
.steps-wrap .dtitle { margin-bottom: var(--space-2); }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); }
.steps li { display: flex; align-items: center; gap: var(--space-1); min-height: var(--control-h); padding: var(--space-1) var(--space-2); border: var(--hairline) solid var(--line); border-radius: var(--brand-radius-control); font-size: var(--t-cap); line-height: 1.3; }
.steps li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.steps .n { flex: none; display: grid; place-items: center; width: var(--space-3); height: var(--space-3); border-radius: var(--radius-point); background: var(--fg); color: var(--bg); font-weight: 600; font-feature-settings: var(--font-features-figures); }
@media (min-width: 960px) {
  .steps-wrap { display: none; }
  .mech .diagram { display: block; }
  .foot-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / span 4; }
  .fc-1 { grid-column: 5 / span 3; }
  .fc-2 { grid-column: 8 / span 2; }
  .fc-3 { grid-column: 10 / span 3; }
}

@media (prefers-reduced-motion: reduce) {
  .opening .rise, .opening .index .point { animation: none; }
  .js [data-enter]:not(.in) { transform: none; }
  .js [data-enter] { transition: opacity var(--dur-hover) linear; }
  .js .dgrid:not(.drawn) .node { opacity: 1; animation: none; }
  .stage[data-run="on"] .tab.on .track i { animation: none; transform: none; }
  .thumb:hover .thumb-frame { transform: none; }
  .viewer img { transition: opacity var(--dur-hover) linear; }
  .js .stage-tabs .shot { transition-duration: var(--dur-hover); }
  .js .dev-panel.on.swap { animation: none; }
  .btn:active { transform: none; }
}

@media (prefers-contrast: more) {
  .vc path, .cn path { stroke-width: var(--stroke-w-more); }
  [data-brand] { --fg-muted: var(--fg); }
  .page, .site-footer { --c-stone: var(--c-white); }
}

@media (min-width: 640px) {
  :root { --control-h: 48px; }
  .facts > div { grid-template-columns: 1fr 2fr; column-gap: var(--space-3); }
  .figs { grid-template-columns: repeat(4, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .house-tiles { grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
  .house-lines { display: block; }
  .hl-d { display: block; }
  .hl-m { display: none; }
}

@media (max-width: 639px) {
  .ledger > .body { min-width: 0; }
  .gallery { display: flex; gap: var(--space-1); margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
  .gallery li.d-only { display: none; }
  .gallery li { flex: none; width: var(--gal-w); scroll-snap-align: start; }
  .thumb-frame { aspect-ratio: var(--gal-ar); }
  .g-d { display: none; }
  .g-m { display: block; }
  .product .ledger { padding-block: var(--space-3); }
  .product .closing { padding-block: var(--space-3) 0; gap: var(--space-2); }
  .product .stage-slot, .product .diagram-slot { margin-top: var(--space-3); }
  .product .cards-slot { margin-top: var(--space-3); }
  .product .cards { gap: var(--space-1); }
  .product .figs { padding-top: var(--space-3); margin-bottom: var(--space-3); }
  .product-head { padding-top: var(--space-4); }
  .ledger.fold > h2 { margin-bottom: 0; }
  .foldbtn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: var(--fold-h); padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
  .foldbtn::after { content: "Show"; font-size: var(--t-cap); font-weight: 400; color: var(--fg-muted); }
  .foldbtn[aria-expanded="true"]::after { content: "Hide"; }
  .ledger.fold.collapsed > :not(h2) { display: none; }
  .foldbtn-facts { display: flex; border-top: var(--hairline) solid var(--line); }
  .facts-fold.collapsed { display: none; }
}

@media (min-width: 960px) {
  :root { --header-h: 64px; --lockup-site: 24px; --gap: 24px; --plate-pad: 96px; --seam: 32px; --stack-head: 24px; --stack-stage: 64px; --opening-pad: 72px; --lockup-h: 40px; --mark-index: 28px; --hero-gap: 56px; --index-gap: 56px; --row-h: 48px; --cn-w: 32px; --cn-h: 40px; }
  .primary { display: block; }
  .menu { display: none; }
  .intro, .ledger, .opening-grid, .plate-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); }
  .opening-grid > h1 { grid-column: 1 / -1; }
  .opening-grid > .lead { grid-column: 1 / -1; }
  .opening-grid > .index { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); column-gap: var(--gap); }
  .plate-head .lockup-link, .plate-head h2, .plate-head .lead { grid-column: 1 / span 8; }
  .plate-head .actions { grid-column: 9 / -1; grid-row: 2 / span 2; align-self: end; justify-content: flex-end; }
  .plate-head .lockup-link { grid-row: 1; }
  .intro > * { grid-column: 1 / span 9; }
  .ledger > h2 { grid-column: 1 / -1; }
  .ledger > .body { grid-column: 1 / span 10; }
  .page .ledger > .body { grid-column: 1 / span 9; }
  .dgrid { display: grid; grid-template-rows: auto var(--cn-h) auto; align-items: stretch; }
  .diagram[data-g="k"] .dgrid, .diagram[data-g="b"] .dgrid { grid-template-columns: repeat(4, minmax(0, 1fr) var(--cn-w)) minmax(0, 1fr); }
  .diagram[data-g="p"] .dgrid { grid-template-columns: repeat(3, minmax(0, 1fr) var(--cn-w)) minmax(0, 1fr); }
  .dgrid .cn { display: block; }
  .dgrid .cn.stopcell svg { display: block; }
  .dgrid .cn.stopcell { padding: 0; }
  .dgrid .cn.stopcell .cl { position: absolute; right: 50%; top: calc(50% + var(--space-1)); width: max-content; padding-right: var(--space-1); }
  .dgrid .vc { display: none; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .ledger.sticky > h2 { position: sticky; top: calc(var(--space-8) * .75); align-self: start; }
  .timeline li { grid-template-columns: repeat(12, 1fr); align-items: start; }
  .timeline time { grid-column: 1 / span 2; }
  .rel-node { display: flex; grid-column: 3 / span 2; }
  .rel-body { grid-column: 5 / span 7; }
  .house-lines { height: var(--space-7); }
  .nf-marks { gap: var(--space-5); }
}

@media (min-width: 1280px) {
  :root { --gap: 32px; --plate-pad: 128px; --seam: 48px; --stack-head: 32px; --stack-stage: 80px; --opening-pad: 96px; }
  .opening-grid > h1 { grid-column: 1 / -1; }
  .ledger > h2 { grid-column: 1 / span 4; }
  .ledger > .body { grid-column: 5 / span 7; }
  .page .ledger > .body { grid-column: 5 / span 7; }
  .ledger.gal > .body { grid-column: 5 / -1; }
  .ledger.brief > .body { grid-column: 1 / -1; }
  .ledger.brief > h2 { grid-column: 1 / -1; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .intro > h1 { grid-column: 1 / span 9; }
  .intro > .lead { grid-column: 1 / span 7; }
}
