/* ==========================================================================
   Glifra. Ink, brass and porcelain; one engraved line carries the page.
   Layers: fixed WebGL canvas (z 0) · veil (1) · annotations (2) · HTML (3)
   ========================================================================== */
/* Local fallbacks sized to the web fonts' widths (measured), so the hero does not
   reflow when Newsreader and Familjen Grotesk arrive. */
@font-face { font-family: "Newsreader Fallback"; src: local("Georgia"); size-adjust: 97.2%; }
@font-face { font-family: "Familjen Fallback"; src: local("Arial"); size-adjust: 94.2%; }

:root {
  --ink: #0e1b26;
  --raised: #142634;
  --hairline: #26394a;
  --hairline-strong: #3a5063;
  --control: #647b8e;              /* form control edges: 3.5:1 on ink and on the field fill */
  --silver: #d6dee4;
  --mist: #8d9eab;
  --brass: #c4a46a;
  --brass-bright: #d6b97f;
  --porcelain: #e9edef;

  --sans: "Familjen Grotesk", "Familjen Fallback", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", "Newsreader Fallback", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1600px;
  --hh: 76px;                      /* header height */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  background: var(--ink);
  color-scheme: dark;
  scroll-padding-top: calc(var(--hh) + 8px);
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--silver);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
i, em { font-style: italic; }
::selection { background: rgba(196, 164, 106, 0.35); color: var(--porcelain); }
:focus-visible { outline: 2px solid var(--brass-bright); outline-offset: 3px; border-radius: 2px; }
:focus { scroll-margin-top: calc(var(--hh) + 12px); scroll-margin-bottom: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--brass); color: var(--ink); padding: 10px 14px; text-decoration: none; font-weight: 500;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- type ---------- */
h1, h2, .statement, .close-line {
  font-family: var(--serif);
  font-weight: 300;
  color: var(--porcelain);
  letter-spacing: -0.018em;
  font-optical-sizing: auto;
}
h1 { font-size: clamp(44px, 4.3vw + 6px, 76px); line-height: 0.98; }
h1 span { display: block; }
h1 span + span { font-style: italic; color: var(--brass); padding-left: 0.04em; }
h2 { font-size: clamp(32px, 2.6vw + 9px, 56px); line-height: 1.05; text-wrap: balance; }
h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.2; color: var(--porcelain); letter-spacing: -0.005em; }
p { text-wrap: pretty; }
strong { font-weight: 500; color: var(--porcelain); }

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 15px/1 var(--sans); letter-spacing: 0.01em;
  padding: 15px 22px; border-radius: 2px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-brass { background: var(--brass); color: var(--ink); }
.btn-brass:hover { background: var(--brass-bright); }
.text-link {
  color: var(--porcelain); text-decoration: none; font-size: 15.5px;
  padding-bottom: 3px; border-bottom: 1px solid var(--hairline-strong);
  transition: border-color 0.2s;
}
.text-link:hover { border-color: var(--brass); }

/* ==========================================================================
   Layer 1: canvas, veil, annotations
   ========================================================================== */
#stage {
  position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh;
  z-index: 0; opacity: 0; transition: opacity 0.9s var(--ease);
}
.gl-ready #stage { opacity: 1; }
.gl-lost #stage, .no-webgl #stage { visibility: hidden; }
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 95% at 72% 48%, rgba(14, 27, 38, 0) 46%, rgba(14, 27, 38, 0.55) 100%),
    linear-gradient(90deg, rgba(14, 27, 38, 0.86) 0%, rgba(14, 27, 38, 0.5) 30%, rgba(14, 27, 38, 0) 48%);
}
.annotations { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.leader { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; }
.leader line { stroke: var(--brass); stroke-width: 1; opacity: 0.7; }
.leader circle { fill: var(--ink); stroke: var(--brass); stroke-width: 1; }
.node-labels span {
  position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap;
  font: italic 400 var(--label-size, 16px)/1 var(--serif); color: var(--mist); letter-spacing: 0.005em;
  will-change: transform, opacity; transition: color 0.3s;
}
.node-labels span.is-on { color: var(--silver); }
.node-labels span.is-now { color: var(--porcelain); }

/* ==========================================================================
   Layer 3: HTML
   ========================================================================== */
main { position: relative; z-index: 3; }

/* ---------- header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10; height: var(--hh);
  transition: background-color 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-header.is-scrolled, .site-header.menu-open {
  background: rgba(14, 27, 38, 0.86);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom-color: var(--hairline);
}
.logo img { height: 31px; width: auto; }
.nav { display: flex; align-items: center; gap: 34px; font-size: 15px; }
.nav a:not(.btn) { text-decoration: none; color: var(--silver); transition: color 0.2s; }
.nav a:not(.btn):hover { color: var(--porcelain); }
.nav .btn { padding: 11px 18px; font-size: 14.5px; }
.menu-toggle {
  display: none; background: none; border: 1px solid var(--hairline-strong); color: var(--porcelain);
  border-radius: 2px; height: 40px; padding: 0 16px; font: 500 14.5px var(--sans); cursor: pointer;
}

/* ---------- chapters: copy on the left, a stage for the engine on the right ---------- */
.chapter-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(24px, 3.4vw, 64px);
}
.chapter .copy { grid-column: 1; grid-row: 1; position: relative; }
.chapter .stage {
  grid-column: 2; grid-row: 1; align-self: start;
  position: sticky; top: var(--hh);
  height: calc(100vh - var(--hh)); height: calc(100svh - var(--hh));
}
.stage-fit { position: absolute; inset: 0 0 4% 0; }
.hero .stage-fit { inset: 0 0 13% 9%; }

/* hero */
.hero .chapter-grid { min-height: 100vh; min-height: 100svh; padding-top: var(--hh); }
.hero .copy { align-self: center; padding: 40px 0 72px; }
.hero .stage { height: calc(100vh - var(--hh) - 8px); height: calc(100svh - var(--hh) - 8px); }
.lede { margin-top: 30px; font-size: clamp(17px, 0.45vw + 12px, 20px); line-height: 1.6; max-width: 31em; color: var(--silver); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px; margin-top: 38px; }
/* the three disciplines: software first and widest */
.disciplines { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 3fr); gap: 0 26px; margin-top: 54px; border-top: 1px solid var(--hairline); max-width: 640px; }
.disciplines a { display: block; padding-top: 14px; text-decoration: none; }
.disciplines strong { display: block; font: 400 18px/1.25 var(--serif); color: var(--porcelain); }
.disciplines span { display: block; margin-top: 5px; font-size: 13.5px; line-height: 1.45; color: var(--mist); text-wrap: balance; }
.disciplines .d-lead { position: relative; }
.disciplines .d-lead::before { content: ""; position: absolute; left: 0; top: -1px; width: 100%; height: 1px; background: var(--brass); }
.disciplines a:hover strong { color: #fff; }

.poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  -webkit-mask-image: radial-gradient(closest-side, #000 96%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 96%, transparent 100%);
  transition: opacity 0.9s var(--ease);
}
.gl-ready .poster { opacity: 0; }
.gl-lost .poster { opacity: 1; }

.callout {
  position: absolute; right: 0; bottom: 2%; width: 300px; z-index: 1;
  padding-top: 12px; border-top: 1px solid var(--hairline-strong); text-align: right;
}
.callout figcaption { font-size: 14px; line-height: 1.45; color: var(--silver); text-wrap: balance; }
.cap-short { display: none; }
.no-webgl .cap-live, .gl-lost .cap-live { display: none; }
.motion-toggle {
  display: none; background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: 400 13px/1.3 var(--sans); color: var(--mist); text-decoration: underline; text-decoration-color: var(--hairline-strong); text-underline-offset: 3px;
}
.motion-toggle:hover { color: var(--porcelain); text-decoration-color: var(--brass); }
.motion-on.gl-ready:not(.gl-lost) .motion-toggle { display: inline-block; }
.motion-on.gl-ready:not(.gl-lost) .mt-narrow { display: none; }
.callout .motion-toggle { margin-top: 8px; }
.formula { margin: 8px 0 8px; font: 400 23px/1.2 var(--serif); color: var(--porcelain); letter-spacing: 0.01em; white-space: nowrap; }
.params { display: flex; justify-content: flex-end; gap: 4px 18px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.params div { display: flex; gap: 5px; align-items: baseline; }
.params dt { color: var(--mist); font-family: var(--serif); font-size: 15px; white-space: nowrap; }
.params dd { color: var(--porcelain); transition: color 0.3s; }
.params div.is-live dd { color: var(--brass-bright); }

/* pattern statement */
.pattern .copy { padding: 22vh 0 26vh; }
.statement { font-size: clamp(30px, 2.3vw + 12px, 52px); line-height: 1.12; text-wrap: balance; }
.pattern .copy > p { margin-top: 34px; max-width: 34em; font-size: 18px; }

/* custom software: the longest chapter */
.software .copy { padding: 14vh 0 20vh; }
.intro { margin-top: 26px; font-size: 18.5px; max-width: 34em; }
.listing {
  margin-top: 46px; border: 1px solid var(--hairline-strong); border-radius: 2px;
  background: rgba(20, 38, 52, 0.9);
}
.listing figcaption {
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--hairline); font-size: 13.5px;
}
.listing .file { color: var(--porcelain); font-weight: 500; }
.listing .what { color: var(--mist); }
.listing pre {
  margin: 0; padding: 18px 0 20px; overflow-x: auto;
  font: 400 13.5px/1.8 var(--mono); color: var(--silver); tab-size: 2;
}
.listing code { display: block; min-width: max-content; padding: 0 18px; font: inherit; }
.listing .kw { color: #9fb0bd; }
.listing .fn { color: var(--porcelain); }
.listing .ln {
  display: inline-block; min-width: calc(100% + 36px); margin: 0 -18px; padding: 0 18px;
  transition: background-color 0.4s, box-shadow 0.4s;
}
.listing .ln.is-on { background: rgba(214, 222, 228, 0.07); box-shadow: inset 2px 0 0 var(--silver); }
.listing mark {
  background: rgba(196, 164, 106, 0.14); color: var(--brass-bright);
  box-shadow: inset 2px 0 0 var(--brass);
}
.listing pre:focus-visible { outline-offset: -2px; }
.listing-note { margin-top: 16px; font-size: 15px; color: var(--mist); max-width: 34em; }

.software .copy h3 { margin-top: 72px; }
.kinds { margin-top: 22px; border-top: 1px solid var(--hairline); }
.kinds div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px 22px; align-items: baseline; padding: 14px 0 15px; border-bottom: 1px solid var(--hairline); }
.kinds dt { font: 400 19px/1.3 var(--serif); color: var(--porcelain); }
.kinds dd { font-size: 15px; line-height: 1.5; color: var(--silver); }

/* bands: opaque, full width, between the chapters. The canvas fades out before
   one reaches it (js/scroll.js), and a short gradient softens the edge. */
.band { position: relative; z-index: 3; background: var(--ink); }
.band::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 120px; pointer-events: none;
  background: linear-gradient(180deg, rgba(14, 27, 38, 0) 0%, var(--ink) 100%);
}
.band + .band::before { display: none; }

/* agentic AI: its own full-width moment */
.agentic { padding: clamp(72px, 7vw, 112px) 0 clamp(72px, 8vw, 120px); border-top: 1px solid var(--hairline); }
.agentic h3 { font: 500 15px/1.4 var(--sans); color: var(--brass); letter-spacing: 0.01em; }
.agentic-statement {
  margin-top: 22px; max-width: 21em;
  font: 300 clamp(36px, 3.4vw + 8px, 66px)/1.06 var(--serif); color: var(--porcelain); letter-spacing: -0.02em; text-wrap: balance;
}
.agentic-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 3.4vw, 64px); margin-top: clamp(48px, 5vw, 76px); align-items: start; }
.agentic-intro { font-size: 18px; max-width: 30em; }
.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 34px; }
.pairs li { padding-top: 14px; border-top: 1px solid var(--hairline-strong); font-size: 15px; line-height: 1.55; color: var(--silver); }
.pairs strong { display: block; margin-bottom: 6px; font: 400 19px/1.3 var(--serif); color: var(--porcelain); }

/* inherited code + the standards in every build */
.standards-band { padding: 0 0 clamp(80px, 9vw, 140px); }
.takeover {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 3.4vw, 64px); align-items: baseline;
  padding: clamp(28px, 3vw, 44px) clamp(22px, 3vw, 44px); background: var(--raised);
  border: 1px solid var(--hairline); border-radius: 2px;
}
.takeover p { font-size: 16.5px; max-width: 40em; }
.standards-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 3.4vw, 64px); margin-top: clamp(64px, 7vw, 104px); align-items: start; }
.standards { columns: 2; column-gap: 34px; border-top: 1px solid var(--hairline); }
.standards li { break-inside: avoid; padding: 13px 0 14px; border-bottom: 1px solid var(--hairline); font-size: 14.5px; line-height: 1.5; color: var(--silver); }
.sub { margin-top: 10px; color: var(--mist); font-size: 15.5px; }
.capabilities { margin-top: 22px; border-top: 1px solid var(--hairline); }
.capabilities li {
  position: relative; padding: 15px 0 16px 26px; border-bottom: 1px solid var(--hairline);
  font-size: 15.5px; line-height: 1.55;
}
.capabilities li::before {
  content: ""; position: absolute; left: 0; top: 27px; width: 12px; height: 1px; background: var(--brass);
}

/* mobile games: a shorter hold */
.games .copy { padding: 16vh 0 18vh; }
.games .capabilities { margin-top: 34px; }
.games .sub { margin-top: 26px; }

/* browser games: one line */
.browser { position: relative; z-index: 3; background: var(--ink); border-bottom: 1px solid var(--hairline); }
.browser::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 120px; pointer-events: none;
  background: linear-gradient(180deg, rgba(14, 27, 38, 0) 0%, var(--ink) 100%);
}
.browser-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 3.4vw, 64px); align-items: baseline; padding-top: 34px; padding-bottom: 34px; }
.browser h2 { font-size: clamp(24px, 1vw + 16px, 30px); }
.browser p { color: var(--silver); max-width: 46em; }

/* ---------- opaque sections (they cover the canvas, which then pauses) ---------- */
.section { position: relative; background: var(--ink); padding: clamp(96px, 11vw, 168px) 0; }
.section + .section { border-top: 1px solid var(--hairline); }
.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 3.4vw, 64px); align-items: end; }
.section-head p { max-width: 34em; font-size: 17.5px; }

/* the spine: one engraved line down the opaque middle of the page */
.mid { position: relative; z-index: 3; }
.mid::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 120px; pointer-events: none;
  background: linear-gradient(180deg, var(--ink) 0%, rgba(14, 27, 38, 0) 100%);
}
.spine { position: absolute; left: calc(max(0px, (100vw - var(--max)) / 2) + var(--gutter) - 30px); right: 0; top: 0; bottom: -160px; z-index: 4; pointer-events: none; display: none; }
.spine svg { position: absolute; left: 0; top: 0; overflow: visible; }
.spine path { fill: none; stroke: var(--brass); stroke-width: 1; opacity: 0.55; stroke-dasharray: 1; stroke-dashoffset: 1; vector-effect: non-scaling-stroke; }
.spine path + path { stroke: var(--silver); opacity: 0.28; }
@media (min-width: 1200px) { .spine { display: block; } }

/* scope */
.ruler { margin-top: 64px; color: var(--hairline-strong); }
.ruler svg { width: 100%; height: 56px; }
.stops { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: 28px; }
.stops h3 { font-size: 23px; }
.duration { display: block; margin-top: 6px; font-size: 14px; color: var(--brass); font-variant-numeric: tabular-nums; }
.stops p { margin-top: 14px; font-size: 15.5px; }

/* process: a real sequence, so it is numbered */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; margin-top: 72px; }
.steps li { counter-increment: step; position: relative; padding-top: 22px; border-top: 1px solid var(--hairline-strong); display: flex; flex-direction: column; }
.steps li::before {
  content: counter(step); position: absolute; top: -15px; left: 0; padding-right: 10px; background: var(--ink);
  font: italic 400 22px/1 var(--serif); color: var(--brass);
}
.steps h3 { font-size: 21px; margin-top: 10px; }
.steps p { margin-top: 12px; font-size: 15px; flex: 1; }
.time { display: block; margin-top: 18px; font-size: 13.5px; color: var(--mist); }

/* model + stack: a full-width statement, then the stack set as a specimen */
.model-head { max-width: 1100px; }
.model-statement { margin-top: 28px; font: 300 clamp(28px, 2vw + 12px, 46px)/1.14 var(--serif); color: var(--silver); letter-spacing: -0.015em; text-wrap: balance; }
.model-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(24px, 4.4vw, 88px); margin-top: 84px; align-items: start; }
.model-text { padding-top: 34px; }
.model-text p { font-size: 18px; max-width: 32em; }
.model-text p + p { margin-top: 18px; }
.stack h3 { font: 500 15px/1.4 var(--sans); color: var(--mist); letter-spacing: 0.01em; }
.stack dl { margin-top: 14px; border-top: 1px solid var(--hairline); }
.stack dl div { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); gap: 20px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--hairline); font-size: 15.5px; }
.stack dt { font: italic 400 21px/1.2 var(--serif); color: var(--porcelain); }

/* faq */
.faq-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 3.4vw, 64px); }
.faq-list { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 22px 48px 22px 0; font: 400 21px/1.3 var(--serif); color: var(--porcelain);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: #fff; }
.plus { position: absolute; right: 6px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 1px; background: var(--brass); transition: transform 0.3s var(--ease); }
.plus::after { transform: rotate(90deg); }
details[open] .plus::after { transform: rotate(0deg); }
.faq details p { padding: 0 48px 24px 0; max-width: 40em; font-size: 16px; }

/* close + contact */
.contact .copy { padding: 34vh 0 18vh; }
.close-line { font-size: clamp(26px, 1.6vw + 14px, 40px); line-height: 1.15; color: var(--silver); font-style: italic; }
.contact h2 { margin-top: 112px; }
.contact-aside { margin-top: 22px; }
.contact-aside p + p { margin-top: 6px; color: var(--mist); }
.contact-aside a { color: var(--porcelain); text-underline-offset: 3px; text-decoration-color: var(--hairline-strong); }
.contact-aside a:hover { text-decoration-color: var(--brass); }
.mark-fallback { display: none; }

form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 18px; margin-top: 44px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
fieldset { border: 0; margin: 0; padding: 0; }
label, legend { font-size: 14px; color: var(--silver); padding: 0; }
.optional { color: var(--mist); }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: 400 16px/1.4 var(--sans); color: var(--porcelain);
  background: rgba(20, 38, 52, 0.92); border: 1px solid var(--control); border-radius: 2px;
  padding: 12px 14px; transition: border-color 0.2s;
}
[aria-invalid="true"] { border-color: #e8c3a0 !important; }
.field-err { font-size: 14px; color: #e8c3a0; }
.field-err:empty { display: none; }
textarea { resize: vertical; min-height: 128px; }
input::placeholder, textarea::placeholder { color: #7d8e9b; }
input:hover, select:hover, textarea:hover { border-color: var(--mist); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brass-bright); outline-offset: 0; border-color: transparent; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--brass) 50%), linear-gradient(135deg, var(--brass) 50%, transparent 50%); background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px 9px 12px; border: 1px solid var(--control); border-radius: 2px; font-size: 14.5px; color: var(--silver); background: rgba(20, 38, 52, 0.7); transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.chip span::before { content: ""; flex: none; width: 11px; height: 11px; border: 1px solid var(--mist); border-radius: 1px; }
.chip:hover span { border-color: var(--mist); }
.chip input:checked + span { background: rgba(196, 164, 106, 0.16); border-color: var(--brass); color: var(--porcelain); }
.chip input:checked + span::before { border-color: var(--brass-bright); background: var(--brass-bright); box-shadow: inset 0 0 0 2px var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--brass-bright); outline-offset: 2px; }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 6px; }
.form-foot small { font-size: 13.5px; color: var(--mist); }
.form-status { grid-column: 1 / -1; font-size: 15px; color: var(--porcelain); }
.form-alert { grid-column: 1 / -1; font-size: 15px; color: #e8c3a0; }
.form-alert:empty { margin-bottom: -20px; }   /* rendered, so it is announced; takes no room while empty */
.form-status:empty { margin-top: -20px; }

/* footer */
.site-footer { position: relative; z-index: 3; background: var(--ink); border-top: 1px solid var(--hairline); padding: 56px 0 44px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 3.4vw, 64px); row-gap: 28px; align-items: start; }
.footer-brand img { height: 36px; width: auto; }
.caliber { margin-top: 14px; font-size: 13px; letter-spacing: 0.04em; color: var(--brass); font-variant-numeric: tabular-nums; }
.glyph-line { font: italic 300 22px/1.35 var(--serif); color: var(--silver); max-width: 30em; text-wrap: balance; }
.footer-nav { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px; font-size: 15px; }
.footer-nav .motion-toggle { font-size: 15px; color: var(--silver); padding: 0; }
.footer-nav a { text-decoration: none; color: var(--silver); }
.footer-nav a:hover { color: var(--porcelain); }
.legal { grid-column: 1; grid-row: 2; align-self: end; font-size: 13.5px; color: var(--mist); }

/* ==========================================================================
   Fallbacks: no WebGL, or the context was lost
   ========================================================================== */
.no-webgl .pattern .stage, .no-webgl .software .stage, .no-webgl .games .stage { display: none; }
.no-webgl .pattern .copy, .no-webgl .software .copy, .no-webgl .games .copy { grid-column: 1 / -1; max-width: 760px; }
.no-webgl .veil { display: none; }
.no-webgl .mark-fallback, .gl-lost .mark-fallback {
  display: block; position: absolute; left: 50%; top: 50%; width: min(44%, 320px); height: auto; transform: translate(-50%, -50%); opacity: 0.9;
}
.no-webgl .callout .params div[data-param] dd { color: var(--porcelain); }

/* ==========================================================================
   Medium widths: 820–1199 px
   ========================================================================== */
@media (max-width: 1199px) {
  .chapter-grid, .browser-row, .section-head, .faq-grid, .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .disciplines { grid-template-columns: minmax(0, 1fr); border-top: 0; }
  .disciplines li { border-top: 1px solid var(--hairline); padding-bottom: 10px; }
  .disciplines a { padding-top: 10px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 52px; }
  .stops { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .callout { width: 260px; }
  .formula { font-size: 21px; }
  .agentic-grid, .standards-grid, .takeover { grid-template-columns: minmax(0, 1fr); row-gap: 30px; }
  .nav { gap: 24px; }
}

/* ==========================================================================
   Narrow: below 820 px. The stage becomes a band under the header; the copy
   slides over it on an ink ground, so text never sits on moving lines.
   ========================================================================== */
@media (max-width: 819px) {
  :root { --hh: 62px; }
  body { font-size: 16.5px; }
  .logo img { height: 27px; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .nav {
    position: fixed; top: var(--hh); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 22px; background: rgba(14, 27, 38, 0.97);
    border-bottom: 1px solid var(--hairline);
    max-height: calc(100vh - var(--hh)); max-height: calc(100dvh - var(--hh)); overflow-y: auto; overscroll-behavior: contain;
    visibility: hidden; opacity: 0; transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0s 0.2s;
  }
  .menu-open .nav { visibility: visible; opacity: 1; transform: none; transition: opacity 0.2s, transform 0.2s; }
  .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--hairline); font-size: 17px; }
  .nav .btn { margin-top: 18px; padding: 15px; font-size: 15.5px; }

  .veil { background: none; }
  .pattern .stage { display: none; }
  .pattern .copy { background: var(--ink); }
  .chapter-grid { grid-template-columns: minmax(0, 1fr); }
  .chapter .stage { grid-column: 1; grid-row: 1; height: 46vh; height: 46svh; z-index: 0; }
  .chapter .copy {
    grid-column: 1; grid-row: 2; z-index: 1;
    margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter);
    background: linear-gradient(180deg, rgba(14, 27, 38, 0) 0, var(--ink) 40px);
  }
  .no-webgl .chapter:not(.hero) .copy { background: none; }

  .hero .chapter-grid { min-height: 0; }
  .hero .stage { display: contents; }
  .hero .stage-fit { grid-column: 1; grid-row: 1; position: relative; inset: auto; height: 40vh; }
  @supports (height: 1svh) { .hero .stage-fit { height: 40svh; } }
  .hero .copy { grid-row: 3; padding: 16px var(--gutter) 56px; background: var(--ink); }
  .motion-on.gl-ready:not(.gl-lost) .mt-narrow { display: inline-block; margin-top: 26px; }
  .motion-on.gl-ready:not(.gl-lost) .mt-wide { display: none; }
  h1 { font-size: clamp(40px, 11vw, 56px); }
  .lede { margin-top: 20px; }
  .actions { margin-top: 28px; }
  .disciplines { margin-top: 40px; }
  .callout {
    grid-column: 1; grid-row: 2; position: relative; right: auto; bottom: auto; width: auto; z-index: 1;
    margin: 0 calc(-1 * var(--gutter)); padding: 10px var(--gutter) 4px; border: 0; text-align: left;
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px;
    background: linear-gradient(180deg, rgba(14, 27, 38, 0) 0, var(--ink) 10px);
  }
  .callout figcaption { font-size: 13.5px; color: var(--porcelain); }
  .cap-long { display: none; }
  .cap-short { display: inline; }
  .formula { margin: 0; font-size: 16px; }
  .params { display: none; }

  .pattern .stage, .games .stage, .software .stage, .contact .stage { height: 44svh; height: 44vh; }
  @supports (height: 1svh) { .pattern .stage, .games .stage, .software .stage, .contact .stage { height: 44svh; } }
  .pattern .copy { padding-top: 32px; padding-bottom: 72px; }
  .software .copy { padding-top: 36px; padding-bottom: 88px; }
  .games .copy { padding-top: 36px; padding-bottom: 72px; }
  .contact .copy { padding-top: 32px; padding-bottom: 72px; }
  .contact h2 { margin-top: 48px; }
  .pairs { grid-template-columns: minmax(0, 1fr); }
  .standards { columns: 1; }
  .kinds div { grid-template-columns: minmax(0, 1fr); }
  .listing pre { font-size: 12px; }
  .listing figcaption { padding: 10px 14px; }
  .listing code { padding: 0 14px; }
  .listing .ln { min-width: calc(100% + 28px); margin: 0 -14px; padding: 0 14px; }
  .takeover { padding: 24px 20px; row-gap: 12px; }
  .software .copy h3 { margin-top: 56px; }

  .browser-row, .section-head, .model-grid, .faq-grid, .footer-grid { grid-template-columns: minmax(0, 1fr); row-gap: 18px; }
  .section { padding: 88px 0; }
  .stops { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 44px; margin-top: 56px; }
  .model-grid { margin-top: 48px; }
  .model-text { padding-top: 0; margin-top: 40px; }
  .stack dl div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .faq h2 { margin-bottom: 26px; }
  .faq summary { font-size: 19px; padding-right: 36px; }
  .faq details p { padding-right: 0; }
  form { grid-template-columns: minmax(0, 1fr); }
  .footer-nav, .legal { grid-column: 1; grid-row: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

@media (forced-colors: active) {
  .plus::before, .plus::after { background: CanvasText; forced-color-adjust: none; }
  select { appearance: auto; background-image: none; padding-right: 14px; }
  .chip span::before { forced-color-adjust: none; border-color: CanvasText; }
  .chip input:checked + span::before { background: Highlight; border-color: Highlight; box-shadow: none; }
  .chip input:checked + span { outline: 2px solid Highlight; }
}
