/* Akhil Theerthala — embedding map theme */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-latin.woff2") format("woff2");
  font-weight: 100 700;
  font-stretch: 85% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-latin-italic.woff2") format("woff2");
  font-weight: 100 700;
  font-stretch: 85% 100%;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/plex-serif-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/plex-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/plex-serif-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* Carbon ledger: one green-black hue for every neutral, tiers stepped by
   lightness with a little more chroma as they rise, and the previous site's
   warm gold as the only accent. The ground is drawn by .ground (below). */
:root {
  color-scheme: dark;
  --bg: #0c0f0d;
  --surface: #141815;
  --surface-2: #1b201c;
  --elev: #232924;
  --line: #2a302a;
  --line-2: #3b423b;
  --ring: var(--line-2);
  --ink: #eef0ea;
  --ink-2: #cdd1c9;
  --muted: #9fa59c;
  --accent: #c8a66b;
  --accent-hover: #d9b97e;
  --accent-text: #d6b67b;
  --mark-gold: #c8a66b;
  --on-accent: #0c0f0d;
  --focus: #c8a66b;
  --plate: rgb(20 24 21 / 0.8);
  --glass: rgb(12 15 13 / 0.74);
  --media-dim: brightness(0.86);

  /* The ground: a lamp glow over the hero, the ledger grid, contours, grain. */
  --glows:
    radial-gradient(70rem 38rem at 50% -8%, rgb(57 43 17 / 0.45), transparent 70%),
    radial-gradient(48rem 40rem at 100% 100%, rgb(57 43 17 / 0.16), transparent 70%);
  --grid-x: rgb(200 166 107 / 0.028);
  --grid-y: rgb(238 240 234 / 0.014);
  --grid-lit: rgb(200 166 107 / 0.1);
  --tick: rgb(200 166 107 / 0.12);
  --vignette: rgb(6 8 7 / 0.34);
  --contour: rgb(200 166 107 / 0.045);
  --contour-2: rgb(200 166 107 / 0.035);
  --grain: rgb(255 255 255 / 0.04);
  --grain-opacity: 0.28;
  --grain-blend: soft-light;

  --k-paper: #d28063;
  --k-project: #7dd9ba;
  --k-role: #9786c9;

  /* Map areas, in the order of data/map-areas.json. */
  --a0: #d28063;
  --a1: #8cbde8;
  --a2: #dd90ae;
  --a3: #9786c9;
  --a4: #7dd9ba;
  --a5: #aae5ff;
  --a6: #c3d98e;
  --a7: #b8bdb4;
  --a8: #919fff;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --serif: "IBM Plex Serif", Georgia, serif;

  --step-xs: 0.8125rem;
  --step-s: 0.9375rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  --step-3: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);
  --step-4: clamp(3rem, 1.6rem + 5.2vw, 6.25rem);

  /* One 12-column grid; the background draws its column edges. */
  --gutter: 16px;
  --col-gap: 16px;
  --cols: 4;
  --max: 1312px;
  --row: 32px;
  --radius: 16px;
  --radius-s: 8px;
  --radius-xs: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 672px) {
  :root {
    --gutter: 24px;
    --col-gap: 24px;
    --cols: 6;
  }
}

@media (min-width: 1056px) {
  :root {
    --gutter: 32px;
    --col-gap: 32px;
    --cols: 12;
  }
}

/* The same family on sage-grey paper. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e6e8e2;
  --surface: #edefea;
  --surface-2: #e0e3dc;
  --elev: #f2f3ef;
  --line: #ced1c9;
  --line-2: #b5b9b0;
  /* Darker than the hairlines, so outlined buttons hold on the paper (3.3:1). */
  --ring: #7a807a;
  --ink: #131914;
  --ink-2: #333a34;
  --muted: #575f57;
  --accent: #c8a66b;
  --accent-hover: #bc985b;
  --accent-text: #76531b;
  --mark-gold: #9a7637;
  --on-accent: #131914;
  --focus: #76531b;
  --plate: rgb(237 239 234 / 0.82);
  --glass: rgb(230 232 226 / 0.78);
  --media-dim: none;

  --glows:
    radial-gradient(70rem 38rem at 50% -8%, rgb(234 221 193 / 0.75), transparent 70%),
    radial-gradient(48rem 40rem at 100% 100%, rgb(234 221 193 / 0.35), transparent 70%);
  --grid-x: rgb(118 83 27 / 0.05);
  --grid-y: rgb(19 25 20 / 0.03);
  --grid-lit: rgb(118 83 27 / 0.14);
  --tick: rgb(118 83 27 / 0.16);
  --vignette: rgb(200 204 196 / 0.45);
  --contour: rgb(118 83 27 / 0.06);
  --contour-2: rgb(118 83 27 / 0.045);
  --grain: rgb(0 0 0 / 0.06);
  --grain-opacity: 0.35;
  --grain-blend: multiply;

  --k-paper: #a84d2b;
  --k-project: #238a71;
  --k-role: #634590;


  --a0: #a84d2b;
  --a1: #2e6799;
  --a2: #95385b;
  --a3: #634590;
  --a4: #238a71;
  --a5: #0087b6;
  --a6: #6a862d;
  --a7: #5f665f;
  --a8: #2f3469;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Transparent so the fixed .ground shows through; html carries --bg. */
  background: transparent;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Ground ---------- */

/* The page sits on a ledger: full-bleed 32px rules, gold lines on the
   content grid's column edges, plus marks every fourth rule, a lamp glow over
   the hero, faint contour rings and grain. Everything is fixed, so content
   scrolls over the sheet. */
.ground {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(to bottom, var(--grid-y) 1px, transparent 1px) 0 0 / 100% var(--row),
    radial-gradient(circle at 50% 12%, transparent 0, transparent 30rem, var(--vignette) 80rem),
    var(--glows);
}

.ground i {
  position: absolute;
  display: block;
}

.ground-cols,
.ground-ticks,
.ground-spot::after {
  inset-block: 0;
  left: 0;
  right: 0;
  width: min(100% - 2 * var(--gutter) + 1px, var(--max) + 1px);
  margin-inline: auto;
  --tile: calc((100% - 1px + var(--col-gap)) / var(--cols));
}

.ground-cols {
  background: linear-gradient(to right, var(--grid-x) 1px, transparent 1px) 0 0 / var(--tile) 100%;
  border-right: 1px solid var(--grid-x);
}

/* Small marks where every other column line crosses every eighth rule. */
.ground-ticks {
  --tick-x: calc(var(--tile) * 2);
  --tick-y: calc(var(--row) * 8);
}

.ground-ticks::before,
.ground-ticks::after {
  content: "";
  position: absolute;
  inset: 0;
}

.ground-ticks::before {
  background: linear-gradient(to right, var(--tick) 4px, transparent 4px calc(100% - 3px), var(--tick) calc(100% - 3px)) 0 0 / var(--tick-x) 100%;
  -webkit-mask: linear-gradient(to bottom, #000 1px, transparent 1px) 0 0 / 100% var(--tick-y);
  mask: linear-gradient(to bottom, #000 1px, transparent 1px) 0 0 / 100% var(--tick-y);
}

.ground-ticks::after {
  background: linear-gradient(to bottom, var(--tick) 4px, transparent 4px calc(100% - 3px), var(--tick) calc(100% - 3px)) 0 0 / 100% var(--tick-y);
  -webkit-mask: linear-gradient(to right, #000 1px, transparent 1px) 0 0 / var(--tick-x) 100%;
  mask: linear-gradient(to right, #000 1px, transparent 1px) 0 0 / var(--tick-x) 100%;
}

/* The grid brightens around the pointer (src/site.js sets --mx and --my). */
.ground-spot {
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  -webkit-mask: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), #000, transparent);
  mask: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), #000, transparent);
}

.ground.lit .ground-spot {
  opacity: 1;
}

.ground-spot::before,
.ground-spot::after {
  content: "";
  position: absolute;
}

.ground-spot::before {
  inset: 0;
  background: linear-gradient(to bottom, var(--grid-lit) 1px, transparent 1px) 0 0 / 100% var(--row);
}

.ground-spot::after {
  background: linear-gradient(to right, var(--grid-lit) 1px, transparent 1px) 0 0 / var(--tile) 100%;
}

/* Contour rings from the previous site, top left and bottom right. */
.ground-contour {
  width: min(70rem, 78vw);
  aspect-ratio: 1.12;
  border-radius: 50%;
  opacity: 0.6;
}

.ground-contour:nth-of-type(4) {
  left: min(-29rem, -29vw);
  top: -14rem;
  background: repeating-radial-gradient(ellipse at 51% 47%, transparent 0 2.35rem, var(--contour) 2.42rem 2.48rem, transparent 2.55rem 4.85rem);
  -webkit-mask-image: linear-gradient(100deg, #000 18%, rgb(0 0 0 / 0.8) 48%, transparent 78%);
  mask-image: linear-gradient(100deg, #000 18%, rgb(0 0 0 / 0.8) 48%, transparent 78%);
  transform: rotate(-9deg) scaleX(1.2);
}

.ground-contour:nth-of-type(5) {
  right: min(-34rem, -34vw);
  bottom: -19rem;
  background: repeating-radial-gradient(ellipse at 48% 52%, transparent 0 1.95rem, var(--contour-2) 2.02rem 2.08rem, transparent 2.15rem 4.2rem);
  -webkit-mask-image: linear-gradient(278deg, #000 12%, rgb(0 0 0 / 0.78) 46%, transparent 80%);
  mask-image: linear-gradient(278deg, #000 12%, rgb(0 0 0 / 0.78) 46%, transparent 80%);
  transform: rotate(14deg) scaleX(1.25);
}

/* Grain over everything but the nav. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  background: radial-gradient(var(--grain) 0.6px, transparent 0.75px) 0 0 / 4px 4px;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

button {
  font: inherit;
  color: inherit;
}

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

::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}

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

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-s);
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

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

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

/* One filled primary per region; everything else is a ringed secondary. */
.btn {
  --btn-bg: color-mix(in srgb, var(--ink) 4%, transparent);
  --btn-ring: var(--ring);
  --btn-ink: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  box-shadow: inset 0 0 0 1px var(--btn-ring);
  color: var(--btn-ink);
  font-size: var(--step-s);
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.1s var(--ease), background-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.btn:hover {
  --btn-bg: color-mix(in srgb, var(--ink) 8%, transparent);
  --btn-ring: color-mix(in srgb, var(--muted) 55%, transparent);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  --btn-bg: var(--accent);
  --btn-ink: var(--on-accent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 1px 2px rgb(0 0 0 / 0.35);
}

.btn-primary:hover {
  --btn-bg: var(--accent-hover);
}

.btn-small {
  min-height: 34px;
  padding: 0 14px;
  font-size: var(--step-xs);
}

.text-link {
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 0.2s;
}

.text-link:hover {
  text-decoration-color: currentColor;
}

/* Small mono labels: dates, kickers, metric names. Never under 13px, and
   capitals only on the shortest of them. */
.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Map legend filters: ringed, with a swatch that hollows out when off. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: inset 0 0 0 1px var(--ring);
  font-size: var(--step-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.chip:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 55%, transparent);
}

/* Legend glyphs match the map: circles are papers, squares projects,
   diamonds production systems. Colour on the map belongs to the area. */
.chip i {
  width: 9px;
  height: 9px;
  flex: none;
  background: var(--ink-2);
  transition: background-color 0.15s, box-shadow 0.15s;
}

.chip [data-shape="paper"] {
  border-radius: 50%;
}

.chip [data-shape="project"] {
  border-radius: 2px;
}

.chip [data-shape="role"] {
  width: 8px;
  height: 8px;
  margin-inline: 1px;
  transform: rotate(45deg);
}

.chip[aria-pressed="false"] {
  color: var(--muted);
}

.chip[aria-pressed="false"] i {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--muted);
}

.chip small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

/* ---------- Navigation ---------- */

.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.site-nav.scrolled {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 var(--line);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 72px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark-mark {
  flex: none;
  width: 23px;
  height: 22px;
}

.wordmark-mark .accent {
  fill: var(--mark-gold);
  transition: transform 0.3s var(--ease);
  transform-origin: 11.5px 5px;
}

.wordmark:hover .wordmark-mark .accent {
  transform: translateY(-1px);
}

.site-nav nav {
  margin-left: auto;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  position: relative;
  display: block;
  padding: 8px 12px;
  color: var(--muted);
  font-size: var(--step-s);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a[aria-current] {
  color: var(--ink);
}

.nav-links a[aria-current]::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.3s var(--ease);
}

.icon-btn:hover {
  background: var(--surface-2);
}

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

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

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

.theme-toggle:active {
  transform: rotate(40deg);
}

/* The menu button appears below 980px, where the links move into a panel. */
.nav-toggle,
.nav-toggle .close,
.site-nav.menu-open .nav-toggle .menu {
  display: none;
}

.site-nav.menu-open .nav-toggle .close {
  display: block;
}

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

.hero {
  position: relative;
  height: 100svh;
  min-height: 680px;
  max-height: 1100px;
  overflow: hidden;
}

.map-stage {
  position: absolute;
  inset: 0;
}

.map-stage noscript p {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  max-width: 320px;
  color: var(--muted);
}

.map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.hero-intro {
  position: absolute;
  z-index: 4;
  left: max(var(--gutter), (100% - var(--max)) / 2);
  top: clamp(128px, 20vh, 200px);
  width: min(500px, 36%);
  pointer-events: none;
}

.hero-intro > * {
  pointer-events: auto;
}

.hero h1 {
  font-size: var(--step-4);
  font-weight: 620;
  font-stretch: 92%;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

/* A gold rule and a mono line above the name. */
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hero-kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

/* The name is a button that opens the About dialog; it underlines in gold on hover. */
.hero-name {
  all: unset;
  display: block;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  color: inherit;
  text-decoration: underline transparent;
  text-decoration-thickness: 0.05em;
  text-underline-offset: 0.1em;
  transition: text-decoration-color 0.2s;
}

.hero-name:hover {
  text-decoration-color: var(--accent);
}

.hero-name:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 6px;
  border-radius: 4px;
}

.hero-lede {
  margin-top: 20px;
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 34ch;
}

/* The portrait chip under the lede is the plain way into the About dialog. */
.about-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 5px 16px 5px 5px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  box-shadow: inset 0 0 0 1px var(--ring);
  color: var(--ink);
  font: 550 var(--step-s) / 1 var(--sans);
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.1s var(--ease);
}

.about-chip:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent);
}

.about-chip:active {
  transform: scale(0.98);
}

.about-chip img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  box-shadow: 0 0 0 1px var(--line-2);
}

/* The search sits in the legend row under the map; its results open upward. */
.map-search {
  position: relative;
  width: min(220px, 100%);
}

.map-search-field {
  position: relative;
}

.map-search-field svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}

.map-search input {
  width: 100%;
  height: 38px;
  padding: 0 40px;
  border: 1px solid var(--ring);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: var(--step-xs);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.map-search input::placeholder {
  color: var(--muted);
}

.map-search input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent);
}

.map-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: var(--step-xs);
  color: var(--muted);
}

.search-results {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  max-height: 340px;
  overflow: auto;
  padding: 6px;
  list-style: none;
  border-radius: var(--radius);
  background: var(--elev);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--line-2);
}

.search-results[hidden] {
  display: none;
}

.search-results a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  text-decoration: none;
}

.search-results a:hover,
.search-results a[aria-selected="true"] {
  background: var(--surface-2);
}

.search-results b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--step-xs);
  font-weight: 600;
  color: var(--muted);
}

.search-results b i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.search-results span {
  display: block;
  margin-top: 2px;
  font-size: var(--step-s);
  line-height: 1.45;
}

.search-results mark {
  background: color-mix(in srgb, var(--accent) 38%, transparent);
  color: inherit;
  border-radius: 3px;
}

.search-results .empty {
  padding: 12px;
  color: var(--muted);
  font-size: var(--step-s);
}

/* The legend sits under the map, which starts at 46% of the hero (src/site.js). */
.map-controls {
  position: absolute;
  z-index: 2;
  left: 46%;
  right: max(var(--gutter), (100% - var(--max)) / 2);
  bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  pointer-events: none;
}

.map-controls > * {
  pointer-events: auto;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  margin-right: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
}

.segmented button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: var(--step-xs);
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.segmented button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 16%, var(--elev));
  color: var(--accent-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.map-tooltip {
  position: absolute;
  z-index: 6;
  left: 0;
  top: 0;
  width: max-content;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--elev);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line-2), 0 18px 40px -12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  transition: opacity 0.15s, transform 0.15s var(--ease);
}

.map-tooltip.on {
  opacity: 1;
}

.map-tooltip b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--step-xs);
  font-weight: 600;
  color: var(--muted);
}

.map-tooltip b i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.map-tooltip strong {
  display: block;
  margin-top: 6px;
  font-size: var(--step-s);
  font-weight: 600;
  line-height: 1.35;
}

.map-tooltip span {
  display: block;
  margin-top: 4px;
  font-size: var(--step-xs);
  line-height: 1.5;
  color: var(--ink-2);
}

.map-tooltip small {
  display: block;
  margin-top: 6px;
  font-size: var(--step-xs);
  color: var(--accent-text);
}

/* The curated links of the hovered work, one per line. */
.map-tooltip-links {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 12px;
}

.map-tooltip-links li {
  margin-top: 2px;
}

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

.section {
  padding-block: clamp(96px, 10vw, 160px);
}

.section + .section {
  padding-top: 0;
}

.hero + .section {
  padding-top: clamp(64px, 8vw, 112px);
}

/* Section heads: the title under a ruled line with a gold tick. */
.section-head {
  position: relative;
  margin-bottom: clamp(40px, 4vw, 56px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.section-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.section-head h2,
.contact h2 {
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

/* About dialog: a card over the dimmed, blurred map. */

.about-dialog {
  width: min(980px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 56px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line-2), 0 40px 90px -30px rgb(0 0 0 / 0.75);
  overflow: auto;
}

.about-dialog::backdrop {
  background: rgb(6 8 7 / 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.about-dialog[open] {
  animation: card-in 0.26s var(--ease);
}

.about-dialog[open]::backdrop {
  animation: fade-in 0.26s;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .about-dialog[open],
  .about-dialog[open]::backdrop {
    animation: none;
  }
}

/* The card is one narrow column by default: the portrait beside the name,
   the now list after the interests. Past 720px it gets a side column. */
.card-body {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0 20px;
  align-items: center;
  padding: 24px 20px;
}

.card-side,
.card-main {
  display: contents;
}

.card-main > :not(.card-head),
.card-now {
  grid-column: 1 / -1;
}

.card-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.card-portrait {
  position: relative;
  grid-column: 1;
  width: 96px;
  aspect-ratio: 1;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line);
}

.card-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.card-portrait figcaption {
  display: none;
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(10, 12, 11, 0.62);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card-head {
  grid-column: 2;
  padding-right: 40px;
}

.card-head h2 {
  margin-top: 2px;
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.card-role {
  margin-top: 8px;
  font-size: var(--step-s);
  color: var(--ink-2);
}

.card-text {
  margin-top: 22px;
  max-width: 62ch;
  font-size: var(--step-s);
  line-height: 1.55;
  color: var(--ink-2);
}

.card-text p + p {
  margin-top: 14px;
}

.card-sub {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-interests {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  list-style: none;
}

.card-interests li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  background: var(--plate);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--step-s);
  font-weight: 500;
}

.card-interests li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.card-now {
  display: grid;
  gap: 10px;
  order: 1;
  margin-top: 26px;
}

.card-now div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  font-size: var(--step-s);
  line-height: 1.5;
}

.card-now dt {
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent-text);
}

.card-now dd {
  color: var(--ink-2);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  order: 2;
  margin-top: 26px;
}

@media (max-width: 720px) {
  .about-dialog {
    width: calc(100% - 16px);
    max-height: calc(100% - 16px);
  }
}

@media (max-width: 480px) {
  .card-interests {
    grid-template-columns: 1fr;
  }

  .card-now div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Past 720px the portrait and the now list take a column of their own. */
@media (min-width: 721px) {
  .card-body {
    grid-template-columns: 272px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    padding: 32px;
  }

  .card-side {
    display: grid;
    gap: 20px;
    align-content: start;
  }

  .card-main {
    display: block;
  }

  .card-portrait {
    width: auto;
    aspect-ratio: 4 / 5;
  }

  .card-portrait figcaption {
    display: block;
  }

  .card-head {
    padding-right: 56px;
  }

  .card-head h2 {
    margin-top: 6px;
    font-size: var(--step-3);
  }

  .card-text {
    margin-top: 20px;
  }

  .card-now {
    margin-top: 0;
  }

  .card-now div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Experience */

/* The rail sits on the third column line; dates fill the first two columns. */
.timeline {
  --rail: calc((100% + var(--col-gap)) / 12 * 2);
  position: relative;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: var(--rail);
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--line-2);
}

.role {
  position: relative;
  display: grid;
  grid-template-columns: calc(var(--rail) - 32px) minmax(0, 1fr);
  column-gap: 64px;
  padding-bottom: 64px;
}

.role::before {
  content: "";
  position: absolute;
  left: calc(var(--rail) - 4px);
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--muted);
}

.role.current::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.role time {
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.role h3 {
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.role h3 span {
  display: block;
  margin-top: 4px;
  font-size: var(--step-s);
  font-weight: 450;
  letter-spacing: 0;
  color: var(--ink-2);
}

.role ul {
  margin-top: 16px;
  list-style: none;
  max-width: 70ch;
}

.role li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-2);
}

.role li + li {
  margin-top: 12px;
}

.role li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  background: var(--muted);
}

.role li strong {
  color: var(--ink);
  font-weight: 600;
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 22%, transparent) 62%);
}

/* Other roles: collapsed, quieter than the main timeline. */
.other-roles {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.other-roles summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.other-roles summary::-webkit-details-marker {
  display: none;
}

.other-roles summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
}

.other-roles[open] summary::before {
  transform: rotate(45deg);
}

.other-roles .timeline {
  margin-top: 32px;
  opacity: 0.86;
}

.other-roles .role::before {
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  background: var(--bg);
}

/* Achievements */

.achievements {
  display: grid;
  gap: 16px;
  list-style: none;
}

.achievement {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 32px;
  align-items: center;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--plate);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent), 0 0 0 1px var(--line);
}

.achievement h3 {
  margin-top: 10px;
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.achievement p:not(.kicker) {
  margin-top: 10px;
  color: var(--ink-2);
  max-width: 64ch;
}

.achievement .project-links {
  margin-top: 18px;
}

.achievement .big-result {
  aspect-ratio: 16 / 9;
}

.achievement .big-result b {
  font-size: clamp(4rem, 2rem + 5vw, 7rem);
}

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

.award-mark {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent-text);
}

.award-mark svg {
  width: 32px;
  height: 32px;
}

/* Projects */

.projects {
  display: grid;
}

.project {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 36px;
  align-items: start;
  padding-block: clamp(56px, 6vw, 88px);
}

.project + .project {
  border-top: 1px solid var(--line);
}

.project:first-child {
  padding-top: 0;
}

.project-media {
  grid-column: 1 / 8;
  position: relative;
  min-width: 0;
}


.project-text {
  grid-column: 9 / 13;
  position: sticky;
  top: 112px;
  min-width: 0;
}

.project:nth-child(even) .project-media {
  grid-column: 6 / 13;
  order: 2;
}

.project:nth-child(even) .project-text {
  grid-column: 1 / 5;
}

.project-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--k-project);
}

.project h3 {
  margin-top: 14px;
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.project-desc {
  margin-top: 16px;
  color: var(--ink-2);
  max-width: 52ch;
}

/* Metrics read as a spec sheet: mono labels over values, hairline separated. */
.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
  margin-top: 28px;
}

.metrics div {
  padding-left: 14px;
  border-left: 1px solid var(--line-2);
}

.metrics dt {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.metrics div:has(dd.long) {
  grid-column: 1 / -1;
}

.metrics dd {
  margin-top: 4px;
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.metrics dd.long {
  font-family: var(--mono);
  font-size: var(--step-s);
  font-weight: 500;
  letter-spacing: 0;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 28px;
}

.project-links .map-link {
  margin-left: 6px;
}

/* App window frame around real dataset rows */
.window {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 30px 70px -30px rgb(0 0 0 / 0.6), 0 0 0 1px var(--line);
  transform: perspective(1400px) rotateY(-4deg) rotateX(2deg);
  transition: transform 0.6s var(--ease);
}

.project:nth-child(even) .window {
  transform: perspective(1400px) rotateY(4deg) rotateX(2deg);
}

.project:hover .window {
  transform: perspective(1400px) rotateY(0) rotateX(0);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  background: var(--elev);
  box-shadow: inset 0 -1px 0 var(--line);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.window-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line-2);
}

.window-bar span {
  margin-left: 10px;
}

/* Dataset viewer fragment built from real rows */
.dataset {
  font-size: var(--step-xs);
}

.dataset table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.dataset th {
  padding: 10px 12px;
  text-align: left;
  font-family: var(--mono);
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.dataset td {
  padding: 12px;
  vertical-align: top;
  line-height: 1.45;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.dataset td:first-child {
  color: var(--ink);
  font-weight: 550;
}

.dataset tr:last-child td {
  border-bottom: 0;
}

.dataset .col-cat {
  width: 22%;
}

.dataset-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--elev);
  box-shadow: inset 0 1px 0 var(--line);
  color: var(--muted);
}

.dataset-foot .text-link {
  margin-left: auto;
}

/* Density vs diversity figure */
.dvd {
  padding: 22px 22px 18px;
  border-radius: var(--radius);
  background: var(--plate);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent), 0 0 0 1px var(--line);
}

.dvd-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dvd-head figcaption b {
  display: block;
  font-size: var(--step-s);
  font-weight: 600;
}

.dvd-head figcaption span {
  display: block;
  font-size: var(--step-xs);
  color: var(--muted);
}

.dvd canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-top: 18px;
}

.dvd-readout {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 14px;
  font-size: var(--step-s);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dvd-readout b {
  color: var(--ink);
  font-weight: 600;
}

.dvd-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--step-xs);
}

.dvd-key i {
  display: inline-block;
  flex: none;
}

.dvd-key .sq {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
}

.dvd-key .dot {
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.dvd-findings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--line);
  box-shadow: 0 0 0 1px var(--line);
}

.dvd-findings div {
  padding: 14px 14px 12px;
  background: var(--surface);
}

.dvd-findings dt {
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.dvd-findings dd {
  margin-top: 4px;
  font-size: var(--step-xs);
  line-height: 1.45;
  color: var(--ink-2);
}

/* Ranked feature importances (crowdfunding study) */
.drivers {
  --fade: 34%;
  padding: 22px 22px 18px;
  border-radius: var(--radius);
  background: var(--plate);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent), 0 0 0 1px var(--line);
}

:root[data-theme="light"] .drivers {
  --fade: 45%;
}

.drivers figcaption b {
  display: block;
  font-size: var(--step-s);
  font-weight: 600;
}

.drivers figcaption span {
  display: block;
  margin-top: 2px;
  font-size: var(--step-xs);
  color: var(--muted);
}

.drivers-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 22px 28px;
  margin-top: 20px;
}

.drivers-title {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent-text);
}

.drivers-meta {
  margin-top: 4px;
  font-size: var(--step-xs);
  line-height: 1.4;
  color: var(--muted);
}

.drivers-bars {
  display: grid;
  gap: 11px;
  margin-top: 14px;
}

.drivers-bars li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4ch;
  align-items: center;
  gap: 5px 10px;
}

.drivers-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 12px;
  grid-column: 1 / -1;
}

.drivers-label {
  font-size: var(--step-xs);
  font-weight: 550;
  line-height: 1.3;
  color: var(--ink);
}

.drivers-label sup {
  margin-left: 3px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--a0);
}

.drivers-effect {
  margin-left: auto;
  font-size: 0.8125rem;
  line-height: 1.3;
  text-align: right;
  color: var(--muted);
}

.drivers-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.drivers-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--v) * 100%);
  min-width: 3px;
  border-radius: inherit;
  background: var(--mark-gold);
  transition: width 0.9s var(--ease) 0.2s;
}

.js .project.reveal:not(.in) .drivers-track i {
  width: 0;
}

/* The part of a bar inside the noise range is faded, with a tick at its edge. */
.has-noise .drivers-track i,
.drivers-notes .swatch {
  background: linear-gradient(to right, color-mix(in srgb, var(--mark-gold) var(--fade), transparent) calc(var(--noise) / var(--v) * 100%), var(--mark-gold) 0);
}

.has-noise .drivers-track::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--noise) * 100%);
  box-shadow: inset -2px 0 0 var(--bg);
}

.flagged .drivers-track i {
  background: repeating-linear-gradient(-45deg, var(--a0) 0 3px, color-mix(in srgb, var(--a0) 30%, transparent) 3px 6px);
}

.has-noise .flagged .drivers-track i {
  -webkit-mask-image: linear-gradient(to right, rgb(0 0 0 / var(--fade)) calc(var(--noise) / var(--v) * 100%), #000 0);
  mask-image: linear-gradient(to right, rgb(0 0 0 / var(--fade)) calc(var(--noise) / var(--v) * 100%), #000 0);
}

.drivers-value {
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-align: right;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.drivers-foot {
  margin-top: 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}

.drivers-notes {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  padding-top: 14px;
  box-shadow: inset 0 1px 0 var(--line);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.drivers-notes li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
}

.drivers-notes b {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--a0);
}

.drivers-notes .swatch {
  --noise: 0.5;
  --v: 1;
  width: 14px;
  height: 8px;
  margin-top: 5px;
  border-radius: 4px;
}

/* Product cover image */
.cover {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line);
  transform: perspective(1400px) rotateY(-4deg) rotateX(2deg);
  transition: transform 0.6s var(--ease);
}

.project:hover .cover {
  transform: perspective(1400px) rotateY(0) rotateX(0);
}

.cover img {
  width: 100%;
  filter: var(--media-dim);
}

/* One result, drawn large over a field of the other entrants. */
.big-result {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--plate);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent), 0 0 0 1px var(--line);
  color: var(--ink);
  text-align: center;
}

.big-result b {
  display: block;
  font-weight: 650;
  font-stretch: 85%;
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: var(--accent-text);
}

.big-result span {
  display: block;
  margin-top: 14px;
  font-size: var(--step-1);
  color: var(--ink-2);
}

.big-result canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.big-result div {
  position: relative;
}

.map-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 6px 0;
  background: none;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s;
}

.map-link:hover {
  color: var(--accent-text);
}

.map-link svg {
  width: 14px;
  height: 14px;
}

/* Publications */

.pub-group + .pub-group {
  margin-top: clamp(48px, 6vw, 80px);
}

.pub-group-head {
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.pub-role {
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink-2);
  letter-spacing: 0.04em;
}

.pub-thumb.draft {
  background: #f4f2ec;
}

.draft-page {
  position: absolute;
  inset: 0;
  padding: 12% 10% 0;
  color: #1c1f1d;
  filter: var(--media-dim);
  text-align: center;
}

.draft-title {
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
}

.draft-authors {
  margin-top: 6px;
  font-size: 6px;
  line-height: 1.4;
  color: #4b524d;
}

.draft-heading {
  margin-top: 9px;
  font-size: 6.5px;
  font-weight: 600;
}

.draft-lines,
.draft-cols i {
  display: block;
  background: repeating-linear-gradient(to bottom, #c9cdc6 0 2px, transparent 2px 5px);
}

.draft-lines {
  height: 30px;
  margin: 5px 6% 0;
}

.draft-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.draft-cols i {
  height: 70px;
}

.draft-stamp {
  position: absolute;
  left: 50%;
  bottom: 14%;
  padding: 4px 10px;
  border: 1.5px solid #9a7637;
  border-radius: 4px;
  color: #85652d;
  background: #f4f2ec;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateX(-50%) rotate(-6deg);
  white-space: nowrap;
}

.pubs {
  display: grid;
  gap: 16px;
  list-style: none;
}

.pub {
  position: relative;
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 36px;
  padding: 28px 32px;
  border-radius: var(--radius);
  background: var(--plate);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent), 0 0 0 1px var(--line);
  transition: box-shadow 0.2s var(--ease);
}

.pub:hover {
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent), 0 0 0 1px var(--line-2);
}

/* First-author work carries a gold rule on its leading edge. */
.pub-group.first-author .pub::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.pub-thumb {
  position: relative;
  align-self: start;
  aspect-ratio: 8.5 / 11;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 14px 28px -14px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line);
  transition: transform 0.3s var(--ease);
}

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

.pub-thumb img {
  filter: var(--media-dim);
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.pub-venue {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent-text);
}

.pub-venue i {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--k-paper);
}

.pub h3 {
  margin-top: 8px;
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 40ch;
}

.pub h3 a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  transition: background-size 0.35s var(--ease);
}

.pub h3 a:hover {
  background-size: 100% 1.5px;
}

.pub-authors {
  margin-top: 10px;
  font-size: var(--step-s);
  color: var(--muted);
  max-width: 72ch;
}

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

.pub details {
  margin-top: 14px;
}

.pub summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--step-s);
  font-weight: 550;
  cursor: pointer;
  list-style: none;
}

.pub summary::-webkit-details-marker {
  display: none;
}

.pub summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
}

.pub details[open] summary::before {
  transform: rotate(45deg);
}

.pub details p {
  margin-top: 12px;
  color: var(--ink-2);
  max-width: 76ch;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  list-style: none;
}

.tags li {
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.copy-btn[data-copied="true"] {
  --btn-bg: color-mix(in srgb, var(--accent) 28%, var(--surface-2));
}

/* Writing */

.featured {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 168px 28px 28px;
  border-radius: var(--radius);
  background: var(--plate);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent), 0 0 0 1px var(--line);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent), 0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--line-2));
}

/* The write-up's own passages, drawn as a constellation in the card's top. */
.feature-card canvas {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 156px;
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

.feature-card .kicker {
  position: relative;
}

.feature-card h3 {
  position: relative;
  margin-top: 10px;
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.feature-card p {
  position: relative;
  margin-top: 12px;
  color: var(--ink-2);
  max-width: 40ch;
  font-size: var(--step-s);
}

.more-writing {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  padding: 18px 4px;
  border-block: 1px solid var(--line);
  font-weight: 550;
  text-decoration: none;
  transition: padding-left 0.3s var(--ease);
}

.more-writing:hover {
  padding-left: 14px;
}

.more-writing .meta {
  font-size: var(--step-s);
  font-weight: 400;
  color: var(--muted);
}

.essay-list {
  list-style: none;
}

.essay-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 24px;
  align-items: baseline;
  padding: 16px 4px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: padding-left 0.3s var(--ease), color 0.2s;
}

.essay-list li:last-child a {
  border-bottom: 1px solid var(--line);
}

.essay-list a:hover {
  padding-left: 14px;
}

.essay-list a span:first-child {
  font-weight: 550;
}

.essay-list .meta {
  font-size: var(--step-s);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.essay-group + .essay-group {
  margin-top: 40px;
}

.essay-group .kicker {
  margin-bottom: 12px;
}

/* Education */

.education {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
}

.education li {
  padding: 28px 32px;
  border-radius: var(--radius);
  background: var(--plate);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent), 0 0 0 1px var(--line);
}

.education h3 {
  margin-top: 14px;
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.education p {
  margin-top: 6px;
  color: var(--ink-2);
}

/* Contact */

.contact {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 48px clamp(32px, 5vw, 80px);
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(48rem 26rem at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--plate);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 5%, transparent), 0 0 0 1px var(--line);
  color: var(--ink);
  padding: clamp(32px, 6vw, 80px);
}

.contact canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.contact > div {
  position: relative;
  min-width: 0;
}

.contact p:not(.kicker) {
  margin-top: 18px;
  font-size: var(--step-1);
  font-weight: 350;
  line-height: 1.45;
  max-width: 46ch;
  color: var(--ink-2);
}

.contact-email {
  color: var(--accent-text);
  display: inline-block;
  margin-top: 32px;
  font-size: clamp(1.75rem, 0.9rem + 3vw, 3.5rem);
  font-weight: 600;
  font-stretch: 90%;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size 0.4s var(--ease);
}

.contact-email:hover {
  background-size: 100% 2px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.contact-side {
  align-self: end;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.interests {
  margin-top: 14px;
  list-style: none;
}

.interests li {
  position: relative;
  padding: 10px 0 10px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--step-s);
  line-height: 1.4;
}

.interests li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.05em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Footer */

.site-footer {
  padding: 40px 0 56px;
  color: var(--muted);
  font-size: var(--step-s);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

/* ---------- Article and artifact pages ---------- */

.page-top {
  padding-top: 150px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--step-s);
  color: var(--muted);
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink);
}

.page-title {
  margin-top: 18px;
  max-width: 22ch;
  font-size: clamp(2.375rem, 1.4rem + 3.4vw, 4.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.page-lede {
  margin-top: 22px;
  max-width: 56ch;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin-top: 28px;
  font-size: var(--step-s);
  color: var(--muted);
}

.page-meta .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.reader {
  display: grid;
  grid-template-columns: 220px minmax(0, 68ch) minmax(240px, 300px);
  justify-content: space-between;
  gap: 56px;
  padding-top: 64px;
  padding-bottom: 120px;
}

.reader.no-aside {
  grid-template-columns: 220px minmax(0, 68ch) minmax(0, 300px);
}

.toc {
  position: sticky;
  top: 104px;
  align-self: start;
  max-height: calc(100vh - 140px);
  overflow: auto;
  font-size: var(--step-s);
}

.toc p {
  margin-bottom: 10px;
  font-weight: 600;
}

.toc ol {
  list-style: none;
  border-left: 2px solid var(--line);
}

.toc a {
  display: block;
  margin-left: -2px;
  padding: 5px 0 5px 14px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.2s, border-color 0.2s;
}

.toc a.sub {
  padding-left: 28px;
}

.toc a:hover,
.toc a.active {
  color: var(--ink);
  border-left-color: var(--accent);
}

.toc-mobile {
  display: none;
}

.prose {
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.72;
  color: var(--ink-2);
  min-width: 0;
}

.prose > * + * {
  margin-top: 1.15em;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--sans);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.prose h2 {
  margin-top: 2.2em;
  font-size: 1.75rem;
  font-weight: 600;
}

.prose > h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: 1.8em;
  font-size: 1.3125rem;
  font-weight: 600;
}

.prose h4 {
  margin-top: 1.6em;
  font-size: 1.0625rem;
  font-weight: 600;
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
  text-underline-offset: 3px;
}

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

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose blockquote {
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  font-style: italic;
}

.prose img {
  height: auto;
  margin-inline: auto;
  border-radius: var(--radius-s);
}

.prose figcaption {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: var(--step-s);
  color: var(--muted);
  text-align: center;
}

.prose code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.82em;
}

.prose pre {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: #080a09;
  color: #e3e7e1;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.6;
}

:root[data-theme="light"] .prose pre {
  background: #181c19;
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  color: inherit;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: var(--step-s);
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin-block: 2.4em;
}

.prose [id^="p-"] {
  scroll-margin-top: 120px;
  border-radius: 6px;
  transition: background-color 1.2s var(--ease), box-shadow 1.2s var(--ease);
}

.prose .flash {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 18%, transparent);
}

.side-map {
  position: sticky;
  top: 104px;
  align-self: start;
}

.side-map h2,
.side-map h3 {
  font-size: var(--step-s);
  font-weight: 600;
}

.mini-map {
  position: relative;
  margin-top: 12px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--line);
  overflow: hidden;
}

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

.side-map .mini-readout {
  min-height: 4.5em;
  margin-top: 10px;
  font-size: var(--step-xs);
  line-height: 1.5;
  color: var(--ink-2);
}

.mini-readout b {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
}

.mini-readout b i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.nearby {
  margin-top: 24px;
}

.nearby h3 {
  margin-bottom: 8px;
}

.nearby ol {
  list-style: none;
}

.nearby a {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: var(--step-s);
  line-height: 1.35;
  text-decoration: none;
}

.nearby a:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nearby i {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 0.45em;
  border-radius: 50%;
}

.article-foot {
  margin-top: 64px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--line);
  font-family: var(--sans);
  font-size: var(--step-0);
}

.article-foot p + p {
  margin-top: 8px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--k-project) 16%, transparent);
  color: var(--ink);
  font-size: var(--step-s);
  font-weight: 550;
}

.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--k-project);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--k-project) 50%, transparent);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.artifact-media {
  margin-top: 56px;
}

.artifact-media .window {
  transform: none;
}

.writing-index {
  padding-top: 64px;
  padding-bottom: 120px;
}

.not-found {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
}

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

.not-found > div {
  position: relative;
  padding: 24px;
}

.not-found h1 {
  font-size: var(--step-4);
  font-weight: 620;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.not-found p {
  margin: 20px auto 0;
  max-width: 40ch;
  font-size: var(--step-1);
  color: var(--ink-2);
}

.not-found nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}

/* ---------- Reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  transition-delay: calc(min(var(--i, 0), 6) * 60ms);
}

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

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .reader {
    grid-template-columns: minmax(0, 68ch) minmax(220px, 280px);
  }

  .toc {
    display: none;
  }

  .toc-mobile {
    display: block;
    margin-top: 28px;
    max-width: 68ch;
  }

  .toc-mobile summary {
    cursor: pointer;
    font-weight: 600;
    font-size: var(--step-s);
  }

  .toc-mobile ol {
    margin-top: 10px;
    padding-left: 18px;
    font-size: var(--step-s);
  }

  .toc-mobile li + li {
    margin-top: 4px;
  }

  .toc-mobile a {
    color: var(--muted);
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-grid;
  }

  /* The open panel and the bar above it are one solid sheet: a blurred
     panel inside a blurred bar cannot see the page, so it would show through. */
  .site-nav nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    margin: 0;
    padding: 4px 0 12px;
    background: var(--surface);
    box-shadow: 0 1px 0 var(--line);
  }

  .site-nav.menu-open nav {
    display: block;
  }

  .site-nav.menu-open,
  .site-nav.menu-open.scrolled {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-links {
    flex-direction: column;
    gap: 0;
    width: min(100% - 2 * var(--gutter), var(--max));
    margin-inline: auto;
  }

  .nav-links a {
    padding: 12px 0;
    font-size: var(--step-1);
    color: var(--ink);
  }

  .nav-links a::after {
    left: 0;
    right: auto;
    bottom: 8px;
    width: 24px;
  }

  .nav-actions {
    margin-left: auto;
  }

  .hero {
    height: auto;
    min-height: 0;
    max-height: none;
    padding-top: 112px;
    display: flex;
    flex-direction: column;
  }

  .hero-intro {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    margin-inline: var(--gutter);
  }

  .map-stage {
    position: relative;
    height: min(78svh, 620px);
    margin-top: 24px;
  }

  .map-controls {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    flex-direction: column;
    align-items: stretch;
    margin: 0 var(--gutter) 24px;
  }

  .project {
    grid-template-columns: 1fr;
  }

  .project-media,
  .project-text,
  .project:nth-child(even) .project-media,
  .project:nth-child(even) .project-text {
    grid-column: 1 / -1;
  }

  .project:nth-child(even) .project-media {
    order: 0;
  }

  .project-text {
    position: static;
  }

  .featured {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact {
    grid-template-columns: 1fr;
  }

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

  .side-map {
    position: static;
    max-width: 480px;
  }
}

@media (max-width: 680px) {
  .site-nav .wrap {
    gap: 12px;
  }

  .nav-actions {
    gap: 4px;
  }

  .dataset .col-cat {
    width: 36%;
  }

  .timeline {
    --rail: 4px;
  }

  .role {
    grid-template-columns: 1fr;
    padding-left: 28px;
    padding-bottom: 48px;
  }

  .role time {
    padding: 0 0 6px;
    text-align: left;
  }

  .now,
  .featured,
  .education {
    grid-template-columns: 1fr;
  }

  .pub {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 22px;
  }

  .pub-thumb {
    width: 96px;
  }

  /* The legend scrolls sideways instead of wrapping into three rows. */
  .map-legend {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter));
    padding: 2px var(--gutter);
  }

  .map-legend::-webkit-scrollbar {
    display: none;
  }

  .chip,
  .segmented {
    flex: none;
  }

  .dvd-findings {
    grid-template-columns: 1fr;
  }

  .dvd-findings div {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    align-items: baseline;
    gap: 12px;
  }

  .dvd-findings dd {
    margin-top: 0;
  }

  .cover,
  .project:hover .cover {
    transform: none;
  }

  .essay-list a {
    grid-template-columns: 1fr auto;
  }

  .essay-list .read {
    display: none;
  }

  .window,
  .project:nth-child(even) .window {
    transform: none;
  }

  .dataset .col-resp,
  .dataset td:nth-child(3) {
    display: none;
  }

  .achievement:not(.compact) {
    grid-template-columns: 1fr;
    gap: 20px;
  }

}

@media (max-width: 420px) {
  .wordmark {
    gap: 8px;
  }

  .nav-actions {
    gap: 0;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 360px) {
  .wordmark-text {
    display: none;
  }
}

/* No keyboard, no shortcut hint. */
@media (hover: none) {
  .map-search kbd {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

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