/* ============================================================
   Tapiwa Makandigona — Anthropic/Claude-inspired system
   Tokens from the Claude DESIGN.md analysis:
   cream canvas #faf9f5 · coral #cc785c · ink #141413
   serif display (Fraunces ≈ Copernicus/Tiempos) + Inter body
   ============================================================ */

:root {
  --film-poster: url("/media/lattice_poster.webp");
  --coral: #cc785c;
  --coral-active: #a9583e;
  --ink: #141413;
  --body: #3d3d3a;
  --body-strong: #252523;
  --muted: #6c6a64;
  --muted-soft: #8e8b82;
  --hairline: #e6dfd8;
  --hairline-soft: #ebe6df;
  --canvas: #faf9f5;
  --surface-soft: #f5f0e8;
  --surface-card: #efe9de;
  --cream-strong: #e8e0d2;
  --dark: #181715;
  --dark-elev: #252320;
  --dark-soft: #1f1e1b;
  --on-dark: #faf9f5;
  --on-dark-soft: #a09d96;
  --teal: #5db8a6;
  --amber: #e8a55a;
  --serif: "Fraunces", "Tiempos Headline", Garamond, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --max: 1200px;
  --pad: clamp(20px, 4vw, 48px);
  --section: clamp(64px, 9vw, 96px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--body);
  background: var(--canvas);
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}
::selection { background: var(--coral); color: #fff; }

h1, h2, h3 { color: var(--ink); text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
p { text-wrap: pretty; }
img { max-width: 100%; display: block; }
a { color: var(--coral); text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 2px; }

/* legacy inbound anchors (/#oss) keep working without showing up in layout */
.anchor-alias { display: block; height: 0; scroll-margin-top: 84px; }

.skip-link {
  position: absolute; left: 24px; top: -60px; z-index: 100;
  background: var(--coral); color: #fff; font-size: 14px; font-weight: 500;
  padding: 10px 16px; border-radius: 0 0 var(--r-md) var(--r-md);
  transition: top .2s ease;
}
.skip-link:focus { top: 0; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 14px; font-weight: 500; line-height: 1;
  height: 44px; padding: 0 22px;
  border-radius: 980px;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { background: var(--coral-active); }
.btn-ghost { background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline); }
.btn-ghost:hover { border-color: var(--muted-soft); }
.btn-cream { background: var(--coral); color: #fff; }
.btn-cream:hover { background: var(--coral-active); }
.btn-outline-cream { color: #fff; border: 1px solid rgba(255,255,255,.55); }
.btn-outline-cream:hover { border-color: #fff; }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: 56px;
  padding: 0 var(--pad);
  display: flex; align-items: center; gap: 28px;
  background: color-mix(in srgb, var(--canvas) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(18px);
  backdrop-filter: saturate(1.8) blur(18px);
  border-bottom: 1px solid var(--hairline-soft);
}
.nav-inner-note { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em; }
.spike { width: 17px; height: 17px; color: var(--coral); flex: none; }
.nav nav { display: flex; gap: 24px; margin-left: auto; }
.nav nav a { color: var(--body); font-size: 14px; font-weight: 500; }
.nav nav a:hover { color: var(--ink); }

/* ── Hero ── */
.hero > *, .db-inner > * { min-width: 0; }
.hero {
  position: relative;
  overflow: hidden;
  min-height: min(94vh, 880px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding: clamp(80px, 12vh, 150px) var(--pad) clamp(56px, 9vh, 110px);
  text-align: center;
  isolation: isolate;
}
.hero-copy { position: relative; z-index: 2; max-width: 900px; }
.kicker {
  font-size: 15px; font-weight: 500;
  color: var(--muted);
  margin-bottom: 26px;
}
.badge-coral {
  background: var(--coral); color: #fff;
  font-size: 12px; font-weight: 500; letter-spacing: 1.2px;
  border-radius: 9999px; padding: 4px 12px;
}
.hero h1 {
  font-size: clamp(38px, 5.6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}
.lede { font-size: 19px; line-height: 1.6; color: var(--body); max-width: 32em; margin-inline: auto; }
.hero-actions { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; justify-content: center; }

/* Code window (dark product chrome) */
.code-window, .terminal {
  background: var(--dark);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(20,20,19,.08);
}
.cw-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 14px;
  background: var(--dark-elev);
}
.cw-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3733; }
.cw-bar i:nth-child(1) { background: #c64545; }
.cw-bar i:nth-child(2) { background: #d4a017; }
.cw-bar i:nth-child(3) { background: #5db872; }
.cw-bar span { font-family: var(--mono); font-size: 11.5px; color: var(--on-dark-soft); margin-left: 8px; }
.code-window pre, .terminal pre {
  padding: 20px 22px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--on-dark);
  overflow-x: auto;
}
.tk { color: #cc785c; }
.tf { color: #5db8a6; }
.tt { color: #e8a55a; }
.tc { color: #8e8b82; }
.tn { color: #e8a55a; }
.tp { color: #5db8a6; }
.tg { color: #5db872; }
.cw-status {
  font-family: var(--mono); font-size: 11.5px;
  color: var(--on-dark-soft);
  padding: 9px 14px;
  background: var(--dark-elev);
  display: flex; align-items: center; gap: 8px;
}
.dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); flex: none; }

/* ── Stats strip ── */
.stats {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) var(--section);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  border-top: 0;
}
.stats div { text-align: center; padding: 8px 0; }
.stats strong { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.2vw, 44px); color: var(--ink); letter-spacing: -0.015em; }
.stats span { font-size: 14px; color: var(--muted); }

/* ── Sections ── */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) var(--section);
}
.eyebrow {
  font-size: 15px; font-weight: 500;
  color: var(--coral);
  margin-bottom: 12px;
}
.eyebrow-dark { color: var(--amber); }
.section h2, .dark-band h2, .cta-band h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.018em;
  line-height: 1.12;
  margin-bottom: clamp(28px, 4vw, 44px);
}

/* ── Flagship cards ── */
.flagship-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.flag-card {
  background: var(--surface-card);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .22s cubic-bezier(.2,.7,.2,1), box-shadow .22s ease;
}
.flag-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px -14px rgba(20,20,19,.25); }
.flag-card figure { aspect-ratio: 16 / 10; overflow: hidden; }
.flag-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.flag-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.flag-body h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; letter-spacing: -0.01em; }
.flag-body p { font-size: 14.5px; color: var(--body); }
.flag-cta { margin-top: auto; padding-top: 10px; font-size: 14px; font-weight: 500; color: var(--coral); }
.flag-cta::after { content: " \203A"; opacity: 0; transition: opacity .18s ease; }
.flag-card:hover .flag-cta::after { opacity: 1; }
.flag-card:hover .flag-cta { color: var(--coral-active); }

/* ── Work list ── */
.work-list { list-style: none; max-width: 820px; }
.work-list li { padding: 26px 0; border-top: 1px solid var(--hairline); }
.work-list li:last-child { border-bottom: 1px solid var(--hairline); }
.wl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.wl-head h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; letter-spacing: -0.01em; }
.wl-year { font-family: var(--mono); font-size: 12.5px; color: var(--muted-soft); flex: none; }
.work-list p { font-size: 15px; color: var(--body); max-width: 44em; }
.wl-tags { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
.wl-links { margin-top: 10px; display: flex; gap: 10px; }
.wl-links a {
  font-size: 13px; font-weight: 500; color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 6px 14px;
  transition: border-color .18s ease, background .18s ease;
}
.wl-links a:hover { border-color: var(--coral); background: var(--surface-soft); }
.text-link { display: inline-block; margin-top: 28px; font-weight: 500; font-size: 15px; }
.text-link:hover { color: var(--coral-active); }

/* ── Dark band ── */
.dark-band { background: var(--dark); color: var(--on-dark); }
.db-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--section) var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.dark-band h2 { color: var(--on-dark); }
.db-copy > p:last-child { color: var(--on-dark-soft); font-size: 16px; max-width: 36em; }
.terminal { background: var(--dark-soft); border: 1px solid #2c2a26; box-shadow: none; }
.cw-bar-dark { background: var(--dark-elev); }

/* ── Tiles (open source) ── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.tile {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: border-color .18s ease, background .18s ease, transform .2s ease;
}
.tile:hover { border-color: var(--coral); background: var(--surface-soft); transform: translateY(-2px); }
.tile h3 { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.tile p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.more-oss { margin-top: 26px; font-size: 14.5px; color: var(--body); max-width: 52em; }
.more-oss a { font-weight: 500; }

/* ── Awards ── */
.award-list { list-style: none; max-width: 860px; }
.award-list li {
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
}
.award-list li:last-child { border-bottom: 1px solid var(--hairline); }
.award-list h3 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.award-list span {
  flex: none;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  letter-spacing: .02em;
}
.award-list h3 { font-size: 16.5px; font-weight: 600; margin-bottom: 3px; }
.award-list p { font-size: 14.5px; color: var(--muted); }

/* ── About ── */
.about-cols {
  columns: 2;
  column-gap: 44px;
  max-width: 900px;
}
.about-cols p { break-inside: avoid; margin-bottom: 18px; font-size: 15.5px; }
.about-cols strong { color: var(--body-strong); font-weight: 600; }

/* ── Coral CTA band ── */
.cta-band {
  max-width: var(--max);
  margin: 0 auto var(--section);
  background: var(--dark);
  color: #fff;
  border-radius: var(--r-xl);
  padding: clamp(48px, 7vw, 88px) var(--pad);
  text-align: center;
  width: calc(100% - 2 * var(--pad));
}
.cta-band h2 { color: #fff; margin-bottom: 12px; max-width: 20em; margin-inline: auto; }
.cta-band > p { color: var(--on-dark-soft); font-size: 15px; }
.cta-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }

/* ── Footer ── */
.footer {
  background: var(--dark);
  color: var(--on-dark-soft);
  padding: clamp(40px, 6vw, 64px) var(--pad);
}
.foot-brand {
  max-width: var(--max); margin: 0 auto 18px;
  display: flex; align-items: center; gap: 10px;
  color: var(--on-dark); font-weight: 600; font-size: 15px;
}
.foot-links {
  max-width: var(--max); margin: 0 auto 22px;
  display: flex; gap: 22px; flex-wrap: wrap;
}
.foot-links a { color: var(--on-dark-soft); font-size: 14px; }
.foot-links a:hover { color: var(--on-dark); }
.foot-fine { max-width: var(--max); margin: 0 auto; font-size: 13px; color: #6c6a64; }

/* ── Reveal on scroll ── */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s cubic-bezier(.2,.7,.2,1); }
  .reveal.in { opacity: 1; transform: none; }
}

/* ── Responsive ── */
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-chrome { max-width: 640px; }
  .db-inner { grid-template-columns: minmax(0, 1fr); }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .flagship-grid { grid-template-columns: 1fr 1fr; }
  .flagship-grid .flag-card:first-child { grid-column: span 2; }
}
@media (max-width: 720px) {
  .nav { gap: 16px; }
  .brand span { display: none; }   /* Apple move: glyph-only brand on phones */
  .brand .spike { width: 20px; height: 20px; }
  .nav nav { gap: 18px; }
  .nav nav a { font-size: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .flagship-grid { grid-template-columns: 1fr; }
  .flagship-grid .flag-card:first-child { grid-column: span 1; }
  .about-cols { columns: 1; }
  .wl-head { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .tile-grid { grid-template-columns: 1fr; }
  .code-window pre, .terminal pre { font-size: 11.5px; padding: 16px 14px; }
  .nav { gap: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .hero h1 { font-size: clamp(30px, 9.5vw, 36px); }
  .cta-band { width: calc(100% - 32px); }
}
@media (pointer: coarse) {
  .foot-links a, .nav nav a { padding: 8px 2px; }
  .wl-links a { padding: 9px 16px; }
}
@media print {
  /* legacy inbound anchors (/#oss) keep working without showing up in layout */
.anchor-alias { display: block; height: 0; scroll-margin-top: 84px; }

.skip-link { display: none !important; }
  .dark-band, .footer, .cta-band, .code-window, .terminal { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ============================================================
   3D STAGE — hand-written WebGL raymarcher (see gl.js)
   One concept, two instances. CSS gradient is the fallback.
   ============================================================ */
.stage {
  position: absolute;
  inset: 13% 0 4%;
  contain: paint;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  /* fallback bloom, visible if WebGL is unavailable */
  background:
    radial-gradient(46% 40% at 62% 34%, color-mix(in srgb, var(--coral) 34%, transparent), transparent 70%),
    radial-gradient(40% 36% at 34% 62%, color-mix(in srgb, var(--amber) 26%, transparent), transparent 72%);
}
.stage canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.1s ease .12s;
}
.stage canvas.gl-on { opacity: 1; }
.stage canvas.gl-on ~ *, .stage:has(canvas.gl-on) { background: none; }

/* keep the headline legible on top of the mass */
.hero::before {
  content: "";
  position: absolute; z-index: 1;
  left: 50%; top: 34%;
  width: min(980px, 100%); height: min(460px, 56%);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--canvas) 74%, transparent) 0%,
    color-mix(in srgb, var(--canvas) 42%, transparent) 54%,
    transparent 100%);
  pointer-events: none;
}

.stage::after { content: none; }
.stage-dark::after { display: none; }

.dark-band { position: relative; isolation: isolate; overflow: hidden; }
.dark-band .db-inner { position: relative; z-index: 2; }
.stage-dark {
  inset: -12% 0;
  background:
    radial-gradient(44% 44% at 74% 30%, color-mix(in srgb, var(--coral) 30%, transparent), transparent 70%),
    radial-gradient(38% 38% at 26% 70%, color-mix(in srgb, var(--teal) 20%, transparent), transparent 72%);
}
.stage-dark canvas.gl-on { opacity: .5; }
/* generated footage sits behind the live graph: atmosphere, not the subject */
.band-film {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .55;
  filter: saturate(1.02) contrast(1.02);
  pointer-events: none;
}
.stage-dark.film-poster {
  background-image: var(--film-poster);
  background-size: cover; background-position: center;
}
.stage-dark::before {            /* keep the deep-black end of the band, not grey */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--dark) 62%, transparent),
    color-mix(in srgb, var(--dark) 30%, transparent) 45%,
    color-mix(in srgb, var(--dark) 72%, transparent));
}
@media (prefers-reduced-motion: reduce) { .band-film { display: none; } }
.dark-band::after {   /* scrim: vignette + a darker left third so the copy stays crisp */
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--dark) 72%, transparent) 0%,
                           color-mix(in srgb, var(--dark) 34%, transparent) 38%,
                           transparent 62%),
    radial-gradient(120% 90% at 50% 50%,
      transparent 0%, color-mix(in srgb, var(--dark) 55%, transparent) 100%);
  pointer-events: none;
}

/* scroll cue — Apple-quiet */
.scroll-hint {
  position: absolute; z-index: 3;
  left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 22px; height: 34px;
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  display: grid; place-items: start center;
  padding-top: 6px;
  opacity: .75;
}
.scroll-hint span {
  width: 3px; height: 7px; border-radius: 2px;
  background: var(--coral);
  animation: sh 1.9s ease-in-out infinite;
}
@keyframes sh {
  0%, 100% { transform: translateY(0); opacity: 1; }
  55%      { transform: translateY(11px); opacity: .25; }
}

/* 3D pointer tilt on flagship cards */
.tilt {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform .5s cubic-bezier(.22,.61,.36,1), box-shadow .3s ease;
}
.tilt.tilting { transition: transform .09s linear, box-shadow .3s ease; }
.tilt figure { transform: translateZ(0); }
.tilt .flag-body { transform: translateZ(22px); }

@media (prefers-reduced-motion: reduce) {
  .scroll-hint span { animation: none; }
  .tilt, .tilt .flag-body { transform: none !important; }
}
@media (max-width: 720px) {
  .hero { min-height: min(90vh, 760px); padding-bottom: clamp(40px, 8vh, 90px); }
  .stage { inset: 48% 0 3%; }
  .hero::before { top: 26%; height: min(360px, 46%); }
  .scroll-hint { display: none; }
}

/* ============================================================
   BRAND ICONS (simple-icons + bootstrap-icons paths, inlined)
   ============================================================ */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.nav-social { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-social a {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--muted);
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.nav-social svg { width: 17px; height: 17px; fill: currentColor; }
.nav-social a:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  transform: translateY(-1px);
}
.nav-social a:nth-child(1):hover { color: #0a66c2; }   /* LinkedIn blue  */
.nav-social a:nth-child(2):hover { color: #e1306c; }   /* Instagram pink */
.nav-social a:nth-child(3):hover { color: var(--ink); }

.foot-links a { display: inline-flex; align-items: center; gap: 8px; }
.foot-links svg { width: 15px; height: 15px; fill: currentColor; flex: none; opacity: .9; }
.foot-links a:nth-child(2):hover { color: #4aa3e0; }
.foot-links a:nth-child(3):hover { color: #f06292; }
.foot-links a:nth-child(4):hover { color: #7cd4a0; }
.foot-links a:nth-child(5):hover { color: #e06b5c; }
.btn-ico { width: 15px; height: 15px; fill: currentColor; margin-right: 8px; }

/* ============================================================
   SHOWCASE — 3D slabs over a drifting accent-sphere field
   ============================================================ */
.showcase { position: relative; isolation: isolate; overflow: hidden; }
.showcase > *:not(.stage) { position: relative; z-index: 2; }
.showcase { padding-bottom: clamp(190px, 24vh, 260px); }
.stage-trio {
  inset: auto 0 34px 0;
  height: clamp(150px, 18vh, 200px);
  background:
    radial-gradient(28% 46% at 14% 42%, color-mix(in srgb, var(--coral) 22%, transparent), transparent 70%),
    radial-gradient(24% 40% at 52% 62%, color-mix(in srgb, var(--teal) 18%, transparent), transparent 72%),
    radial-gradient(26% 42% at 86% 40%, color-mix(in srgb, var(--amber) 20%, transparent), transparent 72%);
}
.stage-trio canvas.gl-on { opacity: .9; }
.stage-trio::after { content: none; }   /* contact shadows belonged to the spheres */

/* the cards become slabs with real thickness */
.flagship-grid { perspective: 1200px; }
.flag-card {
  position: relative;
  overflow: visible;                 /* overflow:hidden flattens 3D — clip on the figure instead */
  transform-style: preserve-3d;
  background: var(--surface-card);
}
.flag-card figure {
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  overflow: hidden;
}
.slab-edge {
  position: absolute; inset: 0;
  z-index: -1;                       /* behind the card face, never over the artwork */
  border-radius: var(--r-lg);
  transform: translateZ(-18px) scale(1.02);
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--coral) 88%, transparent),
    color-mix(in srgb, var(--ink) 30%, transparent));
  opacity: 0; transition: opacity .35s ease;
  pointer-events: none;
}
.flag-card:hover .slab-edge { opacity: .5; }
.sheen {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%),
    rgba(255,255,255,.55), transparent 72%);
  opacity: 0; transition: opacity .3s ease;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 3;
}
.flag-card:hover .sheen { opacity: 1; }
.tilt figure { transform: translateZ(10px); }
.tilt .flag-body { transform: translateZ(34px); }
.tilt .flag-cta  { display: inline-block; transform: translateZ(16px); }

@media (prefers-reduced-motion: reduce) {
  .slab-edge, .sheen { display: none; }
}
@media (max-width: 720px) {
  .showcase { padding-bottom: var(--section); }
  .stage-trio { display: none; }              /* one GPU context is plenty on a phone */
  .nav-social { gap: 2px; }
  .nav-social a { width: 30px; height: 30px; }
  .nav-social svg { width: 16px; height: 16px; }
  .foot-links { gap: 14px 18px; }
}

/* phone nav: keep the two socials he asked for, drop the rest of the clutter */
@media (max-width: 560px) {
  .nav-social a:nth-child(3) { display: none; }   /* GitHub lives in the footer */
  .nav nav .nav-ext { display: none; }
}
@media (max-width: 360px) {
  .nav nav .nav-about { display: none; }
}
/* warmer, more visible slab thickness */

/* ── Desktop composition (≥1024px) ───────────────────────────────────────────
   The centred, full-bleed hero reads well on a phone, but on a monitor the graph
   ran straight through the headline and the column floated in a void of margin.
   On desktop the hero becomes an asymmetric split: type left, graph contained in
   its own stage on the right. Nothing overlaps, and the width gets used.        */
@media (min-width: 1024px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
    align-items: center;
    gap: clamp(36px, 4.6vw, 88px);
    max-width: var(--max);
    margin-inline: auto;
    text-align: left;
    min-height: min(76vh, 720px);
    padding-block: clamp(34px, 5vh, 66px) clamp(30px, 4.5vh, 58px);
  }
  .hero-copy { grid-row: 1; grid-column: 1; max-width: none; }
  .hero .lede { margin-inline: 0; }
  /* scoped to the homepage split hero — project pages (.page-hero) stay centered */
  .hero .hero-actions { justify-content: flex-start; }
  .hero h1 { font-size: clamp(40px, 3.35vw, 54px); }
  .kicker { margin-bottom: 22px; }

  /* the graph gets its own room instead of running under the words */
  .hero .stage {
    --panel: radial-gradient(58% 52% at 50% 44%,
               color-mix(in srgb, var(--coral) 11%, transparent), transparent 72%),
             linear-gradient(180deg,
               color-mix(in srgb, var(--surface-card) 48%, transparent), transparent 74%);
    position: relative;
    inset: auto;
    grid-row: 1;
    grid-column: 2;
    height: min(48vh, 424px);
    border-radius: 26px;
    background: var(--panel);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hairline) 88%, transparent);
  }
  .hero .stage::after {
    content: "live · webgl · 3 draw calls";
    position: absolute; left: 20px; bottom: 15px; z-index: 3;
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
    color: color-mix(in srgb, var(--muted) 68%, transparent);
    pointer-events: none;
  }

  /* the fallback-bloom reset must not strip the panel itself */
  .hero .stage:has(canvas.gl-on) { background: var(--panel); }
  .hero::before { content: none; }  /* no scrim: type and graph no longer share space */
  .stats { margin-top: calc(var(--section) * -0.3); }
}

/* Large monitors: stop rendering a phone layout in the middle of the screen. */
@media (min-width: 1600px) {
  :root { --max: 1360px; }
  .hero h1 { font-size: 62px; }
  .hero .lede { font-size: 20px; }
  .hero .stage { height: min(50vh, 468px); }
}

/* Motion control — an OS "reduce motion" setting drops the graphs to a calm drift
   rather than freezing them; this lets anyone override that choice either way. */
.motion-toggle {
  background: none; border: 1px solid var(--hairline-strong);
  border-radius: 9999px; padding: 5px 13px;
  font: inherit; font-size: 12.5px; color: var(--muted);
  cursor: pointer; transition: color .2s, border-color .2s;
}
.motion-toggle:hover { color: var(--ink); border-color: var(--muted); }

/* =====================================================================
   PAGE LAYER
   Project pages (/zldc/, /lanlink/, /emberdelve/, …) reuse the homepage
   system: same nav, type scale, buttons, dark close, 3D field. Every
   rule here is scoped to body.page so the homepage is never touched.
   ===================================================================== */

/* ---- hero ---------------------------------------------------------- */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: var(--max);
  margin: 0 auto;
  /* the bottom band is reserved for the graph, so no wire ever crosses the type,
     however long the headline or the chip row turns out to be */
  padding: clamp(64px, 9vh, 112px) var(--pad) clamp(170px, 24vh, 250px);
  text-align: center;
}
.page-hero .stage {
  inset: auto -3% 0;
  height: clamp(190px, 27vh, 290px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 20%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 20%, #000 100%);
}
@media (max-width: 720px) {
  .page-hero .stage { inset: auto -8% 0; }
}
.page-hero > *:not(.stage) { position: relative; z-index: 1; }

.page-h1 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.022em;
  line-height: 1.03;
  font-size: clamp(44px, 8vw, 84px);
  color: var(--ink);
  margin: 0 0 18px;
  text-wrap: balance;
}
.page-hero .lede { font-size: clamp(17px, 2vw, 20px); max-width: 34em; }
.page-hero .hero-actions { margin-top: 28px; }
.page-hero .chip-row { justify-content: center; margin-top: 22px; }

/* ---- sections: prose measure, quiet rhythm ------------------------- */
.page main > .section {
  max-width: 880px;
  padding-bottom: clamp(44px, 6.5vw, 72px);
}
.page .section-label {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(25px, 3.2vw, 36px);
  letter-spacing: -0.015em;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 20px;
}
.page .about-text p,
.page .prose-note,
.page .ed-about {
  font-size: 17px;
  line-height: 1.72;
  color: var(--body);
  margin: 0;
}
.page .about-text p + p,
.page .prose-note + .prose-note { margin-top: 1.05em; }
.page .about-text strong,
.page .prose-note strong,
.page .ed-about strong { color: var(--body-strong); font-weight: 600; }
.page .dl-note { font-size: 14.5px; line-height: 1.65; color: var(--muted); margin: 0; }

/* ---- numbered hairline lists (replaces the old emoji rows) --------- */
.feature-list,
.steps,
.z-feature,
.z-tiers,
.promise-list { list-style: none; margin: 0; padding: 0; }
.feature-list, .steps, .z-feature, .z-tiers { counter-reset: n; }

.feature,
.step,
.z-feature > li,
.z-tiers > li {
  counter-increment: n;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  column-gap: 16px;
  padding: 21px 0;
  border-top: 1px solid var(--hairline);
}
.feature-list > li:last-child,
.steps > li:last-child,
.z-feature > li:last-child,
.z-tiers > li:last-child { border-bottom: 1px solid var(--hairline); }

.feature::before,
.step::before,
.z-feature > li::before,
.z-tiers > li::before {
  content: counter(n, decimal-leading-zero);
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--coral);
  padding-top: 4px;
}
.feature > div,
.step > div,
.z-feature > li > div,
.z-tiers > li > h3,
.z-tiers > li > p { grid-column: 2; }

.page .feature h3,
.page .step h3,
.page .z-feature h3,
.page .z-tiers h3 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.006em;
  color: var(--ink);
  margin: 0 0 5px;
}
.page .feature p,
.page .step p,
.page .z-feature p,
.page .z-tiers p {
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--muted);
  margin: 0;
}

/* ---- chips --------------------------------------------------------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip,
.chip-row > span {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--body-strong);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: 980px;
  padding: 6px 12px;
}

/* ---- download cards ------------------------------------------------ */
.dl-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
}
.dl-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: border-color 0.18s ease, transform 0.2s ease;
}
.dl-card:hover { border-color: var(--muted-soft); transform: translateY(-2px); }
.dl-head { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; }
.dl-icon { display: inline-flex; color: var(--ink); }
.dl-icon svg { width: 21px; height: 21px; fill: currentColor; }
.dl-name { font-size: 16px; font-weight: 600; color: var(--ink); }
.dl-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.dl-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dl-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 18px;
  border-radius: 980px;
  font-size: 14px; font-weight: 500;
  background: var(--coral); color: #fff;
  transition: background 0.18s ease;
}
.dl-btn:hover { background: var(--coral-active); }
.dl-alt { display: grid; gap: 7px; margin-top: 11px; }
.dl-alt a { font-size: 13.5px; color: var(--muted); }
.dl-alt a:hover { color: var(--coral); }
.dl-more { margin-top: 12px; }
.dl-more summary {
  cursor: pointer; font-size: 13.5px; color: var(--coral);
  list-style: none; width: fit-content;
}
.dl-more summary::-webkit-details-marker { display: none; }
.dl-more summary::after { content: " ↓"; }
.dl-more[open] summary::after { content: " ↑"; }
.play-badge { display: inline-block; }
.play-badge img { height: 54px; width: auto; aspect-ratio: 646 / 250; display: block; }

/* ---- promises grid (Emberdelve) ------------------------------------ */
.promise-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 12px;
}
.promise {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 15px;
  font-size: 14px;
  color: var(--muted);
}
.promise strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 4px;
}

/* ---- data table (ZLDC) --------------------------------------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.z-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 420px; }
.z-table th {
  text-align: left;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
  padding: 0 14px 10px 0;
}
.z-table td {
  border-top: 1px solid var(--hairline);
  padding: 13px 14px 13px 0;
  color: var(--body);
  line-height: 1.5;
  vertical-align: top;
}
.z-table tbody tr:hover { background: var(--surface-soft); }
.z-table th:last-child, .z-table td:last-child { padding-right: 0; text-align: right; white-space: nowrap; }

/* ---- dark close band (every page ends the same way) ---------------- */
.page-close {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--dark);
  color: var(--on-dark);
  padding: clamp(52px, 7.5vw, 92px) var(--pad);
  text-align: center;
}
.page-close .stage { inset: 0; }
.page-close .pc-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.page-close h2 {
  font-size: clamp(27px, 3.8vw, 42px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--on-dark);
}
.page-close p { font-size: 16px; color: var(--on-dark-soft); margin: 0 0 26px; }

/* ---- back to top --------------------------------------------------- */
.back-top {
  position: fixed;
  right: 18px; bottom: 18px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: rgba(250, 249, 245, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease, border-color 0.18s ease;
  z-index: 40;
}
.back-top.visible { opacity: 1; pointer-events: auto; }
.back-top:hover { border-color: var(--muted-soft); }

/* ---- reveal parity with the homepage ------------------------------- */
.page .feature,
.page .step,
.page .dl-card,
.page .promise,
.page .z-tiers > li { will-change: auto; }

@media (max-width: 560px) {
  .feature, .step, .z-feature > li, .z-tiers > li { grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; }
  .page-hero { padding-top: clamp(52px, 8vh, 84px); }
}

/* The closing band's field is now wide enough to run behind the sign-off, so give the
   words their own pool of dark. The wires stay visible around the type, never through it. */
.page-close .pc-inner::before {
  content: "";
  position: absolute;
  inset: -14% -16%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(58% 60% at 50% 46%,
    rgba(24, 23, 21, .92) 0%, rgba(24, 23, 21, .74) 46%, rgba(24, 23, 21, 0) 78%);
}
