/* Landing page for agfian's space. Earth tones taken from the logo: soil, moss, leaf and the lime of the bolt. */

:root {
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --max: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 64px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d100b;
  --bg-raise: #141810;
  --bg-sunk: #090b07;
  --ink: #e9ecd9;
  --ink-2: #b3bb9f;
  --ink-3: #848c77;
  --line: rgba(233, 236, 217, 0.09);
  --line-strong: rgba(233, 236, 217, 0.2);
  --grid: rgba(233, 236, 217, 0.045);
  --leaf: #8fbf3f;
  --accent: #d4e85a;
  --accent-ink: #10140b;
  --soil: #c49a6c;
  --glow: rgba(168, 204, 63, 0.13);
  --chip: rgba(233, 236, 217, 0.06);
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.7);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f1eee4;
  --bg-raise: #f8f6ef;
  --bg-sunk: #e6e2d4;
  --ink: #1b2015;
  --ink-2: #464e3c;
  --ink-3: #676e5d;
  --line: rgba(27, 32, 21, 0.1);
  --line-strong: rgba(27, 32, 21, 0.24);
  --grid: rgba(27, 32, 21, 0.05);
  --leaf: #4f7a1d;
  --accent: #3f6a14;
  --accent-ink: #f6f4ec;
  --soil: #8a5f36;
  --glow: rgba(79, 122, 29, 0.12);
  --chip: rgba(27, 32, 21, 0.055);
  --shadow: 0 24px 60px -30px rgba(52, 44, 20, 0.35);
}

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

/* clip, not hidden: nothing can widen the page, and clip makes no scroll container, so the sticky story still pins */
html,
body {
  overflow-x: clip;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* Film grain over everything, very faint */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s;
}

.skip:focus {
  transform: none;
}

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

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  /* Nearly opaque: a thinner veil smeared the copy scrolling under it */
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background-color 0.35s;
}

.nav.is-scrolled {
  border-bottom-color: var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.4vw, 28px);
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  padding-block: 7px; /* a 44px target around the 30px mark */
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 2px;
}

/* Touch targets are 44px tall; the transparent border keeps the hover fill at the old 38px */
.nav-links a {
  padding: 7px 12px;
  border-block: 3px solid transparent;
  background-clip: padding-box;
  color: var(--ink-2);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}


.nav-icons {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* A 44px target that draws and lays out as 36px: the padding is clipped out of the fill and the margin gives the room back */
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -4px;
  padding: 4px;
  border: 0;
  background: transparent;
  background-clip: content-box;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}


.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Hover styles only where a real hover exists, so a tap on a phone never leaves a control lit */
@media (hover: hover) {
  .nav-links a:hover,
  .icon-btn:hover {
    color: var(--ink);
    background-color: var(--chip);
  }
}

.theme-toggle .icon-sun,
:root[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

/* ---------------------------------------------------------------- hero */

/* The canvas sits under all content and is shared by the hero and the story */
.field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

main,
.footer {
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--nav-h));
  padding-block: clamp(40px, 6vh, 72px) clamp(64px, 9vh, 104px);
}

/* Survey grid, strongest behind the stage */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 72% 48%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 70% at 72% 48%, #000 25%, transparent 78%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}

.hero-copy {
  max-width: 35rem;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 26px;
  color: var(--ink-2);
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  background: var(--leaf);
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid var(--leaf);
  animation: ping 2.6s var(--ease-out) infinite;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* The rotating craft gets a line of its own, so swapping words never reflows the copy below */
h1 .rot {
  display: block;
  padding-block: 0.04em 0.06em;
  font-size: 1.08em;
  white-space: nowrap;
}

h1 em,
h2 em {
  padding-right: 0.06em;
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.lede {
  max-width: 33rem;
  margin: 26px 0 0;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.1vw, 1.06rem);
  line-height: 1.7;
}

.lede strong {
  color: var(--ink);
  font-weight: 600;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px; /* room for each button's drafting lines, so neighbours never touch */
  margin-top: 34px;
}

.btn {
  --sketch: var(--line-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.97rem;
  text-decoration: none;
  transition: transform 0.25s var(--ease-out), background-color 0.25s, border-color 0.25s;
}

/* Drafting lines: each edge runs a few pixels past the corner, like a tidied-up pencil sketch, and reaches further on hover */
.btn::before,
.btn::after {
  content: "";
  position: absolute;
  pointer-events: none;
  transition: inset 0.3s var(--ease-out);
}

.btn::before {
  inset: -1px -7px;
  border-block: 1px solid var(--sketch);
}

.btn::after {
  inset: -7px -1px;
  border-inline: 1px solid var(--sketch);
}

@media (hover: hover) {
  .btn:hover::before {
    inset: -1px -11px;
  }

  .btn:hover::after {
    inset: -11px -1px;
  }

  .btn:hover {
    transform: translateY(-2px);
  }

  .btn:hover svg {
    transform: translateX(3px);
  }

  .btn--ghost:hover {
    border-color: var(--ink-3);
  }
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease-out);
}

/* Hugeicons draw at 1.5; next to semibold text at this size a 2px stroke matches the letter weight */
.btn svg path,
.link-arrow svg path {
  stroke-width: 2;
}

.btn--primary {
  --sketch: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--ghost {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}

/* Proof strip under the hero copy: the number on top, what it means below */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 33rem;
  margin: 44px 0 0;
  border-top: 1px solid var(--line-strong);
}

.stats div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px 16px 0 0;
}

.stats div + div {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.stats dd {
  margin: 0;
  font-size: clamp(1.35rem, 1.9vw, 1.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stats dt {
  color: var(--ink-3);
  font: 500 11px/1.45 var(--font-mono);
  letter-spacing: 0.04em;
}

/* The stage is where particles build the picture; HUD sits just outside it */
.stage {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 1;
  margin-block: 34px 50px;
  cursor: crosshair;
  background: radial-gradient(closest-side, var(--glow), transparent);
  -webkit-tap-highlight-color: transparent;
  container-type: inline-size; /* the HUD below adapts to the stage's own size, which follows the screen's height too */
}

/* Only exists when the canvas cannot run: inside <noscript>, or added by the script when there is no 2D context */
.stage-fallback {
  width: 70%;
  margin: 15%;
}

.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0 solid var(--accent);
  opacity: 0.85;
  pointer-events: none;
}

.corner--tl {
  top: -10px;
  left: -10px;
  border-top-width: 2px;
  border-left-width: 2px;
}

.corner--tr {
  top: -10px;
  right: -10px;
  border-top-width: 2px;
  border-right-width: 2px;
}

.corner--bl {
  bottom: -10px;
  left: -10px;
  border-bottom-width: 2px;
  border-left-width: 2px;
}

.corner--br {
  right: -10px;
  bottom: -10px;
  border-right-width: 2px;
  border-bottom-width: 2px;
}

.hud {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hud--tl {
  top: -34px;
  left: 0;
}

.hud--tr {
  top: -34px;
  right: 0;
  font-variant-numeric: tabular-nums;
}

.hud--bl {
  bottom: -52px;
  left: 0;
}

.hud-sep {
  opacity: 0.5;
}

.rec {
  width: 7px;
  height: 7px;
  background: #c4553a;
  animation: blink 1.6s steps(1) infinite;
}

/* Under both stages: the current picture's name and a row of small bars */
.hud-progress {
  top: calc(100% + 12px);
  bottom: auto;
  min-height: 22px;
  gap: 12px;
}

.progress {
  display: flex;
  gap: 4px;
}

.progress i {
  width: 18px;
  height: 3px;
  background: var(--line-strong);
  transition: background-color 0.45s ease;
}

.progress i.on {
  background: var(--accent);
}

/* A small stage has room for one readout on top: the counters give way and the progress bars get shorter */
@container (max-width: 300px) {
  .hud--tr {
    display: none;
  }

  .progress i {
    width: 10px;
  }
}

/* In the hero the bars are buttons; the current one is longer and fills up until the next picture */
/* Each button is a 44px-tall target 22px wider than its bar, and negative margins give that room back, so the row looks as it did */
.bars {
  display: flex;
  align-items: center;
}

.bars button {
  position: relative;
  width: 44px;
  height: 44px;
  margin: -11px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: width 0.4s var(--ease-out);
}

/* Where two targets overlap, the one you can still switch to wins */
.bars button[aria-pressed="false"] {
  z-index: 1;
}

.bars button::before,
.bars button::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 13px;
  left: 13px;
  height: 3px;
  margin-top: -1.5px;
}

.bars button::before {
  background: var(--line-strong);
  transition: background-color 0.2s;
}

.bars button::after {
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

@media (hover: hover) {
  .bars button:hover::before {
    background: var(--ink-3);
  }
}

.bars button[aria-pressed="true"] {
  width: 66px;
}

.bars button[aria-pressed="true"]::after {
  transform: scaleX(var(--fill, 1));
}

.bars button[hidden] {
  display: none;
}

.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.scroll-cue::after {
  content: "";
  width: 1px;
  height: 28px;
  background: linear-gradient(var(--ink-3), transparent);
  animation: drip 2.2s var(--ease-out) infinite;
  transform-origin: top;
}

/* ---------------------------------------------------------------- sections */

.section {
  position: relative;
  padding-block: clamp(80px, 11vw, 136px);
  border-top: 1px solid var(--line);
}

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--ink-3);
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow b {
  color: var(--accent);
  font-weight: 600;
}

h2 {
  margin: 0;
  font-size: clamp(1.65rem, 2.8vw, 2.15rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.link-arrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.link-arrow svg {
  width: 15px;
  height: 15px;
  transition: transform 0.25s var(--ease-out);
}

/* A taller invisible target around the underlined link */
.link-arrow::before {
  content: "";
  position: absolute;
  inset: -10px -6px -8px;
}

@media (hover: hover) {
  .link-arrow:hover {
    border-color: var(--accent);
    color: var(--ink);
  }

  .link-arrow:hover svg {
    transform: translateX(3px);
  }
}

/* Rows sit 16px apart so each chip's 44px target never overlaps the row above */
.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 8px;
  margin: 0 0 36px;
  padding: 0;
  list-style: none;
}

.topics:empty {
  display: none;
}

.topic {
  position: relative;
  display: inline-flex;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  font: 500 12px/1 var(--font-mono);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.topic span {
  color: var(--ink-3);
}

.topic::before {
  content: "";
  position: absolute;
  inset: -9px -1px;
}

@media (hover: hover) {
  .topic:hover {
    border-color: var(--accent);
    background: var(--chip);
    color: var(--ink);
  }
}

.notes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 24px 22px;
  border: 1px solid var(--line);
  background: var(--bg-raise);
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), border-color 0.3s, background-color 0.35s;
}

/* On hover a card gets "detected": corner brackets and a label tab, like the boxes in the hero */
.note::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(var(--accent), var(--accent)) top left / 18px 2px, linear-gradient(var(--accent), var(--accent)) top left / 2px 18px, linear-gradient(var(--accent), var(--accent)) top right / 18px 2px, linear-gradient(var(--accent), var(--accent)) top right / 2px 18px, linear-gradient(var(--accent), var(--accent)) bottom left / 18px 2px, linear-gradient(var(--accent), var(--accent)) bottom left / 2px 18px, linear-gradient(var(--accent), var(--accent)) bottom right / 18px 2px, linear-gradient(var(--accent), var(--accent)) bottom right / 2px 18px;
  background-repeat: no-repeat;
  transition: opacity 0.25s, inset 0.3s var(--ease-out);
}

.note::after {
  content: attr(data-label);
  position: absolute;
  top: -7px;
  left: -7px;
  padding: 4px 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(calc(-100% + 4px));
  transition: opacity 0.25s, transform 0.3s var(--ease-out);
}

.note:focus-visible {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.note:focus-visible::before {
  inset: -7px;
  opacity: 1;
}

.note:focus-visible::after {
  opacity: 1;
  transform: translateY(-100%);
}

@media (hover: hover) {
  .note:hover {
    border-color: var(--line-strong);
    transform: translateY(-3px);
  }

  .note:hover::before {
    inset: -7px;
    opacity: 1;
  }

  .note:hover::after {
    opacity: 1;
    transform: translateY(-100%);
  }

  .note:hover .note-go {
    color: var(--accent);
    transform: translate(2px, -2px);
  }
}

.note-meta {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--ink-3);
  font: 500 11.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.note-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.015em;
}

.note-excerpt {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 0.94rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: auto 0 0;
  padding-top: 18px;
  color: var(--leaf);
  font: 500 11.5px/1.4 var(--font-mono);
}

.note-go {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  transition: transform 0.3s var(--ease-out), color 0.3s;
}

.sec-sub {
  max-width: 27rem;
  margin: 0;
  color: var(--ink-2);
  font-size: 1rem;
}

/* ---------------------------------------------------------------- story */

/* --s is the pinned stage: as large as fits beside the copy and under the nav, HUD included */
.story {
  --s: min(540px, 42vw, calc(100svh - var(--nav-h) - 150px));
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--s);
  gap: clamp(40px, 6vw, 96px);
  margin-top: clamp(56px, 5vw, 72px);
}

.story-pin {
  grid-column: 2;
  grid-row: 1;
}

.story-sticky {
  position: sticky;
  top: calc(var(--nav-h) + (100svh - var(--nav-h) - var(--s)) / 2 + 6px);
}

.stage--story {
  width: var(--s);
  max-width: none;
  margin: 0;
}


.steps {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  padding: 0 0 14svh;
  list-style: none;
}

.step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70svh;
  max-width: 33rem;
  transition: opacity 0.6s ease, transform 0.7s var(--ease-out);
}

/* With script, the chapter you're reading stays bright and the others recede */
.js .step:not(.is-active) {
  opacity: 0.26;
  transform: translateX(-10px);
}

.step-idx {
  margin: 0;
  color: var(--ink-3);
  font: 500 11.5px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.step-idx b {
  color: var(--accent);
  font-weight: 600;
}

.step h3 {
  margin: 16px 0 12px;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.step-copy {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.97rem;
  line-height: 1.7;
}

.proof {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 32px;
  margin: 26px 0 22px;
}

.proof div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 6px;
  max-width: 14rem;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
}

.proof dd {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.35rem, 1.9vw, 1.65rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.proof dt {
  color: var(--ink-3);
  font: 500 11.5px/1.45 var(--font-mono);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 5px 9px;
  background: var(--chip);
  color: var(--ink-2);
  font: 500 11.5px/1.3 var(--font-mono);
}

/* ---------------------------------------------------------------- contact */

.contact-card {
  position: relative;
  padding: clamp(32px, 6vw, 72px);
  border: 1px solid var(--line-strong);
  background: radial-gradient(120% 140% at 100% 0%, var(--glow), transparent 60%), var(--bg-raise);
}

/* Survey grid fading in from the corner, echoing the hero */
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(80% 90% at 100% 0%, #000, transparent 70%);
  mask-image: radial-gradient(80% 90% at 100% 0%, #000, transparent 70%);
}

.contact-card > :not(.corner) {
  position: relative;
}

.contact-card h2 {
  max-width: 18ch;
  font-size: clamp(1.8rem, 3.3vw, 2.6rem);
}

.contact-copy {
  max-width: 36rem;
  margin: 22px 0 0;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.1vw, 1.06rem);
  line-height: 1.7;
}

/* ---------------------------------------------------------------- footer */

.footer {
  padding-block: clamp(64px, 9vw, 112px) 36px;
  border-top: 1px solid var(--line);
}

.quote {
  margin: 0;
}

.quote p {
  max-width: 24ch;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-style: italic;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.quote cite {
  display: block;
  margin-top: 16px;
  color: var(--ink-3);
  font: 500 12px/1 var(--font-mono);
  font-style: normal;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  margin-top: clamp(48px, 7vw, 88px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font: 500 12px/1.4 var(--font-mono);
}

/* Each link is a 44px target; the padding is taken back with margins so the row keeps its rhythm */
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin: -14px 0;
  padding: 0;
  list-style: none;
}

.foot-links a {
  display: block;
  margin-inline: -8px;
  padding: 14px 8px;
  text-decoration: none;
  transition: color 0.2s;
}

@media (hover: hover) {
  .foot-links a:hover {
    color: var(--ink);
  }
}

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

.js .hero-copy > * {
  animation: rise 0.9s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 90ms + 120ms);
}

.js #stage {
  animation: fade 1.2s ease both 0.2s;
}

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s var(--ease-out);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes ping {
  from {
    opacity: 0.9;
    transform: scale(0.6);
  }
  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes drip {
  from {
    transform: scaleY(0);
    opacity: 1;
  }
  to {
    transform: scaleY(1);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-height: 860px) {
  .scroll-cue {
    display: none;
  }
}

/* ---------------------------------------------------------------- small screens */

/* Narrow and tall (phones and tablets held upright): one column. The script's card check uses the same query. */
@media (max-width: 900px) and (min-height: 501px) {
  .hero {
    min-height: 0;
    padding-block: 20px 88px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  /* Sized by the screen's height too, so the headline and lede start on the first screen of a phone */
  .hero .stage {
    order: -1;
    justify-self: center;
    max-width: min(540px, 38svh);
    margin-block: 30px 40px;
  }

  .kicker {
    margin-bottom: 18px;
  }

  .hero-copy {
    max-width: none;
  }

  /* The stage pins under the nav and the chapters slide over it as cards */
  .story {
    --s: min(calc(100vw - 2 * var(--gutter) - 20px), 46svh, 480px);
  }

  .story-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .story-pin,
  .steps {
    grid-column: 1;
    grid-row: 1;
  }

  .story-pin {
    justify-self: center;
  }

  .story-sticky {
    top: calc(var(--nav-h) + 40px);
  }

  .steps {
    position: relative;
    padding: calc(var(--s) + 120px) 0 0;
  }

  .step {
    min-height: 0;
    max-width: none;
    margin-bottom: 64svh;
    padding: 24px 22px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-raise) 84%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
  }

  .step:last-child {
    margin-bottom: 8svh;
  }

  .js .step:not(.is-active) {
    opacity: 0.55;
    transform: none;
  }
}

/* Landscape phones: keep the two columns, and size both stages to the short screen so the HUD and the pictures fit */
@media (max-width: 900px) and (max-height: 500px) {
  :root {
    --nav-h: 56px;
  }

  .hero {
    padding-block: 24px 48px;
  }

  .hero-grid {
    align-items: start;
    gap: clamp(24px, 4vw, 40px);
  }

  .hero .stage {
    max-width: min(540px, calc(100svh - var(--nav-h) - 96px));
    margin-block: 40px 44px;
  }

  h1 {
    font-size: clamp(2rem, 4.6vw, 2.6rem);
  }

  .kicker {
    margin-bottom: 18px;
  }

  .story {
    --s: min(540px, 42vw, calc(100svh - var(--nav-h) - 96px));
  }

  .step {
    min-height: 80svh;
  }
}

/* The icon links leave the nav before it runs out of room */
@media (max-width: 680px) {
  .hide-sm {
    display: none;
  }
}

@media (max-width: 600px) {
  .nav-links a {
    padding-inline: 9px;
  }

  .brand span {
    font-size: 0.95rem;
  }

  .hud--tl,
  .hud--tr {
    letter-spacing: 0.06em;
  }

  /* File names in the story get long; the counters give way */
  .stage--story .hud--tr {
    display: none;
  }

  .scroll-cue {
    display: none;
  }

  .stats div {
    padding-right: 10px;
  }

  .stats div + div {
    padding-left: 12px;
  }

  .stats dt {
    font-size: 10.5px;
  }

  .note {
    padding: 22px 20px;
  }
}

/* The mark alone below this: the name, three links and the theme toggle need about 440px */
@media (max-width: 460px) {
  .brand span {
    display: none;
  }
}
