/* ==========================================================================
   Neuralquest — "Lab Notebook" direction
   Fluid, full-width layout: no fixed max-width container. Everything scales
   with the viewport through clamp(); readable measures are set in em/ch.
   ========================================================================== */
/* Self-hosted (SIL OFL 1.1), latin subset. Served from the same origin so the
   first paint does not wait on a cross-origin stylesheet. */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url("fonts/geist-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: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/geist-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: "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: 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;
}

:root {
  /* Colors: brand palette kept; canvas is a warm ink instead of pure black */
  --color-void: #08080a;
  --color-bone-white: #f4f1ea;
  --color-ash-gray: #9c9a94;
  --color-silver-mist: #c3c0b8;
  --color-electric-iris: #8052ff;
  --color-iris-text: #ab8fff;          /* iris lifted for small text on ink (7:1) */
  --color-saffron-spark: #ffb829;
  --color-deep-verdant: #15846e;
  --color-code-string: #22c4a0;
  --void-rgb: 1, 3, 10;
  --bone-rgb: 244, 241, 234;
  --rule: rgba(var(--bone-rgb), 0.14);
  --rule-strong: rgba(var(--bone-rgb), 0.34);
  color-scheme: dark;

  /* Type families */
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* Type scale: fluid between a phone and a very wide screen */
  --text-mono: clamp(12px, 0.25vw + 10px, 16px);
  --text-nav: clamp(11.5px, 0.1vw + 10.2px, 13px);
  --text-btn: clamp(11px, 0.1vw + 9.8px, 12.5px);
  --tracking-mono: 0.08em;
  --text-footer-bar: clamp(12px, 0.15vw + 9.8px, 14px);   /* footer copyright, links and email */
  --text-body: clamp(16px, 0.5vw + 10.5px, 24px);
  --leading-body: 1.55;
  --text-lead: clamp(19px, 0.95vw + 10px, 36px);
  --text-subhead: clamp(26px, 2.2vw, 58px);
  --text-heading: clamp(40px, 5vw, 136px);
  --text-statement: clamp(30px, 4.2vw, 116px);
  --text-impact-title: clamp(48px, 6.6vw, 190px);
  --text-footer-title: clamp(48px, 7.6vw, 210px);
  --text-display: clamp(62px, min(12.4vw, 20vh), 330px);   /* height-capped so the hero CTA stays above the fold */
  --tracking-display: -0.03em;
  --tracking-heading: -0.02em;

  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;

  /* Spacing (6px base) */
  --spacing-6: 6px;
  --spacing-12: 12px;
  --spacing-18: 18px;
  --spacing-24: 24px;
  --spacing-30: 30px;
  --spacing-36: 36px;
  --spacing-60: 60px;
  --spacing-96: 96px;
  --section-pad: clamp(72px, 12vh, 200px);

  /* Layout: 12 fluid columns edge to edge */
  --gutter: clamp(20px, 3.4vw, 110px);
  --col-gap: clamp(16px, 1.8vw, 52px);

  /* Surface language */
  --radius: 2px;

  /* Motion */
  --ease-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-nav: cubic-bezier(0.5, 1, 0.89, 1);
}

/* Light theme: the same tokens, inverted. The attribute is set by theme.js before first paint. */
:root[data-theme="light"] {
  --color-void: #faf8f4;
  --color-bone-white: #14130f;
  --color-ash-gray: #66645e;
  --color-silver-mist: #4a4842;
  --color-electric-iris: #6b3df0;
  --color-iris-text: #5a2fd6;
  --color-saffron-spark: #a86500;
  --color-code-string: #0e7a64;
  /* Dark-on-light reads thinner than light-on-dark, so the lighter weights step up */
  --font-weight-light: 400;
  --font-weight-regular: 450;
  --void-rgb: 250, 248, 244;
  --bone-rgb: 20, 19, 15;
  color-scheme: light;
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}
/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--color-void);
  color: var(--color-bone-white);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--font-weight-light);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  counter-reset: sec;
}
body.menu-open { overflow: hidden; }
/* Dark theme: deepest navy at the top sinking to black, fixed to the viewport */
:root:not([data-theme="light"]) body {
  background: linear-gradient(0deg, #020510 0%, #01030a 50%, #000000 100%) fixed;
}
/* Light theme: the canvas warms from warm sepia cream at the top to a soft orange at the bottom, fixed to the viewport so it stays put while scrolling */
:root[data-theme="light"] body {
  background: linear-gradient(135deg, #f5e8d0 0%, #efdfc4 45%, #f2bf8a 100%) fixed;
}

h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
svg, canvas { display: block; }

::selection { background: var(--color-electric-iris); color: #fff; }

:focus-visible {
  outline: 2px solid var(--color-saffron-spark);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 2000;
  padding: var(--spacing-12) var(--spacing-18);
  background: var(--color-bone-white);
  color: var(--color-void);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
}
.skip-link:focus { top: var(--spacing-12); }

/* Full width: only the gutter limits it */
.container {
  width: 100%;
  padding-inline: var(--gutter);
}

/* The constellation sits behind everything */
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
/* Page layers, bottom to top: process illustration (-3), background code (-2), the particle scene (-1),
   then all the copy (in flow). main and .footer are positioned but get no z-index, so those negative layers
   share one stacking context with the scene instead of being trapped above it. */
main, .footer { position: relative; }
/* Inline SVG sprite (logo gradient and symbols): present for <use>, takes no room. A class, not a style attribute, so the CSP needs no 'unsafe-inline'. */
.sprite { position: absolute; }

/* ==========================================================================
   Type roles
   ========================================================================== */
.display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--font-weight-regular);
  line-height: 0.92;
  letter-spacing: var(--tracking-display);
  word-spacing: 0.09em;
  text-wrap: balance;
}
.heading {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: var(--font-weight-regular);
  line-height: 1;
  letter-spacing: var(--tracking-heading);
  word-spacing: 0.08em;
  text-wrap: balance;
}
/* The last word of every revealed heading is set in italic: the one editorial gesture */
.split .w:last-child { font-style: italic; }

/* Mono label with a running section index (01 /, 02 /, ...) */
.label {
  counter-increment: sec;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--color-saffron-spark);
}
.label::before {
  content: counter(sec, decimal-leading-zero) " /";
  content: counter(sec, decimal-leading-zero) " /" / "";
  margin-right: 1.1em;
  color: var(--color-ash-gray);
}

.lead {
  font-size: var(--text-lead);
  font-weight: var(--font-weight-light);
  line-height: 1.42;
  letter-spacing: -0.012em;
  max-width: 34em;
  text-wrap: pretty;
}
.body {
  font-size: var(--text-body);
  font-weight: var(--font-weight-light);
  line-height: var(--leading-body);
  color: var(--color-silver-mist);
  max-width: 36em;
  text-wrap: pretty;
}

/* ==========================================================================
   Roll: text slides up and a copy rolls in from below on hover
   ========================================================================== */
.roll {
  --roll-gap: 0px;
  position: relative;
  display: inline-block;
  transition: transform 0.7s var(--ease-expo);
}
.roll::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute;
  left: 0;
  top: calc(100% + var(--roll-gap));
  white-space: nowrap;
}
a:hover > .roll,
a:focus-visible > .roll { transform: translateY(calc(-100% - var(--roll-gap))); }

/* Touch screens have no hover: keep labels still and let links be large targets */
@media (hover: none) {
  a:hover > .roll { transform: none; }
}

/* ==========================================================================
   Button: a clean outlined key with a thin arrow; hover lifts the border and
   raises a faint tint while the arrow nudges forward
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.1em;
  overflow: hidden;
  min-height: 44px;
  padding: 0.85em 1.5em;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  color: var(--color-bone-white);
  font-family: var(--font-mono);
  font-size: var(--text-btn);
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  white-space: nowrap;
  word-spacing: -0.3em;
  isolation: isolate;
  transition: border-color 0.5s var(--ease-nav);
}
.btn:hover,
.btn:focus-visible { border-color: var(--color-bone-white); }
/* Thin arrow drawn as a mask so it follows the text colour */
.btn__icon {
  z-index: 1;
  flex: none;
  width: 1.9em;
  height: 0.95em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='%23000' stroke-width='1.2'%3E%3Cpath d='M0 6h23M18 1l5 5-5 5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='%23000' stroke-width='1.2'%3E%3Cpath d='M0 6h23M18 1l5 5-5 5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.6s var(--ease-expo);
}
.btn:hover .btn__icon,
.btn:focus-visible .btn__icon { transform: translateX(0.35em); }
.btn__fill {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(var(--bone-rgb), 0.08);
  transform: translateY(101%);
  transition: transform 0.7s var(--ease-expo);
}
.btn:hover .btn__fill,
.btn:focus-visible .btn__fill { transform: none; }
.btn__text { --roll-gap: 18px; z-index: 1; }
/* Light theme: the mono tops out at weight 500, so button labels get a hairline stroke and a firmer outline */
:root[data-theme="light"] .btn { -webkit-text-stroke: 0.4px currentColor; border-color: rgba(var(--bone-rgb), 0.55); }
:root[data-theme="light"] .btn:hover,
:root[data-theme="light"] .btn:focus-visible { border-color: var(--color-bone-white); }

/* Border runner: a bright comet of light circles the outline while hovered, in an accent colour. A conic gradient is masked down to a
   1px ring, and the registered angle property is what the animation turns. */
@property --btn-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
/* Accent of the runner: amber against the dark canvas, the brand violet against the warm light canvas */
:root { --btn-glow: #ffb829; }
:root[data-theme="light"] { --btn-glow: var(--color-electric-iris); }
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--btn-angle), transparent 0deg, transparent 240deg, color-mix(in srgb, var(--btn-glow) 25%, transparent) 300deg, var(--btn-glow) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-nav);
}
.btn:hover::before,
.btn:focus-visible::before { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .btn:hover::before,
  .btn:focus-visible::before { animation: btn-run 1.2s linear infinite; }
}
@keyframes btn-run { to { --btn-angle: 360deg; } }

/* Plain variant (hero): no outline or fill, and the arrow points down to the next section */
.btn--plain { padding-inline: 0; border: 0; }
.btn--plain .btn__fill,
.btn--plain::before { display: none; }
/* The rotated icon keeps its horizontal layout box; the negative margin trims the empty sides */
.btn--plain .btn__icon { margin-inline: -0.475em; transform: rotate(90deg); }
.btn--plain:hover .btn__icon,
.btn--plain:focus-visible .btn__icon { transform: rotate(90deg) translateX(0.35em); }

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

/* Blurred bar that slides down once the page scrolls (sits over moving content) */
.header__bg {
  position: absolute;
  inset: 0;
  background: rgba(var(--void-rgb), 0.55);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--rule);
  transform: scaleY(0);
  transform-origin: center top;
  transition: transform 0.9s var(--ease-expo);
  pointer-events: none;
}
.header.is-scrolled .header__bg { transform: scaleY(1); }

.header__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-24);
  padding: 1.25rem var(--gutter);
  transition: transform 0.9s var(--ease-expo);
}

.header__logo {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 3rem;
}
.header__mark { width: 34px; height: auto; flex: none; }
/* Wordmark collapses to the mark on scroll */
.header__word {
  display: block;
  width: 126px;
  overflow: hidden;
  transition: width 0.9s var(--ease-expo), opacity 0.5s var(--ease-nav);
}
.header__word svg { width: 118px; height: auto; margin-left: 8px; }
.header.is-scrolled .header__word { width: 0; opacity: 0; }

.nav { display: flex; align-items: center; }
.nav__list { display: flex; align-items: center; }
/* Language, theme and sound switches share one row, in the bar and in the mobile menu */
.nav__tools { display: flex; align-items: center; }
.nav__link {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  font-family: var(--font-mono);
  font-size: var(--text-nav);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ash-gray);
  transition: color 0.5s var(--ease-nav);
}
.nav__link:hover,
.nav__link.is-active { color: var(--color-bone-white); }
/* Hover: the label fills with the accent colour from left to right (the roll copy becomes the overlay) */
.nav__link .roll::after {
  top: 0;
  color: var(--btn-glow);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.25s var(--ease-nav);
}
.nav__link:hover > .roll,
.nav__link:focus-visible > .roll { transform: none; }
.nav__link:hover > .roll::after,
.nav__link:focus-visible > .roll::after { clip-path: inset(0); }

/* Light theme: 500 is the mono's heaviest weight, so the menu gets a darker ink and a hairline stroke to read bolder */
:root[data-theme="light"] .nav__link,
:root[data-theme="light"] .lang__current,
:root[data-theme="light"] .lang__btn,
:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .sound-toggle {
  color: var(--color-silver-mist);
  -webkit-text-stroke: 0.4px currentColor;
}
:root[data-theme="light"] .nav__link:hover,
:root[data-theme="light"] .nav__link.is-active,
:root[data-theme="light"] .lang__btn[aria-pressed="true"] { color: var(--color-bone-white); }
:root[data-theme="light"] .theme-toggle:hover,
:root[data-theme="light"] .sound-toggle:hover,
:root[data-theme="light"] .sound-toggle[aria-checked="true"] { color: var(--btn-glow); }

/* Light theme: Instrument Serif ships only in weight 400, so the titles get a stroke scaled to their size to read bolder on the pale canvas */
:root[data-theme="light"] :is(.display, .heading, .statement__text, .disciplines__name, .steps__name, .footer__title, .impact__title) {
  -webkit-text-stroke: 0.022em currentColor;
}

/* Language switch, beside the last nav link: a trigger with the current code opens a list of endonyms under it.
   500 is the heaviest weight the self-hosted mono ships. */
.lang {
  position: relative;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-nav);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lang__current,
.lang__btn {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ash-gray);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color 0.5s var(--ease-nav), text-shadow 0.5s var(--ease-nav);
}
.lang__current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  justify-content: center;
  color: var(--color-bone-white);
}
.lang__chevron { width: 9px; height: 6px; transition: transform 0.5s var(--ease-expo); }
.lang.is-open .lang__chevron { transform: rotate(180deg); }

.lang__list {
  position: absolute;
  top: 100%;
  right: 0;
  display: flex;
  flex-direction: column;
  min-width: 11.5rem;
  padding: 6px;
  background: rgba(var(--void-rgb), 0.94);
  border: 1px solid var(--rule-strong);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  /* visibility waits for the fade, and a short grace lets a click land if focus leaves first (Safari) */
  transition: opacity 0.3s var(--ease-nav), transform 0.5s var(--ease-expo), visibility 0s linear 0.3s;
}
.lang.is-open .lang__list {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.3s var(--ease-nav), transform 0.5s var(--ease-expo);
}
.lang__btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-12);
  padding: 0 12px;
  text-align: left;
}
.lang__short { min-width: 2ch; }
.lang__name { letter-spacing: 0.04em; }
.lang__btn[aria-pressed="true"] { color: var(--color-bone-white); }
/* Hover matches the theme and sound icons: accent colour with a soft halo */
.lang__current:hover,
.lang__btn:hover,
:root[data-theme="light"] .lang__current:hover,
:root[data-theme="light"] .lang__btn:hover {
  color: var(--btn-glow);
  text-shadow: 0 0 8px color-mix(in srgb, var(--btn-glow) 55%, transparent);
}

/* Theme switch, after the language switch: the sun shows in dark mode (go light), the moon in light mode */
.theme-toggle,
.sound-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ash-gray);
  cursor: pointer;
  transition: color 0.5s var(--ease-nav);
}
.theme-toggle:hover,
.sound-toggle:hover,
.sound-toggle[aria-checked="true"] { color: var(--btn-glow); }
.theme-toggle svg,
.sound-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.6s var(--ease-expo), opacity 0.4s var(--ease-nav), filter 0.5s var(--ease-nav);
}
/* A soft halo in the accent colour on hover */
.theme-toggle:hover svg,
.sound-toggle:hover svg,
.sound-toggle[aria-checked="true"] svg { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--btn-glow) 55%, transparent)); }

/* Theme: sun and moon share one cell and swap with a turn and a fade; on hover the sun spins up and the moon tilts */
.theme-toggle svg { grid-area: 1 / 1; }
.theme-toggle__moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.theme-toggle:hover .theme-toggle__sun { transform: rotate(45deg); }
:root[data-theme="light"] .theme-toggle__sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
:root[data-theme="light"] .theme-toggle__moon { opacity: 1; transform: none; }
:root[data-theme="light"] .theme-toggle:hover .theme-toggle__moon { transform: rotate(-18deg); }

/* Sound: four equaliser bars at rest in varied heights, so they read as an equaliser in both themes. On, they
   take the accent colour and bounce out of step; reduced motion keeps them still. */
.sound-toggle__bar {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.5s var(--ease-expo);
}
.sound-toggle__bar--1 { transform: scaleY(0.55); }
.sound-toggle__bar--2 { transform: scaleY(1); }
.sound-toggle__bar--3 { transform: scaleY(0.7); }
.sound-toggle__bar--4 { transform: scaleY(0.4); }
@media (prefers-reduced-motion: no-preference) {
  .sound-toggle[aria-checked="true"] .sound-toggle__bar { animation: sound-bar 1.1s ease-in-out infinite; }
  .sound-toggle[aria-checked="true"] .sound-toggle__bar--2 { animation-delay: -0.35s; animation-duration: 0.9s; }
  .sound-toggle[aria-checked="true"] .sound-toggle__bar--3 { animation-delay: -0.7s; animation-duration: 1.3s; }
  .sound-toggle[aria-checked="true"] .sound-toggle__bar--4 { animation-delay: -0.15s; animation-duration: 1s; }
}
@keyframes sound-bar { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

.nav-toggle { display: none; }
.nav-toggle__close { display: none; }
.menu-open .nav-toggle__open { display: none; }
.menu-open .nav-toggle__close { display: inline; }

@media (min-width: 1024px) {
  .header__inner { padding-block: 1.5rem; transform: translateY(1rem); }
  .header.is-scrolled .header__inner { transform: none; }
  /* Without flex the li keeps the body's tall line box and the link sits at its top, above the logo/CTA axis */
  .nav__item { display: flex; margin-right: clamp(0.875rem, 1.1vw, 1.75rem); }
  .nav__cta { margin-left: clamp(0.5rem, 1vw, 1.5rem); }
}

/* Mobile: toggle + full-screen menu */
@media (max-width: 1023px) {
  .nav-toggle {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-12);
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-bone-white);
    font-family: var(--font-mono);
    font-size: var(--text-mono);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--tracking-mono);
    text-transform: uppercase;
    cursor: pointer;
  }
  .nav-toggle__lines { position: relative; width: 22px; height: 10px; }
  .nav-toggle__lines span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: currentColor;
    transition: transform 0.5s var(--ease-expo), top 0.5s var(--ease-expo);
  }
  .nav-toggle__lines span:first-child { top: 0; }
  .nav-toggle__lines span:last-child { top: 8.5px; }
  .menu-open .nav-toggle__lines span:first-child { top: 4.25px; transform: rotate(45deg); }
  .menu-open .nav-toggle__lines span:last-child { top: 4.25px; transform: rotate(-45deg); }

  .nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    justify-content: safe center;
    gap: var(--spacing-24);
    padding: 96px 0 var(--spacing-24);   /* clear the 88px header bar; taller content scrolls instead of sliding under it */
    overflow-y: auto;
    background: rgba(var(--void-rgb), 0.94);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s var(--ease-nav), visibility 0s linear 0.5s;
  }
  .menu-open .nav {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.5s var(--ease-nav);
  }
  .nav__list { flex-direction: column; gap: var(--spacing-12); }
  .nav__item { overflow: hidden; }
  .nav__link {
    display: block;
    min-height: 1.1em;
    font-family: var(--font-display);
    font-size: min(48px, 7.2vh);   /* shrinks on short phones so the whole menu fits */
    font-weight: var(--font-weight-regular);
    line-height: 1.1;
    letter-spacing: var(--tracking-heading);
    text-transform: none;
    color: var(--color-bone-white);
    transform: translateY(110%);
    transition: transform 0.9s var(--ease-expo), color 0.5s var(--ease-nav);
  }
  .menu-open .nav__link { transform: none; }
  .menu-open .nav__item:nth-child(2) .nav__link { transition-delay: 60ms; }
  .menu-open .nav__item:nth-child(3) .nav__link { transition-delay: 120ms; }
  .menu-open .nav__item:nth-child(4) .nav__link { transition-delay: 180ms; }
  .menu-open .nav__item:nth-child(5) .nav__link { transition-delay: 240ms; }
  .menu-open .nav__item:nth-child(6) .nav__link { transition-delay: 300ms; }
  .lang { font-size: var(--text-mono); }
  /* In the menu there is room for every code, so the popover becomes a row and the trigger goes away */
  .nav .lang__current { display: none; }
  .nav .lang__list {
    position: static;
    flex-direction: row;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav .lang__btn { justify-content: center; min-width: 40px; padding: 0; }
  /* Six codes plus the theme and sound icons are 328px wide: below that the icons drop to a second row */
  .nav__tools { flex-wrap: wrap; justify-content: center; }
  .nav .lang__name { display: none; }
  .nav__cta, .nav__tools { opacity: 0; transform: translateY(12px); transition: opacity 0.6s var(--ease-nav) 0.2s, transform 0.9s var(--ease-expo) 0.2s; }
  .menu-open .nav__cta, .menu-open .nav__tools { opacity: 1; transform: none; }
}

/* ==========================================================================
   Sections: a 12-column fluid grid; a hairline rule opens each one
   ========================================================================== */
.section { position: relative; }
.section--tall {
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: var(--section-pad);
}

/* Rule across the top of a section; draws in from the left as it enters (progressive) */
.introduction::before,
.statements::before,
.manifesto::before,
.impact::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--rule-strong);
  transform-origin: left center;
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .introduction::before,
    .statements::before,
    .manifesto::before,
    .impact::before {
      animation: rule-draw linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }
  }
}
@keyframes rule-draw { from { transform: scaleX(0); } to { transform: none; } }

/* Landing */
.landing {
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: 18vh 0 clamp(48px, 9vh, 140px);
}
.landing .container { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 90px); }
.landing__title { max-width: 9.2em; }
.landing__body {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-18);
}

/* Introduction: figure on the left, copy in the right half */
.introduction__inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--spacing-24);
  align-content: center;
}
.introduction__inner > * { grid-column: 7 / -1; position: relative; }
.introduction__inner .lead { max-width: 30em; }

/* Statements: serif, left aligned and indented; words light up while scrolling */
.statements { position: relative; padding: 40vh 0 20vh; }
.statement { padding: 12vh 0; }
.statement__text {
  max-width: 24em;
  margin-left: calc((100% - 11 * var(--col-gap)) / 12 * 2 + 2 * var(--col-gap));
  font-family: var(--font-display);
  font-size: var(--text-statement);
  font-weight: var(--font-weight-regular);
  line-height: 1.08;
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}

/* Manifesto rows: alternate right / left on the 12-column grid */
.manifesto__row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  width: 100%;
}
.manifesto__inner {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-24);
  min-width: 0;
}
.manifesto--end .manifesto__inner { grid-column: 7 / -1; }
.manifesto--start .manifesto__inner { grid-column: 1 / 7; }

/* Soft scrim keeps text legible when particles drift under it (no hard edges) */
.landing__body::before,
.introduction__inner > .lead::before,
.manifesto__inner::before,

.footer__head::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -12% calc(var(--gutter) * -0.9);
  background: radial-gradient(closest-side, rgba(var(--void-rgb), 0.62), rgba(var(--void-rgb), 0));
  pointer-events: none;
}
/* Light theme: the paper-coloured scrim shows as a pale halo on the warm canvas, so it is dropped */
:root[data-theme="light"] :is(.landing__body, .introduction__inner > .lead, .manifesto__inner, .footer__head)::before { content: none; }

/* Process: a faint line illustration on the right, under the code (-2), the particles (-1) and the copy.
   The SVG is a mask, so the paint behind it can change: a band of amber light travels across the lines. */
#process::after {
  content: "";
  position: absolute;
  z-index: -3;
  inset: 0 0 0 auto;
  width: 55%;
  -webkit-mask: url("images/neuralbkg.svg") center / contain no-repeat;
  mask: url("images/neuralbkg.svg") center / contain no-repeat;
  background: linear-gradient(100deg, rgba(var(--bone-rgb), 0.35) 42%, rgba(255, 184, 41, 0.9) 50%, rgba(var(--bone-rgb), 0.35) 58%) 0 0 / 250% 100%;
  pointer-events: none;
}
@media (max-width: 959px) {
  #process::after { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  #process::after { animation: process-shimmer 14s linear infinite; }
}
@keyframes process-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Background code: layout-only ghost that keeps the page feeling alive. One variable sets how faint it is;
   it sits under the particles and the copy (z-index -2) and above the process illustration (-3). Where the copy stacks
   (below 960px) it spans the section instead of one side, in a smaller size and a little fainter. */
:root { --ghost-opacity: 0.55; }
:root[data-theme="light"] { --ghost-opacity: 0.4; }
.code-bg {
  position: absolute;
  z-index: -2;
  margin: 0;
  color: var(--color-silver-mist);
  opacity: var(--ghost-opacity);
  pointer-events: none;
  user-select: none;
  top: 50%;
  width: min(40vw, 34em);
  height: 38.4em; /* 24 lines at 1.6 */
  max-height: 100%; /* never taller than its section; the script fits the line count to the height */
  transform: translateY(-50%);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  line-height: 1.6;
  white-space: pre;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent), linear-gradient(var(--code-fade, to right), #000 var(--code-solid, 50%), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent), linear-gradient(var(--code-fade, to right), #000 var(--code-solid, 50%), transparent);
  mask-composite: intersect;
}
.code-bg--left { left: var(--gutter); }
.code-bg--right { right: var(--gutter); --code-fade: to left; }
.py-c { color: var(--color-ash-gray); font-style: normal; }
.py-s { color: var(--color-code-string); font-style: normal; }
.py-k { color: var(--color-iris-text); font-style: normal; }
.py-n { color: var(--color-saffron-spark); font-style: normal; }
/* Light theme: the ghost code needs more ink to hold against the pale canvas */
:root[data-theme="light"] .code-bg { --ghost-opacity: 0.85; color: #2a2822; }
:root[data-theme="light"] .py-c { color: #4a4842; }
:root[data-theme="light"] .py-s { color: #0a5f4d; }
:root[data-theme="light"] .py-k { color: #4a22b8; }
:root[data-theme="light"] .py-n { color: #8a5200; }
/* Where the code sits behind stacked copy it must stay well below the text: fainter and a softer ink */
@media (max-width: 959px) {
  :root[data-theme="light"] .code-bg { --ghost-opacity: 0.3; color: #6b6860; }
  :root[data-theme="light"] .py-c { color: #85827a; }
  :root[data-theme="light"] .py-s { color: #3d8a78; }
  :root[data-theme="light"] .py-k { color: #7b5fd0; }
  :root[data-theme="light"] .py-n { color: #b87a1c; }
}
.py-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--color-bone-white);
  animation: py-blink 1.1s steps(1) infinite;
}
@keyframes py-blink { 50% { opacity: 0; } }

@media (max-width: 959px) {
  .code-bg,
  .code-bg--left,
  .code-bg--right {
    left: var(--gutter);
    right: var(--gutter);
    width: auto;
    font-size: 11px;
    --ghost-opacity: 0.4;
    --code-fade: to right;
    --code-solid: 80%;
  }
}

/* Capabilities list: ruled rows */
.disciplines { display: flex; flex-direction: column; margin-top: var(--spacing-12); }
.disciplines li {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-6);
  padding-block: clamp(14px, 1.4vw, 30px);
  border-top: 1px solid var(--rule);
}
.disciplines li:last-child { border-bottom: 1px solid var(--rule); }
.disciplines__name {
  font-family: var(--font-display);
  font-size: var(--text-subhead);
  font-weight: var(--font-weight-regular);
  line-height: 1.05;
  letter-spacing: var(--tracking-heading);
}

/* Process steps: mono numerals in a left rail */
.steps { display: flex; flex-direction: column; margin-top: var(--spacing-12); counter-reset: step; }
.steps li {
  display: grid;
  grid-template-columns: clamp(44px, 4.4vw, 100px) minmax(0, 1fr);
  gap: var(--spacing-6) 0;
  padding-block: clamp(14px, 1.4vw, 30px);
  border-top: 1px solid var(--rule);
  counter-increment: step;
}
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  grid-row: span 2;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--tracking-mono);
  line-height: 2.4;
  color: var(--color-saffron-spark);
}
.steps__name {
  font-family: var(--font-display);
  font-size: var(--text-subhead);
  font-weight: var(--font-weight-regular);
  line-height: 1.05;
  letter-spacing: var(--tracking-heading);
}

/* ==========================================================================
   Footer: full-screen call to action + bar
   ========================================================================== */
.footer {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}
.footer__head {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-24);
  width: 100%;
  margin: auto;
  padding: var(--section-pad) var(--gutter);
  text-align: center;
}
.footer__title {
  font-family: var(--font-display);
  font-size: var(--text-footer-title);
  font-weight: var(--font-weight-regular);
  line-height: 0.98;
  letter-spacing: var(--tracking-display);
  max-width: 12em;
  text-wrap: balance;
}
.footer__head .lead { max-width: 30em; }
.footer__note {
  max-width: 34em;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-ash-gray);
  text-wrap: pretty;
}

.footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-18) var(--spacing-36);
  margin-inline: var(--gutter);
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule-strong);
  font-family: var(--font-mono);
  font-size: var(--text-footer-bar);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
}
.footer__copyright { font-size: inherit; font-weight: var(--font-weight-regular); letter-spacing: 0.02em; text-transform: none; color: var(--color-ash-gray); }

@media (max-width: 767px) {
  .footer__bar { flex-direction: column; align-items: flex-start; padding: 2rem 0; }
}

/* ==========================================================================
   Responsive layout: below 960px everything stacks in one column and the
   constellation (centred by script.js) sits behind the copy
   ========================================================================== */
@media (max-width: 959px) {
  .introduction__inner > *,
  .manifesto--end .manifesto__inner,
  .manifesto--start .manifesto__inner { grid-column: 1 / -1; }
  .statement__text { margin-left: 0; }
  .section--tall { align-items: flex-end; }
}
@media (max-width: 767px) {
  .landing { padding-top: 22vh; }
  .statements { padding-top: 24vh; }
  .statement { padding: 9vh 0; }
}

/* ==========================================================================
   Reveals
   ========================================================================== */
/* Line reveal: each word rises inside its own mask, staggered by line */
.split .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 0.07em 0.16em 0;
  margin: 0 -0.07em -0.16em 0;
}
.split .w__i { display: inline-block; }
.js .split .w__i { transform: translateY(110%); }
.js .split.is-visible .w__i {
  transform: none;
  transition: transform 1.2s var(--ease-expo) calc(var(--line, 0) * 90ms);
}

/* Fade-up for everything else */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-nav), transform 1.2s var(--ease-expo);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* First-screen copy rises with transform only. Fading it from opacity 0 would
   hold back the largest contentful paint (measured: 2.97s against a 2.5s budget). */
.js .lift { animation: lift 1.2s var(--ease-expo) both; }
@keyframes lift { from { transform: translateY(24px); } to { transform: none; } }

/* Scrub: words brighten with scroll (opacity is set from script.js). The unlit
   floor keeps large text above 3:1 against the ink canvas (WCAG 1.4.3). */
.scrub .sw { opacity: 0.42; }

@media (prefers-reduced-motion: reduce) {
  .js .split .w__i,
  .js .reveal { transform: none; opacity: 1; transition: none; }
  .js .lift { animation: none; }
  .scrub .sw { opacity: 1 !important; }
  .roll, .btn, .btn__fill, .btn__icon, .header__bg, .header__inner, .header__word { transition: none; }
}

/* ==========================================================================
   Ruled definition table: the research facts
   ========================================================================== */
.case__facts { display: flex; flex-direction: column; margin-top: var(--spacing-12); }
.case__facts div {
  display: grid;
  grid-template-columns: minmax(7.5em, 26%) minmax(0, 1fr);
  gap: var(--spacing-6) var(--spacing-24);
  padding-block: clamp(14px, 1.3vw, 28px);
  border-top: 1px solid var(--rule);
}
.case__facts div:last-child { border-bottom: 1px solid var(--rule); }
.case__facts dt {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: var(--font-weight-medium);
  line-height: 1.7;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--color-ash-gray);
}
.case__facts dd {
  margin: 0;
  max-width: 34em;
  font-size: var(--text-body);
  font-weight: var(--font-weight-light);
  line-height: var(--leading-body);
}

@media (max-width: 600px) {
  .case__facts div { grid-template-columns: 1fr; gap: var(--spacing-6); }
}

.footer__head::before { inset-inline: 0; }

/* Serif display lines sit tight; give their word gaps a little air */
.disciplines__name, .steps__name, .statement__text, .footer__title, .impact__title,
.impact__list p { word-spacing: 0.08em; }

/* ==========================================================================
   Impact: a full-width typographic section
   ========================================================================== */
.impact { position: relative; padding: var(--section-pad) 0; }
.impact__head {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-24);
  margin-bottom: clamp(36px, 5vw, 120px);
}
.impact__title {
  max-width: 12em;
  font-family: var(--font-display);
  font-size: var(--text-impact-title);
  font-weight: var(--font-weight-regular);
  line-height: 0.95;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}
.impact__list { counter-reset: impact; border-top: 1px solid var(--rule); }
.impact__list li {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: baseline;
  padding-block: clamp(22px, 2.6vw, 64px);
  border-bottom: 1px solid var(--rule);
  counter-increment: impact;
}
.impact__list li::before {
  content: counter(impact, decimal-leading-zero);
  grid-column: 1 / 3;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--tracking-mono);
  color: var(--color-saffron-spark);
}
.impact__list p {
  grid-column: 3 / -1;
  max-width: 20em;
  font-family: var(--font-display);
  font-size: var(--text-statement);
  font-weight: var(--font-weight-regular);
  line-height: 1.08;
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}
@media (max-width: 767px) {
  .impact__list li::before { grid-column: 1 / -1; margin-bottom: var(--spacing-12); }
  .impact__list p { grid-column: 1 / -1; }
}

/* ==========================================================================
   Back to top: a hexagonal key (the logo shape), shown after the first screen. script.js
   toggles .is-visible and sets --to-top-lift so it rides above the footer bar
   ========================================================================== */
.to-top {
  /* theme colours: outline, tile and the hover fill (ink in light mode, paper in dark mode) */
  --tt-line: #4d5263;
  --tt-tile: #070d1c;
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--spacing-24) + var(--to-top-lift, 0px));
  z-index: 900;
  display: grid;
  place-items: center;
  /* a regular hexagon with its points left and right, like the logo mark (width : height = 1 : 0.866) */
  width: 3.6rem;
  height: 3.118rem;
  background: var(--tt-line);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  color: var(--color-bone-white);
  isolation: isolate;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.4s var(--ease-nav), transform 0.7s var(--ease-expo), color 0.4s var(--ease-nav), visibility 0s linear 0.4s;
}
:root[data-theme="light"] .to-top {
  --tt-line: #3a3832;
  --tt-tile: #fffdf9;
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.4s var(--ease-nav), transform 0.7s var(--ease-expo), color 0.4s var(--ease-nav);
}
/* inner tile: the outline is the hexagon behind it, showing through a 1.5px inset */
.to-top::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  z-index: -2;
  background: var(--tt-tile);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
/* on hover a fill rises through the hexagon; it takes the text colour, so the arrow flips to the canvas colour */
.to-top::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-bone-white);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease-expo);
}
.to-top:hover, .to-top:focus-visible { color: var(--color-void); }
.to-top:hover::after,
.to-top:focus-visible::after { transform: none; }
:root[data-theme="light"] .to-top svg path { stroke-width: 2; }
.to-top svg { width: 22px; height: 22px; transition: transform 0.5s var(--ease-expo); }
.to-top:hover svg,
.to-top:focus-visible svg { transform: translateY(-2px); }

body.menu-open .to-top { opacity: 0; visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .to-top, .to-top.is-visible, .to-top::after, .to-top svg { transition: none; }
}

/* ==========================================================================
   Error page (404.html, also served for 403)
   ========================================================================== */
.header__tools { display: flex; align-items: center; }
/* no menu on this page, so on very narrow screens the logo mark alone leaves room for the switches */
@media (max-width: 400px) { .header--bare .header__word { display: none; } }
/* Pages that scroll copy under the bar need it more opaque, or the text shows through behind the logo and switches */
.header--bare .header__bg { background: rgba(var(--void-rgb), 0.86); }
.error {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: var(--spacing-30);
  min-height: 100vh;
  min-height: 100svh;
  padding: 120px var(--gutter) var(--spacing-96);
  overflow: hidden;
}
/* the counter-based "01 /" does not apply here: the label carries its own number */
.error .label::before { content: none; }
.error__title { max-width: 11em; }
.error__title em { color: var(--color-iris-text); }
/* the logo mark, enormous and almost invisible, behind the copy */
.error__mark {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: calc(var(--gutter) * -1);
  width: min(78vw, 860px);
  height: auto;
  transform: translateY(-50%);
  color: var(--color-bone-white);
  opacity: 0.06;
  pointer-events: none;
}

/* ==========================================================================
   Legal page (privacy.html) and the footer link to it
   ========================================================================== */
.footer__link {
  margin-right: auto;
  color: var(--color-ash-gray);
  letter-spacing: 0.02em;
  text-transform: none;
  transition: color 0.4s var(--ease-nav);
}
.footer__link:hover,
.footer__link:focus-visible { color: var(--btn-glow); }
.legal {
  position: relative;
  display: grid;
  justify-items: start;
  gap: var(--spacing-30);
  padding: 140px var(--gutter) var(--spacing-96);
}
.legal .label::before { content: none; }
.legal__heading em { color: var(--color-iris-text); }
.legal__body { display: grid; gap: var(--spacing-48, 48px); }
.legal__section { display: grid; gap: var(--spacing-18); }
.legal__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.2vw, 40px);
  font-weight: 400;
  line-height: 1.15;
}
.legal__text,
.legal__list { color: var(--color-silver-mist); font-weight: var(--font-weight-light); line-height: var(--leading-body); max-width: 40em; }
.legal__list { display: grid; gap: var(--spacing-12); padding-left: 1.2em; list-style: disc; }
.legal__link { color: var(--btn-glow); text-decoration: underline; text-underline-offset: 0.2em; }
.legal__foot { margin-inline: var(--gutter); padding: 2.5rem 0; border-top: 1px solid var(--rule-strong); font-family: var(--font-mono); font-size: var(--text-footer-bar); }
.legal .code-bg { top: 26%; }
.legal .code-bg--low { top: 74%; }
/* Error page: the code sits below the title so the two do not overlap */
.error .code-bg { top: 82%; }
/* Where the copy stacks the code spans the page behind it, so on these text pages it is kept faint; on the
   privacy page it moves behind the large title and the second block is dropped, so no body text sits on code */
@media (max-width: 959px) {
  :root[data-theme] :is(.legal, .error) .code-bg { --ghost-opacity: 0.16; }
  .legal .code-bg { top: 350px; }
  .legal .code-bg--low { display: none; }
}
