/* ==========================================================================
   InfiniDataLabs — core.css
   Layers: tokens → fonts → reset/base → layout → components → motion → utilities
   Page-specific styles live in /assets/css/pages/<page>.css and may only use
   the tokens and component classes defined here.
   Colour: OKLCH (CSS Color 4) with hex fallbacks. Contrast ratios (WCAG 2.2 / APCA Lc)
   are documented in /docs/design-system.md.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Ground ladder — blue-black, never pure black (halation, OLED smear) */
  --bg-0: #0a0c10; --bg-0: oklch(0.155 0.008 255);
  --bg-1: #0f1216; --bg-1: oklch(0.182 0.009 255);
  --bg-2: #16191d; --bg-2: oklch(0.212 0.010 255);
  --bg-3: #1e2227; --bg-3: oklch(0.250 0.011 255);

  /* Lines: line-* are decorative only; --ctrl marks control boundaries (≥3:1) */
  --line-1: #23272b; --line-1: oklch(0.270 0.010 255);
  --line-2: #34383e; --line-2: oklch(0.340 0.012 255);
  --ctrl:   #6f757c; --ctrl:   oklch(0.560 0.013 255);

  /* Text — tx-1 headings (16.4:1), tx-2 body (13.0:1), tx-3 meta ≥14px (8.5:1) */
  --tx-1: #e9ebee; --tx-1: oklch(0.940 0.005 250);
  --tx-2: #cfd3d8; --tx-2: oklch(0.865 0.008 250);
  --tx-3: #a6abb1; --tx-3: oklch(0.740 0.010 250);

  /* The single accent — "filament": warm light against cool neutrals (10.2:1 on bg-0) */
  --accent:   #f9aa58; --accent:   oklch(0.800 0.135 65);
  --accent-2: #fac787; --accent-2: oklch(0.860 0.100 72);
  --ok:  #69d49a; --ok:  oklch(0.790 0.130 158);
  --err: #f87d7c; --err: oklch(0.730 0.150 22);

  /* Paper theme (long-form reading: positive polarity) */
  --paper:   #f6f4f0; --paper:   oklch(0.968 0.006 85);
  --paper-2: #edebe6; --paper-2: oklch(0.940 0.007 85);
  --ink-1: #181b1f; --ink-1: oklch(0.220 0.010 255);
  --ink-2: #494d54; --ink-2: oklch(0.420 0.012 255);
  --ink-3: #5f646a; --ink-3: oklch(0.500 0.012 255);
  --accent-ink: #a14f09; --accent-ink: oklch(0.520 0.130 52);
  --paper-line: #d3d1cd;

  /* Type */
  --font-sans: "Archivo Variable", "Archivo Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Plex Mono Fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Fluid scale: 1.2 @360px → 1.333 @1440px (Utopia method) */
  --t-label:   0.75rem;                                              /* 12px mono caps */
  --t-small:   clamp(0.875rem, 0.854rem + 0.093vw, 0.9375rem);       /* 14→15 */
  --t-body:    clamp(1rem, 0.958rem + 0.185vw, 1.125rem);            /* 16→18 */
  --t-lead:    clamp(1.2rem, 1.1rem + 0.444vw, 1.5rem);              /* 19→24 */
  --t-h4:      clamp(1.25rem, 1.15rem + 0.45vw, 1.6rem);             /* 20→26 */
  --t-h3:      clamp(1.5rem, 1.3rem + 0.9vw, 2.25rem);               /* 24→36 */
  --t-h2:      clamp(2.074rem, 1.58rem + 2.195vw, 3.556rem);         /* 33→57 */
  --t-h1:      clamp(2.488rem, 1.737rem + 3.337vw, 4.741rem);        /* 40→76 */
  --t-display: clamp(2.875rem, 1.6rem + 5.6vw, 6.6rem);              /* 46→106 */
  --t-numeral: clamp(5.5rem, 2rem + 15vw, 15rem);                    /* 88→240 */

  /* Space (8px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px; --s-11: 192px;
  --section: clamp(96px, 12vw, 192px);
  --gutter: clamp(16px, 2vw, 24px);
  --margin: clamp(20px, 4.5vw, 72px);
  --maxw: 1440px;
  --header-h: 64px;
  --radius: 2px;

  /* Motion — critically damped, no overshoot. Durations: 0.1s instant / 1s flow limits. */
  --dur-micro: 100ms;
  --dur-ui: 240ms;
  --dur-ui-exit: 180ms;
  --dur-section: 900ms;
  --dur-title: 1300ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);      /* expo.out   — entrances */
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);    /* power4.out — settling */
  --ease-move: cubic-bezier(0.65, 0, 0.35, 1);    /* power2.inOut — state to state */
  --ease-in: cubic-bezier(0.32, 0, 0.67, 0);      /* power2.in  — exits */
}

/* ---------- 2. Fonts (self-hosted; no third-party font CDN) -------------- */
@font-face {
  font-family: "Archivo Variable"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("/assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations"), url("/assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo Variable"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("/assets/fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations"), url("/assets/fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 400;
  src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 400;
  src: url("/assets/fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 500;
  src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 500;
  src: url("/assets/fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Arrows: the fontsource latin subsets omit → and ↗. Archivo's own ←↑→↓↔↕ keep both axes;
   the diagonals (↖↗↘↙), which Archivo lacks, come from IBM Plex Mono. */
@font-face { font-family: "Archivo Variable"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url("/assets/fonts/archivo-arrows-wdth-normal.woff2") format("woff2-variations"), url("/assets/fonts/archivo-arrows-wdth-normal.woff2") format("woff2"); unicode-range: U+2190-2195; }
@font-face { font-family: "Archivo Variable"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url("/assets/fonts/ibm-plex-mono-arrows-400.woff2") format("woff2"); unicode-range: U+2196-2199; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 400 500;
  src: url("/assets/fonts/ibm-plex-mono-arrows-400.woff2") format("woff2"); unicode-range: U+2190-2199; }
/* Metric-matched fallbacks (computed from font tables) so the swap causes ~0 layout shift */
@font-face { font-family: "Archivo Fallback"; src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans"); size-adjust: 99%; ascent-override: 88.7%; descent-override: 21.2%; line-gap-override: 0%; }
@font-face { font-family: "Plex Mono Fallback"; src: local("Courier New"), local("Liberation Mono"); size-adjust: 100%; ascent-override: 102.5%; descent-override: 27.5%; line-gap-override: 0%; }

/* ---------- 3. Reset & base --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
  background: var(--bg-0);
}
body {
  min-height: 100svh;
  background: var(--bg-0);
  color: var(--tx-2);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  font-weight: 390;              /* light-on-dark looks heavier (irradiation) */
  font-stretch: 100%;
  line-height: 1.6;
  letter-spacing: 0.003em;
  font-kerning: normal;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
:where(p, li, dd, .prose) a:not([class]) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--ctrl); transition: text-decoration-color var(--dur-micro) linear, color var(--dur-micro) linear; }
:where(p, li, dd, .prose) a:not([class]):hover { text-decoration-color: currentColor; color: var(--tx-1); }
h1, h2, h3, h4 { color: var(--tx-1); font-weight: 500; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
strong { color: var(--tx-1); font-weight: 560; }
::selection { background: var(--accent); color: var(--bg-0); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 1px; }
.paper :focus-visible { outline-color: var(--accent-ink); }
[hidden] { display: none !important; }
hr { border: 0; height: 1px; background: var(--line-1); }
table { border-collapse: collapse; width: 100%; }

/* Static film-grain texture: breaks up 8-bit banding in deep gradients. Never animated. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip-link {
  position: fixed; left: var(--s-4); top: var(--s-3); z-index: 200;
  padding: 10px 16px; background: var(--tx-1); color: var(--bg-0); font-weight: 560; border-radius: var(--radius);
  transform: translateY(-160%); transition: transform var(--dur-ui) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 4. Typography helpers --------------------------------------- */
.t-display { font-size: var(--t-display); line-height: 0.96; letter-spacing: -0.032em; font-weight: 500; font-stretch: 92%; color: var(--tx-1); }
.t-h1 { font-size: var(--t-h1); line-height: 1.0; letter-spacing: -0.026em; font-stretch: 94%; }
.t-h2 { font-size: var(--t-h2); line-height: 1.05; letter-spacing: -0.021em; font-stretch: 96%; }
.t-h3 { font-size: var(--t-h3); line-height: 1.14; letter-spacing: -0.014em; }
.t-h4 { font-size: var(--t-h4); line-height: 1.25; letter-spacing: -0.008em; font-weight: 520; }
.t-lead { font-size: var(--t-lead); line-height: 1.45; letter-spacing: -0.004em; color: var(--tx-2); font-weight: 380; max-width: 46ch; }
.t-body { font-size: var(--t-body); max-width: 62ch; }
.t-small { font-size: var(--t-small); line-height: 1.5; }
.t-numeral { font-size: var(--t-numeral); line-height: 0.85; letter-spacing: -0.045em; font-weight: 300; font-stretch: 100%; color: var(--tx-1); font-variant-numeric: lining-nums tabular-nums; }
.t-dim { color: var(--tx-3); }
.t-quiet { color: var(--tx-2); }
.measure { max-width: 62ch; }
.mono, .label, code, kbd { font-family: var(--font-mono); }
.label {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-size: var(--t-label); line-height: 1.3; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-2);
  font-variant-numeric: tabular-nums slashed-zero;
}
.label .idx { color: var(--tx-3); }
.label--accent { color: var(--accent); }
.num { font-variant-numeric: tabular-nums lining-nums slashed-zero; }
.unit { white-space: nowrap; }

/* ---------- 5. Layout --------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--margin); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.section { padding-block: var(--section); position: relative; }
.section--tight { padding-block: calc(var(--section) * 0.6); }
.section + .section--flush { padding-top: 0; }
.section-head { display: grid; gap: var(--s-5); margin-bottom: clamp(48px, 6vw, 96px); }
.section-head > .label { margin-bottom: var(--s-2); }
.stack > * + * { margin-top: var(--s-5); }
.stack-sm > * + * { margin-top: var(--s-3); }
.stack-lg > * + * { margin-top: var(--s-7); }
.cols-2 { display: grid; gap: var(--s-7) var(--gutter); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.cols-3 { display: grid; gap: var(--s-7) var(--gutter); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.bg-1 { background: var(--bg-1); }
@media (max-width: 767px) { :root { --header-h: 56px; } }

/* Column hairlines (decorative drawing grid behind select sections) */
.colgrid { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.colgrid > .wrap { height: 100%; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); }
.colgrid span { border-left: 1px solid var(--line-1); opacity: 0.55; transform-origin: top; }
.colgrid span:last-child { border-right: 1px solid var(--line-1); }
@media (max-width: 767px) { .colgrid span:nth-child(n+5) { display: none; } .colgrid > .wrap { grid-template-columns: repeat(4, 1fr); } }

/* Section rule: label + hairline that draws in */
.rule { display: block; position: relative; height: 1px; background: var(--line-2); transform-origin: left center; }
.section-rule { display: flex; align-items: center; gap: var(--s-4); margin-bottom: clamp(40px, 5vw, 72px); }
.section-rule .rule { flex: 1; }

/* ---------- 6. Header & navigation -------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
  transition: background-color var(--dur-ui) linear, border-color var(--dur-ui) linear;
  border-bottom: 1px solid transparent; view-transition-name: site-header;
}
.site-header.is-solid, .site-header--solid { background: var(--bg-0); border-bottom-color: var(--line-1); }

.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--tx-1); min-height: 44px; }
.brand svg { height: 18px; width: auto; flex: none; overflow: visible; }
.brand__word { font-size: 17px; font-weight: 600; font-stretch: 104%; letter-spacing: -0.012em; line-height: 1; }
.nav { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 34px); }
.nav__list { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); list-style: none; padding: 0; }
.nav__link { position: relative; display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 450; color: var(--tx-2); letter-spacing: 0.002em; transition: color var(--dur-micro) linear; }
.nav__link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 10px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform var(--dur-ui) var(--ease-out); }
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--tx-1); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav__toggle { display: none; min-height: 44px; min-width: 44px; padding: 0 4px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-1); font-weight: 500; }
@media (max-width: 1023px) {
  .nav__list, .nav .btn { display: none; }
  .nav__toggle { display: inline-flex; align-items: center; gap: 10px; }
}
.nav__toggle .bars { width: 18px; height: 8px; position: relative; }
.nav__toggle .bars::before, .nav__toggle .bars::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; }
.nav__toggle .bars::before { top: 0; } .nav__toggle .bars::after { bottom: 0; }

/* Mobile menu (native <dialog>) */
.menu {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; border: 0; padding: 0;
  background: var(--bg-0); color: var(--tx-1);
}
.menu::backdrop { background: transparent; }
.menu[open] { display: flex; flex-direction: column; }
.menu__top { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding-inline: var(--margin); border-bottom: 1px solid var(--line-1); }
.menu__list { list-style: none; padding: var(--s-6) var(--margin); display: grid; gap: 2px; }
.menu__list a { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line-1); font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 480; letter-spacing: -0.02em; line-height: 1.15; }
.menu__list a[aria-current="page"] > span:first-child { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
.menu__list a[aria-current="page"] .idx { color: var(--tx-1); }
.menu__list a .idx { font-family: var(--font-mono); font-size: 12px; color: var(--tx-3); letter-spacing: 0.06em; }
.menu__foot { margin-top: auto; padding: var(--s-6) var(--margin) calc(var(--s-6) + env(safe-area-inset-bottom)); display: grid; gap: var(--s-4); }

/* ---------- 7. Buttons & links ------------------------------------------ */
.btn {
  --h: 48px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 22px; border-radius: var(--radius);
  font-size: 15px; font-weight: 520; letter-spacing: 0.004em; line-height: 1; white-space: nowrap;
  transition: background-color var(--dur-micro) linear, color var(--dur-micro) linear, border-color var(--dur-micro) linear;
  isolation: isolate;
}
.btn--sm { --h: 40px; padding: 0 16px; font-size: 14px; }
.btn--primary { background: var(--tx-1); color: var(--bg-0); }
.btn--primary:hover { background: #fff; }
.btn--ghost { color: var(--tx-1); box-shadow: inset 0 0 0 1px var(--ctrl); }
.btn--ghost:hover { background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--tx-3); }
.nav .btn[aria-current="page"] { background: transparent; color: var(--tx-1); box-shadow: inset 0 0 0 1px var(--tx-2); }
.btn .arr, .link-arrow .arr { display: inline-block; transition: transform var(--dur-ui) var(--ease-out); }
.btn:hover .arr, .link-arrow:hover .arr { transform: translateX(3px); }
.btn .arr--ne, .link-arrow .arr--ne { transition: transform var(--dur-ui) var(--ease-out); }
.btn:hover .arr--ne, .link-arrow:hover .arr--ne { transform: translate(2px, -2px); }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--tx-1); font-weight: 520; font-size: 15px; }
.link-arrow span:first-child { background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat; padding-bottom: 3px; transition: background-size var(--dur-ui) var(--ease-out); }
.link-arrow:hover span:first-child { background-size: 0% 1px; background-position: right bottom; }
.paper .btn--primary { background: var(--ink-1); color: var(--paper); }
.paper .btn--ghost { color: var(--ink-1); box-shadow: inset 0 0 0 1px var(--ink-3); }

/* ---------- 8. Components ----------------------------------------------- */

/* Title block — ISO 7200-style spec grid */
.tblock { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2); }
.tblock > div { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 14px 16px 16px; display: grid; gap: 6px; align-content: start; min-height: 76px; }
.tblock dt, .tblock .k { font-family: var(--font-mono); font-size: 11px; line-height: 1.3; letter-spacing: 0.09em; text-transform: uppercase; color: var(--tx-3); font-weight: 500; }
.tblock dd, .tblock .v { color: var(--tx-1); font-size: 15px; line-height: 1.4; font-weight: 450; }
.tblock--3 { --cols: 3; } .tblock--4 { --cols: 4; }
@media (max-width: 639px) { .tblock, .tblock--3, .tblock--4 { --cols: 1; } }

/* Status markers: shape + text (never colour alone) */
.status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; color: var(--tx-2); white-space: nowrap; }
.status::before { content: ""; width: 9px; height: 9px; flex: none; background: currentColor; }
.status--live { color: var(--accent); }
.status--live::before { background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--accent); }
.status--live { position: relative; }
.status--live::after { content: ""; position: absolute; left: 0; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; background: var(--accent); opacity: 0; animation: idl-pulse 2.4s var(--ease-out) 4; pointer-events: none; }
@keyframes idl-pulse { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(2.4); opacity: 0; } }

/* Record table */
.record { width: 100%; border-top: 1px solid var(--line-2); font-size: var(--t-body); }
.record th { text-align: left; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--tx-3); font-weight: 500; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line-2); }
.record td { padding: 26px 24px 26px 0; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.record tbody tr { transition: background-color var(--dur-micro) linear; }
.record tbody tr:hover { background: var(--bg-1); }
.record .ref { font-family: var(--font-mono); font-size: 13px; color: var(--tx-3); width: 4.5em; padding-left: 0; }
.record .disc { color: var(--tx-1); font-size: var(--t-h4); line-height: 1.25; letter-spacing: -0.008em; font-weight: 500; width: 32%; }
.record .rec { max-width: 52ch; color: var(--tx-2); }
.record .st { text-align: right; padding-right: 0; white-space: nowrap; }
@media (max-width: 767px) {
  .record thead { display: none; }
  .record, .record tbody, .record tr, .record td { display: block; width: auto; }
  .record tr { padding: 22px 0; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
  .record td { border: 0; padding: 0; }
  .record .ref { grid-row: span 3; padding-top: 4px; }
  .record .st { text-align: left; }
  .record .disc, .record .ref { width: auto; }
}

/* Drawing sheet frame with registration corners (product sheets, diagrams) */
.sheet { position: relative; border: 1px solid var(--line-2); background: var(--bg-1); }
.sheet::before, .sheet::after, .sheet > .corner-b::before, .sheet > .corner-b::after {
  content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none;
  border-color: var(--tx-3); border-style: solid; border-width: 0; transition: transform var(--dur-ui) var(--ease-out);
}
.sheet::before { top: -1px; left: -1px; border-top-width: 1.5px; border-left-width: 1.5px; }
.sheet::after { top: -1px; right: -1px; border-top-width: 1.5px; border-right-width: 1.5px; }
.sheet > .corner-b::before { bottom: -1px; left: -1px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.sheet > .corner-b::after { bottom: -1px; right: -1px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
a.sheet:hover::before, a.sheet:focus-visible::before { transform: translate(-4px, -4px); }
a.sheet:hover::after, a.sheet:focus-visible::after { transform: translate(4px, -4px); }
a.sheet:hover > .corner-b::before, a.sheet:focus-visible > .corner-b::before { transform: translate(-4px, 4px); }
a.sheet:hover > .corner-b::after, a.sheet:focus-visible > .corner-b::after { transform: translate(4px, 4px); }

/* Stamp: "ILLUSTRATIVE", "INDICATIVE — NOT FOR CONSTRUCTION" */
.stamp { display: inline-block; font-family: var(--font-mono); font-size: 11px; line-height: 1; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tx-3); padding: 6px 8px; box-shadow: inset 0 0 0 1px currentColor; font-weight: 500; }

/* Key/value spec list */
.spec { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; font-size: var(--t-small); }
.spec dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--tx-3); padding-top: 3px; font-weight: 500; }
.spec dd { color: var(--tx-1); }

/* Tags (plain, not pills) */
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.tags li { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--tx-2); padding: 5px 8px; box-shadow: inset 0 0 0 1px var(--line-2); border-radius: var(--radius); }

/* Offices + live clocks */
.offices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.office { padding: 22px 24px 26px 0; display: grid; gap: 6px; }
.office + .office { padding-left: 24px; border-left: 1px solid var(--line-2); }
.office__city { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tx-1); font-weight: 500; }
.office__role { font-size: var(--t-small); color: var(--tx-2); }
.office__time { font-family: var(--font-mono); font-size: 13px; color: var(--tx-3); font-variant-numeric: tabular-nums; }
@media (max-width: 767px) { .offices { grid-template-columns: 1fr; } .office + .office { padding-left: 0; border-left: 0; border-top: 1px solid var(--line-2); } }

/* People */
.person { display: grid; gap: var(--s-4); }
.person__photo { aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line-1); }
.person__photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.04) brightness(0.92); transition: filter var(--dur-section) var(--ease-soft); }
.person:hover .person__photo img { filter: grayscale(0.15) contrast(1.02) brightness(0.98); }
.person__name { font-size: var(--t-h4); color: var(--tx-1); font-weight: 520; letter-spacing: -0.01em; line-height: 1.2; }
.person__role { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-3); }

/* Forms */
.field { display: grid; gap: 8px; }
.field label, .field .field__label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-2); font-weight: 500; }
.field .opt { color: var(--tx-3); text-transform: none; letter-spacing: 0; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--bg-1); color: var(--tx-1); border: 1px solid var(--ctrl);
  font-size: 16px; line-height: 1.4; transition: border-color var(--dur-micro) linear, background-color var(--dur-micro) linear;
}
.textarea { min-height: 148px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--tx-3); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--tx-3); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--tx-2); background: var(--bg-2); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a6abb1' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.field[data-invalid] .input, .field[data-invalid] .textarea, .field[data-invalid] .select { border-color: var(--err); }
.field__error { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--err); }
.field__error::before { content: "!"; display: inline-grid; place-items: center; width: 16px; height: 16px; font: 600 11px/1 var(--font-mono); color: var(--bg-0); background: var(--err); border-radius: 50%; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; }
.choice legend { margin-bottom: 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-2); font-weight: 500; }
.choice label { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--ctrl); font-size: 14.5px; color: var(--tx-2); cursor: pointer; transition: background-color var(--dur-micro) linear, color var(--dur-micro) linear, box-shadow var(--dur-micro) linear; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice label:has(input:checked) { background: var(--tx-1); color: var(--bg-0); box-shadow: none; }
.choice label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-status { min-height: 1.5em; font-size: var(--t-small); }
.form-status[data-state="ok"] { color: var(--ok); }
.form-status[data-state="err"] { color: var(--err); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--t-small); color: var(--tx-2); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }

/* Dialog / modal */
.modal { margin: auto; width: min(680px, calc(100% - 32px)); max-height: calc(100svh - 32px); padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); color: var(--tx-2); overflow: auto; }
.modal::backdrop { background: rgba(5, 6, 8, 0.76); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); padding: 24px 28px 0; }
.modal__body { padding: 20px 28px 28px; }
.modal__close { min-width: 44px; min-height: 44px; display: grid; place-items: center; color: var(--tx-2); margin: -8px -12px 0 0; }
.modal__close:hover { color: var(--tx-1); }
.modal[open] { animation: idl-modal-in var(--dur-ui) var(--ease-out); }
.modal[open]::backdrop { animation: idl-fade-in var(--dur-ui) linear; }
@keyframes idl-modal-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes idl-fade-in { from { opacity: 0; } }

/* Paper theme section */
.paper { background: var(--paper); color: var(--ink-2); }
.paper h1, .paper h2, .paper h3, .paper h4, .paper strong { color: var(--ink-1); }
.paper .label, .paper .t-dim { color: var(--ink-3); }
.paper .rule, .paper hr { background: var(--paper-line); }
.paper a:not(.btn) { text-decoration-color: var(--ink-3); }
.paper a:not(.btn):hover { color: var(--ink-1); }
.paper .label .idx { color: var(--ink-3); }
.paper .stamp { color: var(--ink-3); }
.paper .tblock, .paper .tblock > div { border-color: var(--paper-line); }
.paper .tblock dt { color: var(--ink-3); } .paper .tblock dd { color: var(--ink-1); }
.paper ::selection { background: var(--ink-1); color: var(--paper); }

/* Page header (inner pages) */
.page-hero { position: relative; padding-top: calc(var(--header-h) + clamp(72px, 11vw, 168px)); padding-bottom: clamp(56px, 7vw, 112px); overflow: hidden; }
.page-hero__code { display: flex; gap: var(--s-4); align-items: center; margin-bottom: clamp(28px, 4vw, 48px); }
.page-hero__code .rule { flex: 1; }
.page-hero h1 { max-width: 16ch; view-transition-name: page-title; }
.page-hero .t-lead { margin-top: clamp(20px, 2.5vw, 32px); }

/* CTA band */
.cta-band { border-top: 1px solid var(--line-2); padding-block: clamp(72px, 9vw, 144px); }
.cta-band__inner { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-6); }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- 9. Footer --------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line-2); padding-top: clamp(56px, 7vw, 96px); font-size: var(--t-small); position: relative; }
.site-footer .band { padding-block: 28px; border-bottom: 1px solid var(--line-1); }
.site-footer .band:first-child { padding-top: 0; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--s-6); }
.footer-tag { font-size: var(--t-h4); color: var(--tx-1); letter-spacing: -0.01em; max-width: 26ch; line-height: 1.25; font-weight: 450; }
.footer-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-6) var(--gutter); }
.footer-links h2 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--tx-3); font-weight: 500; margin-bottom: 12px; }
.footer-links ul { list-style: none; padding: 0; display: grid; gap: 0; }
.site-footer .footer-links a, .site-footer .footer-bottom a, .menu__list a { text-decoration: none; }
.footer-links a { display: inline-flex; min-height: 44px; align-items: center; color: var(--tx-2); transition: color var(--dur-micro) linear; }
.footer-links a:hover { color: var(--tx-1); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); padding-block: 22px 28px; font-family: var(--font-mono); font-size: 12px; color: var(--tx-3); letter-spacing: 0.02em; }
.footer-bottom a, .footer-bottom button { color: var(--tx-3); min-height: 44px; display: inline-flex; align-items: center; }
.footer-bottom a:hover, .footer-bottom button:hover { color: var(--tx-1); }
.footer-bottom .sep { opacity: 0.5; margin-inline: 8px; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }

/* ---------- 10. Motion states ------------------------------------------- */
/* Initial hidden state only when JS is running; a failsafe reveals content if the
   motion system never initialises. Reduced motion: no hidden state at all. */
html.js:not(.reduce-motion) [data-reveal] { opacity: 0; }
html.js:not(.reduce-motion):not(.motion-ready) [data-reveal] { animation: idl-failsafe 0.4s linear 2.2s forwards; }
html.js:not(.reduce-motion) [data-draw] { transform: scaleX(0); }
html.js:not(.reduce-motion):not(.motion-ready) [data-draw] { animation: idl-failsafe-draw 0.4s linear 2.2s forwards; }
@keyframes idl-failsafe { to { opacity: 1; } }
@keyframes idl-failsafe-draw { to { transform: none; } }
[data-split] .line-mask { overflow: clip; padding-bottom: 0.08em; margin-bottom: -0.08em; }

/* Cross-document View Transitions: a short cut through the ground colour */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 180ms var(--ease-in) both idl-vt-out; }
::view-transition-new(root) { animation: 320ms var(--ease-out) 60ms both idl-vt-in; }
::view-transition-group(site-header) { animation: none; }
::view-transition-new(page-title) { animation: 520ms var(--ease-out) 80ms both idl-vt-title; }
::view-transition-old(page-title) { animation: 160ms var(--ease-in) both idl-vt-out; }
@keyframes idl-vt-out { to { opacity: 0; } }
@keyframes idl-vt-in { from { opacity: 0; } }
@keyframes idl-vt-title { from { opacity: 0; transform: translateY(10px); } }

/* Reduced motion: honour the OS setting and the in-page toggle */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
html.reduce-motion::view-transition-group(*), html.reduce-motion::view-transition-old(*), html.reduce-motion::view-transition-new(*) { animation: none !important; }

/* Lenis (vendored CSS inlined) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---------- 11. Utilities ----------------------------------------------- */
.mt-0 { margin-top: 0 !important; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.hide-sm { } @media (max-width: 767px) { .hide-sm { display: none !important; } }
.only-sm { display: none; } @media (max-width: 767px) { .only-sm { display: revert; } }

@media print {
  body::after, .site-header, .site-footer, canvas, .nav__toggle { display: none !important; }
  body { background: #fff; color: #111; }
  h1, h2, h3, h4, strong { color: #000; }
}

/* Windows High Contrast / forced colors: box-shadow borders disappear, so draw real borders */
@media (forced-colors: active) {
  .choice label { border: 1px solid ButtonText; }
  .choice label:has(input:checked) { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .btn--ghost, .tags li, .stamp { border: 1px solid ButtonText; }
  .status::before { forced-color-adjust: none; background: CanvasText; }
}
