/* EZO Labs Inc — shared styles
 *
 * Black, cool off-white, the blue accent, Inter for headlines and running
 * text, tracked uppercase JetBrains Mono for labels, buttons and the figure,
 * lowercase copy. This is the look picked from a side-by-side on 2026-09-02;
 * the mono-headline / sage variant it was compared against is gone. */

:root {
  --bg: #000000;
  --text: #ededf0;
  --heading: #f6f7f9;
  --muted: #8a8f98;
  --muted-dim: #5f646d;
  --hairline: rgba(255, 255, 255, 0.10);
  --hairline-soft: rgba(255, 255, 255, 0.055);
  --card: rgba(255, 255, 255, 0.018);
  --accent: #3b6ef6;
  --accent-soft: #6f9bff;
  --stuck: #c9776a;        /* the agent, once the world has stopped it */
  --glow-mid: #1b3a8a;     /* the hero glow's outer stop */
  --bar-tint: #c4d4ff;     /* the bottom of the mark's stripes */
  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Two faces, two jobs: the mono speaks (labels, buttons, the figure), the
   sans reads (headlines and every running sentence). Mono paragraphs set
   their word spaces at one cell each, which reads as gaps; the sans fixes
   the spacing and the rag, and keeps the measure around sixty characters. */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

::selection { background: rgba(59, 110, 246, 0.35); color: #fff; }

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

/* Everything that reads sits above the star field. */
main, .site-footer { position: relative; z-index: 1; }

/* ---------- star field ----------
 * Small + · * glyphs scattered by main.js with a fixed seed, so the sky is the
 * same on every load. Fixed to the viewport, behind the page, never a target. */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  color: var(--muted-dim);
  font-family: var(--mono);
  opacity: 0.55;
}
.starfield span {
  position: absolute;
  transform: translate(-50%, -50%);
  line-height: 1;
  opacity: var(--o, 0.3);
  animation: twinkle var(--d, 7s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: calc(var(--o, 0.3) * 0.45); }
  50%      { opacity: var(--o, 0.3); }
}

/* ---------- typesetting ----------
 * Headlines balance their lines; paragraphs avoid a lone last word where the
 * browser can (text-wrap: pretty is progressive, unsupported browsers wrap as
 * before). Phrases that must not split across a line are wrapped in .nw in
 * the markup, so a break never lands inside "operate in" or "the simulation". */
.hero h1, .section-head h2, .page-hero h1 { text-wrap: balance; }
.lede, .lead, .prose p, .prose li, .footer-brand p, .page-hero p { text-wrap: pretty; }
.nw { white-space: nowrap; }

/* ---------- monospace label / eyebrow ----------
 * Uppercase and tracked wide: a label, not a word. The figure's own readouts
 * are the one exception (.world .mono, below). */
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-dim);
  display: flex;
  align-items: center;
  gap: 14px;
}

.eyebrow .idx { color: var(--accent); }
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline-soft);
}

/* ---------- header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.site-header.scrolled {
  background: rgba(0, 0, 0, 0.78);
  border-bottom-color: var(--hairline-soft);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--heading);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand .brand-mark { width: 20px; height: 20px; }
.brand .dim { color: var(--muted-dim); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.6vw, 38px);
}
.nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--heading); }

/* ---------- icon-only nav link ---------- */
.nav a.icon-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted-dim);
}
.nav a.icon-link:hover { color: var(--heading); }
.x-mark { width: 13px; height: 13px; flex: none; }
.icon-link .icon-label { display: none; }

.nav-toggle { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--heading);
  border: 1px solid var(--hairline);
  padding: 14px 22px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover {
  border-color: rgba(111, 155, 255, 0.6);
  background: rgba(59, 110, 246, 0.08);
  color: #fff;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 64px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  width: 100%;
}
.hero-copy { max-width: 38rem; }
.hero .kicker { color: var(--muted-dim); }
/* Sized so "we build worlds." sits on one line in the hero's copy column,
   which is ~523px at 1440: two lines at 60px, measured. */
.hero h1 {
  font-family: var(--sans);
  font-size: clamp(36px, 4.6vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-weight: 500;
  text-transform: lowercase;
  color: var(--heading);
  margin: 22px 0 0;
}
.hero p.lede {
  font-family: var(--sans);
  color: var(--muted);
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.6;
  margin: 24px 0 36px;
  max-width: 34rem;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
}
.hero-visual .mark { width: min(78%, 440px); height: auto; overflow: visible; }
/* The mark's gradients take the theme's colours, so a variant recolours the
   glow and the stripes without touching the SVG. */
.glow-a { stop-color: var(--accent-soft); }
.glow-b { stop-color: var(--accent); }
.glow-c { stop-color: var(--glow-mid); }
.glow-d { stop-color: var(--bg); }
.bar-a { stop-color: var(--heading); }
.bar-b { stop-color: var(--bar-tint); }

/* ---------- the world around the mark ----------
 * Nine seconds: the frame around the mark sits tight and slightly askew,
 * and the mark inside is dim and compressed. The frame opens; the mark
 * jolts, fills out and brightens. Change the world, change the agent. */
.hero-world {
  transform-box: fill-box;
  transform-origin: center;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
  animation: worldframe 9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes worldframe {
  0%, 30%  { transform: scale(0.74) rotate(-3deg); stroke-opacity: 0.35; }
  45%, 85% { transform: scale(1.02) rotate(0deg);  stroke-opacity: 0.6; }
  100%     { transform: scale(0.74) rotate(-3deg); stroke-opacity: 0.35; }
}
.hero-agent {
  transform-box: fill-box;
  transform-origin: center;
  animation: agentfit 9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes agentfit {
  0%, 30%  { transform: scale(0.86, 0.9); opacity: 0.55; }
  33%      { transform: scale(0.86, 0.9) translate(3px, 0); opacity: 0.7; }
  45%, 85% { transform: scale(1, 1); opacity: 1; }
  100%     { transform: scale(0.86, 0.9); opacity: 0.55; }
}

/* ---------- zoom-out frames ----------
 * Four frames on one twelve-second loop, offset by three seconds each, so one
 * is always leaving the mark as another fades out further away. Each turns a
 * little as it goes: the same thing, from a step further back, from a slightly
 * different angle. */
.zf {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  stroke-opacity: 0.55;
  animation: zoomout 12s linear calc(var(--i, 0) * -3s) infinite;
}
@keyframes zoomout {
  0%   { transform: scale(0.72) rotate(0deg);  opacity: 0; }
  12%  { opacity: 0.32; }
  100% { transform: scale(1.9) rotate(11deg); opacity: 0; }
}

.glow-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: glowpulse 5s ease-in-out infinite;
}
@keyframes glowpulse {
  0%, 100% { opacity: 0.7; transform: scale(0.97); }
  50%      { opacity: 1;   transform: scale(1.05); }
}

.scroll-hint {
  position: absolute;
  left: var(--gutter);
  bottom: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-dim);
}
.scroll-hint .line {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, var(--muted-dim), transparent);
  animation: scrollpulse 2.4s ease-in-out infinite;
  transform-origin: top;
}
@keyframes scrollpulse {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ---------- sections ---------- */
section { position: relative; }
.section {
  padding-block: clamp(72px, 11vw, 150px);
  border-top: 1px solid var(--hairline-soft);
}
.section-head { margin-bottom: clamp(34px, 5vw, 64px); }
.section-head h2 {
  font-family: var(--sans);
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 500;
  text-transform: lowercase;
  color: var(--heading);
  margin: 20px 0 0;
  max-width: 20ch;
}

.lead {
  font-family: var(--sans);
  font-size: clamp(18px, 1.9vw, 22px);
  line-height: 1.5;
  color: var(--text);
  max-width: 46ch;
  font-weight: 400;
  letter-spacing: -0.008em;
}
.lead .muted { color: var(--muted); }

/* mission */
.mission-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: start;
}
.mission-grid .aside {
  color: var(--muted);
  font-size: 14px;
}

/* ---------- world figure ----------
 * The thesis, played out inside a terminal-style window. main.js walks the
 * figure through phases (try, stuck, rebuild, solve, solved, many) by setting
 * data-phase; everything visible is keyed to that attribute here. With no
 * attribute at all (scripts off, reduced motion) the figure holds its default
 * state: world 01, edited and solved. */
.world {
  font-family: var(--mono);
  border: 1px solid var(--hairline);
  background: var(--card);
  margin: 0;
  max-width: 26rem;
}
.world-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-dim);
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--hairline-soft);
}
/* The figure's labels are readouts, not headings: lowercase and tight, like
   the rest of the terminal window they sit in. */
.world .mono { text-transform: lowercase; letter-spacing: 0.14em; }
.world-map { display: block; width: 100%; height: auto; }
.world-foot {
  padding: 6px 20px 12px;
  border-top: 1px solid var(--hairline-soft);
}
/* The picker: previous, the six worlds, next. Hidden until the story runs
   (main.js adds .has-nav), so scripts-off and reduced-motion visitors see
   only the held world. pan-y keeps vertical scrolling while a sideways swipe
   changes the world. */
.world.has-nav { touch-action: pan-y; }
.world-steps {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin: 0 -8px 6px;
  border-bottom: 1px solid var(--hairline-soft);
}
.world.has-nav .world-steps { display: flex; }
.world-steps .steps { display: flex; align-items: center; }
.world-steps button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted-dim);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 10px 7px;
  min-height: 36px;
  transition: color 0.2s ease;
}
.world-steps button:hover { color: var(--heading); }
.world-steps button:focus-visible { color: var(--heading); outline: none; box-shadow: inset 0 -1px 0 var(--accent); }
.world-steps .step[aria-disabled="true"] { color: var(--accent); cursor: default; }
.world-steps .step-arrow { font-size: 18px; line-height: 1; padding: 6px 10px; }
.w-scene {
  transform-box: view-box;
  transform-origin: 8px 8px;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.world[data-phase="many"] .w-scene { transform: scale(0.3333); }
.w-ground { opacity: 0; transition: opacity 1s ease; }
.in-view .w-ground { opacity: 1; }
.w-frame { fill: none; stroke: var(--muted-dim); stroke-width: 1; }
.w-many { opacity: 0; color: var(--muted-dim); transition: opacity 0.9s ease 0.4s; }   /* the <use> outlines take currentColor */
.w-many circle { fill: var(--accent); }
.world[data-phase="many"] .w-many { opacity: 1; }

/* Scenes: one shown at a time. */
.scene { display: none; }
.scene.active { display: inline; }
.scene .wall, .scene .block { fill: rgba(255, 255, 255, 0.06); stroke: var(--muted); stroke-width: 1; }
.scene .block { fill: none; }
.scene .edge { stroke: var(--muted-dim); stroke-width: 1; }
.scene .bridge rect { fill: var(--card); stroke: var(--accent); stroke-width: 1; }
.scene .bridge line { stroke: var(--accent); stroke-opacity: 0.5; stroke-width: 1; stroke-dasharray: 2 3; }
.scene .shade { fill: var(--bg); }

/* the view: what the agent can see is a window around where it starts. Small
   while it tries and is stuck; the edit zooms it out to the whole world, which
   is the held default. The shade stays; once the hole covers the world there
   is nothing left of it to see. */
.view-hole {
  transform-box: view-box;
  transform-origin: 36px 100px;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.world[data-phase="try"] .view-hole, .world[data-phase="stuck"] .view-hole { transform: scale(0.24, 0.4); transition: none; }
.scene .view-shade { opacity: 0.96; }
/* the signal: rings of reward the world draws around a point. The first set
   peaks where nothing is; the edit moves it onto the goal. */
.scene .field circle { fill: none; stroke: var(--muted); stroke-opacity: 0.35; stroke-width: 1; stroke-dasharray: 1 3; }
.scene .field.lit circle { stroke: var(--accent); stroke-opacity: 0.4; }
.world[data-phase="stuck"] .field:not(.lit) { animation: flicker 0.5s steps(2) infinite; }
@keyframes flicker { 0% { opacity: 1; } 100% { opacity: 0.25; } }
/* the current: a field the agent could not see until the world showed it. */
.chev { fill: none; stroke: var(--muted-dim); stroke-opacity: 0.5; stroke-width: 1; }
.chev.lit { stroke: var(--accent); stroke-opacity: 0.9; }
.solve-route { fill: none; stroke: var(--accent); stroke-opacity: 0.4; stroke-width: 1; stroke-dasharray: 3 5; }
.goal { fill: none; stroke: var(--accent); stroke-width: 1; transition: fill 0.4s ease; }
.world[data-phase="solved"] .goal, .world[data-phase="many"] .goal { fill: var(--accent); }

/* the belief layer: what the agent plans on, drawn dashed for the visitor
   alone — the agent's map does not contain what it cannot perceive. It
   vanishes with the edit, like every other fix-remove. */
.scene .belief { fill: none; stroke: var(--muted); stroke-opacity: 0.5; stroke-width: 1; stroke-dasharray: 2 4; }

/* the cliff: on stuck the agent is already out past the edge; it drops. The
   rule stops matching on rebuild, so the fall resets for the next showing. */
.world[data-phase="stuck"] .scene .fall-wrap { animation: fall 0.7s cubic-bezier(0.55, 0, 0.85, 0.45) 0.12s forwards; }
@keyframes fall { to { transform: translateY(40px); opacity: 0; } }

/* the science note: the sims are real environments, named once, quietly,
   each term linked to the paper it comes from. */
.science-note {
  margin: 2px 0 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--muted-dim);
  opacity: 0.8;
}
.science-note a {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}
.science-note a:hover { color: var(--muted); }

/* What the edit changes. The defaults are the held, solved state; the try
   and stuck phases show the world as it was. */
.fix-add { opacity: 1; transition: opacity 0.8s ease 0.5s; }
.fix-remove { opacity: 0; transition: opacity 0.6s ease; }
.world[data-phase="try"] .fix-add, .world[data-phase="stuck"] .fix-add { opacity: 0; transition: none; }
.world[data-phase="try"] .fix-remove, .world[data-phase="stuck"] .fix-remove { opacity: 1; transition: none; }
.world[data-phase="try"] .shade, .world[data-phase="stuck"] .shade { opacity: 0.96; }

/* Agents: the one that tries and gets stuck, the retrained one that runs it,
   and the held one at the goal for the no-script and reduced-motion state. */
.try-agent circle, .solve-agent circle, .w-agent-static circle { fill: var(--accent); }
.try-agent .ring, .solve-agent .ring, .w-agent-static .ring { fill: none; stroke: var(--accent); stroke-opacity: 0.35; stroke-width: 1; }
.try-agent, .solve-agent { opacity: 0; transition: opacity 0.3s ease; }
.world[data-phase="try"] .try-agent, .world[data-phase="stuck"] .try-agent { opacity: 1; }
.world[data-phase="solve"] .solve-agent, .world[data-phase="solved"] .solve-agent, .world[data-phase="many"] .solve-agent { opacity: 1; }
.world[data-phase="stuck"] .try-agent circle { fill: var(--stuck); animation: jitter 0.28s steps(2) infinite; }
.world[data-phase="stuck"] .try-agent .ring { fill: none; stroke: var(--stuck); }
@keyframes jitter { 0% { transform: translate(-1.5px, 0); } 100% { transform: translate(1.5px, 0); } }
.w-agent-static { display: none; }
.world:not([data-phase]) .w-agent-static { display: inline; }

/* Status rows the story writes. */
.status-row .v.dim { color: var(--muted); }
.status-row .v.dim::before { border: 1px solid var(--muted-dim); }
.status-row .v.bad { color: var(--stuck); }
.status-row .v.bad::before { background: var(--stuck); }

/* The live dot. A button once the story runs (the rotation control): its
   hit area is the 28px square, the dot itself is drawn by ::before. */
.status-dot {
  width: 28px;
  height: 28px;
  margin: -10px;
  padding: 0;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: default;
}
.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(59, 110, 246, 0.5);
  animation: statuspulse 2.6s ease-out infinite;
  transition: background 0.3s ease;
}
.world.has-nav .status-dot { cursor: pointer; }
.world.has-nav .status-dot:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--accent); }
.world.stopped .status-dot::before { animation: none; background: var(--muted-dim); box-shadow: none; }
@keyframes statuspulse {
  0%   { box-shadow: 0 0 0 0 rgba(59, 110, 246, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(59, 110, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 110, 246, 0); }
}
.status-row {
  display: grid;
  grid-template-columns: 7.5ch 1fr;
  gap: 16px;
  padding: 7px 0;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.status-row .k { color: var(--muted-dim); }
.status-row .v {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.status-row .v::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}
.status-row .v.on::before { background: var(--accent); }
/* The one green word on the card: the thing that is not here yet. */
.status-row .v.next { color: var(--accent); }
.status-row .v.next::before { border: 1px solid var(--accent); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: clamp(48px, 7vw, 80px) 36px;
  background: var(--bg);
}
.footer-grid {
  display: grid;
  /* One row, whatever the column count. The brand block takes the explicit
   * 1.4fr track and every link column after it flows into an implicit 1fr
   * track on the same row — so the home page's three link columns stay on a
   * single line without the rule naming a count. */
  grid-template-columns: 1.4fr;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: clamp(24px, 4vw, 56px);
}
.footer-brand .brand { margin-bottom: 16px; }
.footer-brand p { color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 30ch; margin: 0; }
.footer-col h3 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin: 0 0 16px;
  font-weight: 500;
}
.footer-col a, .footer-col span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--heading); }
.footer-col a.footer-social {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
}
.footer-col .footer-social span { margin-bottom: 0; }
.footer-social .x-mark {
  width: 12px;
  height: 12px;
  color: var(--muted-dim);
  transition: color 0.2s ease;
}
.footer-social:hover .x-mark { color: var(--heading); }
.footer-bottom {
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 24px;
  border-top: 1px solid var(--hairline-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- legal / prose pages ---------- */
.page-hero {
  padding-top: calc(64px + clamp(56px, 9vw, 110px));
  padding-bottom: clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--hairline-soft);
}
.page-hero h1 {
  font-family: var(--sans);
  font-size: clamp(28px, 4.2vw, 48px);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--heading);
  margin: 18px 0 10px;
}
.page-hero p { color: var(--muted); margin: 0; font-size: 14px; }

/* Long legal text stays in the sans: thirty thousand characters of terms in a
   monospace face is a wall, and nobody reads a wall. */
.prose {
  font-family: var(--sans);
  padding-block: clamp(40px, 6vw, 72px);
  max-width: 760px;
}
.prose h2 {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
}
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--muted); font-size: 15px; line-height: 1.7; }
.prose ul { padding-left: 20px; margin: 12px 0; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--accent); }
.prose a:hover { color: var(--accent-soft); }
.prose strong { color: var(--text); font-weight: 500; }

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 8px; }
  .hero-visual { order: -1; max-width: 360px; margin-inline: auto; }
  .mission-grid { grid-template-columns: 1fr; }
  .world { max-width: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; grid-auto-flow: row; }
  .footer-brand { grid-column: 1 / -1; }
  .nav { display: none; }
  .nav.open {
    display: flex;
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(0, 0, 0, 0.96);
    border-bottom: 1px solid var(--hairline);
    padding: 8px var(--gutter) 20px;
  }
  .nav.open a { padding: 14px 0; width: 100%; border-bottom: 1px solid var(--hairline-soft); }
  .nav.open a.icon-link { gap: 10px; color: var(--muted); }
  .nav.open .icon-link .icon-label { display: inline; }
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px 0;
  }
  .nav-toggle span { width: 22px; height: 1.5px; background: var(--text); transition: transform 0.25s ease, opacity 0.2s ease; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; grid-auto-flow: row; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint .line { animation: none; }
  .glow-pulse { animation: none !important; }
  .starfield span { animation: none; }
  .status-dot::before { animation: none; }
  /* The figure holds world 01 solved (its default state; main.js never
     starts the story under reduced motion). */
  .w-ground { opacity: 1; transition: none; }
  .w-scene { transition: none; }
  /* The world open, the mark at full size; three frames held further out. */
  .hero-world { animation: none; transform: scale(1.02); stroke-opacity: 0.6; }
  .hero-agent { animation: none; }
  .zf { animation: none; opacity: 0.16; }
  .zf:nth-child(1) { transform: scale(1); }
  .zf:nth-child(2) { transform: scale(1.35) rotate(5deg); }
  .zf:nth-child(3) { transform: scale(1.7) rotate(10deg); }
  .zf:nth-child(4) { display: none; }
}

/* ---------- phones ----------
 *
 * The layout already reflowed correctly at these widths; what did not was the
 * size of the things a thumb has to hit. Measured at 390px: the hamburger was
 * 31px and every footer link 22px, against a 44px guideline. The open nav's
 * links were already 47px, so only these two were wrong. */
@media (max-width: 900px) {
  .nav-toggle {
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    /* Pull it back to the gutter edge so growing the hit area does not push
       the brand and the button apart. */
    margin-right: -10px;
    padding: 8px 10px;
  }
}

@media (max-width: 640px) {
  /* Padding rather than margin: margin between links is dead space, padding is
     part of the target. The gap between them stays visually the same. */
  .footer-col a,
  .footer-col span {
    padding-block: 11px;
    margin-bottom: 0;
  }
  .footer-col a.footer-social { padding-block: 11px; }
  .footer-col .footer-social span { padding-block: 0; }
  .footer-col h3 { margin-bottom: 6px; }

  /* A single column of links reads better with a rule between them than with
     whitespace alone, now that the whitespace is inside the targets. */
  .footer-col a { border-bottom: 1px solid var(--hairline-soft); }
  .footer-col a:last-child { border-bottom: 0; }
}
