/* swazee.net — broadside splash. Colors, type, and measure baked from design handoff.
   Fonts (IBM Plex Sans, IBM Plex Mono, Instrument Serif) come from Google Fonts via
   the <link> tags in each HTML head. */

:root {
  --bg: #0F0D0B;
  --plate: #1A1714;
  --fg: #F5ECD8;
  --muted: #8A7F6A;
  --rule: rgba(245, 236, 216, 0.18);
  --accent: #E8A23B;

  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'Instrument Serif', Georgia, serif;

  --container: 1320px;
  --pad-x: 40px;
  --pad-section: 80px;
  --pad-hero: 40px;
  --gap: 40px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

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

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(232, 162, 59, 0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232, 162, 59, 0.5); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ---- Footer-push: when content is short (e.g. /contact/, /uses/), grow main
   so the trailing .section--contact still lands at the viewport bottom. On long
   pages the auto-margin is a no-op. ---- */
main { flex: 1; display: flex; flex-direction: column; }
main > .section:last-child { margin-top: auto; }

/* ---- Film grain overlay (retro medium). ---- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: screen;
  opacity: 0.8;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---- Logo flicker keyframes (one-shot on mount). ---- */
@keyframes sw-flicker {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 0 transparent); }
  6%       { filter: brightness(1.25) drop-shadow(0 0 14px rgba(232, 162, 59, 0.5)); }
  9%       { filter: brightness(0.82); }
  12%      { filter: brightness(1.18) drop-shadow(0 0 18px rgba(232, 162, 59, 0.6)); }
  15%      { filter: brightness(0.95); }
  48%, 52% { filter: brightness(1.12) drop-shadow(0 0 10px rgba(232, 162, 59, 0.35)); }
}
.sw-flicker { animation: sw-flicker 5.5s ease-in-out 1 both; }

/* ---- Typography primitives. ---- */
.kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-transform: uppercase;
}
.kicker--heavy { letter-spacing: 0.35em; }
.kicker--wide { letter-spacing: 0.4em; font-size: 11px; margin-top: 16px; }

.center { text-align: center; }

.display {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 64px;
  margin: 0 0 28px;
  letter-spacing: -0.03em;
}
.display--center {
  text-align: center;
  font-size: clamp(56px, 8vw, 112px);
  text-wrap: balance;
  line-height: 1;
  margin: 0;
}
.display__italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.italic-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 36px;
}

.lede-intro {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 520px;
}

/* ---- Ruling lines on masthead. ---- */
.rule-2 { height: 2px; background: var(--fg); }
.rule-1 { height: 1px; background: var(--fg); }
.rule-2-gap { height: 3px; }

/* ---- Sticky compact nav. ---- */
.nav-compact {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: #0F0D0BEE;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transform: translateY(-100%);
  transition: transform 400ms ease, border-color 300ms ease;
}
.nav-compact.is-visible {
  transform: translateY(0);
  border-bottom-color: var(--rule);
}
.nav-compact__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-compact__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.nav-compact__links {
  display: flex;
  gap: 26px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-compact__links a {
  text-decoration: none;
  color: inherit;
  padding: 4px 0;
  position: relative;
  transition: color 150ms ease;
}
.nav-compact__links a:hover { color: var(--fg); }
.nav-compact__links a.is-current { color: var(--fg); }
.nav-compact__links a.is-current::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
}

.cmd-button {
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--rule);
  cursor: pointer;
  letter-spacing: 0.15em;
}
.cmd-button:hover { color: var(--fg); border-color: var(--fg); }

/* ---- Crest (SVG hero / nav). ---- */
.crest { color: var(--accent); display: inline-block; line-height: 0; }
.crest svg { display: block; }
.crest__mono { color: var(--bg); }

.crest--hero {
  filter: drop-shadow(0 0 22px rgba(232, 162, 59, 0.5));
  position: relative;
  isolation: isolate;
}

/* Two ambient effects only: chromatic split on the host + chromatic tear lines.
   No bright flashes, no bloom flashes, no signal cuts, no tracking band, no
   snow spikes — just chromatic aberration in two flavors. Faint always-on
   scanlines stay because they read as "powered CRT" not as a flash. */
.crest--hero::before,
.crest--hero::after {
  content: '';
  position: absolute;
  inset: 6%;
  border-radius: 4%;
  pointer-events: none;
}

/* ::before — held off (intro animations re-enable it briefly, then it stays
   hidden during ambient. No more snow spikes during sparks). */
.crest--hero::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='2.6' numOctaves='1' stitchTiles='stitch' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.78 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 100px 100px;
  mix-blend-mode: overlay;
  opacity: 0;
}

/* ::after — faint always-on scanlines (no spike animation). */
.crest--hero::after {
  background-image:
    radial-gradient(ellipse 115% 115% at center, transparent 58%, rgba(0,0,0,0.36) 100%),
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0.55) 0,
      rgba(0,0,0,0.55) 1.4px,
      transparent 1.4px,
      transparent 4px
    ),
    radial-gradient(circle at 1px 1px, rgba(0,0,0,0.10) 0.8px, transparent 1.3px);
  background-size: 100% 100%, 100% 4px, 10px 8px;
  mix-blend-mode: multiply;
  opacity: 0.18;
}

/* CRT spark particles — 12 hot pixel dots that briefly appear around the
   crest during the first-load intro burst, then drift outward and fade.
   Each spark has its own --tx/--ty drift vector so they radiate at varying
   angles, and stagger through the 1.6s intro for a cascade rather than a
   uniform pop. Ambient = invisible (no animation outside the intro). */
.crest-fx-sparks {
  position: absolute;
  inset: -14%;
  pointer-events: none;
  z-index: 3;
}
.crest-fx-spark {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #FFE3A8;
  border-radius: 50%;
  box-shadow:
    0 0 4px 1px rgba(255, 220, 150, 0.95),
    0 0 12px 2px rgba(232, 162,  59, 0.55);
  opacity: 0;
}
/* Position each spark at a different angle around the crest, with a drift
   vector that pushes it further outward through the animation. Using degrees
   conceptually; positions are anchored as % from the spark wrapper edges. */
.crest-fx-spark--1  { top: 10%; left: 18%; --tx: -22px; --ty: -16px; }
.crest-fx-spark--2  { top:  6%; left: 46%; --tx:   2px; --ty: -28px; }
.crest-fx-spark--3  { top: 12%; left: 78%; --tx:  24px; --ty: -14px; }
.crest-fx-spark--4  { top: 36%; left: 90%; --tx:  30px; --ty:   4px; }
.crest-fx-spark--5  { top: 60%; left: 92%; --tx:  28px; --ty:  18px; }
.crest-fx-spark--6  { top: 84%; left: 78%; --tx:  18px; --ty:  26px; }
.crest-fx-spark--7  { top: 90%; left: 50%; --tx:  -2px; --ty:  30px; }
.crest-fx-spark--8  { top: 86%; left: 22%; --tx: -22px; --ty:  22px; }
.crest-fx-spark--9  { top: 64%; left:  8%; --tx: -30px; --ty:  10px; }
.crest-fx-spark--10 { top: 38%; left:  6%; --tx: -32px; --ty:  -6px; }
.crest-fx-spark--11 { top: 24%; left: 30%; --tx: -10px; --ty: -22px; }
.crest-fx-spark--12 { top: 70%; left: 70%; --tx:  18px; --ty:  20px; }

/* The spark life cycle: 0% nothing, brief snap-on, drift outward, fade out. */
@keyframes sw-crest-spark {
  0%   { opacity: 0;   transform: translate3d(0, 0, 0) scale(0.4); }
  6%   { opacity: 1;   transform: translate3d(0, 0, 0) scale(1.2); }
  10%  { opacity: 0.95; transform: translate3d(calc(var(--tx, 0) * 0.25), calc(var(--ty, 0) * 0.25), 0) scale(1); }
  35%  { opacity: 0.7;  transform: translate3d(var(--tx, 0), var(--ty, 0), 0) scale(0.95); }
  60%  { opacity: 0.18; transform: translate3d(calc(var(--tx, 0) * 1.4), calc(var(--ty, 0) * 1.4), 0) scale(0.6); }
  100% { opacity: 0;    transform: translate3d(calc(var(--tx, 0) * 1.7), calc(var(--ty, 0) * 1.7), 0) scale(0.3); }
}

/* Stagger sparks across the intro: first wave ~150ms in, last wave ~1.1s in,
   so the cascade overlaps the flicker peak and trails out as the bloom settles. */
@media (prefers-reduced-motion: no-preference) {
  html.crest-intro .crest-fx-spark--1,
  body.preview-crest .crest-fx-spark--1  { animation: sw-crest-spark 1.4s ease-out 0.15s 1 both; }
  html.crest-intro .crest-fx-spark--2,
  body.preview-crest .crest-fx-spark--2  { animation: sw-crest-spark 1.4s ease-out 0.22s 1 both; }
  html.crest-intro .crest-fx-spark--3,
  body.preview-crest .crest-fx-spark--3  { animation: sw-crest-spark 1.4s ease-out 0.28s 1 both; }
  html.crest-intro .crest-fx-spark--4,
  body.preview-crest .crest-fx-spark--4  { animation: sw-crest-spark 1.4s ease-out 0.36s 1 both; }
  html.crest-intro .crest-fx-spark--5,
  body.preview-crest .crest-fx-spark--5  { animation: sw-crest-spark 1.4s ease-out 0.45s 1 both; }
  html.crest-intro .crest-fx-spark--6,
  body.preview-crest .crest-fx-spark--6  { animation: sw-crest-spark 1.4s ease-out 0.55s 1 both; }
  html.crest-intro .crest-fx-spark--7,
  body.preview-crest .crest-fx-spark--7  { animation: sw-crest-spark 1.4s ease-out 0.65s 1 both; }
  html.crest-intro .crest-fx-spark--8,
  body.preview-crest .crest-fx-spark--8  { animation: sw-crest-spark 1.4s ease-out 0.75s 1 both; }
  html.crest-intro .crest-fx-spark--9,
  body.preview-crest .crest-fx-spark--9  { animation: sw-crest-spark 1.4s ease-out 0.85s 1 both; }
  html.crest-intro .crest-fx-spark--10,
  body.preview-crest .crest-fx-spark--10 { animation: sw-crest-spark 1.4s ease-out 0.95s 1 both; }
  html.crest-intro .crest-fx-spark--11,
  body.preview-crest .crest-fx-spark--11 { animation: sw-crest-spark 1.4s ease-out 1.05s 1 both; }
  html.crest-intro .crest-fx-spark--12,
  body.preview-crest .crest-fx-spark--12 { animation: sw-crest-spark 1.4s ease-out 1.15s 1 both; }
}

/* Tear lines — 3 horizontal chromatic splits at fixed Y positions. Each line
   is a thin red top edge + transparent gap + cyan bottom edge (so it reads as
   an RGB-misaligned scan tear, not a bright white flash). Each flashes on its
   own prime-ish cycle so the three never sync. */
.crest-fx-tears {
  position: absolute;
  inset: 6%;
  border-radius: 4%;
  overflow: hidden;
  pointer-events: none;
}
.crest-fx-tear {
  position: absolute;
  left: -3%;
  right: -3%;
  height: 3px;
  background-image: linear-gradient(
    to bottom,
    rgba(255,  60,  50, 0.78) 0,
    rgba(255,  60,  50, 0.78) 1px,
    transparent 1px,
    transparent 2px,
    rgba( 60, 200, 255, 0.66) 2px,
    rgba( 60, 200, 255, 0.66) 3px
  );
  filter: blur(0.4px);
  opacity: 0;
}
.crest-fx-tear--1 { top: 19%; }
.crest-fx-tear--2 { top: 44%; }
.crest-fx-tear--3 { top: 71%; }

/* Two animations only: chromatic on host, tear on each of the three lines.
   Cycles lengthened (primes 26/29/41/53s) and event counts trimmed so the
   combined cadence sits at roughly one event every ~6–7s, not constant. */
@media (prefers-reduced-motion: no-preference) {
  .crest--hero {
    animation: sw-crest-chromatic 26s linear infinite 6s;
  }
  .crest-fx-tear--1 { animation: sw-crest-tear 29s linear infinite  7s; }
  .crest-fx-tear--2 { animation: sw-crest-tear 41s linear infinite 11s; }
  .crest-fx-tear--3 { animation: sw-crest-tear 53s linear infinite 17s; }
}

@media (prefers-reduced-motion: reduce) {
  .crest--hero,
  .crest-fx-tear,
  .crest-fx-spark { animation: none; }
  .crest-fx-spark { opacity: 0; }
  .crest--hero::after { opacity: 0; }
}

/* ---- Hero crest: violent first-load CRT power-on intro, then clean static.
       ~2.0s total. Triggered by html.crest-intro (set by inline JS in <head>
       on the first visit). For iteration, body.preview-crest is also gated so
       the preview URL plays it on every load.

       Host runs the flicker keyframes once (1.6s) with fill-forwards. The
       ::before snow runs its tile-shift through the intro and fades by t=2s
       to fully invisible (no ambient snow). The ::after mask fades to its
       always-on faint baseline (0.18). After t=2s the chromatic ambient
       animation takes over on the host (delay 2s here). ---- */
@media (prefers-reduced-motion: no-preference) {
  html.crest-intro .crest--hero,
  body.preview-crest .crest--hero {
    animation:
      sw-crest-flicker 1.6s steps(80, end) 1 forwards,
      sw-crest-chromatic 26s linear infinite 2s;
    will-change: filter, opacity, transform;
  }

  html.crest-intro .crest--hero::before,
  body.preview-crest .crest--hero::before {
    opacity: 0.46;
    animation:
      sw-crest-static 0.05s steps(5, end) 40,
      sw-crest-snow-fade 2s linear 1 forwards;
  }

  html.crest-intro .crest--hero::after,
  body.preview-crest .crest--hero::after {
    opacity: 1;
    animation:
      sw-crest-scan-roll 0.5s linear 4,
      sw-crest-mask-fade 2s linear 1 forwards;
  }
}

/* Per-layer fades — total intro 2.0s, layers visible until 75% (1.5s), then
   ramp over the last 500ms. Snow fades fully out (no ambient snow). Mask
   fades to its always-on faint baseline (0.18) so scanlines stay visible. */
@keyframes sw-crest-snow-fade {
  0%, 75%  { opacity: 0.46; }
  100%     { opacity: 0; }
}
@keyframes sw-crest-mask-fade {
  0%, 75%  { opacity: 1; }
  100%     { opacity: 0.18; }
}

@keyframes sw-crest-static {
  0%   { background-position:   0px   0px; }
  20%  { background-position:  21px -13px; }
  40%  { background-position:  -9px  17px; }
  60%  { background-position:  24px   8px; }
  80%  { background-position: -16px -19px; }
  100% { background-position:   0px   0px; }
}

@keyframes sw-crest-scan-roll {
  from { background-position: 0 0, 0 0, 0 0; }
  to   { background-position: 0 0, 0 4px, 0 0; }
}

/* Single chromatic-aberration animation on the host. 26s cycle, 2 brief
   chromatic events (~140ms each) at 22% and 64% — one horizontal, one vertical,
   so they feel different. No brightness changes, no bloom — just RGB ghost
   splits. ~one event every 13s on the host alone (tears add more on top). */
@keyframes sw-crest-chromatic {
  /* baseline (clean amber drop-shadow) — 0%, 100%, and the frames just before
     AND just after each chromatic event. */
  0%, 21%, 24%,
       63%, 66%,
       100% {
    transform: translate3d(0, 0, 0);
    filter:
      drop-shadow(0 0  6px rgba(232, 162,  59, 0.40))
      drop-shadow(0 0 22px rgba(232, 162,  59, 0.55))
      drop-shadow(0 0 48px rgba(232, 162,  59, 0.18));
  }

  /* Chromatic split #1 — horizontal */
  22% {
    transform: translate3d(-2px, 0, 0);
    filter:
      drop-shadow(-3px 0 0 rgba(255,  60,  50, 0.7))
      drop-shadow( 3px 0 0 rgba( 60, 200, 255, 0.6))
      drop-shadow(0 0 22px rgba(232, 162,  59, 0.55));
  }
  23% {
    transform: translate3d(2px, 0, 0);
    filter:
      drop-shadow( 3px 0 0 rgba(255,  60,  50, 0.55))
      drop-shadow(-3px 0 0 rgba( 60, 200, 255, 0.5))
      drop-shadow(0 0 22px rgba(232, 162,  59, 0.55));
  }

  /* Chromatic split #2 — vertical */
  64% {
    transform: translate3d(0, -2px, 0);
    filter:
      drop-shadow(0 -3px 0 rgba(255,  60,  50, 0.7))
      drop-shadow(0  3px 0 rgba( 60, 200, 255, 0.6))
      drop-shadow(0 0 22px rgba(232, 162,  59, 0.55));
  }
  65% {
    transform: translate3d(0, 1px, 0);
    filter:
      drop-shadow(0  3px 0 rgba(255,  60,  50, 0.55))
      drop-shadow(0 -2px 0 rgba( 60, 200, 255, 0.5))
      drop-shadow(0 0 22px rgba(232, 162,  59, 0.55));
  }
}


/* Tear-line flash — single brief flash per cycle (~150ms total, three frames
   with 2-3px horizontal jiggle for snap). One flash per long cycle (29/41/53s),
   so each line averages one tear every 30-50s. Combined with the two host
   chromatic events per 26s, total cadence ~one event every 6-7s. */
@keyframes sw-crest-tear {
  0%, 51%, 55%, 100% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
  52% { opacity: 0.9;  transform: translate3d( 2px, 0, 0); }
  53% { opacity: 0.95; transform: translate3d(-3px, 0, 0); }
  54% { opacity: 0.55; transform: translate3d( 1px, 0, 0); }
}

/* Composite flicker — violent first-load power-on. 1.6s cycle, ~16 events.
   Sequence:
     0%  : crest off (opacity 0)
     2-4%: white power-on flash (over-exposed)
     5%  : hard cut to dim
     7-10%: dramatic bloom recovery
     11-16%: jitter swarm 1 (±10px lateral)
     18-21%: large RGB split (5px) + skew tear
     23-25%: hue rip #1, saturated
     27%  : deep signal cut #1 (10% opacity)
     30-32%: bloom recovery, smaller
     34-39%: jitter swarm 2 + skew
     42-44%: RGB split #2
     46-48%: deep signal cut #2
     51-54%: hue rip #2 opposite direction
     57-60%: smaller jitter
     63-66%: aberration shimmer
     70-72%: micro-dim
     75-95%: settling, occasional whisper-dim
     100%: clean baseline glow ---- */
@keyframes sw-crest-flicker {
  /* baseline anchors */
  6%, 30%, 33%, 50%, 56%, 62%, 67%, 73%, 95%, 100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) skewX(0deg);
    filter: drop-shadow(0 0 22px rgba(232, 162, 59, 0.55));
  }
  /* OFF (CRT cold start) */
  0%, 1% {
    opacity: 0;
    filter: brightness(0.2);
  }
  /* white power-on flash */
  2%, 4% {
    opacity: 1;
    filter:
      brightness(1.6)
      drop-shadow(0 0 60px rgba(255, 240, 200, 1))
      drop-shadow(0 0 30px rgba(255, 210, 130, 0.95));
  }
  /* hard dim */
  5% {
    opacity: 0.32;
    filter: brightness(0.5) drop-shadow(0 0 6px rgba(232, 162, 59, 0.15));
  }
  /* bloom recovery */
  7%, 10% {
    opacity: 1;
    filter:
      drop-shadow(0 0 50px rgba(255, 210, 130, 0.95))
      drop-shadow(0 0 26px rgba(232, 162, 59, 0.9))
      brightness(1.15);
  }
  /* JITTER SWARM 1 — DIAGONAL (mixed X and Y amplitudes) */
  11% { transform: translate3d(-9px, -4px, 0); }
  12% { transform: translate3d(10px,  3px, 0); }
  13% { transform: translate3d(-7px,  5px, 0); }
  14% { transform: translate3d( 6px, -2px, 0); }
  15% { transform: translate3d(-3px, -1px, 0); }
  16% { transform: translate3d( 1px,  0px, 0); }
  /* RGB split #1 — DIAGONAL ghosts (offset both axes) */
  18%, 20% {
    opacity: 1;
    filter:
      drop-shadow(-5px -3px 0 rgba(255,  60,  50, 0.85))
      drop-shadow( 5px  3px 0 rgba( 60, 200, 255, 0.75))
      drop-shadow(0 0 32px rgba(232, 162, 59, 0.7));
  }
  /* DIAGONAL skew tear (skewX + skewY combined) */
  21% { transform: skewX(-6deg) skewY(-3deg) translate3d(3px, -2px, 0); }
  22% { transform: skewX( 7deg) skewY( 4deg) translate3d(-3px, 2px, 0); }
  /* hue rip #1, saturated */
  23%, 25% {
    opacity: 0.92;
    filter:
      hue-rotate(-26deg)
      saturate(1.5)
      brightness(1.12)
      drop-shadow(0 0 18px rgba(232, 162, 59, 0.5));
  }
  /* DEEP signal cut #1 — almost off */
  27% {
    opacity: 0.10;
    filter: brightness(0.32) drop-shadow(0 0 4px rgba(232, 162, 59, 0.15));
  }
  /* JITTER SWARM 2 — includes a VERTICAL ROLL spike (signal vertical-hold loss):
     mark jumps high, then snaps down through several frames before settling. */
  34% { transform: translate3d( 0px, -12px, 0); }
  35% { transform: translate3d( 4px,  -8px, 0) skewY(-2deg); }
  36% { transform: translate3d(-3px,  -3px, 0) skewX( 2deg); }
  37% { transform: translate3d( 2px,   2px, 0); }
  38% { transform: translate3d(-1px,   0px, 0); }
  39% { transform: translate3d( 0px,   0px, 0); }
  /* RGB split #2 — VERTICAL split (top/bottom ghosts, no horizontal offset) */
  42%, 44% {
    opacity: 1;
    transform: translate3d(0, 1px, 0);
    filter:
      drop-shadow(0 -5px 0 rgba(255,  60,  50, 0.8))
      drop-shadow(0  5px 0 rgba( 60, 200, 255, 0.7))
      drop-shadow(0 0 28px rgba(232, 162, 59, 0.7));
  }
  /* DEEP signal cut #2 */
  46%, 48% {
    opacity: 0.14;
    filter: brightness(0.36) drop-shadow(0 0 4px rgba(232, 162, 59, 0.2));
  }
  /* hue rip #2 opposite */
  51%, 54% {
    opacity: 0.95;
    filter:
      hue-rotate(20deg)
      saturate(1.3)
      drop-shadow(0 0 20px rgba(232, 162, 59, 0.55));
  }
  /* small jitter — diagonal */
  57% { transform: translate3d( 4px, -2px, 0); }
  58% { transform: translate3d(-3px,  2px, 0); }
  59% { transform: translate3d( 1px, -1px, 0); }
  60% { transform: translate3d( 0px,  0px, 0); }
  /* aberration shimmer — diagonal ghosts */
  63%, 66% {
    opacity: 1;
    filter:
      drop-shadow(-2px -1px 0 rgba(255,  80,  60, 0.55))
      drop-shadow( 2px  1px 0 rgba( 70, 200, 255, 0.5))
      drop-shadow(0 0 24px rgba(232, 162, 59, 0.65));
  }
  /* micro-dim before settle */
  70%, 72% {
    opacity: 0.82;
    filter: brightness(0.9) drop-shadow(0 0 14px rgba(232, 162, 59, 0.35));
  }
  /* whisper-dim during settle */
  76%, 94% {
    opacity: 0.96;
    filter: drop-shadow(0 0 19px rgba(232, 162, 59, 0.5));
  }
}

/* Nav-bar wordmark: a scaled-down twin of the giant masthead h1.
   Same family, weight, letter-spacing, and amber accent-dot — just smaller. */
.wordmark {
  font-family: var(--sans);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}
.wordmark--small { font-size: 18px; }

/* ---- Sections. ---- */
.section {
  padding: var(--pad-section) var(--pad-x);
  scroll-margin-top: 64px;
}
.section--bordered { border-bottom: 1px solid var(--rule); }
.section--plate {
  background: var(--plate);
  border-bottom: 1px solid var(--rule);
  padding: calc(var(--pad-section) - 20px) var(--pad-x);
}
.section--contact { padding: calc(var(--pad-section) + 20px) var(--pad-x) 40px; }
/* On subpages where the trailing section only carries the footer row (about, uses,
   linkbacks), the section's generous top padding adds dead space above the footer.
   Trim it for the footer-only case (home + contact still get the full padding). */
.section--contact:has(> .footer:only-child) { padding: 32px var(--pad-x) 32px; }
.section--contact:has(> .footer:only-child) .footer { margin-top: 0; }

/* ---- Masthead. ---- */
.masthead { padding: var(--pad-hero) var(--pad-x) 0; }
.masthead__strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-transform: uppercase;
  padding-bottom: 14px;
}
.masthead__strip > :first-child { text-align: left; }
.masthead__strip > :nth-child(2) { text-align: center; }
.masthead__strip > :last-child { text-align: right; }
.masthead__grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 40px;
  padding: calc(var(--gap) + 20px) 0 20px;
}
.masthead__col--right { text-align: right; }
.masthead__col--left { text-align: left; }
.masthead__col .kicker { margin-bottom: 12px; }
.editorial-name {
  font-family: var(--serif);
  font-size: 34px;
  font-style: italic;
  line-height: 1.1;
}
.masthead__crest { text-align: center; }

.masthead__wordmark { text-align: center; padding: 36px 0 48px; }
.masthead__wordmark h1 {
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(56px, 11vw, 180px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin: 0;
  text-wrap: balance;
}
.accent-dot { color: var(--accent); }

/* ---- Lede (3-column body). ---- */
.lede {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  font-family: var(--serif);
}
.lede__col .kicker { margin-bottom: 14px; }
.lede__p {
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
  text-wrap: pretty;
}
.dropcap {
  font-size: 56px;
  float: left;
  line-height: 0.8;
  padding-right: 8px;
  padding-top: 6px;
  color: var(--accent);
}

/* ---- Inventory. ---- */
.chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 36px;
  font-family: var(--mono);
  font-size: 10px;
}
.chip {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 5px 12px;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.chip:hover { color: var(--fg); border-color: var(--fg); }
.chip.is-active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.projects {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.projects[data-filter="product"]    .project:not([data-kind="product"]) { display: none; }
.projects[data-filter="tool"]       .project:not([data-kind="tool"]) { display: none; }
.projects[data-filter="experiment"] .project:not([data-kind="experiment"]) { display: none; }

.project {
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
  background: transparent;
  transition: background 200ms ease;
  min-height: 200px;
  scroll-margin-top: 80px;
  text-decoration: none;
  color: inherit;
  display: block;
}
/* Defense-in-depth: nothing inside a card should ever pick up an underline,
   even via inherited text-decoration or a future descendant rule. */
.project, .project *, .project *:hover { text-decoration: none; }
.project:hover { background: var(--plate); }
.project__meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.status--active { color: var(--accent); }
.project__title {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 48px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  color: var(--fg);
  transition: color 200ms ease;
}
.project:hover .project__title { color: var(--accent); }
.project__blurb {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  margin: 14px 0 0;
  text-wrap: pretty;
  max-height: 44px;
  overflow: hidden;
  transition: max-height 300ms ease, color 200ms;
}
.project:hover .project__blurb { max-height: 120px; }
.project__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
}

/* ---- Linkbacks. ---- */
#linkbacks { max-width: 820px; margin: 0 auto; }
.list { display: flex; flex-direction: column; }

.linkback {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  align-items: baseline;
}
.linkback--last { border-bottom: 1px solid var(--rule); }
.linkback:hover .linkback__name { color: var(--accent); }
.linkback__idx {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
}
.linkback__name {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  display: block;
  transition: color 150ms ease;
}
.linkback__note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  display: block;
}
.linkback__url {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* ---- Uses grid. ---- */
.uses {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.uses__card {
  padding: 18px 16px;
  border: 1px solid var(--rule);
  background: var(--bg);
}
.uses__label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.uses__value {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  margin-top: 6px;
  text-wrap: balance;
}

/* ---- Contact / footer. ---- */
.email {
  display: inline-block;
  max-width: 100%;
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(28px, 8vw, 96px);
  letter-spacing: -0.03em;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 4px solid var(--accent);
  margin-top: 18px;
}
.email:hover { color: var(--accent); }

.footer {
  margin-top: 80px;
  padding-top: 20px;
  border-top: 2px solid var(--fg);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---- Command palette (native <dialog>). ---- */
.cmdk {
  width: min(640px, 92vw);
  margin: 12vh auto 0;
  padding: 0;
  background: #12100E;
  color: #EDE4D3;
  border: 1px solid rgba(232, 162, 59, 0.18);
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  font-family: var(--mono);
  overflow: hidden;
}
.cmdk::backdrop {
  background: rgba(10, 8, 6, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cmdk__form { display: flex; flex-direction: column; margin: 0; }
.cmdk__header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(232, 162, 59, 0.18);
  gap: 10px;
}
.cmdk__prompt { color: var(--accent); font-size: 12px; letter-spacing: 0.2em; }
.cmdk__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.cmdk__esc {
  font-size: 10px;
  opacity: 0.5;
  border: 1px solid rgba(232, 162, 59, 0.18);
  padding: 2px 6px;
  border-radius: 3px;
}
.cmdk__results { max-height: 48vh; overflow: auto; }
.cmdk__row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  padding: 10px 14px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(232, 162, 59, 0.18);
  color: inherit;
  text-decoration: none;
  background: transparent;
  transition: background 120ms ease;
}
.cmdk__row:hover,
.cmdk__row.is-active { background: rgba(232, 162, 59, 0.08); }
.cmdk__row-kind {
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 10px;
  align-self: center;
}
.cmdk__row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cmdk__row-label { font-weight: 600; }
.cmdk__row-sub {
  opacity: 0.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmdk__row-tag { opacity: 0.45; align-self: center; }
.cmdk__empty {
  padding: 22px;
  font-size: 12px;
  opacity: 0.5;
}
.cmdk__footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 10px;
  opacity: 0.5;
  letter-spacing: 0.1em;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .nav-compact__links { gap: 18px; }
}

@media (max-width: 900px) {
  :root {
    --pad-x: 24px;
    --pad-section: 56px;
    --pad-hero: 28px;
    --gap: 24px;
  }
  .nav-compact__links { display: none; }
  .masthead__grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 32px 0 16px;
  }
  .masthead__col--right,
  .masthead__col--left { text-align: center; }
  /* Crest renders first on mobile per handoff notes. */
  .masthead__crest { order: -1; }
  .editorial-name { font-size: 28px; }

  .lede { grid-template-columns: 1fr; gap: 32px; }
  .projects { grid-template-columns: 1fr; }
  .uses { grid-template-columns: repeat(2, 1fr); }

  .display { font-size: 48px; }

  .footer { flex-direction: column; align-items: flex-start; gap: 6px; }
  .contact-row { gap: 18px; }
}

@media (max-width: 560px) {
  :root { --pad-x: 18px; }
  .masthead__strip { display: flex; font-size: 9px; letter-spacing: 0.18em; gap: 8px; flex-wrap: wrap; justify-content: center; }
  .masthead__strip span:nth-child(2) { display: none; }
  .uses { grid-template-columns: 1fr; }
  .project__title { font-size: 36px; }
  .chips { font-size: 9px; }
  .linkback { grid-template-columns: 24px 1fr; }
  .linkback__url { grid-column: 1 / -1; padding-top: 4px; }
}

/* ---- Touch / no-hover devices: expand all blurbs (peek is hover-only). ---- */
@media (hover: none) {
  .project__blurb { max-height: none; }
  .project:hover .project__title { color: var(--fg); }
}

/* ---- Subpage chrome. data-page="subpage" on <body> means the compact nav is the
       header (always shown). The page-header band sits below it with breadcrumb + h1. ---- */
body[data-page="subpage"] {
  padding-top: 56px;
}
body[data-page="subpage"] .nav-compact {
  transition: none;
}

.page-header {
  padding: 56px var(--pad-x) 44px;
  border-bottom: 2px solid var(--fg);
  position: relative;
}
.page-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: var(--fg);
}
.page-header__inner {
  max-width: var(--container);
  margin: 0 auto;
}
.page-header__kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 22px;
}
.breadcrumb {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb__sep { margin: 0 10px; opacity: 0.5; }
.page-title {
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(48px, 8vw, 104px);
  letter-spacing: -0.04em;
  line-height: 0.92;
  margin: 0;
  text-wrap: balance;
}
.page-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.page-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.5;
  color: var(--muted);
  margin: 18px 0 0;
  max-width: 720px;
  text-wrap: pretty;
}
.page-header .kicker--heavy {
  margin: 22px 0 14px;
}

/* ---- Project-detail layout. ---- */
.project-detail .container { padding-top: 0; padding-bottom: 80px; }
.project-detail__intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding: 60px 0 12px;
}
@media (min-width: 900px) {
  .project-detail__intro {
    grid-template-columns: 1.7fr 1fr;
    gap: 64px;
  }
}
.project-detail__lede {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.55;
  text-wrap: pretty;
  margin: 0;
}
.project-detail__sidebar {
  align-content: start;
  background: var(--plate);
  border: 1px solid var(--rule);
  padding: 24px 22px 22px;
  position: relative;
}
.project-detail__sidebar::before {
  content: '\00a7  FACT SHEET  \00a7';
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--muted);
  text-transform: uppercase;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.project-detail__sidebar dl { margin: 0; }
.project-detail__sidebar dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.project-detail__sidebar dd {
  margin: 0 0 0;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--fg);
}
.project-detail__sidebar dt + dd {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--rule);
}
.project-detail__sidebar dl > dd:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}
.project-detail__sidebar dd a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.project-detail__sidebar dd a:hover { border-bottom-color: var(--accent); }

.project-detail__body { padding-top: 36px; }
.project-detail__body h2 {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin: 56px 0 22px;
  border-top: 1px solid var(--rule);
  padding-top: 28px;
}
.project-detail__body h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.project-detail__body h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.005em;
  margin: 28px 0 10px;
}
.project-detail__body p {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  margin: 0 0 18px;
  text-wrap: pretty;
  max-width: 760px;
}
.project-detail__body ul {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  padding-left: 22px;
  margin: 0 0 22px;
  max-width: 760px;
}
.project-detail__body ul li { margin-bottom: 10px; text-wrap: pretty; }
.project-detail__body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--plate);
  padding: 1px 6px;
  border-radius: 2px;
}

.project-detail__back {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 64px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}
.project-detail__back:hover { color: var(--accent); }

/* ---- Prev / next project navigation at the bottom of each deep page. ---- */
.project-detail__pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: stretch;
  margin-top: 64px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.project-detail__pager > a,
.project-detail__pager > span {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 22px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}
.project-detail__pager a:hover { color: var(--accent); background: var(--plate); }
.project-detail__pager .pager__center {
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  align-items: center;
  justify-content: center;
}
.project-detail__pager .pager__next { text-align: right; align-items: flex-end; }
.project-detail__pager .pager__label { font-size: 10px; opacity: 0.7; }
.project-detail__pager .pager__name {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg);
}
.project-detail__pager a:hover .pager__name { color: var(--accent); }
@media (max-width: 700px) {
  .project-detail__pager { grid-template-columns: 1fr; }
  .project-detail__pager .pager__center,
  .project-detail__pager .pager__next {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--rule);
    text-align: left;
    align-items: flex-start;
  }
}

/* ---- Wide single-column body for /about/, /uses/, /contact/. ---- */
.prose {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 0 80px;
  font-family: var(--serif);
}
.prose p {
  font-size: 21px;
  line-height: 1.6;
  margin: 0 0 22px;
  text-wrap: pretty;
}
.prose p + p { margin-top: 22px; }
.prose .kicker { margin: 40px 0 12px; }
.prose h2 {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin: 56px 0 18px;
}
.prose ul {
  font-size: 19px;
  line-height: 1.55;
  padding-left: 22px;
  margin: 0 0 22px;
}
.prose ul li { margin-bottom: 8px; }

/* ---- Inline body links: amber, underline only on hover. Applies inside prose
       paragraphs and project-detail body paragraphs / lists. ---- */
.prose a,
.project-detail__body p a,
.project-detail__body li a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease;
}
.prose a:hover,
.project-detail__body p a:hover,
.project-detail__body li a:hover {
  border-bottom-color: var(--accent);
}

/* ---- Reduced motion. ---- */
@media (prefers-reduced-motion: reduce) {
  .sw-flicker { animation: none; }
  .grain { display: none; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---- Print: a broadside should print like one. Ink on paper, no chrome. ---- */
@media print {
  :root {
    --bg: #ffffff;
    --plate: #f6f1e6;
    --fg: #14110e;
    --muted: #4d4839;
    --rule: rgba(20, 17, 14, 0.35);
    --accent: #8a4a14;
  }
  body { background: #ffffff; color: var(--fg); }
  .grain, .nav-compact, .cmdk, .chips, .cmd-button { display: none !important; }
  .sw-flicker { animation: none; }
  .crest--hero { filter: none; }
  a { color: var(--fg); text-decoration: none; }
  .linkback__url { color: var(--accent); }
  .section { padding: 28pt 0; }
  .section--plate { background: var(--plate); }
  .container { max-width: none; padding: 0 18pt; }
  .project, .linkback, .uses__card { break-inside: avoid; }
  .project { min-height: 0; }
  .project__blurb { max-height: none; color: var(--muted); }
  .lede { grid-template-columns: 1fr; gap: 16pt; }
  .email { font-size: 28pt; border-bottom-width: 2pt; }
  .footer { border-top: 2pt solid var(--fg); }
  @page { margin: 18mm; }
}

/* ============================================================
   Project pages — stat strip, hero, and 6 figure primitives.
   Added 2026-04-26 per docs/superpowers/specs/2026-04-26-project-pages-refinement-design.md
   ============================================================ */

/* ---- Hero block (4 pages: omega, flux, secnull, xiphos). ---- */
.hero {
  margin: 0;
  padding: 0;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  background: var(--plate);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.hero picture, .hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Stat strip (sits under .page-header / hero). ---- */
.stat-strip {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 24px var(--pad-x);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px;
  max-width: var(--container);
  margin: 0 auto;
}

/* The body section was tuned to sit directly under .page-header, with 80px of
   top padding. When a stat-strip is between them, that gap stacks with the strip's
   own padding and feels like dead space. Pull the section in close. */
.stat-strip + .section { padding-top: 32px; }

.fig {
  margin: 0;
  font-family: var(--mono);
}
.fig figcaption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- 1. Number plate. ---- */
.fig--plate { display: flex; flex-direction: column; gap: 6px; }
.plate__num {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.plate__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Plate fade-in (one-shot, staggered by inline --i variable). */
@media (prefers-reduced-motion: no-preference) {
  .stat-strip .fig--plate {
    opacity: 0;
    transform: translateY(6px);
    animation: plate-in 380ms ease-out forwards;
    animation-delay: calc(var(--i, 0) * 60ms);
  }
}
@keyframes plate-in {
  to { opacity: 1; transform: none; }
}

/* ---- Inline figures (sit inside .project-detail__body). ---- */
.fig--inline {
  margin: 28px 0 36px;
  padding: 24px;
  background: var(--plate);
  border: 1px solid var(--rule);
}
.fig--inline svg { display: block; width: 100%; height: auto; }

/* ---- 2. Sparkbar row. ---- */
.fig--bars .bar    { fill: var(--accent); }
.fig--bars .bar-bg { fill: var(--rule); }
.fig--bars .bar-label,
.fig--bars .bar-value {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--fg);
}
.fig--bars .bar-value { fill: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .fig--bars.is-in-view .bar {
    transform-origin: left center;
    animation: bar-grow 600ms ease-out both;
  }
}
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- 3. Pipeline diagram. ---- */
.fig--pipeline .stage-box  { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.fig--pipeline .stage-text {
  font-family: var(--mono); font-size: 11px; fill: var(--fg);
  text-anchor: middle; dominant-baseline: middle;
}
.fig--pipeline .arrow      { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.fig--pipeline .arrow-head { fill: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .fig--pipeline.is-in-view .arrow {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: dash-in 600ms ease-out forwards;
  }
}
@keyframes dash-in { to { stroke-dashoffset: 0; } }

/* ---- 4. Node graph. ---- */
.fig--graph .node          { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.fig--graph .node-hub      { fill: var(--accent); stroke: var(--accent); }
.fig--graph .node-text     {
  font-family: var(--mono); font-size: 11px; fill: var(--fg);
  text-anchor: middle; dominant-baseline: middle;
}
.fig--graph .node-hub-text { fill: var(--bg); }
.fig--graph .edge          { stroke: var(--accent); stroke-width: 1; opacity: 0.6; }

/* ---- 5. Treemap. ---- */
.fig--treemap .cell      { stroke: var(--bg); stroke-width: 2; }
.fig--treemap .cell-text { font-family: var(--mono); font-size: 10px; fill: var(--bg); }

/* ---- 6. Timeline strip. ---- */
.fig--timeline .axis       { stroke: var(--rule); stroke-width: 1; }
.fig--timeline .tick       { stroke: var(--accent); stroke-width: 1.2; }
.fig--timeline .tick-major { stroke-width: 2; }
.fig--timeline .label      { font-family: var(--mono); font-size: 10px; fill: var(--muted); }

/* ---- New H2 sections in .project-detail__body. ---- */
.project-detail__body h2.h2--added { /* same styling as existing h2; class exists for selector hooks. */ }

/* ---- Mobile reflow for stat strip. ---- */
@media (max-width: 720px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); padding: 22px var(--pad-x); gap: 20px; }
}
@media (max-width: 480px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); padding: 18px var(--pad-x); gap: 14px; }
  .plate__num { font-size: 32px; }
}

