/* ------------------------------------------------------------------
   Fonts — self-hosted, latin subset (SIL OFL, licences beside the files).
   Instrument Sans is variable: weight 400–700, width 75–100.
------------------------------------------------------------------- */
@font-face {
  font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  src: url(assets/fonts/instrument-sans-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(assets/fonts/instrument-serif-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap;
  src: url(assets/fonts/instrument-serif-italic-latin.woff2) format('woff2');
}

/* ------------------------------------------------------------------
   Tokens — the Hurdle "Editorial Mono" ladder, the STNC grain and type.
   Black-first. No colour: dots, icons, length and inversion carry state.
------------------------------------------------------------------- */
:root {
  --bg: #050505;
  --fg: #f2f2f2;
  --muted: #8f8f8f;
  --faint: #5a5a5a;
  --line: #1f1f1f;
  --line-strong: #383838;
  --surface: #0c0c0c;

  --sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', ui-serif, Georgia, serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, Menlo, monospace;

  --expo: cubic-bezier(0.16, 1, 0.3, 1);
  --quart: cubic-bezier(0.76, 0, 0.24, 1);
  --gutter: clamp(16px, 3vw, 40px);
}
:root[data-theme="invert"] {
  --bg: #f4f4f2;
  --fg: #0a0a0a;
  --muted: #5e5e5e;
  --faint: #9a9a9a;
  --line: #dcdcda;
  --line-strong: #bdbdbb;
  --surface: #ebebe9;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
::selection { background: var(--fg); color: var(--bg); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
/* The scrambling copy of a decoding label: no box of its own, so the label's
   flex gaps still apply to the dot, text and icon inside it. */
.dec { display: contents; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* Circular invert (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 9999; }

.label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; flex-shrink: 0; }
.dot--live { background: currentColor; }
.ico { width: 14px; height: 14px; flex-shrink: 0; }

/* Rolling digits */
.odo { display: inline-flex; align-items: flex-start; }
.odo__col { display: inline-block; height: 1em; line-height: 1em; overflow: hidden; }
.odo__strip { display: block; transform: translateY(calc(var(--n, 0) * -1em)); transition: transform var(--odur, 1.8s) var(--expo); transition-delay: var(--odel, 0s); }
.odo__strip > span { display: block; height: 1em; text-align: center; }
.odo__sep { display: inline-block; line-height: 1em; }

/* ---------- Film grain ---------- */
/* Plain transparency, no blend mode: a full-screen blended layer that re-composites
   14 times a second flickers on some GPUs, and over flat dark or light it looks the same. */
.grain { pointer-events: none; position: fixed; inset: 0; z-index: 100; overflow: hidden; opacity: .085; }
:root[data-theme="invert"] .grain { opacity: .1; }
.grain::after, .preview__grain {
  content: '';
  position: absolute;
  /* The noise tiles every 220px, so jumps of up to ±110px look fully random. The layer
     overhangs by 120px each side, so no jump can ever uncover an edge of the screen. */
  inset: -120px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  animation: grain .7s steps(1) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 10% { transform: translate(-30px,-60px); } 20% { transform: translate(-90px,30px); }
  30% { transform: translate(40px,-100px); } 40% { transform: translate(-30px,100px); } 50% { transform: translate(-90px,60px); }
  60% { transform: translate(90px,0); } 70% { transform: translate(0,90px); } 80% { transform: translate(20px,110px); } 90% { transform: translate(-60px,60px); }
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px var(--gutter);
  color: var(--fg);  /* sits over its own fade, so it needs no blend layer */
}
.topbar .label { color: var(--muted); }
/* A soft fade under the see-through top bar, so scrolled content never collides with it. */
.topfade {
  position: fixed; inset: 0 0 auto 0; z-index: 49; height: 92px; pointer-events: none;
  background: linear-gradient(var(--bg) 30%, color-mix(in srgb, var(--bg) 70%, transparent) 60%, transparent);
  opacity: 0; transition: opacity .5s var(--expo);
}
.is-scrolled .topfade { opacity: 1; }
.topbar__side { display: flex; align-items: center; gap: 16px; }
.mark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; font-weight: 500; }
.mark svg { width: 12px; height: 12px; transition: transform 1.2s var(--expo); }
.mark:hover svg { transform: rotate(180deg); }
.mark__txt { opacity: 0; transition: opacity .5s var(--expo); }
.mark__txt.is-on { opacity: 1; }
.slash { color: var(--faint); }
.avail { display: inline-flex; align-items: center; gap: 8px; }
.avail .dot { position: relative; width: 6px; height: 6px; background: var(--fg); border-color: var(--fg); }
/* The pulse is a ring that scales and fades (compositor only), not an animated
   box-shadow, which repaints the top bar on every frame. */
.avail .dot::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; background: var(--fg); animation: pulse 2.4s var(--expo) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .5; } 70%, 100% { transform: scale(3.3); opacity: 0; } }
.toplink { position: relative; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.toplink::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--expo); }
.toplink:hover::after { transform: scaleX(1); transform-origin: left; }
.invert-btn { width: 14px; height: 14px; border-radius: 50%; border: 1px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); transition: transform .8s var(--expo); }
.invert-btn:hover { transform: rotate(180deg); }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

/* ---------- Section dock ----------
   Once the chips above the index scroll away, the same four sit in the middle of the top
   bar, with one pill that slides to the section in view. Phones get a button instead
   (see the phone overrides at the end). */
.dock {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) translateY(-6px); opacity: 0; visibility: hidden;
  transition: opacity .45s var(--expo), transform .6s var(--expo), visibility 0s linear .45s;
}
.dock.is-on { opacity: 1; transform: translate(-50%, -50%); visibility: visible; transition: opacity .45s var(--expo), transform .6s var(--expo), visibility 0s; }
.dock__now { display: none; }
.dock__list {
  position: relative; display: flex; padding: 3px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.dock__chip {
  position: relative; z-index: 1; padding: 6px 11px; border-radius: 999px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); transition: color .45s var(--expo);
}
.dock__chip:hover { color: var(--fg); }
.dock__chip[aria-current="true"] { color: var(--bg); }
.dock__chip:focus-visible { outline-offset: 1px; }
.dock__chip sup { font-size: 8px; margin-left: 4px; opacity: .6; }
.dock__pill {
  position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: 999px; background: var(--fg);
  width: var(--pw, 0px); transform: translateX(var(--px, 0px)); opacity: var(--po, 0);
  transition: transform .55s var(--expo), width .55s var(--expo), opacity .3s var(--expo);
}
.dock__pill.still { transition: none; }
/* Narrow windows make room for it: the counts go, and the place and the clock step aside. */
@media (max-width: 1000px) {
  .dock__chip sup { display: none; }
  .topbar.is-docked .topbar__extra { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: 84px var(--gutter) 0; }
/* The name scrolls with the page, under the top bar and its fade (no blend layer:
   overlapping difference layers flicker as one slides beneath the other). */
.hero__name {
  position: relative;
  margin: 0 0 0 -0.05em;
  font-weight: 500;
  font-size: 16.4vw;
  line-height: .8;
  letter-spacing: -0.065em;
  white-space: nowrap;
  color: var(--fg);
  will-change: transform, opacity;
}
.hero__name .line { display: block; overflow: hidden; padding-bottom: .07em; }
.hero__name .ch { display: inline-block; text-align: center; transform: translateY(105%); transition: transform 1.3s var(--expo); font-variation-settings: "wght" 500, "wdth" 100; }
.is-ready .hero__name .ch { transform: none; }
.hero__name .ast { font-family: var(--serif); font-weight: 400; font-size: .42em; vertical-align: top; position: relative; top: .12em; margin-left: .04em; letter-spacing: 0; font-variation-settings: normal; }

.hero__row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(16px, 3vw, 48px);
  align-items: end;
  margin-top: 18px;
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
}
.hero__statement { margin: 0; max-width: 36ch; font-size: clamp(18px, 1.7vw, 24px); line-height: 1.2; letter-spacing: -0.02em; }
.hero__statement .serif { font-size: 1.08em; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding-left: 16px; border-left: 1px solid var(--line); }
.stat__num { display: flex; align-items: flex-start; font-family: var(--serif); font-size: clamp(34px, 3.8vw, 60px); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.stat__num small { font-size: .5em; line-height: 1.3; margin-left: .06em; color: var(--muted); }
.stat .label { display: block; margin-top: 10px; line-height: 1.4; }
@media (max-width: 900px) {
  .hero__row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
}

.rise { opacity: 0; transform: translateY(12px); transition: opacity 1.1s var(--expo), transform 1.1s var(--expo); }
.is-ready .rise { opacity: 1; transform: none; }

/* ---------- Index ---------- */
.index-wrap { position: relative; padding: 0 var(--gutter); }
.toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--line-strong);
}
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted);
  transition: background-color .4s var(--expo), color .4s var(--expo), border-color .4s var(--expo);
}
.chip sup { font-size: 8px; margin-left: 4px; opacity: .6; }
.chip:hover { color: var(--fg); border-color: var(--fg); }
.chip[aria-current="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend .ico { width: 11px; height: 11px; }
.legend .dot { width: 6px; height: 6px; }
.legend kbd {
  display: inline-grid; place-items: center; min-width: 15px; height: 15px; padding: 0 3px; margin-right: -3px;
  font: 500 9px/1 var(--mono); color: var(--fg); border: 1px solid var(--line-strong); border-radius: 3px;
}
.legend__keys { display: none !important; }
@media (hover: hover) and (pointer: fine) { .legend__keys { display: inline-flex !important; } }
/* The row chosen from the keyboard stays lit; the rest step back, as on hover. */
.index:has(.row__link:focus-visible) .row:not(:has(:focus-visible)):not(:hover) { opacity: .32; }

/* The row dividers are drawn as springy strings in this SVG, not borders. */
.strings { position: absolute; left: var(--gutter); top: 0; overflow: visible; pointer-events: none; z-index: 2; }
.strings path { fill: none; stroke: var(--fg); stroke-width: 1; vector-effect: non-scaling-stroke; }

.index { --skew: 0deg; }
.group, .toolbar { scroll-margin-top: 56px; }
.group__list { list-style: none; margin: 0; padding: 0; }
/* Section heads sit between two hairlines, aligned with the names. */
.group__head {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: end;
  margin: 0; padding: clamp(30px, 3.2vw, 48px) 0 11px; font: inherit;
}
.group:first-child .group__head { padding-top: 16px; }
/* The brand asterisk marks each section, the same glyph as the top bar. */
.group__mark { width: 10px; height: 10px; margin-bottom: 4px; color: var(--fg); }
.group__name { grid-column: 2; color: var(--fg); font-size: 10.5px; letter-spacing: .2em; }
.group__count { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.row { position: relative; isolation: isolate; transition: opacity .5s var(--expo); }
.row__link { display: block; position: relative; padding: clamp(12px, 1.4vw, 18px) 0; }
.row--link .row__link::before {
  content: ''; position: absolute; inset: 0 calc(var(--gutter) * -1);
  background: var(--fg); transform: scaleY(0); transform-origin: 50% 100%;
  transition: transform .6s var(--expo); z-index: -1;
}
.row[data-dir="top"] .row__link::before { transform-origin: 50% 0%; }
.row__grid {
  display: grid;
  grid-template-columns: 44px minmax(0, 1.25fr) minmax(0, 1fr) 104px 80px 56px;
  gap: 16px;
  align-items: center;
}
.row__no { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.row__name {
  font-weight: 500; font-size: clamp(28px, 3.4vw, 54px); line-height: .95; letter-spacing: -0.05em; white-space: nowrap;
  overflow: hidden; padding: .04em 0 .16em; margin: -.04em 0 -.16em;
  transform: skewY(var(--skew)); transform-origin: 0 50%;
}
.row__name .serif { font-weight: 400; letter-spacing: -0.03em; }
.rc { display: inline-block; text-shadow: 0 1.3em currentColor; transition: transform .6s var(--expo); transition-delay: calc(var(--i) * 16ms); }
.row__info { position: relative; min-height: 2.9em; display: flex; align-items: center; font-size: 14px; line-height: 1.4; }
.row__tag, .row__desc { display: flex; align-items: center; gap: 10px; transition: opacity .45s var(--expo), transform .45s var(--expo); }
.row__desc { color: var(--muted); }
.row__status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.row__status .dot { width: 6px; height: 6px; }
.row__status .dot--past { width: 8px; height: 1px; border: 0; border-radius: 0; background: currentColor; }
.row__status .ico { width: 10px; height: 10px; }
.row__year { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.row__icon { justify-self: end; display: inline-flex; color: var(--muted); }
.row__icon:empty { display: none; }
.row__icon .ico { transition: transform .6s var(--expo); }
.row__thumb { display: none; }
.row__no, .row__status, .row__year, .row__icon, .row__name { transition: color .45s var(--expo), opacity .45s var(--expo); }

@media (hover: hover) and (pointer: fine) {
  .row__desc { position: absolute; inset: 0; opacity: 0; transform: translateY(8px); }
  .row:hover .row__tag { opacity: 0; transform: translateY(-8px); }
  .row:hover .row__desc { opacity: 1; transform: none; }
  .index:has(.row:hover) .row:not(:hover):not(:has(:focus-visible)) { opacity: .32; }
  .row--link .row__head:hover .row__link::before { transform: scaleY(1); }
  .row--link .row__head:hover .row__link .rc { transform: translateY(-1.3em); }
  .row--link .row__head:hover .row__link .row__name,
  .row--link .row__head:hover .row__link .row__no,
  .row--link .row__head:hover .row__link .row__year,
  .row--link .row__head:hover .row__link .row__status,
  .row--link .row__head:hover .row__link .row__desc,
  .row--link .row__head:hover .row__link .row__icon { color: var(--bg); }
  .row--link .row__head:hover .row__link .row__desc { opacity: .7; }
  .row--link .row__head:hover .row__link .row__icon .ico--arrow { transform: rotate(45deg); }
  .row--link .row__head:hover .row__link .row__icon .ico--plus { transform: rotate(90deg); }
  .row--link .row__head:hover .row__go { color: var(--bg); }
  .row__go:hover .ico--arrow { transform: rotate(45deg); }
  .row__go:hover .ico--book { transform: translateY(-2px); }
}
.row--link .row__link:focus-visible { outline: none; }
.row--link .row__link:focus-visible::before { transform: scaleY(1); }
.row--link .row__link:focus-visible, .row--link .row__link:focus-visible * { color: var(--bg); }
.row__head:has(.row__link:focus-visible) .row__go { color: var(--bg); }

/* The ↗ (or book) beside the ＋ goes straight to the destination; the rest of the row opens the panel. */
.row__head { position: relative; }
.row__go {
  position: absolute; top: 0; bottom: 0; right: 30px; width: 30px; z-index: 1;
  display: grid; place-items: center; color: var(--muted); transition: color .45s var(--expo);
}
.row__go .ico { transition: transform .6s var(--expo); }

/* Rows without a destination open a detail panel in place of leaving the page. */
.row--more .row__link { width: 100%; text-align: left; }
.row--more.is-open .row__icon .ico--plus { transform: rotate(45deg); }
.row__grid { width: 100%; }
.row__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .75s var(--expo); }
.row.is-open .row__more { grid-template-rows: 1fr; }
.more { min-height: 0; overflow: hidden; }
.more__grid {
  display: grid; grid-template-columns: 44px minmax(0, 1.25fr) minmax(0, 1fr) 104px 80px 56px; gap: 16px;
  align-items: center; padding: 4px 0 clamp(24px, 2.6vw, 36px);
}
/* The panel's measure is --inset, the number column plus its gap (44 + 16). The picture
   starts on the name's edge; the text starts in line with the description above and stops
   --inset short of the right edge, mirroring the number column on the left. Between them,
   a gutter of the same size (narrowing on small laptops so the picture keeps its size). */
.more__grid { --inset: 60px; --gutter-in: clamp(36px, 3.9vw, 60px); }
.more__media {
  grid-column: 2; margin: 0; position: relative; width: calc(100% - var(--gutter-in) + 16px); max-width: 880px; justify-self: start; aspect-ratio: 16 / 10; overflow: hidden;
  border: 1px solid var(--line-strong); background: var(--surface);
  clip-path: inset(0 0 100% 0); transition: clip-path .8s var(--quart);
}
.row.is-open .more__media { clip-path: inset(0 0 0 0); transition-delay: .1s; }
.more__media img, .more__media video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.6s var(--expo); }
.row.is-open .more__media img, .row.is-open .more__media video { transform: none; }
/* The loop sits over its still and fades in once it is actually playing. */
.more__media video { position: absolute; inset: 0; opacity: 0; transition: opacity .7s var(--expo), transform 1.6s var(--expo); }
.more__media video.on { opacity: 1; }
.more__media--type { display: flex; flex-direction: column; justify-content: space-between; padding: 20px; background: var(--bg); }
.more__media--type b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(48px, 5vw, 76px); line-height: .9; letter-spacing: -0.02em; }
.more__body {
  grid-column: 3 / -1; margin-right: var(--inset); display: grid; gap: 18px; justify-items: start;
  opacity: 0; transform: translateY(12px); transition: opacity .5s var(--expo), transform .8s var(--expo);
}
.row.is-open .more__body { opacity: 1; transform: none; transition-delay: .2s; }
.more__lede { margin: 0; font-size: 15px; line-height: 1.45; max-width: 36ch; text-wrap: balance; }
.more__facts { margin: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; border-top: 1px solid var(--line-strong); }
.more__facts div { display: grid; gap: 5px; padding: 11px 0 12px; border-bottom: 1px solid var(--line-strong); }
.more__facts dt { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.more__facts dd { margin: 0; font-size: 14px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.more__ask::before { content: '→'; margin-right: 10px; font-family: var(--sans); letter-spacing: 0; }
/* Rows with a destination: one clear way out first, then the facts, then everything else. */
.more__cta {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 18px 12px 20px; border-radius: 999px;
  background: var(--fg); color: var(--bg); font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
}
.more__cta .ico { width: 12px; height: 12px; transition: transform .6s var(--expo); }
.more__cta:hover .ico--arrow { transform: rotate(45deg); }
.more__cta:hover .ico--book { transform: translateY(-2px); }
.more__cta:focus-visible { outline-offset: 3px; }
.more__links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; }
.more__link { display: inline-flex; align-items: center; gap: 8px; }
.more__link .ico { width: 10px; height: 10px; }
.more__media--book img { object-fit: contain; padding: 7% 0; filter: drop-shadow(0 12px 22px rgba(0,0,0,.35)); }
/* Recordings of real websites are in colour, so they can't flip with the theme: they run full
   bleed inside the same hairline as every other panel, held to the top so the site's header is
   never cropped, and swap to a light cut where the site has its own light theme
   (data-motion-light on the figure, data-light on the stills). */
.more__media--site > img, .more__media--site > video { object-position: 50% 0; }

/* Phones and narrow windows: everything shows; a thumbnail per row; the row
   nearest the middle of the screen wakes up as you scroll. */
.m-only { display: none; }
@media (hover: none), (pointer: coarse), (max-width: 860px) {
  .m-only { display: inline; }
  /* One column on phones: number, name, words, picture and panel all share the same two
     edges, so nothing is indented and every block sits centred on the screen. */
  .row__link { padding: 14px 0 18px; }
  /* The number sits over the name; the thumbnail rides beside them; tag and two lines of
     description run beside it; the year tucks under it. */
  .row__grid {
    grid-template-columns: minmax(0, 1fr) 84px;
    grid-template-areas: "no thumb" "name thumb" "info thumb" "info status" "info year";
    grid-template-rows: auto auto auto 1fr auto;
    row-gap: 6px; column-gap: 14px; align-items: start;
  }
  .row__no { grid-area: no; font-size: 10px; line-height: 1; margin-bottom: -2px; }
  .row__name { grid-area: name; white-space: normal; font-size: clamp(26px, 7.6vw, 34px); }
  .rc { text-shadow: none; }
  .row__info { grid-area: info; display: block; min-height: 0; font-size: 13.5px; }
  .row__tag { gap: 8px; }
  .row__desc { margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .row__status { grid-area: status; align-self: end; justify-self: end; font-size: 9.5px; gap: 6px; }
  .row__status:empty { display: none; }
  .row__year { grid-area: year; align-self: end; justify-self: end; text-align: right; font-size: 10px; white-space: normal; line-height: 1.4; }
  .row__icon { position: absolute; top: 20px; right: 4px; z-index: 2; padding: 5px; border-radius: 999px; background: var(--bg); color: var(--fg); }
  .row__icon .ico { width: 12px; height: 12px; }
  .row__thumb { grid-area: thumb; display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface); margin-top: 4px; }
  .row__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transform: scale(1.08); transition: filter .9s var(--expo), transform 1.4s var(--expo); }
  .row.is-active .row__thumb img { filter: none; transform: none; }
  .row__thumb--book img { object-fit: contain; padding: 4px 0; }
  /* Type tiles stand in where there's no picture; they invert when the row wakes. */
  .row__thumb--type { display: flex; flex-direction: column; justify-content: space-between; padding: 6px 8px 7px; background: var(--bg); color: var(--fg); transition: background-color .6s var(--expo), color .6s var(--expo); }
  .row__thumb--type i { font-style: normal; font-family: var(--mono); font-size: 7.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
  .row__thumb--type b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 19px; line-height: .9; letter-spacing: -0.01em; }
  .row.is-active .row__thumb--type { background: var(--fg); color: var(--bg); }
  .index.has-active .row:not(.is-active) { opacity: .5; }

  /* Touch feedback: the plate answers a press straight away. */
  .row--link .row__link:active::before { transform: scaleY(1); transition-duration: .18s; }
  .row--link .row__link:active, .row--link .row__link:active * { color: var(--bg); }

  /* Filter chips on one swipeable line; the key keeps only what the rows need. */
  .toolbar { gap: 12px; padding: 12px 0 14px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); width: calc(100% + var(--gutter) * 2); -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .filters::-webkit-scrollbar { display: none; }
  .filters { gap: 5px; }
  .chip { flex-shrink: 0; padding: 11px 10px; font-size: 10px; letter-spacing: .1em; }
  .chip sup { margin-left: 3px; }
  .legend { gap: 14px; }
  .group__head { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; padding: 34px 0 10px; }
  .group:first-child .group__head { padding-top: 14px; }

  /* Detail panels stack under the name, edge to edge with it: picture, line, facts. */
  .more__grid { grid-template-columns: minmax(0, 1fr); row-gap: 18px; padding: 2px 0 26px; }
  .more__media, .more__body { grid-column: 1; width: 100%; max-width: none; margin-right: 0; }
  .more__body { gap: 16px; }
  .more__lede { font-size: 14.5px; }
  .more__ask, .more__link { padding: 10px 0; }
  .row__go { display: none; }
  .index.has-active .row.is-open { opacity: 1; }
  .row--more.is-open .row__thumb { opacity: 0; transition: opacity .4s var(--expo); }

  /* Bigger targets in the top bar. */
  .topbar { padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: 12px; }
  .toplink { padding: 12px 2px; }
  .toplink::after { bottom: 9px; }
  .invert-btn { position: relative; }
  .invert-btn::after { content: ''; position: absolute; inset: -15px; }

  .hero { padding-top: calc(70px + env(safe-area-inset-top)); }
  .hero__row { padding: 18px 0 22px; gap: 18px; }
  .hero__statement { font-size: 17px; }
  .stat__num { font-size: 32px; }
  .stats { row-gap: 16px; }

}
html { -webkit-tap-highlight-color: transparent; }
:root { --gutter: max(clamp(16px, 3vw, 40px), env(safe-area-inset-left)); }

/* ---------- Preview card (follows the cursor over the index) ---------- */
.preview {
  position: fixed; left: 0; top: 0; z-index: 60;
  width: 340px; pointer-events: none;
  opacity: 0; transform: scale(.9);
  transition: opacity .3s var(--expo), transform .5s var(--expo);
  will-change: transform, translate;
}
.preview.on { opacity: 1; transform: scale(1); }
.preview__inner {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.9); transform-origin: 50% 120%;
  clip-path: inset(100% 0 0 0); transition: clip-path .6s var(--quart);
}
.preview.on .preview__inner { clip-path: inset(0 0 0 0); }
.preview__media { position: relative; overflow: hidden; aspect-ratio: var(--ratio, 16 / 10); }
.preview__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: grayscale(1) contrast(1.08); transform: scale(1.1); transition: opacity .3s var(--expo), filter .9s var(--expo), transform 0s; }
.preview__media img.active { opacity: 1; transform: scale(1); transition: opacity .3s var(--expo), filter .9s var(--expo), transform 7s cubic-bezier(.2,.6,.2,1); }
.preview.color .preview__media img.active { filter: grayscale(0) contrast(1); }
.preview__text { position: absolute; inset: 0; display: none; flex-direction: column; justify-content: space-between; padding: 20px; background: var(--bg); color: var(--fg); }
.preview__text.active { display: flex; }
.preview__text b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 54px; line-height: .9; letter-spacing: -0.02em; }
.preview__grain { opacity: .12; mix-blend-mode: screen; pointer-events: none; }
.preview__cap { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line-strong); background: var(--bg); }
.preview__cap .label { color: var(--fg); }
@media (hover: none), (pointer: coarse) { .preview { display: none; } }

/* ---------- Contact ---------- */
.contact {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: end;
  padding: clamp(56px, 7vw, 100px) var(--gutter) 0;
}
.contact__local { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 10px; margin-bottom: -4px; }
.contact__local .dot { width: 6px; height: 6px; background: currentColor; }
.contact__big { margin: 0; font-weight: 500; font-size: clamp(56px, 9vw, 150px); line-height: .82; letter-spacing: -0.06em; }
.contact__big .serif { font-weight: 400; letter-spacing: -0.03em; color: var(--muted); transition: color .6s var(--expo); }
.contact__big:hover .serif { color: var(--fg); }
.links { border-top: 1px solid var(--line); }
.links a, .links button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 16px; text-align: left; }
.links .label { display: inline-flex; align-items: center; gap: 10px; transition: color .4s var(--expo); }
.links a:hover .label, .links button:hover .label { color: var(--fg); }
.links .ico { transition: transform .6s var(--expo); }
.links a:hover .ico, .links button:hover .ico { transform: rotate(45deg); }
.links .copied { display: none; }
.links .did-copy .copied { display: inline; }
.links .did-copy .to-copy { display: none; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

footer.foot { display: flex; justify-content: space-between; gap: 16px; padding: 24px var(--gutter) 56px; }

/* ---------- Status bar ---------- */
.status { position: fixed; inset: auto 0 0 0; z-index: 50; padding: 0 var(--gutter) 12px; pointer-events: none; mix-blend-mode: difference; color: #f2f2f2; }
.status__row { display: flex; justify-content: space-between; padding-bottom: 8px; }
.status .label { color: rgba(242,242,242,.55); font-size: 9px; }
.status__track { height: 1px; background: rgba(242,242,242,.14); }
.status__fill { height: 1px; background: #f2f2f2; transform: scaleX(0); transform-origin: left; }

/* ---------- PDF reader ---------- */
.reader {
  position: fixed; inset: 0; z-index: 95;
  display: grid; grid-template-rows: auto 1fr;
  background: var(--bg);
  clip-path: inset(100% 0 0 0); visibility: hidden;
  transition: clip-path .9s var(--quart), visibility 0s linear .9s;
}
.reader.open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .9s var(--quart), visibility 0s; }
.reader__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px var(--gutter); border-bottom: 1px solid var(--line); }
.reader__title { font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader__title .label { margin-right: 12px; }
.reader__actions { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.reader__close { display: inline-flex; align-items: center; gap: 10px; }
.reader__close svg { width: 12px; height: 12px; transition: transform .6s var(--expo); }
.reader__close:hover svg { transform: rotate(90deg); }
.reader__frame { width: 100%; height: 100%; border: 0; background: var(--surface); }
body.reading { overflow: hidden; }

/* Phone overrides for rules defined after the main phone block. */
@media (hover: none), (pointer: coarse), (max-width: 860px) {
  .status { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .status__row { display: none; }
  .contact { gap: 18px; }
  .links a, .links button { padding: 18px 0; font-size: 15px; }
  footer.foot { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }

  /* The dock becomes one button at the foot of the screen, in thumb reach, naming the
     section in view; it opens the four sections as a list above it. */
  .dock { position: fixed; top: auto; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 51; transform: translate(-50%, 14px); }
  .dock.is-on { transform: translate(-50%, 0); }
  .dock__now {
    display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 18px;
    border-radius: 999px; background: var(--fg); color: var(--bg); white-space: nowrap;
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(0,0,0,.28);
  }
  .dock__now:focus-visible { outline-offset: 3px; }
  .dock__no { opacity: .5; }
  .dock__no:empty { display: none; }
  .dock__caret { width: 10px; height: 10px; transition: transform .45s var(--expo); }
  .dock.is-open .dock__caret { transform: rotate(180deg); }
  .dock__list {
    position: absolute; left: 50%; bottom: calc(100% + 8px);
    width: min(300px, calc(100vw - var(--gutter) * 2));
    flex-direction: column; padding: 6px; border-radius: 16px;
    background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none;
    box-shadow: 0 16px 40px rgba(0,0,0,.28);
    opacity: 0; visibility: hidden; transform: translate(-50%, 10px) scale(.97); transform-origin: 50% 100%;
    transition: opacity .3s var(--expo), transform .45s var(--expo), visibility 0s linear .3s;
  }
  .dock.is-open .dock__list { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .3s var(--expo), transform .45s var(--expo), visibility 0s; }
  .dock__chip { display: flex; justify-content: space-between; align-items: center; padding: 15px 14px; border-radius: 10px; font-size: 11px; transition: none; }
  .dock__chip sup { display: inline; font-size: 9px; }
  .dock__chip[aria-current="true"] { background: var(--fg); color: var(--bg); }
  .dock__pill { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .hero__name .ch, .rise { transform: none !important; opacity: 1 !important; }
  .mark__txt { opacity: 1; }
}

/* ---------- Typesetting ---------- */
.hero__statement { text-wrap: balance; }
.row__desc, .contact__local { text-wrap: pretty; }

/* ---------- Light theme: black-and-white visuals flip to match ---------- */
/* The drawn pictures are made on the dark page colour (#050505); flipped and dimmed a touch,
   that lands on the light page colour (#f4f4f2) and the ink on near-black, so their edges
   disappear into the page in both themes. */
:root[data-theme="invert"] img.mono, :root[data-theme="invert"] video.mono { filter: invert(1) brightness(.976) !important; }

/* ---------- Sections arrive: hairlines draw across (in site.js), names rise
   out of their mask, the rest of the row follows. ---------- */
.row.pre .row__name { clip-path: inset(0 0 100% 0); transform: translateY(.45em); }
.row.pre .row__no, .row.pre .row__info, .row.pre .row__status, .row.pre .row__year,
.row.pre .row__icon, .row.pre .row__thumb { opacity: 0; transform: translateY(10px); }
.group__head.pre .group__count { opacity: 0; transform: translateY(8px); }
.group__head.pre .group__mark { opacity: 0; transform: rotate(-120deg) scale(.6); }
.row.in .row__name { transition: clip-path .9s var(--quart) var(--rd, 0s), transform 1.1s var(--expo) var(--rd, 0s); }
.row.in .row__no, .row.in .row__info, .row.in .row__status, .row.in .row__year,
.row.in .row__icon, .row.in .row__thumb,
.group__head.in .group__mark, .group__head.in .group__count {
  transition: opacity .8s var(--expo) calc(var(--rd, 0s) + .12s), transform 1s var(--expo) calc(var(--rd, 0s) + .12s);
}
.row.pre .row__go { opacity: 0; transform: translateY(10px); }
.row.in .row__go { transition: opacity .8s var(--expo) calc(var(--rd, 0s) + .12s), transform 1s var(--expo) calc(var(--rd, 0s) + .12s), color .45s var(--expo); }
