/* =========================================================================
   Stage — cinematic intro (kinetic wordmark + orbiting proof)
   and the site-wide motion layer (spotlights, page entrances, grain).
   Everything here degrades to a calm static layout under reduced motion
   and without JavaScript.
   ========================================================================= */

/* Unbounded (SIL Open Font License), self-hosted variable font. Latin is
   preloaded; latin-ext only downloads if a page uses those characters. */
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/unbounded-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/unbounded-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Metric-matched stand-in while Unbounded loads: same wordmark width, so the
   swap is invisible and doesn't register as a later, larger LCP paint.
   (Arial Black 'MAGALONA' = 639.8 vs Unbounded 779.0 units -> 121.8%.) */
@font-face {
  font-family: 'Unbounded Fallback';
  src: local('Arial Black'), local('Arial-Black'), local('ArialBlack');
  size-adjust: 121.8%;
}

:root {
  --stage-ink: #f3f1eb;
  --stage-muted: #a3a29d;
  --stage-gold: #e8c879;
  --stage-ember: #ff7a45;
  --stage-violet: #8f7bff;
  --stage-bg: #0b0c0e;
  --font-display: 'Unbounded', 'Unbounded Fallback', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html.stage-off .stage {
  display: none;
}

.stage {
  --p: 0; /* scroll progress through the stage, 0..1 (set by JS) */
  --card-w: clamp(118px, 12.5vw, 214px);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  overflow: clip;
  color: var(--stage-ink);
  background: var(--stage-bg);
}

/* ---------- background ---------- */

.stage-bg,
.stage-bg > * {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stage-bg {
  z-index: -1;
}

.stage-aurora {
  inset: -20%;
  background:
    radial-gradient(38% 32% at 30% 38%, rgba(232, 200, 121, 0.16), transparent 70%),
    radial-gradient(34% 30% at 72% 58%, rgba(143, 123, 255, 0.14), transparent 70%),
    radial-gradient(30% 26% at 55% 30%, rgba(255, 122, 69, 0.10), transparent 70%);
  filter: blur(20px);
  animation: stage-aurora 22s ease-in-out infinite alternate;
}

@keyframes stage-aurora {
  0% { transform: translate3d(-2%, -1%, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(2%, 2%, 0) rotate(8deg) scale(1.06); }
  100% { transform: translate3d(-1%, 3%, 0) rotate(-6deg) scale(1.02); }
}

.stage-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center center;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, #000 10%, transparent 75%);
}

.stage-vignette {
  background:
    radial-gradient(ellipse 85% 70% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.65) 100%),
    linear-gradient(to bottom, transparent 70%, var(--polish-bg, #101113) 100%);
}

/* ---------- top bar ---------- */

.stage-nav {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(1240px, calc(100% - 48px));
  margin: 22px auto 0;
  padding: 8px 8px 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(16, 17, 19, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.stage-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--stage-gold), var(--stage-ember), var(--stage-violet), var(--stage-gold));
  color: #0b0c0e;
  font: 800 12px/1 var(--font-display);
  letter-spacing: 0.02em;
  text-decoration: none;
}

.stage-mark span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0b0c0e;
  color: var(--stage-ink);
}

.stage-nav-links {
  display: flex;
  gap: 4px;
  margin: 0 auto 0 0;
  padding: 0;
  list-style: none;
}

.stage-nav-links a,
.stage-nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--stage-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.stage-nav-links a:hover,
.stage-nav-links a:focus-visible {
  color: var(--stage-ink);
  background: rgba(255, 255, 255, 0.06);
}

.stage-nav-cta {
  color: #0b0c0e;
  background: var(--stage-ink);
  font-weight: 600;
}

.stage-nav-cta:hover,
.stage-nav-cta:focus-visible {
  background: var(--stage-gold);
}

/* ---------- orbit rings ---------- */

.stage-rings {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.stage-ring {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.stage-ring--base {
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
}

.stage-ring--faint {
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 1;
  stroke-dasharray: 2 8;
}

.stage-ring--a {
  stroke: url(#stage-ring-a);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 26 74;
  filter: drop-shadow(0 0 6px rgba(232, 200, 121, 0.55));
  animation: stage-ring-sweep 14s linear infinite;
}

.stage-ring--b {
  stroke: url(#stage-ring-b);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 16 84;
  filter: drop-shadow(0 0 6px rgba(143, 123, 255, 0.5));
  animation: stage-ring-sweep 22s linear infinite reverse;
}

@keyframes stage-ring-sweep {
  to { stroke-dashoffset: -100; }
}

/* ---------- orbit cards ---------- */

.stage-orbit {
  /* No z-index: cards must interleave with the copy (behind / in front). */
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.orbit-card {
  --n: 16;
  --a: calc(var(--i) * 360deg / var(--n) - 90deg + 180deg / var(--n));
  --roll: -7deg;
  --rx: min(43vw, 660px);
  --ry: clamp(140px, 27svh, 290px);
  /* Static depth from the same trig the JS uses: near = bottom of the ring. */
  --depth: calc((sin(var(--a)) + 1) / 2);
  position: absolute;
  top: 46%;
  left: 50%;
  width: var(--card-w);
  aspect-ratio: 10 / 7;
  margin: calc(var(--card-w) * -0.35) 0 0 calc(var(--card-w) * -0.5);
  /* Static fallback layout (no JS / reduced motion); JS replaces this per frame. */
  /* Same ellipse + roll as stage.ts, so JS picks up without a jump. */
  transform: translate3d(
      calc(cos(var(--a)) * var(--rx) * cos(var(--roll)) - sin(var(--a)) * var(--ry) * sin(var(--roll))),
      calc(cos(var(--a)) * var(--rx) * sin(var(--roll)) + sin(var(--a)) * var(--ry) * cos(var(--roll))),
      0)
    scale(calc(0.6 + var(--depth) * 0.55));
  pointer-events: auto;
  will-change: transform;
}

.orbit-card a {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  outline-offset: 4px;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.5s var(--ease-out-back);
}

.orbit-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: inherit;
  background: #1a1b1e;
  box-shadow:
    0 18px 40px -12px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(0, 0, 0, 0.4);
}

/* Depth shading: far cards sink into the dark. Cheap (opacity only). */
.orbit-card a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #0b0c0e;
  opacity: calc((1 - var(--depth)) * 0.72);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.orbit-card a:hover,
.orbit-card a:focus-visible {
  transform: rotate(0deg) scale(1.14);
}

.orbit-card a:hover::after,
.orbit-card a:focus-visible::after {
  opacity: 0;
}

.orbit-tag {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: 220px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(14, 15, 17, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--stage-ink);
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -6px);
  transition: opacity 0.25s ease, transform 0.35s var(--ease-out-expo);
  pointer-events: none;
}

.orbit-tag b {
  color: var(--stage-gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.orbit-card a:hover .orbit-tag,
.orbit-card a:focus-visible .orbit-tag {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Entrance runs from first paint (html.stage-on is set in <head>), so it
   never waits on JS. Only opacity/scale animate: JS owns transform. Fill is
   'backwards' so inline opacity (scroll fade) wins once it ends. */
.stage-on .orbit-card {
  animation: stage-card-in 1s var(--ease-out-expo) backwards;
  animation-delay: calc(var(--i) * 40ms + 180ms);
}

@keyframes stage-card-in {
  from { opacity: 0; scale: 0.7; }
}

/* ---------- center copy ---------- */

.stage-center {
  position: relative;
  align-self: center;
  display: grid;
  justify-items: center;
  gap: clamp(14px, 2.2vh, 24px);
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 6vh, 64px) 0 clamp(16px, 3vh, 32px);
  text-align: center;
  pointer-events: none;
}

/* The center is deliberately NOT a stacking context: orbit cards in front
   pass over the wordmark (z 5) but under the kicker, lede and CTAs (z 9). */
.stage-center > * {
  --fade: clamp(0, calc(1 - var(--p) * 1.35), 1);
  position: relative;
  z-index: 9;
  translate: 0 calc(var(--p) * -90px);
  opacity: var(--fade);
  pointer-events: auto;
}

.stage-center > .stage-wordmark {
  z-index: 5;
  translate: 0 calc(var(--p) * -60px);
  scale: calc(1 - var(--p) * 0.12);
}

.stage-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 14px 7px 10px;
  border: 1px solid rgba(232, 200, 121, 0.28);
  border-radius: 999px;
  background: rgba(24, 21, 14, 0.92);
  color: #e9dcb7;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5ee08f;
  box-shadow: 0 0 10px #5ee08f;
}

.stage-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid #5ee08f;
  animation: stage-pulse 2s ease-out infinite;
}

@keyframes stage-pulse {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(3); opacity: 0; }
}

.stage-wordmark {
  display: grid;
  margin: 0;
  color: var(--stage-ink);
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 9.2vw, 9.6rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-shadow: 0 10px 60px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.wm-line {
  display: block;
  /* Fixed line box: font swap cannot shift the layout below. */
  height: 0.98em;
  padding: 0 0.04em;
  overflow: hidden;
  white-space: nowrap;
}

.wm-char {
  display: inline-block;
  transform-origin: 50% 100%;
  font-variation-settings: 'wght' var(--w, 800);
  will-change: transform;
}

/* Gradient line: each letter paints its own slice of one wide gradient
   (pure CSS, so nothing has to be measured or re-rendered at runtime). */
.wm-line--grad .wm-char {
  background: linear-gradient(100deg, #f3f1eb 20%, var(--stage-gold) 55%, var(--stage-ember) 95%);
  background-size: calc(var(--chars) * 100%) 100%;
  background-position: calc(var(--k) * 100% / (var(--chars) - 1)) 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wm-char {
  transform: translate3d(0, var(--lift, 0px), 0);
  transition: transform 0.45s var(--ease-out-expo), font-variation-settings 0.45s ease;
}

/* Lines rise out of their own clip box at first paint. */
.stage-on .wm-line {
  animation: stage-line-in 1s var(--ease-out-expo) backwards;
  animation-delay: var(--line-delay, 60ms);
}

.stage-on .wm-line--grad {
  --line-delay: 150ms;
}

@keyframes stage-line-in {
  from { clip-path: inset(0 0 100% 0); transform: translate3d(0, 45%, 0); }
  to { clip-path: inset(0 0 -10% 0); transform: none; }
}

.stage-lede {
  max-width: 44ch;
  padding: 6px 16px;
  border-radius: 16px;
  /* Glass backing keeps the copy legible when a card glides behind it. */
  background: rgba(11, 12, 14, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
  margin: 0;
  color: var(--stage-muted);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.6;
}

.stage-rotator {
  position: relative;
  display: inline-block;
  vertical-align: bottom;
  color: var(--stage-ink);
  font-weight: 600;
  white-space: nowrap;
}

.stage-rotator::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--stage-gold), var(--stage-ember));
  transform-origin: left;
  animation: stage-underline 2.8s var(--ease-out-expo) infinite;
}

@keyframes stage-underline {
  0% { transform: scaleX(0); }
  25%, 80% { transform: scaleX(1); transform-origin: left; }
  81% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

.stage-rotator-word {
  display: inline-block;
}

.stage-rotator-word.is-out {
  animation: stage-word-out 0.4s var(--ease-out-expo) forwards;
}

.stage-rotator-word.is-in {
  animation: stage-word-in 0.6s var(--ease-out-expo) both;
}

@keyframes stage-word-out {
  to { opacity: 0; transform: translateY(-60%); filter: blur(4px); }
}

@keyframes stage-word-in {
  from { opacity: 0; transform: translateY(60%); filter: blur(4px); }
}

/* Staged entrance for the supporting copy (transform only on the way in;
   the scroll exit uses the independent `translate` property). */
.stage-on .stage-nav,
.stage-on .stage-kicker,
.stage-on .stage-lede,
.stage-on .stage-actions,
.stage-on .stage-stats,
.stage-on .stage-marquee,
.stage-on .stage-scroll {
  animation: stage-rise 0.9s var(--ease-out-expo) backwards;
}

.stage-on .stage-kicker { animation-delay: 0.05s; }
.stage-on .stage-lede { animation-delay: 0.38s; }
.stage-on .stage-actions { animation-delay: 0.48s; }
.stage-on .stage-stats { animation-delay: 0.58s; }
.stage-on .stage-marquee,
.stage-on .stage-scroll { animation-delay: 0.7s; }

@keyframes stage-rise {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
}

/* ---------- buttons ---------- */

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.stage-btn {
  --mx: 0px;
  --my: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  overflow: hidden;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform 0.35s var(--ease-out-expo), background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.3s ease;
}

.stage-btn > * {
  position: relative;
  z-index: 1;
}

.stage-btn--primary {
  color: #141414;
  background: var(--stage-gold);
  box-shadow: 0 10px 40px -10px rgba(232, 200, 121, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.stage-btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease-out-expo);
}

.stage-btn--primary:hover::before,
.stage-btn--primary:focus-visible::before {
  transform: translateX(120%);
}

.stage-btn--primary:hover,
.stage-btn--primary:focus-visible {
  box-shadow: 0 16px 50px -10px rgba(232, 200, 121, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.stage-btn--primary svg {
  transition: transform 0.35s var(--ease-out-expo);
}

.stage-btn--primary:hover svg {
  transform: translateX(4px);
}

.stage-btn--ghost {
  color: var(--stage-ink);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 21, 24, 0.92);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.stage-btn--ghost:hover,
.stage-btn--ghost:focus-visible {
  border-color: rgba(232, 200, 121, 0.55);
  background: #1f1c15;
}

/* ---------- stats ---------- */

.stage-stats {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: center;
  gap: 0;
  width: min(880px, calc(100% - 32px));
  margin: 0 auto clamp(18px, 3vh, 28px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  background: rgba(16, 17, 19, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  --fade: clamp(0, calc(1 - var(--p) * 1.5), 1);
  opacity: var(--fade);
}

.stage-stat {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 4px;
  padding: 14px clamp(16px, 3vw, 36px);
}

.stage-stat + .stage-stat {
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.stage-stat dt {
  color: var(--stage-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stage-stat dd {
  margin: 0;
  color: var(--stage-ink);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.3vw, 2rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.stage-stat dd span {
  display: inline; /* base reset makes every span a block */
}

.stage-stat-text {
  background: linear-gradient(90deg, var(--stage-gold), var(--stage-ember));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

/* ---------- marquee ---------- */

.stage-marquee {
  position: relative;
  z-index: 8;
  overflow: hidden;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.stage-marquee-track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  color: rgba(243, 241, 235, 0.42);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stage-marquee-track i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--stage-gold);
  opacity: 0.6;
}

.stage.is-live .stage-marquee-track {
  animation: stage-marquee 48s linear infinite;
}

.stage-marquee:hover .stage-marquee-track {
  animation-play-state: paused;
}

@keyframes stage-marquee {
  to { transform: translate3d(-50%, 0, 0); }
}

/* ---------- scroll cue ---------- */

.stage-scroll {
  position: absolute;
  right: clamp(16px, 3vw, 40px);
  /* Clears the fixed chat button (bottom 30px + 60px tall). */
  bottom: 112px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--stage-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-decoration: none;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.stage-scroll-line {
  position: relative;
  width: 1px;
  height: 56px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.stage-scroll-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, var(--stage-gold));
  animation: stage-scroll 2.2s var(--ease-out-expo) infinite;
}

@keyframes stage-scroll {
  from { transform: translateY(-100%); }
  to { transform: translateY(100%); }
}

/* ---------- responsive ---------- */

@media (max-width: 1023px) {
  .stage-scroll { display: none; }
  .orbit-card--extra { display: none; }
  .orbit-card { --n: 12; }
}

@media (max-width: 720px) {
  .stage {
    --card-w: clamp(92px, 26vw, 124px);
    min-height: 100svh;
  }

  .stage-nav {
    width: calc(100% - 24px);
    margin-top: 12px;
    gap: 8px;
  }

  .stage-nav-links {
    display: none;
  }

  .stage-nav-cta {
    margin-left: auto;
  }

  .stage-center {
    padding-top: max(300px, 37svh);
    gap: 14px;
  }

  .stage-wordmark {
    font-size: clamp(2.2rem, 11.4vw, 4.6rem);
  }

  .orbit-card {
    top: max(200px, 24svh);
    --rx: 40vw;
    --ry: clamp(56px, 9svh, 90px);
  }

  .stage-kicker {
    font-size: 10.5px;
  }

  .stage-btn {
    min-height: 46px;
    padding: 0 18px;
    font-size: 14px;
  }

  .stage-btn--ghost[href="/contact"] {
    display: none;
  }

  .stage-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stage-stat {
    padding: 12px 10px;
  }

  .stage-stat:nth-child(3) {
    border-left: 0;
  }

  .stage-stat:nth-child(n + 3) {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
  }
}

@media (max-height: 720px) and (min-width: 721px) {
  .stage-wordmark { font-size: clamp(2.8rem, 15vh, 7.5rem); }
  .stage-stats { margin-bottom: 12px; }
  .stage-stat { padding: 10px 24px; }
}

/* =========================================================================
   Site-wide motion layer
   ========================================================================= */

/* Film grain: adds texture to flat charcoal panels. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Display face on article titles ties the app to the intro. */
.article-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Cursor spotlight (span injected by motion-fx on first hover). */
.fx-host {
  position: relative;
}

.fx-spot {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--fx-x, 50%) var(--fx-y, 50%), rgba(232, 200, 121, 0.11), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.fx-spot::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--fx-x, 50%) var(--fx-y, 50%), rgba(232, 200, 121, 0.6), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.fx-host:hover > .fx-spot {
  opacity: 1;
}

/* Page entrance: sections of the newly active article cascade in. */
@keyframes fx-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 26px, 0);
    filter: blur(6px);
  }
}

article.fx-enter > * {
  animation: fx-rise 0.85s var(--ease-out-expo) both;
  animation-delay: calc(var(--fx-i, 0) * 70ms);
}

/* Scroll reveal: below-the-fold blocks and cards are opted in by JS
   (never anything already on screen), then rise, sharpen and settle in a
   stagger as they enter. Individual transform properties are used so they
   compose with hover tilts and existing transforms. */
.fx-r {
  opacity: 0;
  translate: 0 36px;
  scale: 0.97;
  filter: blur(8px);
}

.fx-r.fx-in {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  filter: blur(0);
  transition:
    opacity 0.8s ease,
    translate 1.1s var(--ease-out-expo),
    scale 1.1s var(--ease-out-expo),
    filter 0.8s ease;
  transition-delay: calc(var(--fx-d, 0) * 75ms);
}

/* Magnetic CTAs elsewhere in the app. */
[data-magnetic]:not(.stage-btn) {
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  transition: transform 0.35s var(--ease-out-expo);
}

/* Sliding nav indicator (element injected by motion-fx). */
.navbar.has-indicator .navbar-list {
  position: relative;
  z-index: 1;
}

.navbar.has-indicator .navbar-link.active {
  background: transparent;
}

.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(232, 200, 121, 0.16), rgba(232, 200, 121, 0.06));
  box-shadow: inset 0 0 0 1px rgba(232, 200, 121, 0.28), 0 6px 24px -10px rgba(232, 200, 121, 0.5);
  pointer-events: none;
  transition: transform 0.55s var(--ease-out-expo), width 0.55s var(--ease-out-expo), height 0.55s var(--ease-out-expo);
}

/* Profile avatar: a slowly turning brand ring instead of a flat box. */
@property --ring-spin {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.sidebar .avatar-box {
  position: relative;
  isolation: isolate;
  overflow: visible;
  border-color: transparent;
}

.sidebar .avatar-box::after {
  content: '';
  position: absolute;
  inset: -3px;
  z-index: -1;
  border-radius: calc(24px + 3px);
  background: conic-gradient(from var(--ring-spin), var(--stage-gold), var(--stage-ember), var(--stage-violet), #4fd1c5, var(--stage-gold));
  animation: ring-spin 7s linear infinite;
}

.sidebar .avatar-box::before {
  content: '';
  position: absolute;
  inset: -14px;
  z-index: -2;
  border-radius: 40px;
  background: conic-gradient(from var(--ring-spin), rgba(232, 200, 121, 0.35), rgba(143, 123, 255, 0.3), rgba(232, 200, 121, 0.35));
  filter: blur(18px);
  opacity: 0.55;
  animation: ring-spin 7s linear infinite;
}

.sidebar .avatar-box picture,
.sidebar .avatar-box img {
  position: relative;
  border-radius: 22px;
  background: var(--polish-panel-soft, #202226);
}

@keyframes ring-spin {
  to { --ring-spin: 360deg; }
}

@media (max-width: 1023px) {
  .sidebar .avatar-box::after { border-radius: 21px; }
  .sidebar .avatar-box picture,
  .sidebar .avatar-box img { border-radius: 16px; }
}

.sidebar .info-content .name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Featured work: slow push-in on hover. */
.featured-project-media {
  overflow: hidden;
}

.featured-project-media img {
  transition: transform 1.2s var(--ease-out-expo);
}

.featured-project:hover .featured-project-media img,
.featured-project:focus-visible .featured-project-media img {
  transform: scale(1.06);
}

/* =========================================================================
   Site redesign: the app shell speaks the intro's language.
   ========================================================================= */

/* ---------- ambient backdrop ---------- */

body {
  background: #0c0d0f;
}

/* Slow-drifting aurora behind every page (one fixed layer, GPU transform only). */
body::before {
  content: '';
  position: fixed;
  inset: -15%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 12% 18%, rgba(232, 200, 121, 0.075), transparent 70%),
    radial-gradient(34% 30% at 88% 28%, rgba(143, 123, 255, 0.07), transparent 70%),
    radial-gradient(40% 34% at 62% 92%, rgba(255, 122, 69, 0.055), transparent 70%);
  animation: ambient-drift 34s ease-in-out infinite alternate;
}

@keyframes ambient-drift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(3%, -2%, 0) rotate(6deg); }
  100% { transform: translate3d(-2%, 3%, 0) rotate(-4deg); }
}

/* ---------- headings: display face, kinetic words, drawn underline ---------- */

.featured-projects-heading h3,
.service-title,
.achievements-title,
.github-heatmap-title,
.section-title,
.selected-work h3,
.project-explorer-heading h3,
.workflow-heading h3,
.recruiter-cta-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.fx-split .fx-word {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
  vertical-align: top;
}

.fx-split .fx-word > span {
  display: inline-block;
  translate: 0 108%;
  rotate: 4deg;
  transform-origin: 0 100%;
}

.fx-split.fx-in .fx-word > span {
  translate: 0 0;
  rotate: 0deg;
  transition: translate 1s var(--ease-out-expo), rotate 1s var(--ease-out-expo);
  transition-delay: calc(var(--w, 0) * 55ms);
}

.article-title::after {
  background: linear-gradient(90deg, var(--stage-gold), var(--stage-ember)) !important;
  transform-origin: left;
}

.article-title.fx-split::after {
  transform: scaleX(0);
}

.article-title.fx-split.fx-in::after {
  transform: scaleX(1);
  transition: transform 1.1s var(--ease-out-expo) 0.35s;
}

/* Gradient-filled emphasis on the about headline. */
.recruiter-cta-title {
  background: linear-gradient(100deg, #f6f3ea 30%, var(--stage-gold) 75%, var(--stage-ember));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- cards: depth, light, response ---------- */

.featured-project,
.service-item,
.selected-work-card,
.gear-card,
.web-destination-card,
.stack-item,
.timeline-content,
.honors-stats > div,
.workflow-grid > li {
  transition:
    border-color 0.35s ease,
    box-shadow 0.5s var(--ease-out-expo),
    background-color 0.35s ease;
}

.featured-project:hover,
.service-item:hover,
.selected-work-card:hover,
.gear-card:hover,
.web-destination-card:hover,
.timeline-content:hover,
.workflow-grid > li:hover {
  border-color: rgba(232, 200, 121, 0.35);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(232, 200, 121, 0.08);
}

/* 3D tilt (transform set inline by motion-fx while hovered). */
.fx-tilt {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.6s var(--ease-out-expo), border-color 0.35s ease, box-shadow 0.5s var(--ease-out-expo);
}

.fx-tilt.is-tilting {
  transition: transform 0.12s linear, border-color 0.35s ease, box-shadow 0.5s var(--ease-out-expo);
}

/* Project imagery: slow push-in and a light sweep on hover. */
.project-item .project-img {
  overflow: hidden;
}

.project-item .project-img img {
  transition: transform 1.2s var(--ease-out-expo), filter 0.6s ease;
}

.project-item:hover .project-img img,
.project-item:focus-within .project-img img {
  transform: scale(1.07);
  filter: saturate(1.15);
}

.project-item .project-img::after,
.featured-project-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.16) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}

.featured-project-media {
  position: relative;
}

.project-item:hover .project-img::after,
.featured-project:hover .featured-project-media::after {
  transform: translateX(120%);
  transition: transform 1.1s var(--ease-out-expo);
}

/* Archive rows slide and light up. */
.project-explorer-timeline > li {
  transition: transform 0.45s var(--ease-out-expo), background-color 0.3s ease;
}

.project-explorer-timeline > li:hover {
  transform: translateX(6px);
  background-color: rgba(232, 200, 121, 0.035);
}

/* Service icons spin up on hover. */
.service-icon-box {
  transition: transform 0.6s var(--ease-out-back);
}

.service-item:hover .service-icon-box {
  transform: rotate(-8deg) scale(1.12);
}

/* Gear objects float. */
.gear-card .gear-visual {
  animation: fx-float 6s ease-in-out infinite;
  animation-delay: calc(var(--fx-float, 0) * -1.3s);
}

@keyframes fx-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

.gear-card:hover .gear-visual {
  scale: 1.06;
  transition: scale 0.6s var(--ease-out-back);
}

/* Build-loop steps: numbered chips glow in sequence. */
.workflow-grid > li strong {
  background: linear-gradient(90deg, var(--stage-gold), var(--stage-ember));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- timeline: the line draws itself as you read ---------- */

.timeline-container::after {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 30px;
  left: 15px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--stage-gold), var(--stage-ember) 70%, transparent);
  box-shadow: 0 0 12px rgba(232, 200, 121, 0.55);
  transform: scaleY(var(--tl, 0));
  transform-origin: top;
  pointer-events: none;
}

/* ---------- heatmap ripple ---------- */

.github-heatmap-grid.fx-ripple .github-heatmap-cell {
  animation: fx-cell 0.7s var(--ease-out-back) backwards;
  animation-delay: calc(var(--hc, 0) * 14ms);
}

@keyframes fx-cell {
  from { opacity: 0; scale: 0.2; }
}

/* ---------- tech marquee (Stack page) ---------- */

.fx-marquee {
  --skew: 0deg;
  position: relative;
  margin: 0 calc(clamp(24px, 3vw, 40px) * -1) 28px;
  padding: 18px 0;
  overflow: hidden;
  border-block: 1px solid rgba(255, 255, 255, 0.06);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.fx-marquee-row {
  display: flex;
  gap: 34px;
  width: max-content;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: skewX(var(--skew));
  animation: stage-marquee 40s linear infinite;
}

.fx-marquee-row + .fx-marquee-row {
  margin-top: 6px;
  animation-direction: reverse;
  animation-duration: 52s;
}

.fx-marquee-row span {
  display: inline-block;
  color: transparent;
  -webkit-text-stroke: 1px rgba(243, 241, 235, 0.28);
}

.fx-marquee-row span:nth-child(3n + 1) {
  color: rgba(243, 241, 235, 0.9);
  -webkit-text-stroke: 0;
}

.fx-marquee-row span:nth-child(5n + 2) {
  background: linear-gradient(90deg, var(--stage-gold), var(--stage-ember));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 0;
}

.fx-marquee:hover .fx-marquee-row {
  animation-play-state: paused;
}

@media (max-width: 720px) {
  .fx-marquee { margin-inline: -18px; }
}

/* ---------- honors: stat tiles and opened years ---------- */

.honors-stats > div strong {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.year-header .toggle-icon {
  transition: transform 0.5s var(--ease-out-back);
}

/* ---------- custom cursor: brighter, blends with content ---------- */

.custom-cursor {
  border-width: 1.5px;
  transition: width 0.45s var(--ease-out-expo), height 0.45s var(--ease-out-expo), background-color 0.3s ease, border-color 0.3s ease;
}

.custom-cursor.hovered {
  width: 72px;
  height: 72px;
  background-color: rgba(232, 200, 121, 0.14);
  backdrop-filter: blur(2px);
}

/* ---------- editorial type scale ---------- */

.recruiter-cta .recruiter-cta-title {
  font-size: clamp(34px, 4.4vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

/* Numbered section headings: 01, 02, 03 … per page (numbers set by
   motion-fx; CSS counters can't cross the sections' style containment). */
.featured-projects-heading h3,
.service-title,
.github-heatmap-title,
.achievements-title,
.timeline-section .section-title,
.selected-work h3,
.project-explorer-heading h3,
.workflow-heading h3 {
  font-size: clamp(22px, 2.3vw, 32px);
}

.featured-projects-heading h3::before,
.service-title::before,
.github-heatmap-title::before,
.achievements-title::before,
.timeline-section .section-title::before,
.selected-work h3::before,
.project-explorer-heading h3::before,
.workflow-heading h3::before {
  content: attr(data-fx-index);
  display: inline-block;
  margin-right: 0.7em;
  color: var(--stage-gold);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: 0.12em;
  vertical-align: 0.55em;
}

/* =========================================================================
   Layout v2: no boxes. Pages are full-bleed scenes on the living backdrop,
   one floating nav rides on top, and the profile closes every page as a
   big contact footer.
   ========================================================================= */

main#main-content {
  display: block;
  width: min(1320px, calc(100% - 64px));
  max-width: none;
  margin: 0 auto;
  padding: 108px 0 40px;
}

html.stage-on main#main-content {
  padding-top: 56px;
}

.main-content {
  width: 100%;
  margin: 0;
}

/* ---------- floating nav ---------- */

.main-content > nav.navbar {
  position: fixed;
  inset: 14px auto auto 50%;
  bottom: auto;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(940px, calc(100% - 24px));
  height: auto;
  margin: 0;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(13, 14, 16, 0.74);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  translate: -50% 0;
  transition: translate 0.7s var(--ease-out-expo), opacity 0.4s ease;
}

/* On the home route the intro has its own bar; the nav starts tucked (from
   first paint) and slides in once the intro scrolls away. */
html.stage-on:not(.nav-free) .main-content > nav.navbar {
  translate: -50% calc(-100% - 28px);
  opacity: 0;
  pointer-events: none;
}

.main-content > nav.navbar .navbar-list {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 2px;
  padding: 0;
}

.main-content > nav.navbar .navbar-item {
  flex: 0 1 auto;
}

.main-content > nav.navbar .navbar-link {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--stage-muted);
  font-size: 13px;
  font-weight: 500;
}

.main-content > nav.navbar .navbar-link:hover {
  color: var(--stage-ink);
  background: rgba(255, 255, 255, 0.05);
}

.main-content > nav.navbar .navbar-link.active {
  color: var(--stage-ink);
}

.nav-indicator {
  border-radius: 999px;
}

.nav-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: conic-gradient(from var(--ring-spin), var(--stage-gold), var(--stage-ember), var(--stage-violet), var(--stage-gold));
  animation: ring-spin 7s linear infinite;
  text-decoration: none;
}

.nav-mark span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0d0e10;
  color: var(--stage-ink);
  font: 800 11px/1 var(--font-display);
}

.nav-cta {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--stage-ink);
  color: #0d0e10;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.25s ease, transform 0.4s var(--ease-out-back);
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--stage-gold);
  transform: scale(1.04);
}

/* ---------- pages: no panel, just the scene ---------- */

.main-content > article[data-page] {
  position: relative;
  isolation: isolate;
  overflow: visible;
  overflow-x: clip;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  scroll-margin-top: 90px;
}

.main-content > article[data-page] > section,
.main-content > article[data-page] > .recruiter-cta {
  margin-block: 0 clamp(72px, 11vh, 132px);
}

/* Page hero: kicker, giant title, a hairline that draws itself. */
.page-hero {
  position: relative;
  margin: 0 0 clamp(40px, 6vh, 72px);
  padding: clamp(28px, 7vh, 88px) 0 clamp(28px, 4vh, 48px);
}

.page-hero::before {
  content: attr(data-kicker);
  display: block;
  margin-bottom: clamp(16px, 2.4vh, 26px);
  color: var(--stage-gold);
  font: 500 12px/1.2 ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.page-hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--stage-gold), rgba(255, 122, 69, 0.6) 30%, rgba(255, 255, 255, 0.08) 60%, transparent);
  transform-origin: left;
  animation: fx-draw 1.4s var(--ease-out-expo) 0.2s both;
}

article.fx-enter .page-hero::after {
  animation: fx-draw 1.4s var(--ease-out-expo) 0.25s both;
}

@keyframes fx-draw {
  from { transform: scaleX(0); }
}

.page-hero .article-title,
.main-content > article[data-page] .page-hero .article-title {
  margin: 0;
  padding: 0;
  /* 10.2vw keeps the longest word ("Background") on one line at 320px+. */
  font-size: clamp(32px, 10.2vw, 168px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.055em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.page-hero .article-title::after {
  content: none;
}

/* Giant outlined page name drifting behind the hero. */
.main-content > article[data-page]::before {
  content: attr(data-page);
  position: absolute;
  top: clamp(10px, 4vh, 40px);
  right: -0.04em;
  z-index: -1;
  color: transparent;
  font-family: var(--font-display);
  font-size: clamp(110px, 21vw, 340px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  -webkit-text-stroke: 1px rgba(232, 200, 121, 0.12);
  pointer-events: none;
}

.main-content > article.about::before { content: 'About'; }
.main-content > article.destinations::before { content: 'More'; }

@supports (animation-timeline: scroll()) {
  .main-content > article[data-page]::before {
    animation: fx-watermark linear both;
    animation-timeline: scroll(root);
  }

  @keyframes fx-watermark {
    to { translate: -30% 0; }
  }
}

/* About: the page's hero is the headline itself. */
.about > header {
  padding-top: clamp(24px, 6vh, 72px);
}

.about > header .article-title {
  margin: 0 0 24px;
  color: var(--stage-gold);
  font: 500 12px/1.2 ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: 0.22em;
}

.about > header .article-title::after {
  content: none;
}

.recruiter-cta {
  padding: 0 0 clamp(40px, 6vh, 64px);
  border: 0;
  background: none;
}

.recruiter-cta .recruiter-cta-title {
  max-width: 14ch;
  font-size: clamp(44px, 7vw, 112px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.recruiter-cta-copy > p:last-child {
  max-width: 54ch;
  font-size: clamp(16px, 1.45vw, 21px);
  line-height: 1.6;
}

/* Section headings become chapter openers. */
.featured-projects-heading h3,
.service-title,
.github-heatmap-title,
.achievements-title,
.selected-work h3,
.project-explorer-heading h3,
.workflow-heading h3 {
  font-size: clamp(28px, 3.6vw, 52px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.timeline-section .section-title {
  font-size: clamp(24px, 2.6vw, 36px);
}

/* Cards: quieter glass now that panels are gone. */
.featured-project,
.service-item,
.selected-work-card,
.gear-card,
.web-destination-card,
.timeline-content,
.achievement-card,
.github-heatmap,
.selected-work,
.project-explorer,
.workflow-section,
.timeline-section,
.honors-stats > div,
.year-header,
.stack-item {
  border-radius: 20px;
  border-color: rgba(255, 255, 255, 0.075);
  background-color: rgba(20, 21, 25, 0.62);
}

/* Project groups (rendered by projects-sort) get chapter headings too. */
.project-group-header {
  margin-bottom: 28px;
}

.project-group-title {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 52px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.project-group + .project-group {
  margin-top: clamp(64px, 10vh, 120px);
}

/* Availability pill (footer identity row). */
.sidebar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  padding: 5px 11px 5px 9px;
  border: 1px solid rgba(94, 224, 143, 0.25);
  border-radius: 999px;
  background: rgba(94, 224, 143, 0.06);
  color: #b9efcb;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-footer .social-link {
  transition: transform 0.4s var(--ease-out-back), color 0.25s ease, filter 0.25s ease;
}

.site-footer .social-link:hover,
.site-footer .social-link:focus-visible {
  transform: translateY(-4px) scale(1.08);
  filter: drop-shadow(0 6px 14px rgba(232, 200, 121, 0.45));
}

/* ---------- footer: the profile closes every page ---------- */

.sidebar-rail.site-footer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(36px, 5vh, 56px);
  width: 100%;
  min-width: 0;
  margin: clamp(48px, 8vh, 96px) 0 0;
  /* Bottom clearance so the floating command/chat buttons never sit on content. */
  padding: clamp(56px, 10vh, 120px) 0 96px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-cta {
  grid-column: 1 / -1;
}

.footer-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  color: var(--stage-gold);
  font: 500 12px/1.2 ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.footer-title {
  display: grid;
  margin: 0 0 clamp(28px, 4vh, 44px);
  font-family: var(--font-display);
  font-size: clamp(46px, 9.6vw, 160px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.footer-title span {
  display: block;
  color: var(--stage-ink);
}

.footer-title span + span {
  background: linear-gradient(100deg, #f3f1eb 10%, var(--stage-gold) 50%, var(--stage-ember) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-mail {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 6px;
  color: var(--stage-ink);
  font-size: clamp(20px, 2.8vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.footer-mail span {
  display: inline;
}

.footer-mail::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--stage-gold), var(--stage-ember));
  transform: scaleX(0.25);
  transform-origin: left;
  transition: transform 0.7s var(--ease-out-expo);
}

.footer-mail svg {
  transition: transform 0.5s var(--ease-out-back);
}

.footer-mail:hover::after,
.footer-mail:focus-visible::after {
  transform: scaleX(1);
}

.footer-mail:hover svg,
.footer-mail:focus-visible svg {
  transform: rotate(45deg) scale(1.15);
}

/* The old sidebar card, recomposed: identity, contacts and socials on the
   left, the contact form as a card on the right (stacks below 1024px).
   .sidebar-info_more becomes display:contents so its children (including the
   contact card injected by contact-flow) are placed directly by the grid. */
.site-footer .sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'id' 'contacts' 'socials' 'views' 'card';
  align-items: start;
  gap: 28px;
  width: 100%;
  margin: 0;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}

.site-footer .sidebar::before { content: none; }
.site-footer .sidebar-info_more { display: contents; }
.site-footer .sidebar-info_more > .separator { display: none; }

.site-footer .sidebar-info { grid-area: id; }
.site-footer .contacts-list { grid-area: contacts; }
.site-footer .social-list { grid-area: socials; }
.site-footer .visitor-counter { grid-area: views; justify-content: flex-start; margin: 0; }
.site-footer .contact-flow-card { grid-area: card; }

@media (min-width: 1024px) {
  .site-footer .sidebar {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
    grid-template-areas:
      'id card'
      'contacts card'
      'socials card'
      'views card';
    grid-template-rows: auto auto auto 1fr;
    column-gap: clamp(40px, 6vw, 96px);
  }
}

.site-footer .sidebar-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  gap: 18px;
  margin: 0;
  text-align: left;
}

.site-footer .avatar-box {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  margin: 0;
  border-radius: 20px;
}

.site-footer .avatar-box::after { border-radius: 23px; }
.site-footer .avatar-box picture,
.site-footer .avatar-box img { border-radius: 18px; }

.site-footer .info-content {
  align-items: flex-start;
  min-width: 0;
  text-align: left;
}

.site-footer .info-content .name {
  margin: 0 0 2px;
  font-size: clamp(20px, 2vw, 26px);
}

.site-footer .info-content .title {
  margin: 0;
}

.site-footer .sidebar-status {
  margin: 8px 0 0;
}

/* Contacts: a row of chips; the résumé link is a real button. */
.site-footer .contacts-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.site-footer .contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 6px 16px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(20, 21, 25, 0.62);
}

.site-footer .contact-item:first-child {
  padding: 0;
  border: 0;
  background: none;
}

.site-footer .contact-item .icon-box {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.site-footer .contact-info {
  min-width: 0;
  max-width: none;
  width: auto;
}

.site-footer .contact-title {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.site-footer .contact-link,
.site-footer .contact-item address {
  max-width: none;
  font-size: 13.5px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.site-footer .contact-link.resume {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: auto;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--stage-ink);
  color: #0d0e10;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.25s ease, transform 0.4s var(--ease-out-back);
}

.site-footer .contact-link.resume::after {
  content: '\2197';
  font-size: 15px;
  letter-spacing: 0;
}

.site-footer .contact-link.resume:hover,
.site-footer .contact-link.resume:focus-visible {
  background: var(--stage-gold);
  transform: translateY(-2px);
}

/* Socials: comfortable 44px targets. */
.site-footer .social-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  justify-self: start;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.site-footer .social-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: rgba(20, 21, 25, 0.62);
}

/* Contact card: same glass language as the rest of the site. */
.site-footer .contact-flow-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(20px, 2.4vw, 28px);
  border: 1px solid transparent;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(24, 25, 29, 0.92), rgba(15, 16, 19, 0.9)) padding-box,
    linear-gradient(155deg, rgba(232, 200, 121, 0.32), rgba(255, 255, 255, 0.05) 30%, rgba(143, 123, 255, 0.24)) border-box;
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.9);
}

.site-footer .contact-flow-card h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.03em;
}

.site-footer .contact-flow-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 420px) {
  .site-footer .contact-flow-actions {
    grid-template-columns: 1fr;
  }
}

.site-footer .release-sidebar {
  grid-column: 1 / -1;
  justify-self: start;
  width: min(100%, 440px);
  min-width: 0;
  border-radius: 16px;
  background: rgba(20, 21, 25, 0.62);
}

/* ---------- living backdrop: a glow that follows the cursor ---------- */

.fx-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 720px;
  height: 720px;
  margin: -360px 0 0 -360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 200, 121, 0.09), rgba(143, 123, 255, 0.05) 40%, transparent 70%);
  pointer-events: none;
  will-change: transform;
}

/* ---------- paragraphs light up word by word as you read ---------- */

.fx-scrub .fx-sw {
  display: inline;
  /* Unlit words stay readable (>= 4.5:1 on the backdrop); lit ones glow. */
  color: #85878c;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.fx-scrub .fx-sw.on {
  color: #f6f3ea;
  text-shadow: 0 0 18px rgba(232, 200, 121, 0.18);
}

/* ---------- v2 responsive ---------- */

@media (max-width: 1023px) {
  main#main-content {
    width: calc(100% - 40px);
    padding-top: 92px;
  }

}

@media (max-width: 720px) {
  main#main-content {
    width: calc(100% - 32px);
    padding-top: 78px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }

  html.stage-on main#main-content {
    padding-top: 40px;
  }

  .main-content > nav.navbar {
    top: 10px;
    width: calc(100% - 16px);
    padding: 4px;
    gap: 2px;
  }

  .nav-cta {
    display: none;
  }

  .nav-mark {
    width: 36px;
    height: 36px;
  }

  .nav-mark span {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }

  .main-content > nav.navbar .navbar-list {
    justify-content: space-between;
    gap: 0;
  }

  .main-content > nav.navbar .navbar-item {
    flex: 1 1 0;
  }

  .main-content > nav.navbar .navbar-link {
    width: 100%;
    min-height: 36px;
    padding: 0 2px;
    font-size: 0;
  }

  .main-content > nav.navbar .navbar-link::before {
    content: attr(data-mobile-label);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.3;
  }

  .sidebar-rail.site-footer {
    padding-bottom: 24px;
  }
}

/* Reserve the timeline filter bar's space until JS inserts it (no CLS). */
article.background:not(:has(.timeline-filter-bar)) > header {
  margin-bottom: calc(clamp(40px, 6vh, 72px) + 55px + 18px);
}

@media (max-width: 580px) {
  article.background:not(:has(.timeline-filter-bar)) > header {
    margin-bottom: calc(clamp(40px, 6vh, 72px) + 100px + 18px);
  }
}

/* =========================================================================
   Stress-test fixes
   ========================================================================= */

/* One focus ring everywhere. Several legacy rules set outline:none on
   :focus-visible, which left keyboard users with no visible position. */
:where(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid var(--stage-gold) !important;
  outline-offset: 3px !important;
}

/* The intro tucks the site nav away; if keyboard focus lands in it, show it. */
html.stage-on:not(.nav-free) .main-content > nav.navbar:focus-within {
  translate: -50% 0;
  opacity: 1;
  pointer-events: auto;
}

/* Experience certificate (inline-floated in the markup): keep it above its
   neighbours, and stack it full width on narrow screens instead of letting
   the company name paint over it. */
.timeline-content > div[style*="float"] {
  position: relative;
  z-index: 1;
}

@media (max-width: 600px) {
  .timeline-content > div[style*="float"] {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 16px !important;
  }
}

/* Deep links: until the router takes over (it removes data-route), show the
   requested page from first paint instead of the About page. */
html[data-route] .main-content > article[data-page] { display: none; }
html[data-route="about"] .main-content > article[data-page="about"],
html[data-route="stack"] .main-content > article[data-page="stack"],
html[data-route="background"] .main-content > article[data-page="background"],
html[data-route="projects"] .main-content > article[data-page="projects"],
html[data-route="gear"] .main-content > article[data-page="gear"],
html[data-route="destinations"] .main-content > article[data-page="destinations"] {
  display: block;
}

/* ---------- reduced motion: calm, static, complete ---------- */

@media (prefers-reduced-motion: reduce) {
  .stage-aurora,
  .stage-ring--a,
  .stage-ring--b,
  .stage-pulse::after,
  .stage-rotator::after,
  .stage-scroll-line::after,
  .stage.is-live .stage-marquee-track {
    animation: none !important;
  }

  .stage .wm-char,
  .stage .stage-center,
  .stage [class^='stage-'] {
    transition: none !important;
  }

  .stage-on .orbit-card,
  .stage-on .wm-line,
  .stage-on .stage-nav,
  .stage-on .stage-kicker,
  .stage-on .stage-lede,
  .stage-on .stage-actions,
  .stage-on .stage-stats,
  .stage-on .stage-marquee,
  .stage-on .stage-scroll {
    animation: none;
  }

  article.fx-enter > * {
    animation: none;
  }

  .sidebar .avatar-box::before,
  .sidebar .avatar-box::after {
    animation: none;
  }

  .nav-indicator,
  .featured-project-media img {
    transition: none;
  }

  .fx-r {
    opacity: 1;
    translate: none;
    scale: none;
    filter: none;
  }

  .fx-split .fx-word > span {
    translate: none;
    rotate: none;
  }

  .article-title.fx-split::after {
    transform: none;
  }

  body::before,
  .gear-card .gear-visual,
  .fx-marquee-row,
  .github-heatmap-grid.fx-ripple .github-heatmap-cell,
  .page-hero::after,
  .nav-mark,
  .main-content > article[data-page]::before {
    animation: none !important;
  }

  .fx-scrub .fx-sw {
    color: inherit;
  }

  .main-content > nav.navbar {
    transition: none;
  }

  .timeline-container::after {
    transform: none;
  }
}
