/* ============ base ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #04050a;
  --bg-soft: #0a0d18;
  --text: #eef1ff;
  --muted: #8b93b0;
  --line: rgba(255, 255, 255, 0.08);
  --cyan: #22d3ee;
  --magenta: #ff4d7d;
  --violet: #8b5cf6;
  --font-display: "Unbounded", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--magenta); color: #fff; }

a { color: inherit; text-decoration: none; }

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

/* ============ background layers ============ */
.bg {
  position: fixed; inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #0a0f1e 0%, var(--bg) 60%);
}

/* full-screen video slot: sources are injected from app.js (VIDEO_SOURCES).
   Falls back to the procedural neural field below when nothing loads. */
.bg-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06) translate(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -10px));
  filter: saturate(1.45) contrast(1.12) brightness(0.82);
  transition: opacity 1.4s ease;
  will-change: transform, opacity;
}
.bg-video.ready { opacity: 0.5; }

#bg-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  transform: translate(calc(var(--px, 0) * -22px), calc(var(--py, 0) * -16px));
  will-change: transform;
}

.bg-orb {
  position: absolute;
  width: 46vw; height: 46vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
  will-change: transform;
}
.bg-orb-1 { background: #0e7490; top: -16vw; left: -12vw; animation: orb1 26s ease-in-out infinite alternate; }
.bg-orb-2 { background: #9d174d; bottom: -20vw; right: -14vw; animation: orb2 34s ease-in-out infinite alternate; }

@keyframes orb1 { to { transform: translate(10vw, 8vh) scale(1.18); } }
@keyframes orb2 { to { transform: translate(-9vw, -7vh) scale(0.92); } }

.bg-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(4, 5, 10, 0.78) 0%,
    rgba(4, 5, 10, 0.5) 34%,
    rgba(4, 5, 10, 0.55) 66%,
    rgba(4, 5, 10, 0.9) 100%);
}

.bg-grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 95% 75% at 50% 0%, #000 15%, transparent 78%);
  transform: translate(calc(var(--px, 0) * -8px), calc(var(--py, 0) * -6px));
}

/* a light band slowly sweeping down the screen */
.bg-sweep {
  position: absolute; left: 0; right: 0;
  height: 180px;
  top: -220px;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.045) 45%, rgba(139, 92, 246, 0.05) 55%, transparent);
  animation: sweep 9s linear infinite;
  pointer-events: none;
}
@keyframes sweep { to { transform: translateY(calc(100vh + 440px)); } }

.bg-scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg,
    rgba(255, 255, 255, 0.025) 0 1px,
    transparent 1px 3px);
  opacity: 0.5;
  pointer-events: none;
}

.bg-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(2, 3, 6, 0.75) 100%);
  pointer-events: none;
}

.noise {
  position: absolute; inset: 0;
  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='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
}

/* ============ custom cursor ============ */
body.custom-cursor, body.custom-cursor * { cursor: none !important; }

.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-100px, -100px);
}
.cursor-dot { width: 7px; height: 7px; background: #fff; mix-blend-mode: difference; transition: opacity 0.2s; }
.cursor-ring {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  mix-blend-mode: difference;
  transition: width 0.25s, height 0.25s, border-color 0.25s, background 0.25s;
}
.cursor-label {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: #04050a;
  opacity: 0;
  transition: opacity 0.2s;
}
body.cursor-hover .cursor-ring { width: 62px; height: 62px; border-color: var(--cyan); }
body.cursor-play .cursor-ring {
  width: 78px; height: 78px;
  background: var(--cursor-accent, var(--cyan));
  border-color: var(--cursor-accent, var(--cyan));
  mix-blend-mode: normal;
}
body.cursor-play .cursor-label { opacity: 1; }
body.cursor-play .cursor-dot { opacity: 0; }

.cursor-fx {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9998;
  display: none;
}
body.custom-cursor .cursor-fx { display: block; }

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring, .cursor-fx { display: none !important; }
}

/* ============ scroll progress ============ */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 300;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta));
  transform: scaleX(var(--sp, 0));
  transform-origin: left;
  pointer-events: none;
}

/* ============ nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; gap: 32px;
  padding: 16px clamp(20px, 5vw, 64px);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(4, 5, 10, 0.5);
  border-bottom: 1px solid var(--line);
  transition: background 0.35s, box-shadow 0.35s;
}
.nav.scrolled {
  background: rgba(4, 5, 10, 0.82);
  box-shadow: 0 14px 44px -22px rgba(0, 0, 0, 0.85);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 800; font-size: 19px;
  letter-spacing: 0.06em;
  transition: text-shadow 0.3s;
}
.nav-logo:hover {
  text-shadow: 2px 0 rgba(255, 77, 125, 0.6), -2px 0 rgba(34, 211, 238, 0.6);
}
.nav-logo-dot { color: var(--cyan); }
.nav-logo-tag {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  color: var(--bg);
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  padding: 3px 7px;
  border-radius: 6px;
  margin-left: 8px;
  vertical-align: 2px;
  letter-spacing: 0.08em;
}
.nav-links { display: flex; gap: 24px; margin-left: auto; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 13px; color: var(--muted);
  letter-spacing: 0.06em;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--cyan);
  transition: width 0.25s;
}
.nav-links a::before {
  content: attr(data-text);
  position: absolute; inset: 0;
  opacity: 0;
  pointer-events: none;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover::before { animation: navGlitch 0.34s steps(2, end) 1; }
@keyframes navGlitch {
  0%   { opacity: 1; clip-path: inset(0 0 62% 0); transform: translate(-2px, -1px); color: var(--cyan); }
  33%  { opacity: 1; clip-path: inset(58% 0 0 0); transform: translate(2px, 1px); color: var(--magenta); }
  66%  { opacity: 1; clip-path: inset(26% 0 32% 0); transform: translate(-1px, 0); color: var(--cyan); }
  100% { opacity: 0; clip-path: none; transform: none; }
}
.nav-cta {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 9px 20px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 100px;
  color: var(--cyan);
  transition: background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.nav-cta:hover {
  background: var(--cyan); color: #04050a; border-color: var(--cyan);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.45);
}

/* ============ hero ============ */
.hero {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 92px clamp(20px, 5vw, 72px) 30px;
  min-height: min(54vh, 540px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* giant outline word floating behind the title */
.hero-ghost {
  position: absolute;
  left: 50%; top: 46%;
  transform: translate(-50%, -50%);
  translate: calc(var(--px, 0) * 36px) calc(var(--py, 0) * 24px + var(--sy, 0) * 0.1px);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(90px, 21vw, 300px);
  letter-spacing: 0.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(140, 160, 255, 0.08);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  animation: ghostDrift 16s ease-in-out infinite alternate;
}
@keyframes ghostDrift {
  from { transform: translate(-53%, -52%) rotate(-1.5deg); }
  to   { transform: translate(-47%, -48%) rotate(1.5deg); }
}

.hero-main {
  position: relative;
  translate: calc(var(--px, 0) * -12px) calc(var(--py, 0) * -8px);
  opacity: calc(1 - var(--sy, 0) / 640);
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 18px;
  opacity: 0.9;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 6.6vw, 96px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  display: flex; flex-direction: column;
  position: relative;
}
.hero-title .line { display: block; min-height: 1.04em; position: relative; }

/* staggered letter entrance (spans injected by JS) */
.hero-title .ch { display: inline-block; overflow: hidden; vertical-align: bottom; }
.hero-title .ch-in {
  display: inline-block;
  transform: translateY(115%) rotate(7deg);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(140ms + var(--i, 0) * 42ms);
}
.hero.in .hero-title .ch-in { transform: translateY(0) rotate(0deg); }

@property --shim {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.hero-title .gradient,
.hero-title .gradient.split .ch-in {
  background-image: linear-gradient(92deg, var(--cyan) 0%, var(--violet) 22%, var(--magenta) 50%, var(--violet) 78%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-title .gradient {
  background-size: 200% 100%;
  background-position: calc(var(--shim) * 100%) 0;
  animation: shimmer 7s linear infinite, rgbFlick 6s steps(1) infinite;
}
/* background-clip:text on the line can't see glyphs inside the transformed letter
   spans (Chrome keeps only the first one — the lone "R"), so once JS splits the line
   every letter paints its own slice of the same line-wide gradient (--lw / --ox) */
.hero-title .gradient.split { background-image: none; }
.hero-title .gradient.split .ch-in {
  background-size: calc(var(--lw) * 2) 100%;
  background-position: calc(var(--shim) * var(--lw) * -1 - var(--ox)) 0;
}
.hero-title:hover .gradient {
  text-shadow: 2px 0 rgba(255, 77, 125, 0.4), -2px 0 rgba(34, 211, 238, 0.4);
}
@keyframes shimmer { to { --shim: 2; } }
@keyframes rgbFlick {
  0%, 90%, 100% { text-shadow: none; transform: none; }
  91% { text-shadow: 4px 0 rgba(255, 77, 125, 0.55), -4px 0 rgba(34, 211, 238, 0.55); transform: translateX(3px) skewX(-2deg); }
  93% { text-shadow: -4px 0 rgba(255, 77, 125, 0.55), 4px 0 rgba(34, 211, 238, 0.55); transform: translateX(-3px); }
  95% { text-shadow: 2px 0 rgba(255, 77, 125, 0.4), -2px 0 rgba(34, 211, 238, 0.4); transform: none; }
}

@keyframes blink { 50% { opacity: 0.2; } }

.hero-sub {
  margin-top: 22px;
  max-width: 520px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
}

.hero-scroll {
  margin-top: 28px;
  display: inline-flex; align-items: center; gap: 14px;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s;
}
.hero-scroll i {
  width: 1px; height: 36px;
  background: linear-gradient(180deg, var(--cyan), transparent);
  position: relative;
  overflow: hidden;
  display: block;
}
.hero-scroll i::after {
  content: "";
  position: absolute; left: 0; top: -40%;
  width: 100%; height: 40%;
  background: #fff;
  animation: scrollDrip 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes scrollDrip { to { top: 110%; } }
.hero-scroll:hover { color: var(--cyan); }

/* ============ section headings ============ */
.sec-head {
  display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap;
  margin-bottom: 30px;
}
.sec-index {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 100px;
  padding: 4px 12px;
}
.sec-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 4.4vw, 52px);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
}
.sec-sub {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ============ games section ============ */
.games {
  padding: 0 clamp(20px, 5vw, 72px) 64px;
  max-width: 1400px;
  margin: 0 auto;
}

#games, #experiments, #process, #explore { scroll-margin-top: 96px; }
.experiments .sec-index {
  color: #b69cff;
  border-color: rgba(182, 156, 255, 0.35);
}

/* ============ games grid & card ============ */
.games-grid {
  --grid-gap: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  perspective: 1600px;
}
.experiments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.experiments-grid .card-media { aspect-ratio: 16 / 9; }

@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.game-card {
  --accent: var(--cyan);
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(165deg, rgba(13, 17, 32, 0.82), rgba(7, 9, 18, 0.72));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transition: border-color 0.35s, box-shadow 0.35s;
}
.game-card:hover {
  border-color: transparent;
  box-shadow:
    0 30px 70px -28px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}

/* rotating conic border glow on hover */
.game-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--spin),
    transparent 0deg,
    color-mix(in srgb, var(--accent) 85%, #fff) 40deg,
    transparent 90deg,
    transparent 360deg);
  -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, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 3;
}
.game-card:hover::before { opacity: 1; animation: spin 2.6s linear infinite; }
@keyframes spin { to { --spin: 360deg; } }

/* cursor-following glare */
.game-card::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--accent) 13%, transparent), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
  z-index: 2;
}
.game-card:hover::after { opacity: 1; }

.card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: #05060d;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.card-media canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.game-card:hover .card-media canvas { transform: scale(1.045); }
.card-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4, 5, 10, 0.25), transparent 30%, transparent 70%, rgba(4, 5, 10, 0.45));
  pointer-events: none;
}

.card-num {
  position: absolute; top: 14px; left: 14px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  background: rgba(4, 5, 10, 0.6);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 4px 12px;
  border-radius: 100px;
  backdrop-filter: blur(6px);
}

.card-status {
  position: absolute; top: 14px; right: 14px;
  z-index: 2;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text);
  background: rgba(4, 5, 10, 0.6);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 100px;
  backdrop-filter: blur(6px);
}
.card-status i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink 1.6s steps(2, start) infinite;
}

.card-body {
  padding: 22px 22px 24px;
  display: flex; flex-direction: column;
  gap: 12px;
  flex: 1;
}
.card-body h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}
.card-body h3 em {
  display: block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-top: 5px;
}
.card-body p { color: var(--muted); font-size: 14.5px; line-height: 1.55; }

.card-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.card-tags span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 4px 11px;
  transition: border-color 0.3s, color 0.3s;
}
.game-card:hover .card-tags span {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: color-mix(in srgb, var(--accent) 80%, #fff);
}

.card-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: auto;
}
.card-actions .card-link { margin-top: 0; }

.card-link {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 100px;
  padding: 12px 26px;
  position: relative;
  overflow: hidden;
  transition: color 0.3s, transform 0.25s, box-shadow 0.3s;
}
.card-link::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: -1;
}
.card-link:hover {
  color: #04050a;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.card-link:hover::before { transform: scaleX(1); }
.card-link svg { transition: transform 0.3s; position: relative; }
.card-link:hover svg { transform: translate(2px, -2px); }

/* a card that owns a whole row: media under columns 1–2, text under column 3 */
@media (min-width: 1201px) {
  .game-card--wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: calc((200% - var(--grid-gap)) / 3) 1fr;
  }
  .game-card--wide .card-media {
    aspect-ratio: auto;
    min-height: 300px;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
}

/* ============ marquee ============ */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  background: rgba(255, 255, 255, 0.02);
}
.marquee-track {
  display: flex; width: max-content;
  animation: marquee 26s linear infinite;
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee-track.js-run { animation: none; will-change: transform; }

/* ============ stats strip ============ */
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.stats-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 72px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 34px 26px;
  border-left: 1px solid var(--line);
  transition: background 0.35s;
}
.stat:first-child { border-left: none; }
.stat:hover { background: rgba(255, 255, 255, 0.03); }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
  background: linear-gradient(92deg, #fff 20%, var(--cyan) 70%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-inf { animation: infPulse 3.2s ease-in-out infinite; }
@keyframes infPulse { 50% { opacity: 0.55; } }
.stat-label {
  display: block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
}

/* ============ pipeline ============ */
.pipeline {
  max-width: 1400px;
  margin: 0 auto;
  padding: 84px clamp(20px, 5vw, 72px) 10px;
}
.pipe-steps {
  list-style: none;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding-top: 40px;
}
.pipe-steps::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.35s;
}
.pipe-steps.visible::before { transform: scaleX(1); }
.pipe-step {
  position: relative;
  padding: 20px 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(13, 17, 32, 0.7), rgba(7, 9, 18, 0.55));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s, box-shadow 0.35s;
}
.pipe-step::before {
  content: "";
  position: absolute; top: -45px; left: 20px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--cyan);
  transition: background 0.3s, box-shadow 0.3s;
}
.pipe-step:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 24px 50px -30px rgba(34, 211, 238, 0.45);
}
.pipe-step:hover::before {
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}
.pipe-num {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--cyan);
}
.pipe-step h3 {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 15px; font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color 0.3s;
}
.pipe-step:hover h3 { color: var(--cyan); }
.pipe-step p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ============ final cta ============ */
.cta {
  max-width: 1400px;
  margin: 0 auto;
  padding: 84px clamp(20px, 5vw, 72px) 90px;
}
.cta-links { border-top: 1px solid var(--line); }
.cta-link {
  --accent: var(--cyan);
  position: relative;
  display: flex; align-items: center; gap: clamp(16px, 3vw, 34px);
  padding: clamp(20px, 3vw, 30px) 12px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.cta-link::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 13%, transparent), transparent 65%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
.cta-link:hover::before { transform: scaleX(1); }
.cta-era {
  position: relative;
  width: 150px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}
.cta-name {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3.8vw, 46px);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), color 0.35s;
}
.cta-arrow {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s;
}
.cta-link:hover .cta-name { transform: translateX(14px); color: var(--accent); }
.cta-link:hover .cta-era { color: var(--accent); }
.cta-link:hover .cta-arrow { transform: translate(6px, -6px) scale(1.15); color: var(--accent); }

/* ============ footer ============ */
.footer {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  padding: 44px clamp(20px, 6vw, 80px) 40px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
}
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-brand p {
  font-size: 13.5px;
  max-width: 280px;
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  width: fit-content;
  position: relative;
  transition: color 0.25s, transform 0.25s;
}
.footer-links a:hover { color: var(--cyan); transform: translateX(6px); }
.footer-meta {
  align-items: flex-end;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
}
.footer-dot { color: var(--cyan); }

/* ============ reveal animation ============ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============ responsive ============ */
@media (max-width: 1200px) {
  .games-grid { grid-template-columns: 1fr; max-width: 720px; margin: 0 auto; }
  .experiments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
  .card-media { aspect-ratio: 16 / 8; }
  .pipe-steps { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }
}

@media (max-width: 900px) {
  .nav { flex-wrap: wrap; gap: 12px 20px; }
  .nav-links { order: 3; width: 100%; gap: 24px; }
  .nav-links .nav-process { display: none; }
  .nav-cta { margin-left: auto; }
  .hero { min-height: 44vh; padding-top: 138px; }
  #games, #experiments, #process, #explore { scroll-margin-top: 138px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 30px 20px; }
  .stat:nth-child(odd) { border-left: none; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .sec-sub { margin-left: 0; width: 100%; }
  .footer { grid-template-columns: 1fr; gap: 30px; }
  .footer-meta { align-items: flex-start; text-align: left; }
}

@media (max-width: 760px) {
  .experiments-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .pipe-steps { grid-template-columns: 1fr; }
  .cta-era { display: none; }
  .hero-main { translate: none; }
}

@media (max-width: 520px) {
  .hero-eyebrow { font-size: 11px; letter-spacing: 0.12em; }
  .nav-logo { font-size: 16px; }
  .nav-cta { padding: 10px 16px; }
  .nav-links { justify-content: space-between; gap: 12px; }
  .nav-links a { font-size: 11px; }
  .card-body { padding: 18px 18px 20px; }
}

@media (max-width: 350px) {
  .nav { column-gap: 10px; }
  .nav-logo { font-size: 15px; }
  .hero-title { font-size: 22px; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  .bg-video { display: none; }
  .hero-ghost, .hero-main { translate: none; opacity: 1; }
  .pipe-steps::before { transform: scaleX(1); }
}
