/* ==========================================================================
   Litequo — main stylesheet
   Concept: one beam of light, four products. Ink background, paper type,
   and four spectral accents that only ever appear as light.
   ========================================================================== */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/instrument-serif-latin.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: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/instrument-serif-latin-ext.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: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/instrument-serif-italic-latin.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: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/instrument-serif-italic-latin-ext.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: "Host Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(../fonts/host-grotesk-latin.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: "Host Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(../fonts/host-grotesk-latin-ext.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: "Fragment Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/fragment-mono-latin.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: "Fragment Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/fragment-mono-latin-ext.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; }

/* ---------- Tokens ---------- */
:root {
  --ink: #060708;
  --ink-2: #0b0c0e;
  --ink-3: #111215;
  --paper: #ecebe6;
  --paper-dim: rgba(236, 235, 230, .66);
  --paper-faint: rgba(236, 235, 230, .4);
  --paper-ghost: rgba(236, 235, 230, .2);
  --hair: rgba(236, 235, 230, .11);
  --hair-2: rgba(236, 235, 230, .2);
  --white: #f4f3ef;               /* the recombined light: footer surface */
  --white-ink: #0a0b0c;
  --white-dim: rgba(10, 11, 12, .62);
  --white-hair: rgba(10, 11, 12, .14);

  /* The spectrum, in order of wavelength (short → long) */
  --news: #315cf5;  --news-hi: #7b95ff;   /* Newsverum  ≈ 470 nm */
  --agri: #00ff66;                         /* AgriDigi   ≈ 515 nm */
  --l3d:  #c8f368;                         /* Listin3D   ≈ 565 nm */
  --volt: #feae04;                         /* Voltformer ≈ 590 nm */

  --serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --sans: "Host Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --arabic: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", "Arial", sans-serif;

  /* never closer to the edge than a notch or rounded corner (landscape phones, viewport-fit=cover) */
  --gutter: max(clamp(16px, 3.4vw, 52px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --nav-h: 68px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ink); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 380;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
canvas { display: block; }
em { font-style: italic; }
::selection { background: var(--paper); color: var(--ink); }
:focus-visible { outline: 1px solid var(--paper); outline-offset: 4px; border-radius: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 10001; padding: 10px 14px;
  background: var(--paper); color: var(--ink); font: 500 14px/1 var(--sans);
  transform: translateY(-200%); transition: transform .3s var(--ease-out);
}
.skip:focus { transform: none; }

/* Shared typographic atoms */
.fig, .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--paper-faint);
}
/* units keep their case inside uppercase labels: nm, not NM; λ, not Λ */
.unit { text-transform: none; }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7; }
.eyebrow--dark { color: var(--white-dim); }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center;
  background: var(--ink);
  transition: opacity .9s var(--ease-out) .55s, visibility 0s linear 1.5s;
}
.no-js .loader, .reduced .loader { display: none; }
.loader__beam { position: relative; width: min(62vw, 720px); height: 1px; }
.loader__beam i {
  position: absolute; inset: 0;
  background: #fff;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  box-shadow: 0 0 14px rgba(255, 255, 255, .55);
  transition: transform 1s var(--ease-in-out), background-color .45s ease, box-shadow .45s ease, opacity .8s ease .35s;
}
.loader.is-done .loader__beam i { opacity: 0; }
.loader.is-done .loader__beam i:nth-child(1) { background: var(--news-hi); box-shadow: 0 0 14px var(--news); transform: rotate(-9deg) scaleX(1.25); }
.loader.is-done .loader__beam i:nth-child(2) { background: var(--agri);    box-shadow: 0 0 14px var(--agri); transform: rotate(-3deg) scaleX(1.25); }
.loader.is-done .loader__beam i:nth-child(3) { background: var(--l3d);     box-shadow: 0 0 14px var(--l3d);  transform: rotate(3deg)  scaleX(1.25); }
.loader.is-done .loader__beam i:nth-child(4) { background: var(--volt);    box-shadow: 0 0 14px var(--volt); transform: rotate(9deg)  scaleX(1.25); }
.loader__meta {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; gap: 16px;
  font: 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--paper-faint);
  transition: opacity .5s ease;
}
.loader.is-done .loader__meta { opacity: 0; }
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__count { color: var(--paper); font-variant-numeric: tabular-nums; }

/* ---------- Cursor ---------- */
.cursor { display: none; }
.has-cursor .cursor { display: block; position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.cursor__dot, .cursor__ring { position: fixed; left: 0; top: 0; will-change: transform; }
.cursor__dot {
  width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: #fff; mix-blend-mode: difference;
  transition: opacity .3s ease, width .3s var(--ease-out), height .3s var(--ease-out), margin .3s var(--ease-out);
}
.cursor__ring {
  width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55); mix-blend-mode: difference;
  display: grid; place-items: center;
  transition: width .5s var(--ease-out), height .5s var(--ease-out), margin .5s var(--ease-out),
              background-color .4s ease, border-color .4s ease, opacity .4s ease;
}
.cursor__label {
  font: 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  color: var(--cursor-fg, var(--ink)); opacity: 0; transform: scale(.6);
  transition: opacity .3s ease, transform .4s var(--ease-out);
}
.cursor.is-label .cursor__ring {
  width: 86px; height: 86px; margin: -43px 0 0 -43px;
  background: var(--cursor-bg, var(--paper)); border-color: transparent; mix-blend-mode: normal;
}
.cursor.is-label .cursor__label { opacity: 1; transform: none; }
.cursor.is-label .cursor__dot { opacity: 0; }
.cursor.is-link .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: rgba(255, 255, 255, .9); }
.cursor.is-cross .cursor__ring { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-color: rgba(255, 255, 255, .8); }
.cursor.is-hidden .cursor__ring, .cursor.is-hidden .cursor__dot { opacity: 0; }
.cursor.is-down .cursor__ring { width: 30px; height: 30px; margin: -15px 0 0 -15px; }

/* ---------- Grain & progress ---------- */
.grain {
  position: fixed; left: -20%; top: -20%; width: 140%; height: 140%; /* covers the viewport at every grain offset, at half the layer area */
  z-index: 9000; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.1 -.1'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1s steps(5) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); } 60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 4%); } 100% { transform: translate(0, 0); }
}
.progress { position: fixed; left: 0; top: 0; right: 0; height: 1px; z-index: 9500; pointer-events: none; }
.progress i {
  display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(var(--sp, 0));
  background: linear-gradient(90deg, var(--news-hi), var(--agri), var(--l3d), var(--volt), #fff);
  opacity: .8;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed; left: 0; right: 0; top: 0; z-index: 9400; height: var(--nav-h);
  display: flex; align-items: center; gap: 32px; padding: 0 var(--gutter);
  color: #fff; mix-blend-mode: difference;
  transition: transform .6s var(--ease-out);
}
.nav.is-hidden { transform: translateY(-110%); }
.js .nav { opacity: 0; transform: translateY(-12px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.js .is-ready .nav, .is-ready .nav { opacity: 1; transform: none; }
.is-ready .nav.is-hidden { transform: translateY(-110%); }
.nav__brand { display: inline-flex; align-items: center; margin-right: auto; padding: 6px 0; }
.nav__links { display: flex; gap: 28px; font-size: 14px; letter-spacing: .01em; }
.nav__links a { position: relative; padding: 6px 0; opacity: .82; transition: opacity .3s ease; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: 100% 50%; transition: transform .5s var(--ease-out);
}
.nav__links a:hover { opacity: 1; }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav__lang { position: relative; flex: 0 0 auto; font: 12px/1 var(--mono); letter-spacing: .06em; }
.nav__lang summary { display: flex; align-items: center; gap: 10px; padding: 12px 4px; cursor: pointer; list-style: none; }
.nav__lang summary::-webkit-details-marker { display: none; }
.nav__lang summary > span:last-child { opacity: .5; }
.nav__lang-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 170px; padding: 8px; background: var(--ink-2); color: var(--paper); border: 1px solid var(--hair-2); border-radius: 6px; box-shadow: 0 10px 35px #0007; }
.nav:has(.nav__lang[open]) { mix-blend-mode: normal; }
.nav__lang a { display: block; padding: 12px; opacity: .7; transition: opacity .3s ease; font-family: var(--sans); font-size: 14px; line-height: 1.4; letter-spacing: 0; }
.nav__lang a[aria-current="page"] { opacity: 1; background: var(--ink-3); }
.nav__lang a:hover { opacity: 1; }

/* Arabic prose flows right-to-left; technical diagrams stay in their own coordinates. */
html[lang="ar"] { --serif: var(--arabic); --sans: var(--arabic); --mono: var(--arabic); }
html[lang="ar"] .hero__title, html[lang="ar"] .agents__title,
html[lang="ar"] .finale__title, html[lang="ar"] .index__title { line-height: 1.35; letter-spacing: 0; }
html[lang="ar"] .nav__brand { margin-right: 0; margin-left: auto; }
html[lang="ar"] .hero__sub, html[lang="ar"] .chapter__desc,
html[lang="ar"] .agents__body { line-height: 1.8; }
html[lang="ar"] .index__table th, html[lang="ar"] .index__table td { text-align: right; }
html[lang="ar"] .terminal, html[lang="ar"] .agentview__body { font-family: "Fragment Mono", ui-monospace, monospace; text-align: left; }
@media (min-width: 901px) {
  html[lang="ar"] .hero__title { font-size: clamp(3.3rem, 7.8vw, 8rem); line-height: 1.2; }
}

/* Wordmark: the i's tittle is a point of light carrying the whole spectrum */
.wordmark {
  font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: -.012em;
  display: inline-flex; align-items: baseline; white-space: nowrap;
}
.wordmark__i { position: relative; display: inline-block; }
.wordmark__i i {
  position: absolute; left: 50%; top: .07em; width: .19em; height: .19em; border-radius: 50%;
  transform: translateX(-46%);
  background: conic-gradient(from 210deg, var(--news-hi), var(--agri), var(--l3d), var(--volt), var(--news-hi));
  box-shadow: 0 0 .28em rgba(255, 255, 255, .5);
  animation: tittle 6s linear infinite;
}
@keyframes tittle { to { filter: hue-rotate(0deg); transform: translateX(-46%) rotate(360deg); } }

/* ---------- Hero — Fig. 1 ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; isolation: isolate; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero__meta {
  position: absolute; top: calc(var(--nav-h) + 6px); left: var(--gutter);
  display: flex; gap: 22px; flex-wrap: wrap;
  font: 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--paper-faint);
}
.hero__meta > span + span::before { content: "/"; margin-right: 22px; opacity: .5; }
.hero__fig { position: absolute; top: calc(var(--nav-h) + 6px); right: var(--gutter); }

.hero__content {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(36px, 7.5vh, 88px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 48px; align-items: end;
  pointer-events: none;
}
.hero__content > * { pointer-events: auto; }
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(3.3rem, 9.4vw, 10.4rem); line-height: .9; letter-spacing: -.022em;
  text-wrap: balance;
}
.hero__title em { letter-spacing: -.01em; }
.hero__sub { color: var(--paper-dim); font-size: 1rem; line-height: 1.55; max-width: 36ch; padding-bottom: .55em; }

.hero__rays { position: absolute; inset: 0; pointer-events: none; }
.ray {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: baseline; justify-items: end;
  text-align: right; white-space: nowrap; will-change: transform; opacity: 0;
  transition: opacity .8s var(--ease-out);
}
.rays-on .ray { opacity: 1; }
.ray__dot { display: none; }
.ray__name { font: 500 15px/1.2 var(--sans); letter-spacing: .005em; color: var(--paper); grid-column: 1 / -1; }
.ray__meta { font: 10px/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--paper-faint); grid-column: 1 / -1; transition: color .3s ease; }
.ray:hover .ray__meta, .ray.is-hot .ray__meta { color: var(--c); }

.hero__hint {
  position: absolute; right: var(--gutter); bottom: calc(clamp(36px, 7.5vh, 88px) + 210px);
  font: 10px/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--paper-ghost);
  opacity: 0; transition: opacity 1s ease 2.2s;
}
.is-ready .hero__hint { opacity: 1; }
.hero__scroll {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px;
  font: 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--paper-faint);
}
.hero__scroll i { display: block; width: 1px; height: 38px; background: linear-gradient(var(--paper-faint), transparent); overflow: hidden; position: relative; }
.hero__scroll i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: #fff; animation: drip 2.2s var(--ease-in-out) infinite; }
@keyframes drip { 0% { top: -40%; } 70%, 100% { top: 100%; } }

/* Intro choreography — elements wait for .is-ready */
.js .hero__meta, .js .hero__fig, .js .hero__sub, .js .hero__scroll { opacity: 0; transform: translateY(10px); transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out); }
.is-ready .hero__meta { opacity: 1; transform: none; transition-delay: 1.1s; }
.is-ready .hero__fig { opacity: 1; transform: none; transition-delay: 1.3s; }
.is-ready .hero__sub { opacity: 1; transform: none; transition-delay: 1.25s; }
.is-ready .hero__scroll { opacity: 1; transform: translateX(-50%); transition-delay: 1.8s; }
.js .hero__scroll { transform: translate(-50%, 10px); }

/* Word-split reveal (used by hero title and [data-reveal="words"]) */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: .02em .04em .14em; margin: -.02em -.04em -.14em; }
.w > span { display: inline-block; }
.js [data-split] .w > span, .js [data-reveal="words"] .w > span {
  transform: translate3d(0, 112%, 0) rotate(4deg); transform-origin: 0 100%;
  transition: transform 1.25s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms + var(--d, 0s));
}
.js [data-split].is-in .w > span, .js [data-reveal="words"].is-in .w > span { transform: none; }

/* ---------- Generic reveal ---------- */
.js [data-reveal]:not([data-reveal="words"]) {
  opacity: 0; transform: translate3d(0, 22px, 0);
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in:not([data-reveal="words"]) { opacity: 1; transform: none; }

/* ---------- Spectrum — Fig. 2 ---------- */
.spectrum { position: relative; padding: clamp(120px, 22vh, 220px) var(--gutter) clamp(96px, 16vh, 180px); }
.statement {
  margin-top: 40px; max-width: 22ch; max-width: min(100%, 1180px);
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 4.6rem); line-height: 1.04; letter-spacing: -.016em;
  text-wrap: pretty;
}
.statement .w { overflow: visible; padding: 0; margin: 0; }
.statement .w > span { transition: color .5s ease; }
.js .statement .w { opacity: var(--o, .16); }
.statement .hl .w.is-lit > span { color: var(--c); }
.statement em { color: var(--paper); }

.ruler { margin-top: clamp(64px, 12vh, 140px); }
.ruler__canvas { width: 100%; height: 150px; }
@media (max-width: 559px) { .ruler__canvas { height: 190px; } }
.ruler__caption { margin-top: 18px; max-width: 46ch; font: 11px/1.6 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--paper-faint); }

/* ---------- Chapters (products) ---------- */
.products { position: relative; }
.chapter {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto auto;
  column-gap: clamp(28px, 4.4vw, 84px);
  padding: 0 var(--gutter);
  border-top: 1px solid var(--hair);
}
.chapter__head {
  grid-column: 1; grid-row: 1; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: calc(var(--nav-h) + 32px) 0 56px;
}
.chapter__meta {
  display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 26px;
  font: 11px/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--paper-faint);
}
.chapter__meta span:first-child { color: var(--c-hi); }
.chapter__name {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(3.4rem, 7.6vw, 8.4rem); line-height: .9; letter-spacing: -.028em;
  margin-left: -.04em;
}
.chapter__tag {
  margin-top: 22px; font-family: var(--serif); font-style: italic;
  font-size: clamp(1.45rem, 2.2vw, 2.1rem); line-height: 1.12; color: var(--paper);
  max-width: 22ch;
}
.chapter__desc { margin-top: 22px; max-width: 44ch; color: var(--paper-dim); }

.cta {
  margin-top: 34px; display: inline-flex; align-items: center; gap: 14px;
  padding: 13px 18px 13px 20px; border: 1px solid var(--hair-2); border-radius: 999px;
  font: 13px/1 var(--mono); letter-spacing: .04em; color: var(--paper);
  position: relative; overflow: hidden; isolation: isolate;
  transition: border-color .4s ease, color .4s ease;
}
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--c-hi, var(--paper)); transform: translateY(101%); transition: transform .6s var(--ease-out);
}
.cta:hover { color: var(--ink); border-color: var(--c-hi, var(--paper)); }
.cta:hover::before { transform: none; }
.cta__arrow { display: inline-block; transition: transform .5s var(--ease-out); }
.cta:hover .cta__arrow { transform: translate(2px, -2px); }

.chapter__steps { grid-column: 1; grid-row: 2; padding-bottom: 28vh; counter-reset: step; }
.step {
  min-height: 74vh; min-height: 74svh; display: flex; flex-direction: column; justify-content: center;
  padding: 24px 0; max-width: 40ch;
  opacity: .22; transition: opacity .7s var(--ease-out);
}
.step.is-active { opacity: 1; }
.step__n {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px;
  font: 11px/1 var(--mono); letter-spacing: .08em; color: var(--paper-faint); text-transform: uppercase;
}
.step__n::after { content: ""; width: 0; height: 1px; background: var(--c-hi); transition: width .9s var(--ease-out); }
.step.is-active .step__n::after { width: 48px; }
.step__title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 3vw, 2.9rem); line-height: 1.02; letter-spacing: -.012em; }
.step__body { margin-top: 14px; color: var(--paper-dim); }

.chapter__media {
  grid-column: 2; grid-row: 1 / span 2; align-self: start;
  position: sticky; top: 0; height: 100vh; height: 100svh;
  padding: calc(var(--nav-h) + 4px) 0 var(--gutter);
}

/* The plate: a scientific figure frame */
.plate {
  position: relative; width: 100%; height: 100%; overflow: hidden; isolation: isolate;
  border-radius: 3px;
  background:
    radial-gradient(120% 90% at 70% 30%, color-mix(in srgb, var(--c) 7%, transparent), transparent 62%),
    var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.plate__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.plate__fig { position: absolute; left: 18px; top: 16px; z-index: 3; }
.plate__chrome i { position: absolute; width: 10px; height: 10px; border-color: var(--paper-ghost); border-style: solid; z-index: 3; pointer-events: none; }
.plate__chrome i:nth-child(1) { left: 8px; top: 8px; border-width: 1px 0 0 1px; }
.plate__chrome i:nth-child(2) { right: 8px; top: 8px; border-width: 1px 1px 0 0; }
.plate__chrome i:nth-child(3) { left: 8px; bottom: 8px; border-width: 0 0 1px 1px; }
.plate__chrome i:nth-child(4) { right: 8px; bottom: 8px; border-width: 0 1px 1px 0; }

/* ---------- Newsverum lineage ---------- */
.lineage {
  position: absolute; inset: 52px 22px 22px; z-index: 2;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
}
.lin-card {
  position: relative; padding: 16px 18px 18px;
  background: color-mix(in srgb, var(--ink-2) 82%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--hair); border-radius: 3px;
  opacity: .18; transform: translateY(10px) scale(.985);
  transition: opacity .9s var(--ease-out), transform 1s var(--ease-out), border-color .6s ease;
}
.lin-card.is-on { opacity: 1; transform: none; }
.lin-card.is-focus { border-color: color-mix(in srgb, var(--news-hi) 55%, transparent); }
.lin-card__kicker {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px;
  font: 10.5px/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--paper-faint);
}
/* When the open cards don't fit the plate (JS sets .is-tight), only the card in focus
   stays open; the others fold down to their kicker line. */
.lin-card__fold { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .8s var(--ease-out); }
.lin-card__body { min-height: 0; overflow: hidden; overflow: clip; overflow-clip-margin: 6px; }
.lin-card__body > :first-child { margin-top: 10px; }
.lin-card__body > :last-child { margin-bottom: 0; }
.lineage.is-tight .lin-card:not(.is-focus):not(:focus-within) .lin-card__fold { grid-template-rows: 0fr; }
.lin-stamp { color: var(--news-hi); }
.lin-source { width: min(100%, 420px); }
.lin-source__name { font: 400 clamp(1.3rem, 2vw, 1.75rem)/1.1 var(--serif); }
.lin-source__url { margin-top: 6px; font: 12px/1.4 var(--mono); color: var(--paper-dim); }
.lin-source__url a, .lin-story__title {
  text-decoration: underline 1px; text-decoration-color: transparent; text-underline-offset: .22em;
  transition: color .3s ease, text-decoration-color .3s ease;
}
.lin-source__url a { text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.lin-source__url a:hover, .lin-story__title:hover { color: var(--news-hi); text-decoration-color: currentColor; }

.lin-figures { width: min(100%, 520px); align-self: center; }
.figlist li {
  display: grid; grid-template-columns: 7.2em minmax(0, 1fr) auto; gap: 14px; align-items: baseline;
  padding: 9px 0; border-top: 1px solid var(--hair);
  opacity: 0; transform: translateX(-8px); transition: opacity .6s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 110ms + .15s);
}
.lin-figures.is-on .figlist li { opacity: 1; transform: none; }
.figlist strong { font: 400 1.3rem/1 var(--serif); font-variant-numeric: tabular-nums; color: var(--paper); white-space: nowrap; }
.figlist span { font-size: 13.5px; line-height: 1.3; color: var(--paper-dim); }
.figlist em {
  font: 9.5px/1 var(--mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 6px 3px; border-radius: 2px; border: 1px solid var(--hair-2); color: var(--paper-dim); white-space: nowrap;
}
.figlist li[data-kind="observed"] em { border-color: color-mix(in srgb, var(--news-hi) 70%, transparent); color: var(--news-hi); }
.figlist li[data-kind="target"] em { border-style: dashed; }
.figlist li[data-kind="estimate"] em { border-style: dotted; }
.lin-note { margin-top: 10px; font: 10.5px/1.5 var(--mono); letter-spacing: .03em; color: var(--paper-faint); }

.lin-story { width: min(100%, 560px); align-self: flex-end; }
.lin-story__title {
  display: block;
  font: 400 clamp(1.25rem, 2.1vw, 1.9rem)/1.14 var(--serif); letter-spacing: -.006em;
  min-height: 3.42em; text-wrap: balance;
}
.lin-story__title[lang="ar"] { font-family: var(--arabic); font-size: clamp(1.1rem, 1.8vw, 1.55rem); line-height: 1.5; letter-spacing: 0; }
.lin-editions { display: inline-flex; gap: 4px; }
.lin-editions button {
  padding: 3px 6px 2px; border-radius: 2px; font: 10px/1.2 var(--mono); letter-spacing: .06em;
  color: var(--paper-faint); border: 1px solid transparent; transition: color .3s ease, border-color .3s ease, background-color .3s ease;
}
.lin-editions button:hover { color: var(--paper); }
.lin-editions button[aria-pressed="true"] { color: var(--ink); background: var(--news-hi); }

/* ---------- Newsverum wire (marquee) ---------- */
.wire { position: relative; padding: 22px 0 26px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); overflow: hidden; }
.wire__head {
  display: flex; align-items: center; gap: 12px; padding: 0 var(--gutter) 16px;
  font: 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--paper-faint);
}
.wire__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--news-hi); box-shadow: 0 0 10px var(--news); animation: pulse 2.4s ease-in-out infinite; }
.wire__status { margin-left: auto; color: var(--paper-ghost); }
@keyframes pulse { 50% { opacity: .35; } }
.wire__viewport { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.wire__track { display: flex; width: max-content; will-change: transform; }
.wire__item { display: flex; align-items: baseline; gap: 14px; padding-right: 56px; white-space: nowrap; }
.wire__item small { font: 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--news-hi); }
.wire__item a { font: 400 clamp(1.3rem, 2.1vw, 1.9rem)/1.2 var(--serif); color: var(--paper-dim); transition: color .3s ease; }
.wire__item a:hover { color: var(--paper); }
.wire__item::after { content: "✦"; font-size: 10px; color: var(--paper-ghost); margin-left: 42px; }

/* ---------- AgriDigi HUD ---------- */
.agri-hud { position: absolute; right: 18px; top: 14px; z-index: 3; text-align: right; }
.agri-hud__index { font: 11px/1.4 var(--mono); letter-spacing: .07em; color: var(--paper-faint); }
.agri-hud__index strong { font: 400 1.5rem/1 var(--serif); letter-spacing: 0; color: var(--agri); margin-left: 6px; }
.agri-hud__name { margin-top: 6px; font: 10.5px/1.4 var(--mono); letter-spacing: .04em; color: var(--paper-dim); max-width: 30ch; margin-left: auto; }
.agri-hud__pass { margin-top: 4px; font: 10px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--paper-faint); }
/* scrims keep the HUD legible over a bright raster */
.plate--agri::before, .plate--agri::after { content: ""; position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none; }
.plate--agri::before { top: 0; height: 170px; background: linear-gradient(rgba(6, 7, 8, .8), rgba(6, 7, 8, .38) 55%, rgba(6, 7, 8, 0)); }
.plate--agri::after { bottom: 0; height: 80px; background: linear-gradient(rgba(6, 7, 8, 0), rgba(6, 7, 8, .7)); }
.agri-legend {
  position: absolute; left: 18px; bottom: 16px; z-index: 3;
  display: flex; align-items: center; gap: 10px; font: 10px/1 var(--mono); color: var(--paper-faint);
}
.agri-legend i { display: block; width: 120px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #0c110e 0%, #0d1f16 29%, #0a3621 49%, #065c32 68%, #029648 84%, #00ee62 100%); }
.agri-tip {
  position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none;
  padding: 9px 11px; border-radius: 3px; background: rgba(6, 7, 8, .88); border: 1px solid rgba(0, 255, 102, .35);
  font: 11px/1.45 var(--mono); color: var(--paper); white-space: nowrap;
  opacity: 0; transform: translate(14px, -50%); transition: opacity .25s ease;
}
.agri-tip.is-on { opacity: 1; }
.agri-tip b { font-weight: 400; color: var(--agri); }

/* ---------- Listin3D ---------- */
.l3d-hint {
  position: absolute; right: 18px; bottom: 16px; z-index: 3;
  font: 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--paper-faint);
  display: flex; align-items: center; gap: 8px;
}
.l3d-hint::before { content: "↻"; font-size: 13px; color: var(--l3d); }
.plate--l3d { touch-action: pan-y; }
.plate--l3d.is-dragging { cursor: grabbing; }

/* ---------- Voltformer RFQ ---------- */
.rfq {
  position: absolute; right: 18px; bottom: 18px; z-index: 3; width: min(300px, calc(100% - 36px));
  padding: 14px 16px 14px; border-radius: 3px;
  background: rgba(8, 9, 11, .97); border: 1px solid color-mix(in srgb, var(--volt) 45%, transparent);
  opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease-out), transform .9s var(--ease-out);
  pointer-events: none;
}
.rfq.is-on { opacity: 1; transform: none; }
.rfq__kicker { display: flex; justify-content: space-between; gap: 12px; font: 10.5px/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--paper-faint); }
.rfq__kicker span:first-child { color: var(--volt); }
.rfq__specs { margin-top: 10px; }
.rfq__specs div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--hair); font-size: 13px; }
.rfq__specs dt { color: var(--paper-faint); }
.rfq__specs dd { font-family: var(--mono); font-size: 12px; color: var(--paper); }
.rfq__status { margin-top: 10px; display: flex; align-items: center; gap: 8px; font: 10.5px/1.35 var(--mono); letter-spacing: .03em; color: var(--paper-dim); }
.rfq__status i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--volt); box-shadow: 0 0 8px var(--volt); animation: pulse 1.6s ease-in-out infinite; }

/* ---------- Agents — Fig. 7 ---------- */
.agents {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(28px, 4.4vw, 84px); align-items: center;
  padding: clamp(110px, 20vh, 220px) var(--gutter); border-top: 1px solid var(--hair);
}
.agents__title {
  margin-top: 28px; font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.6rem, 5.2vw, 5.4rem); line-height: .95; letter-spacing: -.022em;
}
.agents__body { margin-top: 26px; max-width: 46ch; color: var(--paper-dim); }
.endpoints { margin-top: 34px; border-bottom: 1px solid var(--hair); }
.endpoints li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 0; border-top: 1px solid var(--hair); font: 13px/1.3 var(--mono);
}
.endpoints a { position: relative; padding-left: 18px; color: var(--paper); transition: color .3s ease; }
.endpoints a::before { content: ""; position: absolute; left: 0; top: .42em; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.endpoints a:hover { color: var(--c); }
.endpoints span { color: var(--paper-faint); font-size: 11px; letter-spacing: .04em; text-align: right; }

.terminal {
  position: relative; border-radius: 6px; overflow: hidden;
  background: linear-gradient(180deg, #0d0e11, #08090a);
  box-shadow: 0 0 0 1px var(--hair-2), 0 40px 120px -40px rgba(0, 0, 0, .8);
}
.terminal__bar {
  display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--hair);
  font: 11px/1 var(--mono); color: var(--paper-faint);
}
.terminal__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--hair-2); }
.terminal__bar span { margin-left: 10px; letter-spacing: .04em; }
.terminal__body {
  margin: 0; padding: 18px 20px 22px; height: clamp(320px, 42vh, 420px); overflow: hidden;
  font: 12.5px/1.75 var(--mono); color: var(--paper-dim); white-space: pre-wrap; word-break: break-word;
}
.terminal__body .t-cmd { color: var(--paper); }
.terminal__body .t-prompt { color: var(--paper-ghost); }
.terminal__body .t-ok { color: var(--c, var(--paper)); }
.terminal__body .t-dim { color: var(--paper-faint); }
.terminal__body .t-caret { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; background: var(--paper); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Index — Fig. 8 ---------- */
.index { padding: clamp(100px, 18vh, 200px) var(--gutter) clamp(120px, 22vh, 240px); border-top: 1px solid var(--hair); }
.index__head { display: flex; flex-direction: column; gap: 26px; margin-bottom: clamp(40px, 7vh, 80px); }
.index__title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 4.8vw, 4.8rem); line-height: .98; letter-spacing: -.02em; }
.index__table { width: 100%; border-collapse: collapse; }
.index__table thead th {
  text-align: left; padding: 0 0 14px; font: 10.5px/1 var(--mono); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-faint);
}
/* the hover sweep is a row background: a pseudo-element on a <tr> would become an extra table cell */
.index__table tbody tr {
  position: relative;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%) no-repeat 0 0 / 0% 100%;
  transition: background-size .8s var(--ease-out);
}
.index__table tbody tr:hover { background-size: 100% 100%; }
.index__table tbody th, .index__table tbody td {
  text-align: left; vertical-align: baseline; padding: 26px 18px 26px 0; border-top: 1px solid var(--hair);
  font-size: 15px; color: var(--paper-dim); font-weight: 380;
}
.index__table tbody tr:last-child > * { border-bottom: 1px solid var(--hair); }
.index__table tbody th { width: 30%; }
.index__table tbody th a {
  font: 400 clamp(1.9rem, 3.4vw, 3.2rem)/1 var(--serif); letter-spacing: -.016em; color: var(--paper);
  display: inline-flex; align-items: baseline; gap: 14px; transition: color .4s ease;
}
.index__table tbody th a::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); transform: translateY(-.28em); }
.index__table tbody th a::after { content: ""; position: absolute; inset: 0; }
.index__table tbody tr:hover th a { color: var(--c); }
.index__go { text-align: right !important; font-family: var(--mono); font-size: 12px !important; letter-spacing: .03em; white-space: nowrap; color: var(--paper-faint) !important; transition: color .3s ease, transform .5s var(--ease-out); }
.index__table tbody tr:hover .index__go { color: var(--paper) !important; }

/* ---------- Finale — Fig. 9 ---------- */
.finale { position: relative; height: 260vh; height: 260svh; --flood: 0; }
.finale__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.finale__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* caption and title sit on the canvas with a difference blend, so the white wavefront inverts them exactly where it passes */
.finale__fig { position: absolute; left: var(--gutter); top: calc(var(--nav-h) + 6px); color: #8e8d89; mix-blend-mode: difference; }
.finale__title {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(40px, 9vh, 110px);
  font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 8.4vw, 9.4rem); line-height: .92; letter-spacing: -.024em;
  color: var(--paper); mix-blend-mode: difference;
  opacity: var(--title-o, 0); transform: translateY(calc((1 - var(--title-o, 0)) * 30px));
  max-width: 12ch;
}

/* ---------- Footer (white light) ---------- */
.footer {
  position: relative; background: var(--white); color: var(--white-ink);
  padding: clamp(40px, 8vh, 96px) var(--gutter) 0; overflow: hidden;
}
.footer ::selection { background: var(--white-ink); color: var(--white); }
.footer :focus-visible { outline-color: var(--white-ink); }
.footer__contact { padding-bottom: clamp(64px, 12vh, 140px); }
.footer__mail {
  display: block; width: fit-content; max-width: 100%; margin-top: 26px; position: relative;
  font: 400 clamp(2.6rem, 8.2vw, 9.2rem)/1 var(--serif); letter-spacing: -.03em;
  will-change: transform;
}
.footer__mail::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.04em; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: 100% 50%; transition: transform .7s var(--ease-out);
}
.footer__mail:hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.footer__note { margin-top: 20px; color: var(--white-dim); }
.footer__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px;
  padding: 28px 0 40px; border-top: 1px solid var(--white-hair);
}
.footer__grid h3 { font: 10.5px/1.4 var(--mono); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--white-dim); margin-bottom: 14px; }
.footer__grid p, .footer__grid li { font-size: 15px; line-height: 1.6; }
.footer__grid a, .linkish { position: relative; text-align: left; }
.footer__grid a::after, .linkish::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: 100% 50%; transition: transform .5s var(--ease-out);
}
.footer__grid a:hover::after, .linkish:hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.footer__mark {
  display: flex; justify-content: center; line-height: .74; margin: 0 calc(var(--gutter) * -1); padding-top: 10px;
  overflow: hidden; height: 18.5vw; user-select: none;
}
.footer__mark .wordmark { font-size: 31vw; letter-spacing: -.045em; }
.footer__mark .wordmark__i i { box-shadow: none; }
.footer__legal {
  position: relative; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  padding: 18px 0 calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--white-hair);
  font: 11px/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--white-dim);
  background: var(--white);
}
.footer__legal a:hover { color: var(--white-ink); }

/* ---------- Agent view ---------- */
.agentview {
  position: fixed; inset: 0; z-index: 9800; display: flex; flex-direction: column;
  background: var(--ink); color: var(--paper);
  opacity: 0; transition: opacity .4s ease;
}
.agentview[hidden] { display: none; }
.agentview.is-open { opacity: 1; }
.agentview__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px var(--gutter); border-bottom: 1px solid var(--hair);
  font: 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--paper-faint);
}
.agentview__close { font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--paper); padding: 8px 0; }
.agentview__body {
  flex: 1; margin: 0; overflow: auto; padding: 28px var(--gutter) 60px;
  font: 13px/1.75 var(--mono); color: var(--paper-dim); white-space: pre-wrap; word-break: break-word;
  overscroll-behavior: contain;
}
.agentview__body .h { color: var(--paper); }
.agentview__body .l { color: var(--news-hi); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav__links { gap: 20px; }
  .hero__content { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hero__hint { display: none; }
}

@media (max-width: 900px) {
  :root { --nav-h: 58px; }
  body { font-size: 1rem; }
  .nav { gap: 18px; }
  .nav__links { display: none; }
  .wordmark { font-size: 27px; }

  .hero { min-height: 560px; }
  .hero__fig { display: none; }
  .hero__content { bottom: 64px; }
  .hero__title { font-size: clamp(2.9rem, 13.4vw, 5.4rem); }
  .hero__sub { font-size: .95rem; }
  .ray__name { font-size: 13px; }
  .ray__meta { font-size: 9px; }

  .chapter { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .chapter__head { grid-row: 1; min-height: 0; padding: 120px 0 36px; }
  /* the sticky figure owns the strip under the nav too, so steps never show through above it */
  .chapter__media {
    grid-column: 1; grid-row: 2; z-index: 2; top: 0;
    height: calc(56vh + var(--nav-h)); height: calc(56svh + var(--nav-h));
    padding: var(--nav-h) 0 0; background: var(--ink);
  }
  .chapter__media::after {
    content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 44px; pointer-events: none;
    background: linear-gradient(var(--ink), transparent);
  }
  .chapter__steps { grid-row: 3; padding-bottom: 12vh; position: relative; z-index: 1; }
  .step { min-height: 40vh; min-height: 40svh; max-width: none; }
  .step__title { font-size: 1.75rem; }

  .lineage { inset: 44px 12px 12px; gap: 8px; }
  .lin-card { padding: 11px 12px 12px; }
  .lin-card__kicker { font-size: 9.5px; }
  .lin-card__body > :first-child { margin-top: 8px; }
  .lin-source__name { font-size: 1.15rem; }
  .lin-source__url { font-size: 11px; }
  .figlist li { grid-template-columns: 5.4em minmax(0, 1fr) auto; gap: 8px; padding: 4px 0; }
  .figlist strong { font-size: 1.05rem; }
  .figlist span { font-size: 11.5px; }
  .lin-note { display: none; }
  .lin-story__title { font-size: 1.12rem; min-height: 0; }

  .agri-hud__name, .agri-hud__pass { display: none; }
  .agri-hud { top: auto; bottom: 10px; right: 14px; }
  .agri-hud__index strong { font-size: 1.25rem; }
  .rfq { width: calc(100% - 24px); right: 12px; bottom: 12px; padding: 10px 12px; }
  .rfq__specs div { padding: 4px 0; font-size: 12px; }

  .agents { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
  .terminal__body { height: 380px; font-size: 11.5px; }

  .index__table thead { display: none; }
  .index__table, .index__table tbody, .index__table tr, .index__table th, .index__table td { display: block; width: 100% !important; }
  .index__table tbody tr { padding: 22px 0; border-top: 1px solid var(--hair); }
  .index__table tbody tr:last-child { border-bottom: 1px solid var(--hair); }
  .index__table tbody th, .index__table tbody td { border: 0 !important; padding: 3px 0; font-size: 14px; }
  .index__table tbody th { padding-bottom: 10px; }
  .index__go { text-align: left !important; padding-top: 10px !important; }

  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
}

/* Phones held sideways (and other short, wide screens): the stacked layout would leave the
   figure a thin strip, so chapters go back to two columns with a full-height sticky figure.
   Keep this query in sync with LQ.env.mobile in core.js. */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 540px) {
  .chapter { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto auto; column-gap: 24px; }
  .chapter__head { grid-column: 1; grid-row: 1; min-height: 100svh; padding: calc(var(--nav-h) + 16px) 0 32px; }
  .chapter__media {
    grid-column: 2; grid-row: 1 / span 2; height: 100vh; height: 100svh;
    padding: calc(var(--nav-h) + 4px) 0 12px; background: none;
  }
  .chapter__media::after { display: none; }
  .chapter__steps { grid-column: 1; grid-row: 2; padding-bottom: 30svh; }
  .step { min-height: 80svh; }
  .step__title { font-size: 1.5rem; }
  .lineage { inset: 36px 10px 10px; }
}

/* Touch: grow small hit areas to ~44px without changing how they look */
@media (pointer: coarse) {
  .nav__lang a, .lin-editions button, .lin-source__url a { position: relative; }
  .nav__lang a::after, .lin-editions button::after, .lin-source__url a::after {
    content: ""; position: absolute; inset: -10px -3px;
  }
  .lin-source__url a::after { inset: -14px -6px; }
}

@media (max-width: 400px) {
  /* very narrow screens (folded phones): legend labels may wrap */
  .hero__rays { gap: 12px 12px; }
  .ray { white-space: normal; min-width: 0; }
}

@media (max-width: 719px) {
  /* the hero becomes a column: prism above, legend and title below */
  .hero { display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--gutter) 76px; }
  .hero__rays {
    position: relative; inset: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px;
    pointer-events: auto; margin-bottom: 30px;
  }
  .ray {
    position: relative; transform: none !important;
    grid-template-columns: 8px auto; column-gap: 10px; justify-items: start; text-align: left;
  }
  .ray__dot { display: block; grid-column: 1; grid-row: 1; align-self: center; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
  .ray__name { grid-column: 2; grid-row: 1; }
  .ray__meta { grid-column: 2; grid-row: 2; }
  .hero__content { position: relative; left: auto; right: auto; bottom: auto; }
}

@media (max-width: 520px) {
  .wire__head { flex-wrap: wrap; row-gap: 8px; }
  .wire__status { flex-basis: 100%; margin-left: 19px; }
  .footer__grid { grid-template-columns: minmax(0, 1fr); }
  .endpoints li { flex-direction: column; gap: 4px; }
  .endpoints span { text-align: left; padding-left: 18px; }
}

/* ---------- Without JavaScript: everything readable, nothing waiting on a scene ---------- */
.no-js .ray, .no-js .step, .no-js .lin-card, .no-js .figlist li, .no-js .rfq { opacity: 1; transform: none; }
.no-js .hero__hint, .no-js .wire, .no-js .terminal, .no-js [data-agent-view] { display: none; }
.no-js .agents { grid-template-columns: minmax(0, 1fr); }
.no-js .finale { height: auto; }
.no-js .finale__stage { position: relative; height: auto; padding: 22vh var(--gutter) 16vh; }
.no-js .finale__fig { position: static; margin-bottom: 40px; }
.no-js .finale__title { position: static; opacity: 1; transform: none; }
@media (min-width: 720px) {
  .no-js .hero__rays { position: absolute; inset: auto var(--gutter) auto auto; top: 30%; display: grid; gap: 18px; }
  .no-js .ray { position: relative; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .wordmark__i i { animation: none; }
  .hero__scroll i::after { animation: none; }
  .js [data-reveal]:not([data-reveal="words"]), .js [data-split] .w > span, .js [data-reveal="words"] .w > span,
  .js .hero__meta, .js .hero__fig, .js .hero__sub, .js .hero__scroll, .js .nav,
  .step, .step__n::after, .lin-card, .lin-card__fold, .figlist li, .rfq, .ray {
    transition-duration: .01s !important; transition-delay: 0s !important;
  }
}
