/* ============ tokens ============ */
:root {
  --bg: #070812;
  --ink: #f2f4fb;
  --muted: #b4b9cf;
  --dim: #8389a3;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --glass: rgba(13, 15, 30, 0.56);
  --accent: #8fb4ff;
  --accent-2: #c79bff;
  --live: #8fb4ff;
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --gutter: clamp(16px, 4vw, 72px);
  --gap: clamp(14px, 1.6vw, 24px);
  --r: clamp(18px, 1.8vw, 28px);
  --r-sm: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 12px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(90vw 70vh at 12% 8%, rgba(72, 96, 190, 0.28), transparent 60%),
    radial-gradient(80vw 70vh at 92% 80%, rgba(140, 82, 190, 0.2), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 clamp(1rem, 0.96rem + 0.18vw, 1.09rem) / 1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, p, dl, dd, dt, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--live); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--live) 55%, transparent); color: #fff; }

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 100;
  padding: 10px 16px; border-radius: 10px; background: #fff; color: #000; font-weight: 600;
  transition: top 0.2s;
}
.skip:focus { top: 12px; }

/* ============ backdrop ============ */
#stage {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.2s var(--ease);
}
#stage.is-ready { opacity: 1; }
.no-webgl #stage { display: none; }
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(4, 5, 12, 0.72) 100%),
    linear-gradient(to bottom, rgba(7, 8, 18, 0.5), transparent 16%, transparent 84%, rgba(7, 8, 18, 0.55));
}
main { position: relative; z-index: 2; }

/* ============ glass ============ */
.glass {
  --mx: 50%; --my: 0%;
  position: relative;
  border-radius: var(--r);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.025) 38%, rgba(255, 255, 255, 0.06)),
    var(--glass);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 34px 80px -34px rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
}
.glass::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%);
  opacity: 0; transition: opacity 0.4s;
}
@media (hover: hover) { .glass:hover::before { opacity: 1; } }
.glass > * { position: relative; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(14, 16, 32, 0.92); }
}

/* When frames run long the 3D scene adds .lite to <html>: no blur layers at all, solid glass instead. */
.lite .glass, .lite .hero-card { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(140deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02) 38%, rgba(255, 255, 255, 0.05)), rgba(16, 18, 34, 0.93); }
.lite.is-scrolled .top, .lite .is-scrolled .top { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(11, 13, 26, 0.95); }

/* ============ type bits ============ */
.eyebrow {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.6em;
  font: 500 0.76rem / 1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow .sep { color: var(--dim); }
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #5ff0a6;
  box-shadow: 0 0 0 0 rgba(95, 240, 166, 0.6); animation: pulse 2.4s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(95, 240, 166, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 240, 166, 0); } }
.grad {
  background: linear-gradient(100deg, #fff 0%, var(--live) 45%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 0.08em;
}
.lede { color: var(--muted); font-size: clamp(1.02rem, 0.96rem + 0.4vw, 1.3rem); line-height: 1.55; max-width: 58ch; text-wrap: pretty; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 46px; padding: 0 1.25em; border-radius: 999px;
  font: 600 0.95rem / 1 var(--body); white-space: nowrap;
  border: 1px solid var(--line); background: rgba(34, 37, 58, 0.72);
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.btn:hover { transform: translateY(-2px); background: rgba(52, 56, 84, 0.86); border-color: rgba(255, 255, 255, 0.3); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-accent {
  background: var(--accent); border-color: transparent; color: #0a0b14;
  box-shadow: 0 10px 34px -12px var(--accent);
}
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); border-color: transparent; box-shadow: 0 16px 40px -12px var(--accent); }
.btn-sm { min-height: 40px; font-size: 0.88rem; }
.btn .count { font: 500 0.72rem var(--mono); padding: 3px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); }
.ico { width: 0.95em; height: 0.95em; transition: transform 0.25s var(--ease); }
a:hover > .ico { transform: translate(2px, -2px); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.built { display: grid; gap: 10px; }
.built h3 { font: 500 0.72rem / 1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.chips li {
  font: 500 0.7rem / 1 var(--mono); letter-spacing: 0.02em; color: var(--muted);
  padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.04);
}

/* ============ top bar ============ */
.top {
  position: fixed; z-index: 30; top: max(10px, env(safe-area-inset-top)); left: var(--gutter); right: var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 7px 7px 7px 16px; border-radius: 999px; border: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}
.is-scrolled .top {
  background: rgba(11, 13, 26, 0.74); border-color: var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.12rem / 1 var(--display); letter-spacing: -0.01em; min-height: 40px; }
.mark { width: 28px; height: 28px; transition: transform 0.8s var(--ease); }
.brand:hover .mark { transform: rotate(180deg); }
.top-nav { display: none; gap: 4px; }
.top-nav a { padding: 10px 14px; border-radius: 999px; font-size: 0.9rem; font-weight: 500; color: var(--muted); transition: color 0.2s, background 0.2s; }
.top-nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
@media (min-width: 860px) { .top-nav { display: flex; } }

/* ============ rail (desktop) / dock (mobile) ============ */
.rail {
  position: fixed; z-index: 20; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 5px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(11, 13, 26, 0.9);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
  max-width: calc(100vw - 24px);
}
.rail a {
  --accent: var(--live);
  display: inline-flex; align-items: center; gap: 0; flex: none; min-width: clamp(30px, 9.2vw, 42px); height: 40px; padding: 0 4px; justify-content: center;
  border-radius: 999px; color: var(--dim); font: 500 0.74rem / 1 var(--mono);
  transition: background 0.3s, color 0.3s, padding 0.3s;
}
.rail-label { max-width: 0; overflow: hidden; white-space: nowrap; font: 600 0.82rem / 1 var(--body); transition: max-width 0.4s var(--ease), margin 0.4s var(--ease); }
.rail i { display: none; }
.rail a.is-active { background: color-mix(in srgb, var(--accent) 20%, rgba(255, 255, 255, 0.06)); color: var(--ink); }
.rail a.is-active .rail-n { color: var(--accent); }
.rail a.is-active { padding: 0 14px; }
.rail a.is-active .rail-n { display: none; }
.rail a.is-active .rail-label { max-width: 130px; }

@media (min-width: 1100px) {
  .rail {
    left: auto; bottom: auto; right: 14px; top: 50%; transform: translateY(-50%);
    flex-direction: column; align-items: flex-end; gap: 0; padding: 0;
    border: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .rail a { height: 34px; min-width: 0; padding: 0 0 0 12px; gap: 10px; background: none !important; }
  .rail-n { opacity: 0; transition: opacity 0.3s; }
  .rail-label {
    max-width: none; margin: 0 !important; opacity: 0; transform: translateX(8px); transition: opacity 0.3s, transform 0.3s var(--ease);
    padding: 6px 10px; border-radius: 999px; background: rgba(9, 10, 22, 0.86); border: 1px solid var(--line);
  }
  .rail i { display: block; width: 18px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); transition: width 0.35s var(--ease), background 0.3s; }
  .rail:hover .rail-label, .rail:focus-within .rail-label { opacity: 1; transform: none; }
  .rail-n { display: none; }
  .rail a:hover i { width: 26px; background: #fff; }
  .rail a.is-active i { width: 38px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
  :root { --gutter: clamp(40px, 4.6vw, 96px); }
}

/* ============ hero ============ */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; padding: clamp(84px, 12vh, 130px) var(--gutter) 48px;
}
.hero-inner {
  width: 100%; max-width: 1760px; margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(8px, 2vh, 24px); align-content: center;
}
.hero-inner { justify-items: start; }
.hero-copy { display: contents; }
.hero-copy > .eyebrow { order: 1; }
.hero-copy > h1 { order: 2; }
.hero-stage { order: 3; width: 100%; }
.hero-copy > .hero-card { order: 4; }
.hero-card { display: grid; gap: clamp(16px, 2.4vh, 28px); justify-items: start; width: 100%; }
@media (max-width: 1023.98px) {
  /* on small screens the copy sits on its own pane so the worlds can pass behind it */
  .hero-card {
    padding: 18px; border-radius: var(--r); border: 1px solid var(--line);
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 40%), var(--glass);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 34px 80px -34px rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .hero-card .hero-stats { background: none; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; max-width: none; }
  .hero-card .hero-stats::before { display: none; }
  .hero-card .hero-stats .stat { padding: 14px 10px 0; }
  .hero-card .hero-stats .stat:first-child { padding-left: 0; }
}
.hero h1 {
  font: 800 clamp(3.1rem, 14vw, 5.6rem) / 0.9 var(--display);
  font-stretch: 80%; letter-spacing: -0.012em;
}
.hero h1 span { display: block; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; max-width: 640px; }
.hero-stats .stat { padding: clamp(12px, 1.6vw, 20px); }
.hero-stats .stat + .stat { border-left: 1px solid var(--line-soft); }
.stat { display: flex; flex-direction: column-reverse; gap: 4px; min-width: 0; }
.stat dd { font: 700 clamp(1.5rem, 1.1rem + 1.5vw, 2.3rem) / 1 var(--display); font-stretch: 88%; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.stat dt { font-size: 0.78rem; line-height: 1.3; color: var(--muted); }

.hero-stage {
  position: relative; min-height: 280px; height: 40svh;
  touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none;
}
.hero-stage.is-hot { cursor: pointer; }
.hero-stage.is-dragging { cursor: grabbing; }
.no-webgl .hero-stage, .no-webgl .world-labels { display: none; }
.stage-hint {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  font: 500 0.72rem / 1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); white-space: nowrap;
  padding: 8px 12px; border-radius: 999px; border: 1px dashed var(--line); pointer-events: none;
}
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-fine { display: none; } .hint-touch { display: inline; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: clamp(74px, 9vh, 96px); transform: translateX(-50%);
  width: 26px; height: 42px; border-radius: 14px; border: 1.5px solid var(--line); display: none;
}
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--ink); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80%, 100% { transform: translateY(14px); opacity: 0; } }

@media (min-width: 1024px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(20px, 3vw, 56px); }
  .hero-copy { display: grid; gap: clamp(16px, 2.4vh, 28px); justify-items: start; align-content: center; }
  .hero-copy > * { order: 0; }
  .hero-stage { order: 0; height: min(74svh, 780px); min-height: 420px; }
  .hero h1 { font-size: clamp(4rem, 0.6rem + 5.5vw, 7.6rem); }
  .hero h1 span { white-space: nowrap; }
  .scroll-cue { display: block; bottom: 28px; }
  .hero { padding-bottom: clamp(64px, 9vh, 100px); }
}

/* world labels (positioned by JS) */
.world-labels { position: fixed; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.world-label {
  position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none; will-change: transform, opacity;
  display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; justify-items: start;
  padding: 7px 12px 7px 10px; border-radius: 12px; white-space: nowrap;
  background: rgba(10, 12, 24, 0.82); border: 1px solid var(--line);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.world-label i { grid-row: span 2; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.world-label b { font: 700 0.84rem / 1.15 var(--display); letter-spacing: 0; }
.world-label small { font: 500 0.62rem / 1.2 var(--mono); color: var(--muted); letter-spacing: 0.03em; }
.world-label:hover, .world-label.is-hover { border-color: var(--accent); background: rgba(10, 12, 24, 0.82); box-shadow: 0 0 0 1px var(--accent), 0 10px 30px -10px var(--accent); }
@media (max-width: 640px) {
  .world-label { padding: 5px 9px 5px 8px; }
  .world-label small { display: none; }
  .world-label b { font-size: 0.74rem; }
}

/* ============ project sections ============ */
.project {
  position: relative; min-height: 100vh; min-height: 100svh; display: grid; align-items: center;
  contain: layout style;
  padding: 56px var(--gutter) clamp(40px, 8vh, 96px);
}
.project-inner { width: 100%; max-width: 1760px; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.col { display: contents; }
.world-slot { order: 1; position: relative; height: clamp(180px, 30svh, 270px); pointer-events: none; }
.p-head { order: 2; }
.p-media { order: 3; }
.p-body { order: 4; }
.slot-ring {
  position: absolute; left: 50%; bottom: 6%; width: min(62%, 300px); aspect-ratio: 4 / 1; transform: translateX(-50%);
  border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 40px -6px var(--accent), inset 0 0 30px -10px var(--accent);
  opacity: 0.55;
}
.no-webgl .world-slot { display: none; }

.p-head { padding: clamp(20px, 2.4vw, 38px); display: grid; gap: clamp(10px, 1.3vh, 16px); justify-items: start; }
.p-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font: 500 0.72rem / 1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.p-index { color: var(--accent); font-weight: 600; }
.p-index::after { content: ''; display: inline-block; vertical-align: middle; width: 28px; height: 1px; margin-left: 12px; background: var(--accent); opacity: 0.6; }
.p-status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); color: var(--ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.p-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.p-title {
  font: 800 clamp(2.5rem, 1.5rem + 4.6vw, 5.4rem) / 0.94 var(--display); font-stretch: 80%; letter-spacing: -0.01em;
  background: linear-gradient(100deg, #fff 30%, var(--accent) 120%); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 0.06em;
}
.p-aka { font: 500 0.8rem / 1.3 var(--mono); color: var(--muted); letter-spacing: 0.02em; }
.p-aka span { color: var(--accent); margin: 0 0.3em; }
.p-tag { font: 500 clamp(1.08rem, 1rem + 0.5vw, 1.4rem) / 1.3 var(--display); color: var(--ink); text-wrap: balance; }
.p-blurb { color: var(--muted); max-width: 64ch; text-wrap: pretty; }
.p-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.p-body { padding: clamp(18px, 2vw, 30px); display: grid; gap: clamp(16px, 2vh, 24px); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-radius: var(--r-sm); overflow: hidden; background: var(--line-soft); border: 1px solid var(--line-soft); }
.stats .stat { padding: 14px 16px; background: rgba(10, 12, 24, 0.5); }
.stats .stat dd { color: var(--accent); }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 560px) { .stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.feats { display: grid; gap: 14px 26px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feats li { position: relative; padding-left: 18px; }
.feats li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.feats h3 { font: 600 0.98rem / 1.3 var(--body); }
.feats p { font-size: 0.9rem; line-height: 1.45; color: var(--muted); margin-top: 2px; text-wrap: pretty; }

/* media */
.p-media { display: grid; gap: 12px; min-width: 0; perspective: 1400px; }
.frame {
  --ry0: 0deg;
  position: relative; border-radius: var(--r); padding: clamp(6px, 0.7vw, 10px);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04) 45%, rgba(255, 255, 255, 0.1));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 40px 90px -36px rgba(0, 0, 0, 0.9), 0 0 70px -30px var(--accent);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, var(--ry0)));
  transform-style: preserve-3d;
  transition: transform 0.7s var(--ease);
}
.frame.is-tilting { transition-duration: 0.12s; }
.frame-main { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: calc(var(--r) - 7px); overflow: hidden; background: #05060c; cursor: zoom-in; }
.frame-main img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s, transform 0.9s var(--ease); }
.frame-main:hover img { transform: scale(1.03); }
.frame-main.is-swapping img { opacity: 0; }
.frame-shine { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s; background: radial-gradient(420px circle at var(--sx, 50%) var(--sy, 50%), rgba(255, 255, 255, 0.2), transparent 60%); mix-blend-mode: screen; }
.frame.is-tilting .frame-shine { opacity: 1; }
.frame-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 6, 12, 0.25); }
.frame-play[hidden] { display: none; }
.frame-play .ico-play { width: 72px; height: 72px; padding: 20px; border-radius: 50%; background: var(--accent); color: #0a0b14; box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 25%, transparent); }
.frame figcaption {
  position: absolute; left: clamp(14px, 1.6vw, 22px); bottom: clamp(14px, 1.6vw, 22px); right: clamp(14px, 1.6vw, 22px);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; pointer-events: none;
  transform: translateZ(34px);
}
.cap-text, .cap-count {
  font: 500 0.72rem / 1 var(--mono); padding: 8px 11px; border-radius: 999px;
  background: rgba(7, 8, 18, 0.86); border: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cap-count { flex: none; color: var(--accent); }

.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb {
  position: relative; flex: 0 0 clamp(76px, 20vw, 118px); aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; scroll-snap-align: start;
  border: 1px solid var(--line); opacity: 0.6; transition: opacity 0.25s, transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: 1; transform: translateY(-3px); }
.thumb.is-active { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -8px var(--accent); }
.thumb .ico-play { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px; padding: 6px; border-radius: 50%; background: var(--accent); color: #0a0b14; }

@media (min-width: 1024px) {
  .project-inner { grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); align-items: start; gap: clamp(24px, 3.2vw, 64px); }
  .col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
  .col-media { position: sticky; top: 84px; align-self: start; }
  .project.flip .col-text { order: 2; }
  .world-slot { order: 0; height: clamp(150px, 25vh, 310px); }
  .p-head, .p-media, .p-body { order: 0; }
  .project { padding-top: clamp(84px, 11vh, 120px); }
  .frame { --ry0: -7deg; }
  .project.flip .frame { --ry0: 7deg; }
  .thumb { flex-basis: clamp(88px, 7.4vw, 128px); }
}

/* ============ about ============ */
.about { padding: clamp(90px, 16vh, 180px) var(--gutter) clamp(40px, 8vh, 90px); }
.about-inner { max-width: 1760px; margin-inline: auto; display: grid; gap: clamp(28px, 5vh, 56px); }
.about-head { display: grid; gap: 18px; max-width: 980px; }
.about h2, .contact h2 { font: 800 clamp(2.3rem, 1.3rem + 5vw, 5.6rem) / 0.96 var(--display); font-stretch: 80%; letter-spacing: -0.01em; text-wrap: balance; }
.caps { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.cap { padding: clamp(18px, 1.8vw, 26px); display: grid; gap: 10px; align-content: start; transition: transform 0.4s var(--ease), border-color 0.3s; }
@media (hover: hover) { .cap:hover { transform: translateY(-6px); border-color: rgba(255, 255, 255, 0.28); } }
.cap-n { font: 500 0.72rem var(--mono); color: var(--live); letter-spacing: 0.08em; }
.cap h3 { font: 700 1.35rem / 1.1 var(--display); letter-spacing: -0.01em; }
.cap p { font-size: 0.93rem; line-height: 1.5; color: var(--muted); }
.principles { display: grid; gap: clamp(18px, 3vw, 44px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); counter-reset: p; padding-top: clamp(20px, 3vh, 36px); border-top: 1px solid var(--line); }
.principles li { counter-increment: p; display: grid; gap: 8px; align-content: start; }
.principles li::before { content: '0' counter(p); font: 500 0.72rem var(--mono); color: var(--live); letter-spacing: 0.08em; }
.principles h3 { font: 700 clamp(1.3rem, 1.1rem + 0.8vw, 1.8rem) / 1.1 var(--display); letter-spacing: -0.01em; }
.principles p { color: var(--muted); font-size: 0.96rem; max-width: 44ch; }

/* ============ contact ============ */
.contact { min-height: 92vh; min-height: 92svh; display: grid; grid-template-rows: 1fr auto; gap: 40px; padding: clamp(70px, 12vh, 140px) var(--gutter) calc(84px + env(safe-area-inset-bottom)); }
.contact-card { align-self: center; width: 100%; max-width: 1180px; margin-inline: auto; padding: clamp(26px, 5vw, 76px); display: grid; gap: clamp(16px, 2.4vh, 26px); justify-items: start; }
.contact-links { display: grid; gap: 12px; width: 100%; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin-top: 8px; }
.link-card {
  position: relative; display: grid; gap: 4px; padding: 18px 46px 18px 20px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05);
  transition: transform 0.3s var(--ease), background 0.3s, border-color 0.3s;
}
.link-card small { font: 500 0.7rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.link-card b { font: 700 1.25rem / 1.2 var(--display); overflow-wrap: anywhere; }
.link-card .ico { position: absolute; right: 18px; top: 20px; width: 18px; height: 18px; color: var(--live); }
.link-card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 0.1); border-color: var(--live); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font: 500 0.74rem var(--mono); color: var(--dim); max-width: 1760px; width: 100%; margin-inline: auto; }
.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1100px) { .contact { padding-bottom: 36px; } }

/* ============ lightbox ============ */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(5, 6, 12, 0.96); color: var(--ink);
}
.lightbox::backdrop { background: rgba(5, 6, 12, 0.5); }
.lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; animation: lb-in 0.3s var(--ease); }
@keyframes lb-in { from { opacity: 0; transform: scale(0.98); } }
.lb-stage { display: grid; place-items: center; min-height: 0; padding: clamp(56px, 8vh, 80px) clamp(12px, 6vw, 96px) 8px; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 12px; box-shadow: 0 30px 90px -20px #000; }
.lb-stage video { width: min(100%, 1280px); }
.lb-bar { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 12px 16px calc(18px + env(safe-area-inset-bottom)); font-size: 0.95rem; text-align: center; }
.lb-count { font: 500 0.74rem var(--mono); color: var(--muted); }
.lb-btn {
  position: absolute; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(20, 22, 40, 0.7); transition: background 0.2s, transform 0.2s var(--ease);
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.18); transform: scale(1.06); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: max(12px, env(safe-area-inset-top)); right: 14px; }
.lb-prev { left: 14px; top: 50%; margin-top: -24px; }
.lb-next { right: 14px; top: 50%; margin-top: -24px; }
@media (max-width: 640px) {
  .lb-prev, .lb-next { top: auto; bottom: calc(64px + env(safe-area-inset-bottom)); margin: 0; }
  .lb-stage { padding-bottom: 64px; }
}

/* ============ hiring details: role, availability, at-a-glance, email ============ */
.p-role { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 0.92rem; color: var(--ink); }
.p-role span { font: 500 0.68rem / 1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

.avail {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px;
  font-size: 0.9rem; font-weight: 600; color: var(--ink);
  border: 1px solid rgba(95, 240, 166, 0.4); background: rgba(95, 240, 166, 0.1);
}
.avail i { width: 8px; height: 8px; border-radius: 50%; background: #5ff0a6; box-shadow: 0 0 10px #5ff0a6; }
.hero-cta .btn-ghost .ico, .email-big .ico { width: 1.1em; height: 1.1em; }
.hero-cta a:hover > .ico, .email-big:hover > .ico { transform: none; }

.about-inner { grid-template-columns: minmax(0, 1fr); }
.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 0; padding: 6px; max-width: 1180px; min-width: 0; }
.glance > div { padding: clamp(14px, 1.6vw, 22px); display: grid; gap: 6px; align-content: start; }
.glance dt { font: 500 0.7rem / 1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--live); }
.glance dd { margin: 0; color: var(--ink); line-height: 1.45; }
.glance a { text-decoration: underline; text-decoration-color: var(--live); text-underline-offset: 3px; overflow-wrap: anywhere; }

.workflow { padding: clamp(20px, 2.6vw, 38px); max-width: 1180px; display: grid; gap: 16px; }
.workflow h3 { font: 700 clamp(1.3rem, 1rem + 1vw, 1.9rem) / 1.15 var(--display); }
.workflow ol { display: grid; gap: 4px 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.workflow li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.workflow li > span { font: 600 0.74rem / 1.6 var(--mono); color: var(--live); }
.workflow h4 { margin: 0 0 4px; font: 600 1rem / 1.3 var(--body); color: var(--ink); }
.workflow p { color: var(--muted); font-size: 0.95rem; line-height: 1.55; }

.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.email-big {
  display: inline-flex; align-items: center; gap: 0.5em; max-width: 100%;
  font: 700 clamp(1.25rem, 0.9rem + 2vw, 2.3rem) / 1.15 var(--display); color: var(--ink); overflow-wrap: anywhere;
  border-bottom: 2px solid color-mix(in srgb, var(--live) 70%, transparent); padding-bottom: 4px; transition: border-color 0.2s, color 0.2s;
}
.email-big .ico { color: var(--live); flex: none; }
.email-big:hover { color: #fff; border-color: var(--live); }

/* the mobile dock has seven projects to fit, so it scrolls instead of spilling off screen */
@media (max-width: 1099.98px) {
  .rail { overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .rail::-webkit-scrollbar { display: none; }
  .rail a { min-width: clamp(27px, 7.4vw, 42px); }
  .rail a.is-active { padding: 0 12px; }
  .rail a.is-active .rail-label { max-width: min(104px, 22vw); text-overflow: ellipsis; }
}

/* ============ reveal ============ */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .frame { transform: none !important; }
}

@media print {
  #stage, .veil, .rail, .top, .world-labels, .world-slot, .hero-stage, .scroll-cue { display: none !important; }
  body { background: #fff; color: #000; }
  .glass { background: none; border-color: #ccc; box-shadow: none; }
  .grad, .p-title { background: none; color: #000; -webkit-text-fill-color: #000; }
  .lede, .p-blurb, .stat dt, .glance dd, .p-role, .feats p { color: #222; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .lightbox, .copy-email, .p-links button { display: none !important; }
}

/* frame-rate readout, shown with ?stats on the address */
.stats-readout { position: fixed; left: 10px; bottom: 10px; z-index: 99; padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.8); color: #9fe870; font: 500 12px/1.4 var(--mono); pointer-events: none; white-space: pre; }
