/* Agency Simulation Research: site styles.
   Plain CSS, no build step. Brand tokens on :root; the paper section swaps
   the semantic tokens (--bg, --fg, ...) and leaves the brand tokens alone so
   agents.js can read a stable palette. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand tokens: logo/brand.md */
  --ink: #0B1219;
  --ink-2: #141E28;
  --line: #273645;
  --paper: #EEEAE2;
  --text: #EEEAE2;
  --text-muted: #97A3AE;
  --muted: var(--text-muted);
  --accent: #F4A23A;
  --accent-deep: #B45B07;
  --secondary: #7FA8CB;
  --secondary-deep: #33658F;
  --slate: #4B5865;

  /* Derived */
  --text-soft: #C3CAD1;
  --line-strong: #3A4D60;

  /* Semantic (dark default) */
  --bg: var(--ink);
  --surface: var(--ink-2);
  --fg: var(--text);
  --fg-soft: var(--text-soft);
  --fg-muted: var(--muted);
  --rule: var(--line);
  --rule-strong: var(--line-strong);
  --link-accent: var(--accent);
  --focus: var(--accent);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 78rem;
  --header-h: 4rem;
  --section-pad: clamp(5.5rem, 4rem + 7vw, 11rem);
  --radius: 6px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  --icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8h10.5M9 4l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2.5v10.5M4 9l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-ext: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 11.5l7-7M5.5 4.5h6v6' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 3.2v9.6L12.6 8z' fill='%23000'/%3E%3C/svg%3E");
}

.theme-paper {
  --bg: var(--paper);
  --surface: #E4DFD6;
  --fg: var(--ink);
  --fg-soft: #26313C;
  --fg-muted: var(--slate);
  --rule: #CBC5B9;
  --rule-strong: #A59E92;
  --link-accent: var(--secondary-deep);
  --num-accent: var(--ink); /* accent-deep is 3.9:1 on paper: graphics and large text only */
  --focus: var(--secondary-deep);
  background: var(--bg);
  color: var(--fg);
}

/* ---------- Base ---------- */

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

html {
  font-size: clamp(100%, 0.8rem + 0.25vw, 118.75%);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Sections carry their own top padding, so anchors land flush under the bar
     (no strip of the previous section shows). Inner anchors add scroll-margin. */
  scroll-padding-top: var(--header-h);
  background: var(--ink);
}

/* Smooth anchor scrolling: without JS from the start, with JS once the page
   has loaded (site.js), so a reload's scroll restore is instant. */
@media (prefers-reduced-motion: no-preference) {
  html:not(.js),
  html.smooth-scroll { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
cite { font-style: italic; }
b, strong { font-weight: 600; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--link-accent) 60%, transparent);
  transition: color 0.2s, text-decoration-color 0.2s;
}
a:hover { color: var(--link-accent); text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
main:focus { outline: none; }

::selection { background: var(--accent); color: var(--ink); }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Small type ---------- */

.eyebrow,
.section-label,
.kicker,
.chapter-meta,
.step-num,
.service-num,
.facts dt,
.figures dt,
.pub-year,
.wi-num,
.wi-years,
.hero-note,
.legend,
.caveat,
.video-duration,
.video-note,
.partners-title,
.how-num,
.scrolly-hud,
.more-title,
.copy-btn,
.footer-meta {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--accent);
}

.kicker {
  font-size: 0.75rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
}

/* ---------- Buttons and links ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.875rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease-out);
}
.btn::after {
  content: "";
  width: 1em;
  height: 1em;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon-arrow) center / contain no-repeat;
  mask: var(--icon-arrow) center / contain no-repeat;
  transition: transform 0.25s var(--ease-out);
}
.btn:hover::after { transform: translateX(3px); }
.btn-down::after { -webkit-mask-image: var(--icon-down); mask-image: var(--icon-down); }
.btn-down:hover::after { transform: translateY(2px); }

.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: #F7B762; color: var(--ink); }

.btn-ghost {
  border-color: var(--rule-strong);
  color: var(--fg);
  background: rgb(11 18 25 / 0.25);
}
.btn-ghost:hover { border-color: var(--fg-muted); color: var(--fg); background: rgb(237 233 225 / 0.04); }

.btn-quiet {
  border-color: var(--rule-strong);
  color: var(--fg);
  background: transparent;
}
.btn-quiet:hover { border-color: var(--fg); color: var(--fg); }
.btn-quiet::after { -webkit-mask-image: var(--icon-down); mask-image: var(--icon-down); }
.btn-quiet[aria-expanded="true"]::after { transform: rotate(180deg); }
.btn-quiet[aria-expanded="true"]:hover::after { transform: rotate(180deg) translateY(2px); }
.btn-quiet[aria-expanded="false"]:hover::after { transform: translateY(2px); }

.link-ext,
.link-arrow {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
}
.link-ext::after,
.link-arrow::after {
  content: "";
  width: 0.8em;
  height: 0.8em;
  flex: none;
  align-self: center;
  background: currentColor;
  opacity: 0.7;
  -webkit-mask: var(--icon-ext) center / contain no-repeat;
  mask: var(--icon-ext) center / contain no-repeat;
}
.link-arrow::after { -webkit-mask-image: var(--icon-arrow); mask-image: var(--icon-arrow); }
/* a taller tap area for the link at the end of a caption, without moving the text */
figcaption .link-arrow { padding-block: 0.6rem; margin-block: -0.6rem; }

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin-top: 1.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s, border-color 0.35s;
}
.site-header.is-solid,
.site-header.menu-open,
.site-header.bf-docked {
  background: var(--ink);
  border-bottom-color: var(--line);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* The brandmark (brandmark.css) at the planner's size; the padding gives it a
   taller tap target without moving it. */
.site-header .brandmark {
  position: relative;   /* site.js nudges it onto whole pixels (initBrandFly) */
  flex: none;
  padding-block: 0.75rem;
  margin-block: -0.75rem;
}

.nav-list {
  display: flex;
  gap: clamp(1.25rem, 2.2vw, 2.25rem);
  font-size: 0.875rem;
  font-weight: 500;
}
.nav-list a {
  position: relative;
  display: inline-block;
  padding-block: 0.4rem;
  color: var(--text-soft);
  text-decoration: none;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.nav-list a:hover,
.nav-list a[aria-current="true"] { color: var(--text); }
.nav-list a:hover::after,
.nav-list a[aria-current="true"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  height: 2.5rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgb(11 18 25 / 0.4);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}
.nav-toggle-icon { position: relative; width: 14px; height: 8px; }
.nav-toggle-icon i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s var(--ease-out), top 0.25s var(--ease-out);
}
.nav-toggle-icon i:first-child { top: 0; }
.nav-toggle-icon i:last-child { top: 6.5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon i:first-child { top: 3.25px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon i:last-child { top: 3.25px; transform: rotate(-45deg); }

/* Below 360 px the toggle keeps only its icon, so the brandmark and the
   button fit (down to 320 px); "Menu" stays its accessible name. */
@media (max-width: 359.98px) {
  .header-inner { gap: 0.75rem; }
  .nav-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (max-width: 767.98px) {
  .nav-list { display: none; }   /* without JS, nojs.css (noscript) shows the links in a second header row */
  .js .nav-toggle { display: inline-flex; }
  .js .menu-open .nav-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    font-size: 1.125rem;
  }
  .js .menu-open .nav-list li + li { border-top: 1px solid var(--line); }
  .js .menu-open .nav-list a { display: block; padding-block: 0.9rem; }
  .js .menu-open .nav-list a::after { display: none; }
}

/* ---------- Scene fallback ---------- */

.scene-fallback {
  --grid: rgb(127 168 203 / 0.07);
  background-color: var(--ink-2);
  background-image:
    radial-gradient(circle at 68% 42%, rgb(244 162 58 / 0.12), transparent 38%),
    radial-gradient(circle at 22% 78%, rgb(127 168 203 / 0.08), transparent 42%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 56px 56px, 56px 56px;
  background-position: 0 0, 0 0, -1px -1px, -1px -1px;
}
.scene-fallback.has-scene { background-image: none; }

.scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--ink);
}
.hero-scene {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-color: var(--ink);
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(11 18 25 / 0.7) 0, rgb(11 18 25 / 0) calc(var(--header-h) + 4rem)),
    linear-gradient(0deg, var(--ink) 0, rgb(11 18 25 / 0.82) 22%, rgb(11 18 25 / 0) 62%),
    linear-gradient(90deg, rgb(11 18 25 / 0.72) 0, rgb(11 18 25 / 0.35) 45%, rgb(11 18 25 / 0) 75%);
}
.hero-content {
  --hero-h1: clamp(2.875rem, 1.2rem + 6.2vw, 5.75rem);
  padding-top: calc(var(--header-h) + 5rem);
  padding-bottom: clamp(5rem, 14vh, 10rem);
}
.hero-title {
  margin-top: 1.5rem;
  font-size: var(--hero-h1);
  font-weight: 620;
  line-height: 0.98;
  letter-spacing: -0.045em;
  max-width: 11ch;
  text-wrap: balance;
}
.hero-lead {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 38rem;
  font-size: clamp(1.0625rem, 0.95rem + 0.45vw, 1.3125rem);
  line-height: 1.55;
  color: var(--text-soft);
}
.hero .actions { margin-top: clamp(2rem, 4vw, 2.75rem); }

/* Intro: the A and "agencysims.dev" at half the H1 size (--bm-ratio), and
   never wider than the column once it turns into the capitals (the whole
   brandmark is 20.9em). The icon is mark.svg from 778 px wide, where the A
   renders 24 px tall or more (a 32 px favicon box: 1.71 x 0.5 / 1.8 x the H1
   size; the <picture> in index.html), with the .brandmark--mark proportions
   from the same width. */
.hero-brand {
  --bm-ratio: 0.5;
  --bm-size: min(calc(var(--hero-h1) * var(--bm-ratio) / 1.8), calc((100vw - 2 * var(--gutter)) / 20.9));
  display: flex;
  width: fit-content;
  margin-bottom: clamp(1.75rem, 4.5vh, 3rem);
}
.hero-brand picture { display: block; flex: none; }
@media (max-width: 639.98px) {
  .hero-brand { --bm-ratio: 0.56; }   /* the min() above keeps the capitals inside the gutter down to 320 px */
  /* Phones have no side scrim under the intro, so the word gets a halo of ink
     against the network behind it, the copy's word too (it is gone before the
     nav link takes over, so the handoff is unchanged). */
  .hero-brand .brandmark-word,
  .brandfly .brandmark-word { text-shadow: 0 0 0.12em var(--ink), 0 0 0.45em var(--ink); }
}
@media (min-width: 778px) {
  .hero-brand { --bm-icon: 1.64em; --bm-gap: 0.64em; }
}

/* Scroll transition (site.js, initBrandFly): one fixed copy of the mark lies
   over the intro, crossfades "agencysims.dev" into the brandmark, then shrinks
   and moves towards the nav slot, where the real link takes over and slides
   the rest of the way. Transform and
   opacity only, set by scroll-driven animations (or by site.js where the
   browser has none), which the !important rules below override (site.js
   rebuilds the animations once an override ends). With JS and
   motion, the slot starts empty; if site.js never takes over (html.bf-on), the
   slot shows after 3 s. The empty slot is only transparent, so the link stays
   in the accessibility tree and the tab order. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  [data-brandfly-slot] { opacity: 0; animation: bf-failsafe 0s 3s forwards; }
}
@keyframes bf-failsafe { to { opacity: 1; } }
.bf-on [data-brandfly-slot] { animation: none; }
.bf-on [data-brandfly-slot]:not(.is-docked) { pointer-events: none; }

.brandfly {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 51;
  margin: 0;
  transform-origin: 0 0;
  pointer-events: none;
  visibility: hidden;
}
.bf-on .brandfly { visibility: visible; }
/* The intro's own icon and word inside the copy, at the intro's size;
   site.js scales them by 1/k and places them where they sit in the intro. */
.brandfly-intro {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
img.brandfly-intro { width: var(--bf-icon); height: var(--bf-icon); max-width: none; }
.brandfly .brandmark-word { font-size: var(--bf-word); }
/* The open phone menu covers the hero, so the bar shows the docked mark. */
.site-header.menu-open [data-brandfly-slot] { opacity: 1 !important; transform: none !important; pointer-events: auto; }
.site-header.menu-open ~ .brandfly { visibility: hidden; }
/* Keyboard focus on the nav link before the dock: the page looks as under
   reduced motion (nav link in the bar, intro static in the hero), never two
   copies of the capitals. */
.bf-on [data-brandfly-slot]:focus-visible { opacity: 1 !important; transform: none !important; pointer-events: auto; }
.bf-on:has([data-brandfly-slot]:focus-visible) .brandfly { visibility: hidden; }
.bf-on:has([data-brandfly-slot]:not(.is-docked):focus-visible) [data-hero-brand] { opacity: 1 !important; }

.hero-note {
  position: absolute;
  right: var(--gutter);
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.hero-note-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgb(244 162 58 / 0.18);
}
@media (max-width: 639.98px) {
  .hero-note { left: var(--gutter); right: auto; }
  .hero .eyebrow { font-size: 0.6875rem; letter-spacing: 0.1em; gap: 0.6rem; }
  .hero .eyebrow::before { width: 1.25rem; }
}
@media (max-width: 959.98px) {
  .hero-scrim {
    background:
      linear-gradient(180deg, rgb(11 18 25 / 0.7) 0, rgb(11 18 25 / 0) calc(var(--header-h) + 3rem)),
      linear-gradient(0deg, var(--ink) 0, rgb(11 18 25 / 0.9) 38%, rgb(11 18 25 / 0.55) 62%, rgb(11 18 25 / 0) 86%);
  }
}

/* ---------- Sections ---------- */

.section { padding-block: var(--section-pad); }

.section-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.section-num { color: var(--fg-muted); }

.section-title {
  font-size: clamp(2.25rem, 1.35rem + 3.3vw, 4.25rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 16ch;
}

/* ---------- Approach (scrollytelling) ---------- */

.approach { padding-bottom: clamp(4rem, 8vw, 7rem); }

.scrolly {
  position: relative;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}
.scrolly-frame {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-2);
}
.scene-box {
  position: relative;
  flex: 1;
  min-height: 0;
}
.scrolly-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.scrolly-hud li {
  position: relative;
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s;
}
.scrolly-hud li + li { border-left: 1px solid var(--line); }
.scrolly-hud li::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  height: 2px;
  width: calc(var(--fill, 0) * 100%);
  background: var(--accent);
}
.scrolly-hud li.is-done { --fill: 1; }
.scrolly-hud li.is-active { color: var(--text); }
.scrolly-hud span { color: var(--text-muted); }
.scrolly-hud li.is-active span { color: var(--accent); }

.steps {
  position: relative;
  counter-reset: step;
}
.steps::before,
.steps::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.steps::after {
  background: var(--accent);
  transform-origin: top;
  transform: scaleY(var(--progress, 0));
}
.step {
  position: relative;
  padding-left: clamp(1.5rem, 3vw, 2.5rem);
}
.step-num { position: relative; }
.step-num::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(1.5rem, 3vw, 2.5rem) - 3.5px);
  top: 50%;
  margin-top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--line-strong);
  z-index: 1;
  transition: background-color 0.3s, border-color 0.3s;
}
.step.is-active .step-num::before { background: var(--accent); border-color: var(--accent); }
.step-num {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.step.is-active .step-num { color: var(--accent); }
.step-title {
  margin-top: 0.75rem;
  font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.step p:not(.step-num) {
  margin-top: 1rem;
  max-width: 32rem;
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.6;
  color: var(--text-soft);
}
.js .step :is(.step-title, p) { transition: color 0.45s var(--ease-out); }
.js .step:not(.is-active) :is(.step-title, p) { color: var(--text-muted); }

@media (min-width: 960px) {
  .scrolly {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(2.5rem, 5vw, 6rem);
  }
  .scrolly-visual {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    position: sticky;
    /* centred in the space under the bar once the 44rem cap applies (tall screens) */
    top: max(calc(var(--header-h) + 1.5rem), calc((100vh + var(--header-h) - 44rem) / 2));
    top: max(calc(var(--header-h) + 1.5rem), calc((100svh + var(--header-h) - 44rem) / 2));
    height: calc(100vh - var(--header-h) - 3rem);
    height: calc(100svh - var(--header-h) - 3rem);
    max-height: 44rem;
  }
  .steps {
    grid-column: 1;
    grid-row: 1;
    padding-block: 8svh 22svh;
  }
  .step {
    min-height: 72vh;
    min-height: 72svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .step:first-child { justify-content: flex-start; padding-top: 18svh; }
}

@media (max-width: 959.98px) {
  .scrolly-visual {
    position: sticky;
    top: var(--header-h);
    z-index: 2;
    height: 46vh;
    height: 46svh;
    max-height: 28rem;
    padding-block: 0.75rem;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    background: var(--ink);
  }
  .scrolly-visual::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 2.5rem;
    background: linear-gradient(var(--ink), rgb(11 18 25 / 0));
    pointer-events: none;
  }
  .steps { padding-block: 2rem 24vh; }
  .step {
    min-height: 40vh;
    min-height: 40svh;
    padding-top: 1.5rem;
  }
  .scrolly-hud li { padding: 0.55rem 0.6rem; }
}
@media (max-width: 479.98px) {
  .scrolly-hud li { font-size: 0; gap: 0; justify-content: center; }
  .scrolly-hud li span { font-size: 0.6875rem; }
}

.approach-close {
  display: grid;
  gap: 1rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--line);
}
@media (min-width: 960px) {
  .approach-close {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(2.5rem, 5vw, 6rem);
  }
}
.approach-close-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.6rem;
}
.approach-close-text {
  max-width: 44rem;
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.75rem);
  font-weight: 450;
  line-height: 1.42;
  letter-spacing: -0.015em;
  color: var(--text);
}

/* ---------- Work ---------- */

.work { padding-top: clamp(4rem, 8vw, 7rem); padding-bottom: clamp(3rem, 6vw, 5rem); }

.section-head--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.section-head--split .section-label { margin-bottom: 0; }
@media (min-width: 960px) {
  .section-head--split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(2.5rem, 5vw, 6rem);
    align-items: start;
  }
  .section-head--split .section-label { grid-column: 1 / -1; }
  .work-index { padding-top: 0.6rem; }
}

.work-intro {
  margin-top: 1.25rem;
  max-width: 24rem;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text-soft);
}
.work-index ol { border-top: 1px solid var(--line); }
.work-index li { border-bottom: 1px solid var(--line); }
.work-index a {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.7rem 0;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.9375rem;
  transition: color 0.2s, padding 0.3s var(--ease-out);
}
.work-index a:hover { color: var(--text); padding-left: 0.4rem; }
.wi-num { font-size: 0.75rem; color: var(--text-muted); }
.wi-name { min-width: 0; }
.wi-years { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.chapter {
  padding-block: clamp(4rem, 8vw, 7.5rem);
  border-top: 1px solid var(--line);
}
@media (min-width: 960px) {
  .chapter {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(2.5rem, 5vw, 6rem);
    align-items: start;
  }
  .chapter-visual {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }
}

.chapter-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}
.chapter-num { color: var(--text-muted); }
.chapter-meta + .kicker { margin-top: 0.5rem; }

.chapter-title {
  margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.875rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 20ch;
}
.chapter-body { margin-top: clamp(1.25rem, 2.5vw, 1.75rem); }
.chapter-body p {
  max-width: 34rem;
  color: var(--fg-soft);
  font-size: 1.0625rem;
  line-height: 1.65;
}
.chapter-body p + p { margin-top: 1.1em; }

.facts {
  margin-top: 2rem;
  border-top: 1px solid var(--rule);
  max-width: 34rem;
}
.facts > div {
  display: grid;
  grid-template-columns: 5.75rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--rule);
}
.facts dt {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-top: 0.2rem;
}
.facts dd {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--fg);
}

.chapter-visual { margin: 2.5rem 0 0; }
@media (min-width: 960px) {
  .chapter-visual { margin-top: 0; }
}
.chapter-visual figcaption,
.chapter-visual > figcaption {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 40rem;
}

.media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--ink-2);
}
.media-frame--wide { aspect-ratio: 16 / 10; }
.media-frame--scene { aspect-ratio: 4 / 3; }
.media-frame--diagram {
  padding: clamp(1rem, 2.5vw, 1.75rem);
  background-image: none;
}
.media-frame > img,
.media-frame > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame > video { opacity: 0; transition: opacity 0.6s; pointer-events: none; }
.media-frame.has-video > video { opacity: 1; }
.media-frame.has-embed {
  aspect-ratio: 4 / 3;
  background: var(--ink);
}
@media (max-width: 599.98px) {
  .media-frame.has-embed { aspect-ratio: 4 / 5; }
}
.media-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.embed-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.85rem;
}
.embed-bar:has(.btn-embed[hidden]):has(.embed-status:empty) { display: none; }
.btn-embed { min-height: 2.5rem; padding-block: 0.5rem; font-size: 0.875rem; }
.btn-embed::after { -webkit-mask-image: var(--icon-play); mask-image: var(--icon-play); width: 0.8em; height: 0.8em; }
.btn-embed:hover::after { transform: none; }
.embed-status { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.embed-status:empty { display: none; }
.media-frame.has-image .media-fallback-label,
.media-frame.has-scene .media-fallback-label { display: none; }
.media-fallback-label {
  position: absolute;
  left: 1rem;
  bottom: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Capacity: stat placeholder, how-it-works, caveat */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding-block: 1rem;
  border-block: 1px solid var(--line);
}
.stat-row > div {
  display: grid;
  grid-template-rows: 1fr auto;   /* values on one baseline when a label wraps */
}
.stat-row dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-row dd {
  margin-top: 0.25rem;
  font-size: 1.75rem;
  font-weight: 550;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.how {
  margin-top: 2.5rem;
  max-width: 34rem;
  scroll-margin-top: 2rem;
}
.how:focus { outline: none; }
.how-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.how-steps {
  margin-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.how-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: 0.75rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.how-num {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.how-steps strong { font-size: 0.9375rem; font-weight: 600; }
.how-steps span:not(.how-num) {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--fg-soft);
}

.caveat {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--muted);
}

/* Flood: legend */

.legend {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgb(11 18 25 / 0.78);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  pointer-events: none;
}
.legend-swatch {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--secondary), rgb(127 168 203 / 0.35));
}

/* FEM diagram */

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.fem-diagram { width: 100%; height: auto; overflow: visible; }
.fem-diagram--v { display: none; max-width: 26rem; margin-inline: auto; }
@media (max-width: 559.98px) {
  .fem-diagram--h { display: none; }
  .fem-diagram--v { display: block; }
}
.d-spine { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.d-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 3 200;
  stroke-dashoffset: 3;
  animation: fem-pulse 3.6s linear infinite;
}
.d-pulse--late { animation-delay: -1.8s; }
@keyframes fem-pulse {
  from { stroke-dashoffset: 3; }
  to { stroke-dashoffset: -100; }
}
.d-node rect { fill: var(--ink); stroke: var(--line); stroke-width: 1; }
.d-node--core rect { stroke: rgb(244 162 58 / 0.55); }
.d-idx {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  fill: var(--text-muted);
}
.d-label {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 550;
  letter-spacing: -0.01em;
  fill: var(--text);
}
.d-label-sub { fill: var(--muted); font-weight: 450; }
.fem-diagram--v .d-label { font-size: 17px; }
.d-chev { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.d-axis { fill: none; stroke: var(--muted); stroke-width: 1.25; }
.d-curve { fill: none; stroke: var(--secondary); stroke-width: 1.75; }
.d-curve--2 { opacity: 0.65; }
.d-curve--3 { opacity: 0.4; }
.d-water { fill: rgb(127 168 203 / 0.2); }
.d-link { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.d-closed { fill: none; stroke: var(--accent-deep); stroke-width: 2.25; stroke-dasharray: 4 4; }
.d-x { fill: none; stroke: var(--accent-deep); stroke-width: 1.75; stroke-linecap: round; }
.d-safe { fill: none; stroke: var(--secondary); stroke-width: 2; }
.d-agent { fill: var(--accent); }
.d-bar { fill: var(--line-strong); }
.d-bar--hi { fill: var(--accent); }

/* Singapore: video facades */

.videos {
  display: grid;
  gap: 1.75rem 1.25rem;
}
@media (min-width: 560px) {
  .videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.videos .video { margin: 0; }
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-2);
}
.video-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}
.video-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) brightness(0.82);
  transition: filter 0.35s, transform 0.6s var(--ease-out);
}
.video-facade:hover img,
.video-facade:focus-visible img { filter: saturate(1) brightness(0.95); transform: scale(1.02); }
.video-facade:focus-visible { outline-offset: -3px; }
.video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.5rem;
  height: 3.5rem;
  margin: -1.75rem 0 0 -1.75rem;
  border-radius: 50%;
  background: rgb(11 18 25 / 0.72);
  border: 1px solid rgb(237 233 225 / 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color 0.25s, border-color 0.25s, transform 0.3s var(--ease-out);
}
.video-play::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.15rem;
  height: 1.15rem;
  transform: translateX(1px);
  background: var(--text);
  -webkit-mask: var(--icon-play) center / contain no-repeat;
  mask: var(--icon-play) center / contain no-repeat;
}
.video-facade:hover .video-play,
.video-facade:focus-visible .video-play { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.video-facade:hover .video-play::after,
.video-facade:focus-visible .video-play::after { background: var(--ink); }
.video-duration {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: rgb(11 18 25 / 0.8);
  font-size: 0.6875rem;
  color: var(--text);
}
.video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.85rem;
}
.video-title { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.video-caption { font-size: 0.8125rem; line-height: 1.5; color: var(--muted); }
.video-yt { margin-top: 0.2rem; padding-block: 0.6rem; font-size: 0.8125rem; color: var(--text-soft); width: fit-content; }
.video-note {
  grid-column: 1 / -1;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Compact chapters */

.chapter-pair {
  display: grid;
  border-top: 1px solid var(--line);
}
.chapter-pair .chapter {
  display: block;
  border-top: 0;
}
@media (min-width: 768px) {
  .chapter-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(2.5rem, 5vw, 6rem);
  }
}
@media (max-width: 767.98px) {
  .chapter-pair .chapter + .chapter { border-top: 1px solid var(--line); }
}
.chapter--compact .chapter-title { font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2.125rem); }

/* Also */

.more {
  scroll-margin-top: 2rem;
  padding-top: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--line);
}
.more-title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.more-list { margin-top: 1.25rem; border-top: 1px solid var(--line); }
.more-list li {
  display: grid;
  gap: 0.35rem 2rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 768px) {
  .more-list li { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(2.5rem, 5vw, 6rem); }
}
.more-term { font-weight: 600; font-size: 0.9375rem; }
.more-desc { font-size: 0.9375rem; line-height: 1.6; color: var(--fg-soft); max-width: 46rem; }
.more-desc a { overflow-wrap: anywhere; }

/* ---------- Services ---------- */

.services { padding-top: clamp(4rem, 8vw, 7rem); }
.service-grid {
  display: grid;
  gap: 2.5rem clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
@media (min-width: 640px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .service-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.service {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-strong);
}
.service-num { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.1em; }
.service-title {
  margin-top: 1.5rem;
  font-size: 1.375rem;
  letter-spacing: -0.025em;
}
.service p:not(.service-num) {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-soft);
}

/* ---------- Paper: publications and about ---------- */

.split {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}
@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(2.5rem, 5vw, 6rem);
    align-items: start;
  }
  .split-aside {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }
}
.theme-paper .section-title { max-width: 12ch; }
.aside-note {
  margin-top: 1.5rem;
  max-width: 22rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fg-soft);
}

.publications { padding-bottom: clamp(4rem, 8vw, 6rem); }
.pubs { border-top: 1px solid var(--rule-strong); }
.pub {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 1.25rem;
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 640px) {
  .pub { grid-template-columns: 5rem minmax(0, 1fr); }
}
.pub-year {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  padding-top: 0.2rem;
}
.pub-title {
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  font-weight: 560;
  line-height: 1.35;
  letter-spacing: -0.012em;
}
.pub-title a {
  color: var(--fg);
  text-decoration-color: rgb(180 91 7 / 0.45); /* ink link, accent-deep underline (graphic) */
}
.pub-title a:hover { color: var(--link-accent); text-decoration-color: currentColor; }
.pub-authors {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--fg-soft);
}
.pub-me { font-weight: 620; color: var(--fg); }
.pub-venue {
  margin-top: 0.15rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--fg-muted);
}
.pubs-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 1.75rem;
}
.pubs-orcid {
  padding-block: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg-soft);
}

.about { padding-top: clamp(4rem, 8vw, 6rem); border-top: 1px solid var(--rule); }
.figures {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 1.75rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.figures > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.4rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule-strong);
}
.figures dd {
  font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem);
  font-weight: 560;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.figures dt {
  max-width: 6rem;
  font-size: 0.6875rem;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.about-text p {
  max-width: 40rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--fg-soft);
}
.about-text p + p { margin-top: 1.25rem; }
.about-text .about-lede {
  font-size: clamp(1.3125rem, 1.1rem + 0.9vw, 1.875rem);
  line-height: 1.38;
  letter-spacing: -0.02em;
  font-weight: 470;
  color: var(--fg);
  max-width: 42rem;
}
.about-text .about-lede + p { margin-top: 1.75rem; }

.partners {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.partners-title {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule-strong);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.partners-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  column-gap: 1.5rem;
  font-size: 1rem;
  font-weight: 520;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.partners-list li {
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule);
}

/* ---------- Contact ---------- */

.contact {
  /* Tall enough that scrolling to #contact never shows the paper section above it. */
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(6rem, 4rem + 9vw, 13rem);
  background:
    radial-gradient(ellipse 60% 70% at 85% 100%, rgb(244 162 58 / 0.07), transparent 70%),
    var(--ink);
}
.contact-title {
  font-size: clamp(2.375rem, 1.3rem + 4.4vw, 5.25rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  max-width: 15ch;
}
.contact-line {
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  color: var(--text-soft);
}
.contact-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  min-height: 2.5rem;
}
.email-link,
.email-plain {
  font-size: clamp(1.1875rem, 0.95rem + 1.5vw, 2.125rem);
  font-weight: 520;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--accent);
  text-decoration-color: rgb(244 162 58 / 0.45);
  text-underline-offset: 0.2em;
  min-width: 0;
}
.email-link:hover { color: #F7B762; }
.copy-btn {
  min-height: 2.75rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--muted); color: var(--text); }
.copy-status { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  font-weight: 500;
}
.contact-links a { color: var(--text-soft); }
.contact-links a:hover { color: var(--accent); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.25rem 2.75rem;
  background: var(--ink);
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}
/* Footer: the same brandmark, larger (icon below 32 px, so favicon.svg). */
.site-footer .brandmark { --bm-size: clamp(12.5px, 9px + 0.6vw, 17px); }
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
}

/* ---------- Reveal ---------- */

.reveal-ready [data-reveal] {
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal-ready [data-reveal]:not(.is-in) {
  opacity: 0;
  transform: translateY(18px);
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.notfound-main {
  flex: 1;
  display: flex;
  align-items: center;
  padding-block: calc(var(--header-h) + 3rem) 4rem;
}
.notfound-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
@media (min-width: 860px) {
  .notfound-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
}
.notfound-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.notfound-code span { color: var(--accent); }
.notfound h1 {
  margin-top: 1.25rem;
  font-size: clamp(2.5rem, 1.4rem + 4.5vw, 5rem);
  letter-spacing: -0.045em;
  line-height: 1;
  max-width: 12ch;
}
.notfound-text {
  margin-top: 1.5rem;
  max-width: 30rem;
  font-size: 1.125rem;
  color: var(--text-soft);
}
.notfound-map { width: 100%; max-width: 30rem; height: auto; }
.nf-link { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-linecap: round; }
.nf-route { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nf-gap { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 5; stroke-linecap: round; }
.nf-node { fill: var(--ink); stroke: var(--line-strong); stroke-width: 1.5; }
.nf-here { fill: var(--accent); }
.nf-lost { fill: none; stroke: var(--muted); stroke-width: 1.5; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .d-pulse { display: none; }
  .reveal-ready [data-reveal]:not(.is-in) { opacity: 1; transform: none; }
  .video-facade:hover img { transform: none; }
}

@media print {
  .site-header, .hero-scene, .hero-scrim, .scrolly-visual, .video-frame, .media-frame--scene, .brandfly { display: none !important; }
  .bf-on [data-hero-brand] { opacity: 1 !important; }
  body, .theme-paper { background: #fff; color: #000; }
}
