/* ============================================================
   Luke — Cinnamon Night · 3D · alive
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
em {
  font-style: italic;
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--accent-2);
}

:root {
  /* Neutral near-white base */
  --bg:           #fafafa;
  --bg-2:         #f1f1f1;
  --bg-3:         #ebebeb;
  --surface:      rgba(0, 0, 0, 0.03);
  --surface-2:    rgba(0, 0, 0, 0.05);
  --surface-3:    #f4f4f4;

  /* Monochrome text */
  --text:         #0a0a0a;
  --text-2:       #525252;
  --dim:          #737373;
  --muted:        #a3a3a3;

  /* Black & White accent palette */
  --accent:       #0a0a0a;   /* black */
  --accent-2:     #525252;   /* mid-gray */
  --accent-warm:  #2a2a2a;   /* dark gray */
  --accent-mint:  #737373;   /* dim gray */
  --accent-soft:  rgba(0, 0, 0, 0.08);
  --accent-glow:  rgba(0, 0, 0, 0.22);

  /* UI chrome stays neutral black */
  --brand:        #0a0a0a;
  --brand-2:      #1f1f1f;
  --brand-deep:   #2e2e2e;
  --brand-soft:   rgba(0, 0, 0, 0.06);
  --brand-glow:   rgba(0, 0, 0, 0.18);

  --line:         rgba(0, 0, 0, 0.10);
  --line-strong:  rgba(0, 0, 0, 0.20);

  --shadow-sm:    0 4px 14px -8px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 16px 36px -16px rgba(0,0,0,0.22), 0 4px 14px -6px rgba(0,0,0,0.08);
  --shadow-lg:    0 36px 80px -28px rgba(0,0,0,0.28), 0 14px 32px -18px rgba(0,0,0,0.10);
  --shadow-glow:  0 0 0 1px rgba(0, 0, 0, 0.22), 0 28px 60px -16px rgba(0, 0, 0, 0.18);

  --grad:         linear-gradient(135deg, #0a0a0a 0%, #5c5c5c 50%, #2a2a2a 100%);
  --grad-warm:    linear-gradient(135deg, #0a0a0a 0%, #737373 50%, #525252 100%);
  --grad-soft:    linear-gradient(135deg, rgba(0,0,0,0.12), rgba(80,80,80,0.06));
  --display:      'Geist', system-ui, sans-serif;
  --mono:         'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-lg:    24px;
  --radius-md:    18px;
  --radius-sm:    12px;
  --radius-arch:  50% 50% 24px 24px / 28% 28% 24px 24px;
  --radius-arch-tall: 50% 50% 26px 26px / 22% 22% 26px 26px;
}

::selection { background: var(--accent); color: #fafafa; }

/* ============================================================
   Background — simple solid near-white, no animated layers
   ============================================================ */

/* ============================================================
   3D Floating cubes — reusable decoration
   ============================================================ */
.cube-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  perspective: 1000px;
  overflow: visible;
  z-index: 0;
}
.cube-wrap {
  position: absolute;
  width: var(--cube-size, 64px);
  height: var(--cube-size, 64px);
  pointer-events: none;
  animation: cube-float var(--float-dur, 7s) ease-in-out infinite alternate;
  animation-delay: var(--float-delay, 0s);
  opacity: var(--cube-op, 0.85);
  transform-style: preserve-3d;
}
.cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: cube-rotate var(--spin-dur, 14s) linear infinite;
  animation-direction: var(--spin-dir, normal);
}
.cube .f {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 0, 0, 0.45);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.25)),
    rgba(245, 245, 245, 0.7);
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.08),
    0 0 18px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: calc(var(--cube-size, 64px) * 0.18);
  color: rgba(0, 0, 0, 0.7);
  letter-spacing: 0.04em;
}
.cube .f.front  { transform: translateZ(calc(var(--cube-size, 64px) / 2)); }
.cube .f.back   { transform: translateZ(calc(var(--cube-size, 64px) / -2)) rotateY(180deg); }
.cube .f.right  { transform: rotateY(90deg)  translateZ(calc(var(--cube-size, 64px) / 2)); }
.cube .f.left   { transform: rotateY(-90deg) translateZ(calc(var(--cube-size, 64px) / 2)); }
.cube .f.top    { transform: rotateX(90deg)  translateZ(calc(var(--cube-size, 64px) / 2)); }
.cube .f.bottom { transform: rotateX(-90deg) translateZ(calc(var(--cube-size, 64px) / 2)); }

@keyframes cube-rotate {
  0%   { transform: rotateX(0deg)   rotateY(0deg)   rotateZ(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(180deg); }
}
@keyframes cube-float {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(var(--float-x, 10px), var(--float-y, -28px), 0); }
}

/* Solid variant — for stronger contrast */
.cube.is-solid .f {
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.88), rgba(70, 70, 70, 0.78));
  border-color: rgba(0, 0, 0, 0.7);
  color: #f5f5f5;
}
/* Wireframe variant — only edges (transparent faces) */
.cube.is-wire .f {
  background: transparent;
  border-color: rgba(0, 0, 0, 0.45);
  box-shadow: none;
  backdrop-filter: none;
}

@media (max-width: 760px) {
  .cube-wrap { transform: scale(0.7); }
}

/* ============================================================
   Code decorations — Luau accents
   ============================================================ */
.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.code-chip::before {
  content: '--';
  color: var(--brand-2);
  font-weight: 600;
}

.studio-stripe {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--brand);
  opacity: 0.32;
  letter-spacing: 0.06em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  pointer-events: none;
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: max(1.4rem, env(safe-area-inset-top)) max(2.4rem, env(safe-area-inset-right)) 1.4rem max(2.4rem, env(safe-area-inset-left));
  font-size: 0.92rem;
  transition: background 0.4s ease, border-color 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(250, 250, 250, 0.78);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--line);
  box-shadow: 0 12px 30px -22px rgba(0, 0, 0, 0.20);
  padding-top: max(0.85rem, env(safe-area-inset-top));
  padding-bottom: 0.85rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; font-family: var(--display); font-weight: 700; font-size: 1.4rem; letter-spacing: -0.02em; color: var(--text); }
.brand-mark { width: 14px; height: 14px; background: var(--grad); border-radius: 4px; transform: rotate(45deg); display: inline-block; box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.45); }
.brand-name { color: inherit; transition: color 0.3s ease; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  color: var(--text-2);
  position: relative;
  padding: 0.3rem 0;
  letter-spacing: 0.01em;
  transition: color 0.3s ease;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a::after { content: ''; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0; background: var(--accent); transition: width 0.3s ease; }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--brand);
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.nav-cta:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.45);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  z-index: 102;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-backdrop {
  display: none;
}

@media (max-width: 820px) {
  .nav {
    padding: max(1rem, env(safe-area-inset-top)) max(1.2rem, env(safe-area-inset-right)) 1rem max(1.2rem, env(safe-area-inset-left));
  }
  .nav.scrolled {
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-bottom: 0.75rem;
  }
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 101;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    width: min(320px, 88vw);
    padding: max(5.5rem, calc(env(safe-area-inset-top) + 4.5rem)) 1.6rem max(2rem, env(safe-area-inset-bottom));
    background: rgba(250, 250, 250, 0.97);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-left: 1px solid var(--line);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.18);
    transform: translateX(105%);
    transition: transform 0.4s cubic-bezier(0.2, 0.85, 0.2, 1);
    overflow-y: auto;
  }
  .nav.open .nav-menu { transform: translateX(0); }
  .nav.open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }
  .nav.open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 1.6rem;
  }
  .nav-links a {
    display: block;
    padding: 0.95rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
  }
  .nav-links a::after { display: none; }
  .nav-cta {
    justify-content: center;
    padding: 0.85rem 1.2rem;
    font-size: 0.85rem;
  }
}

/* ============================================================
   HERO — transparent over canvas
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 8rem 2.4rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  color: var(--text);
  isolation: isolate;
}
.hero > * { position: relative; z-index: 2; }

.hero-meta {
  position: absolute;
  top: 7rem;
  left: 2.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  letter-spacing: 0.06em;
  padding: 0.55rem 0.95rem;
  background: rgba(245, 245, 245, 0.8);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-glow); }
  50%      { box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.04); }
}

.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 12vw, 11rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin: 0 0 1.5rem;
  max-width: 1400px;
  color: var(--text);
  text-shadow: 0 4px 30px rgba(250, 250, 250, 0.65);
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .word {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 1s cubic-bezier(0.2, 0.85, 0.2, 1), opacity 1s ease;
}
.hero-title .grad {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-style: italic;
}
.hero-title .line:nth-child(2) .word { transition-delay: 0.12s; }
.hero-title .line:nth-child(3) .word { transition-delay: 0.24s; }
.loaded .hero-title .word { transform: translateY(0); opacity: 1; }

.grad {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

/* Reserved area for the tile mosaic — bio/footer sit below */
.hero-tiles-stage {
  position: relative;
  width: 100%;
  min-height: clamp(300px, 42vh, 540px);
  margin-bottom: 2.5rem;
  flex-shrink: 0;
  z-index: 1;
}

.hero-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2.4rem;
  flex-wrap: wrap;
  margin-top: 0;
  border-top: 1px solid var(--line-strong);
  padding-top: 2.4rem;
  flex-shrink: 0;
  width: 100%;
}
@media (max-width: 760px) { .hero-foot { grid-template-columns: 1fr; gap: 1.4rem; } }

.hero-left { display: flex; flex-direction: column; gap: 1.2rem; }
.hero-lead {
  max-width: 460px;
  font-size: 1.08rem;
  color: var(--text-2);
  margin: 0;
}
.hero-lead strong { color: var(--accent); font-weight: 600; }

.hero-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.hs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line-strong);
  color: var(--text);
  transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.hs-btn svg { width: 16px; height: 16px; opacity: 0.9; }
.hs-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  transform: translateY(-2px);
}
.hs-btn.copied {
  background: rgba(0, 0, 0, 0.08);
  border-color: var(--accent-mint);
  color: var(--accent-mint);
}

.cta-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 1.05rem;
  padding: 0.5rem 0;
  position: relative;
  color: var(--text);
  font-weight: 500;
}
.cta-arrow span { position: relative; }
.cta-arrow span::after {
  content: '';
  position: absolute; left: 0; bottom: -4px;
  height: 1.5px; width: 100%;
  background: currentColor;
  transform-origin: right center;
  transition: transform 0.5s cubic-bezier(0.7, 0, 0.3, 1);
}
.cta-arrow:hover span::after { transform-origin: left center; transform: scaleX(0); }
.cta-arrow svg { transition: transform 0.4s ease; color: var(--accent); }
.cta-arrow:hover svg { transform: translateX(8px); }

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  right: 2.4rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--text-2);
  z-index: 2;
}
.scroll-line { width: 1px; height: 60px; background: linear-gradient(to bottom, transparent, var(--accent)); position: relative; overflow: hidden; }
.scroll-line::before {
  content: ''; position: absolute; top: -20px; left: 0;
  width: 1px; height: 20px;
  background: var(--accent-2);
  animation: scroll-down 1.6s linear infinite;
}
@keyframes scroll-down { 0% { top: -20px; } 100% { top: 60px; } }

/* ============================================================
   Shared section heads
   ============================================================ */
.eyebrow {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.eyebrow::before {
  content: '--';
  color: var(--accent-warm);
  font-weight: 600;
  letter-spacing: 0;
}

.big-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 0;
  color: var(--text);
}

.section-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7.2vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
  margin: 0;
  color: var(--text);
}
.section-title .line { display: block; }
.section-title .indent-1 { padding-left: 0; }
.section-title .indent-2 { padding-left: 1.1em; }
.section-title .indent-3 { padding-left: 2em; }
.section-title.is-big { font-size: clamp(2.6rem, 9vw, 7rem); letter-spacing: -0.05em; line-height: 0.95; }

/* Italic title lines — soft violet emphasis */
.section-title em,
.studio-name em,
.massive em {
  color: var(--accent-2);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
}

@media (max-width: 760px) {
  .section-title .indent-2 { padding-left: 0.6em; }
  .section-title .indent-3 { padding-left: 1.1em; }
}

/* ============================================================
   Studios — premium credentials
   ============================================================ */
.roles {
  padding: 6rem 2.4rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}
.roles-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.roles-head .eyebrow { margin-bottom: 1rem; }
.roles .studio-stripe { top: 7rem; right: 1rem; }

.studio-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 4rem;
}

.studio-card {
  position: sticky;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 2rem;
  padding: 4rem;
  min-height: 420px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.85, 0.2, 1),
              border-color 0.45s ease,
              box-shadow 0.45s ease;
}
.studio-card:nth-child(1) { top: 120px; z-index: 1; }
.studio-card:nth-child(2) { top: 140px; z-index: 2; }

@media (max-width: 880px) {
  .studio-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    padding: 2.5rem;
    min-height: auto;
  }
  .studio-card:nth-child(1) { top: 100px; }
  .studio-card:nth-child(2) { top: 116px; }
}

.studio-card::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% -10%, rgba(0, 0, 0, 0.06), transparent 55%),
    radial-gradient(ellipse at -10% 110%, rgba(0, 0, 0, 0.04), transparent 60%);
  pointer-events: none;
}
.studio-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 60%, var(--brand-2) 100%);
  opacity: 0;
  transition: opacity 0.55s ease;
  z-index: 0;
}
.studio-card > * { position: relative; z-index: 1; transform-style: preserve-3d; }
.studio-card:hover {
  box-shadow: var(--shadow-glow);
  border-color: transparent;
}
.studio-card:hover::after { opacity: 1; }
.studio-card:hover, .studio-card:hover * { color: #ffffff; }

.studio-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  transform: translateZ(30px);
}

.studio-top {
  display: flex;
  align-items: center;
}
.studio-role {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(0, 0, 0, 0.18);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}
.studio-card:hover .studio-role {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.studio-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  transform-style: preserve-3d;
}

.studio-icon {
  width: 180px;
  height: 180px;
  object-fit: contain;
  transform: translateZ(60px);
  transition: transform 0.6s cubic-bezier(0.2, 0.85, 0.2, 1);
}

/* Indigo is black text on transparent bg — show as-is on light theme */
.indigo-icon {
  filter: none;
}
.studio-card:hover .indigo-icon {
  filter: invert(1) brightness(2);
}

.studio-card:hover .studio-icon {
  transform: translateZ(90px) scale(1.1) rotateY(-12deg) rotateX(8deg);
}

@media (max-width: 880px) {
  .studio-icon { width: 120px; height: 120px; }
  .studio-visual { order: -1; justify-content: flex-start; padding-bottom: 1rem; }
}

.studio-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  letter-spacing: -0.04em;
  line-height: 0.92;
  margin: 0;
  color: var(--text);
}
.studio-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.studio-meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--dim);
  letter-spacing: 0.06em;
  transition: color 0.4s ease;
}
.studio-card:hover .studio-meta { color: rgba(255, 255, 255, 0.82); }
.studio-arrow {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 52px; height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.65);
  transition: transform 0.5s cubic-bezier(0.2, 0.85, 0.2, 1),
              background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}
.studio-card:hover .studio-arrow {
  transform: rotate(45deg);
  background: #ffffff;
  border-color: #ffffff;
  color: #0a0a0a;
}

/* ============================================================
   Games — deck of cards carousel
   ============================================================ */
.games {
  padding: 4rem 2.4rem 6rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}
.carousel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2.6rem;
  flex-wrap: wrap;
}
.carousel-meta {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.cr-count {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--dim);
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}
.cr-count strong {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.05rem;
  margin-right: 0.4rem;
}
.cr-controls { display: flex; gap: 0.6rem; }
.cr-btn {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.45s cubic-bezier(0.2, 0.85, 0.2, 1),
              border-color 0.4s ease, color 0.4s ease, background 0.4s ease;
  box-shadow: var(--shadow-sm);
}
.cr-btn:hover {
  border-color: var(--brand);
  color: #ffffff;
  background: var(--brand);
  transform: translateY(-2px);
}

.deck {
  position: relative;
  width: 100%;
  height: 580px;
  perspective: 1600px;
  user-select: none;
  margin: 0 auto;
}
@media (max-width: 1080px) { .deck { height: 640px; } }
@media (max-width: 900px)  { .deck { height: 760px; } }
@media (max-width: 640px)  { .deck { height: 820px; } }

.deck-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(86%, 920px);
  height: 100%;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.85s cubic-bezier(0.2, 0.85, 0.2, 1),
              opacity 0.65s ease,
              filter 0.65s ease,
              box-shadow 0.65s ease;
  cursor: pointer;
  opacity: 0; pointer-events: none;
}

.deck-card[data-offset="0"] {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  z-index: 50;
  pointer-events: auto;
}
.deck-card[data-offset="1"] {
  transform: translate(-50%, -50%) translateX(46%) rotateY(-24deg) scale(0.90);
  opacity: 0.78;
  z-index: 40;
  filter: blur(0.4px);
  pointer-events: auto;
}
.deck-card[data-offset="-1"] {
  transform: translate(-50%, -50%) translateX(-46%) rotateY(24deg) scale(0.90);
  opacity: 0.78;
  z-index: 40;
  filter: blur(0.4px);
  pointer-events: auto;
}
.deck-card[data-offset="2"] {
  transform: translate(-50%, -50%) translateX(82%) rotateY(-38deg) scale(0.78);
  opacity: 0.38;
  z-index: 30;
  filter: blur(1.5px);
  pointer-events: auto;
}
.deck-card[data-offset="-2"] {
  transform: translate(-50%, -50%) translateX(-82%) rotateY(38deg) scale(0.78);
  opacity: 0.38;
  z-index: 30;
  filter: blur(1.5px);
  pointer-events: auto;
}
@media (max-width: 760px) {
  .deck-card[data-offset="1"],
  .deck-card[data-offset="-1"],
  .deck-card[data-offset="2"],
  .deck-card[data-offset="-2"] {
    transform: translate(-50%, -50%) scale(0.96) translateY(-12px);
    opacity: 0;
    pointer-events: none;
    filter: none;
  }
}

.deck-card .slide-inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 1.4rem;
  height: 100%;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.45s ease, box-shadow 0.45s ease;
}
.deck-card[data-offset="0"] .slide-inner {
  border-color: rgba(0, 0, 0, 0.28);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.08);
}
@media (max-width: 900px) {
  .deck-card .slide-inner {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding: 1.1rem;
    overflow: auto;
  }
}

.slide-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  overflow: hidden;
  display: block;
  background: var(--bg-3);
  border: 1px solid var(--line);
  transform: perspective(900px) rotateX(0deg) rotateY(0deg);
  transition: transform 0.55s cubic-bezier(0.2, 0.85, 0.2, 1), box-shadow 0.55s ease;
}
.deck-card[data-offset="0"] .slide-cover:hover {
  box-shadow: var(--shadow-glow);
}
.slide-cover .glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.32) 0%,
    rgba(255, 255, 255, 0) 45%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  mix-blend-mode: overlay;
  z-index: 3;
}
.deck-card[data-offset="0"] .slide-cover:hover .glare { opacity: 1; }
.cover-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.9s cubic-bezier(0.2, 0.85, 0.2, 1);
}
.slide-cover:hover .cover-img { transform: scale(1.05); }
.rank {
  position: absolute; top: 1rem; left: 1rem; z-index: 4;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  color: #ffffff;
  background: var(--brand);
  font-weight: 600;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.4);
}
.play-pill {
  position: absolute; bottom: 1rem; right: 1rem; z-index: 4;
  background: rgba(10, 10, 10, 0.78);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  letter-spacing: 0.04em;
  transform: translateY(6px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.slide-cover:hover .play-pill { transform: translateY(0); opacity: 1; }

.slide-info { padding-right: 1rem; }
.slide-studio {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.20);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  margin-bottom: 1rem;
}
.slide-info h3 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 1rem;
  line-height: 1.05;
  color: var(--text);
}
.game-tags {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-bottom: 1.2rem;
}
.game-tags li {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.6);
}
.slide-stats {
  display: flex; gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.slide-stats div {
  flex: 1;
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.slide-stats div:hover { transform: translateY(-2px); border-color: var(--brand); }
.slide-stats strong {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.slide-stats span {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cr-dots {
  display: flex; justify-content: center; gap: 0.6rem;
  margin-top: 1.6rem;
}
.cr-dot {
  width: 28px; height: 6px;
  border-radius: 999px;
  background: var(--line-strong);
  border: 0;
  transition: width 0.4s ease, background 0.4s ease;
}
.cr-dot:hover { background: var(--muted); }
.cr-dot.active { width: 52px; background: var(--grad); }

.deck-autoplay-bar {
  margin: 1.4rem auto 0;
  max-width: 280px;
  height: 2px;
  background: var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.deck-autoplay-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  background: var(--brand);
  border-radius: 999px;
}

/* ============================================================
   Stats — big numbers + 3D floating cubes
   ============================================================ */
.stats {
  padding: 5rem 2.4rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}
.stats-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: end;
  margin-bottom: 2.6rem;
}
.stats-head p {
  margin: 0;
  max-width: 460px;
  color: var(--text-2);
  font-size: 1.06rem;
  justify-self: end;
}
@media (max-width: 900px) {
  .stats-head { grid-template-columns: 1fr; gap: 1.4rem; }
  .stats-head p { justify-self: start; }
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  perspective: 1400px;
  perspective-origin: 50% 30%;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: 1fr; } }

.big-stat-shell {
  position: relative;
  overflow: visible;
}
.big-stat-cubes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}
.big-stat {
  position: relative;
  z-index: 2;
  padding: 2rem 2.2rem 2.2rem;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  overflow: visible;
  isolation: isolate;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.85, 0.2, 1),
              box-shadow 0.45s ease, border-color 0.45s ease;
}
.big-stat::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at top right, rgba(0, 0, 0, 0.05), transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(0, 0, 0, 0.04), transparent 50%);
  z-index: -1;
  pointer-events: none;
}
.big-stat:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-glow);
}
.big-stat .bs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.big-stat .bs-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-2);
  border: 1px solid var(--line-strong);
}
.big-stat .bs-code {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
  letter-spacing: 0.06em;
}
.big-stat .bs-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.2rem, 8vw, 6.5rem);
  letter-spacing: -0.05em;
  line-height: 0.9;
  display: block;
  margin-bottom: 0.5rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px var(--accent-glow);
}
.big-stat .bs-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 1.4rem;
}
.bs-bars {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.bs-bars li {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
}
.bs-bars .bar-title {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-bars .bar-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.10);
  overflow: hidden;
}
.bs-bars .bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  background: var(--grad);
  border-radius: 999px;
  transition: width 1.2s cubic-bezier(0.2, 0.85, 0.2, 1);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
}
.big-stat.in-view .bs-bars .bar-fill { width: var(--w, 0%); }
.bs-bars .bar-value {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--dim);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .bs-bars li { grid-template-columns: 1fr auto; }
  .bs-bars .bar-track { grid-column: 1 / -1; }
}

/* Stat card cubes — sibling layer (outside tilted card) */
.big-stat-shell .cube-wrap.bs-cube-1 {
  top: -34px; right: 28px;
  --cube-size: 56px;
  --float-y: -18px; --float-x: 8px;
  --float-dur: 8s; --float-delay: -2s;
  --spin-dur: 18s;
  z-index: 3;
}
.big-stat-shell .cube-wrap.bs-cube-2 {
  bottom: -42px; left: 32px;
  --cube-size: 72px;
  --float-y: -24px; --float-x: -10px;
  --float-dur: 11s; --float-delay: -4s;
  --spin-dur: 22s;
  --spin-dir: reverse;
  z-index: 3;
}
.big-stat-shell .cube-wrap.bs-cube-3 {
  top: 38%; right: -14px;
  --cube-size: 38px;
  --float-y: 24px; --float-x: -6px;
  --float-dur: 6s; --float-delay: -1s;
  --spin-dur: 10s;
  z-index: 3;
}
@media (max-width: 760px) {
  .big-stat-shell .cube-wrap.bs-cube-3 { display: none; }
}

/* ============================================================
   Code editor — Luau preview
   ============================================================ */
.code-section {
  padding: 5rem 2.4rem 4rem;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}
.code-head { margin: 0 0 2.6rem; max-width: 800px; }
.code-lead {
  font-size: 1.02rem;
  color: var(--text-2);
  margin: 1rem 0 0;
  max-width: 540px;
}
.code-lead strong { color: var(--accent-mint); font-weight: 600; }

.editor {
  background: linear-gradient(180deg, #161616 0%, #0d0d0d 100%);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  color: #f5f5f5;
}
.editor::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 60%);
  pointer-events: none;
}
.editor-bar {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255,0.10);
  background: rgba(0,0,0,0.45);
  position: relative; z-index: 1;
}
.bar-dots { display: flex; gap: 0.4rem; }
.bar-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.bar-dot.d-r { background: #5a5a5a; opacity: 0.8; }
.bar-dot.d-a { background: #fafafa; opacity: 0.9; }
.bar-dot.d-g { background: #5a5a5a; opacity: 0.75; }
.bar-tab {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255,0.08);
  border: 1px solid rgba(255, 255, 255,0.14);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #f5f5f5;
}
.bar-tab svg { color: var(--accent-mint); }
.bar-copy {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255,0.14);
  background: rgba(255, 255, 255,0.05);
  color: #f5f5f5;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.bar-copy:hover { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.bar-copy.copied { color: #fff; border-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.18); }
.editor-body {
  position: relative; z-index: 1;
  padding: 1.2rem 0.5rem 1.5rem;
  background: linear-gradient(180deg, rgba(14, 14, 14,0) 0%, rgba(14, 14, 14,0.4) 100%);
  max-height: 540px; overflow: auto;
}
.editor-body::-webkit-scrollbar { width: 10px; height: 10px; }
.editor-body::-webkit-scrollbar-track { background: transparent; }
.editor-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255,0.15); border-radius: 999px; }
.editor-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255,0.25); }
.code {
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.65;
  margin: 0;
  color: #f5f5f5;
  counter-reset: ln;
  tab-size: 2;
  -moz-tab-size: 2;
  white-space: pre;
}
.code .ln {
  display: block;
  padding-left: 4.5rem;
  position: relative;
  transition: background 0.2s ease;
  border-left: 2px solid transparent;
  counter-increment: ln;
}
.code .ln::before {
  content: counter(ln);
  position: absolute; left: 0; top: 0;
  width: 3.4rem;
  text-align: right;
  color: rgba(255, 255, 255, 0.25);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
}

.code .ln:hover {
  background: rgba(255, 255, 255, 0.06);
  border-left-color: var(--accent-mint);
}

/* Luau syntax — VS Code / Luau LSP palette (isolated from site accents) */
.editor {
  --luau-directive: #c586c0;
  --luau-comment: #6a9955;
  --luau-keyword: #c586c0;
  --luau-constant: #569cd6;
  --luau-type: #4ec9b0;
  --luau-function: #dcdcaa;
  --luau-property: #9cdcfe;
  --luau-string: #ce9178;
  --luau-number: #b5cea8;
  --luau-builtin: #4fc1ff;
  --luau-identifier: #d4d4d4;
  --luau-operator: #d4d4d4;
  --luau-punctuation: #808080;
}
.editor .code .tk-d   { color: var(--luau-directive); font-style: italic; }
.editor .code .tk-c   { color: var(--luau-comment); font-style: italic; }
.editor .code .tk-k   { color: var(--luau-keyword); }
.editor .code .tk-b   { color: var(--luau-constant); }
.editor .code .tk-t   { color: var(--luau-type); }
.editor .code .tk-fn  { color: var(--luau-function); }
.editor .code .tk-prop{ color: var(--luau-property); }
.editor .code .tk-s   { color: var(--luau-string); }
.editor .code .tk-n   { color: var(--luau-number); }
.editor .code .tk-bi  { color: var(--luau-builtin); }
.editor .code .tk-id  { color: var(--luau-identifier); }
.editor .code .tk-o   { color: var(--luau-operator); }
.editor .code .tk-p   { color: var(--luau-punctuation); }

.editor-foot {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid rgba(255, 255, 255,0.10);
  background: rgba(0,0,0,0.45);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.05em;
  position: relative; z-index: 1;
  flex-wrap: wrap;
}
.ef-tag { color: var(--accent-mint); font-weight: 600; }
.ef-sep { color: rgba(255,255,255,0.18); }

/* ============================================================
   Editor deck — stacked, swipeable code cards
   ============================================================ */
.editor-deck {
  position: relative;
  --drag-x-raw: 0;
  --drag-progress: 0;
}

/* Top tab bar (segmented control) */
.editor-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  padding: 0.32rem;
  margin-bottom: 1.1rem;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 100%;
  overflow: hidden;
}
.editor-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.25s ease;
}
.editor-tab > svg { color: var(--accent-mint); opacity: 0.55; transition: opacity 0.25s ease; flex-shrink: 0; }
.editor-tab:hover:not(.is-active) { color: var(--text); }
.editor-tab.is-active { color: var(--text); }
.editor-tab.is-active > svg { opacity: 1; }
.editor-tab-indicator {
  position: absolute;
  z-index: 0;
  top: 0.32rem;
  left: 0;
  height: calc(100% - 0.64rem);
  width: 0;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  transform: translate3d(0, 0, 0);
  transition:
    transform 0.5s cubic-bezier(0.2, 0.85, 0.2, 1),
    width 0.5s cubic-bezier(0.2, 0.85, 0.2, 1);
  will-change: transform, width;
  pointer-events: none;
}

/* Card stack */
.editor-stack {
  position: relative;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  isolation: isolate;
}
.editor-stack .editor {
  transition:
    transform 0.55s cubic-bezier(0.2, 0.85, 0.2, 1),
    opacity 0.45s ease;
  transform: translate3d(0, 22px, 0) scale(0.96);
  transform-origin: 50% 0%;
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
  will-change: transform, opacity;
}
.editor-stack .editor:not(:first-child) {
  position: absolute;
  inset: 0;
}
.editor-stack .editor.is-active {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

/* While dragging — suppress transitions & follow pointer */
.editor-stack.is-dragging .editor { transition: none; }
.editor-stack.is-dragging .editor.is-active {
  transform:
    translate3d(calc(var(--drag-x-raw) * 1px), 0, 0)
    rotate(calc(var(--drag-x-raw) * 0.025deg));
}
.editor-stack.is-dragging .editor:not(.is-active):not(.is-exiting) {
  transform:
    translate3d(0, calc((1 - var(--drag-progress)) * 22px), 0)
    scale(calc(0.96 + var(--drag-progress) * 0.04));
  opacity: calc(0.5 + var(--drag-progress) * 0.5);
}

/* Fly-off state when card is dismissed */
.editor.is-exiting {
  transform:
    translate3d(calc(var(--exit-dir, 1) * 130%), 0, 0)
    rotate(calc(var(--exit-dir, 1) * 8deg)) !important;
  opacity: 0 !important;
  transition:
    transform 0.55s cubic-bezier(0.4, 0, 0.4, 1),
    opacity 0.45s ease !important;
  z-index: 3 !important;
  pointer-events: none !important;
}
.editor.no-transition { transition: none !important; }

/* Pager dots */
.editor-deck-pager {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 2.2rem;
}
.edp-dot {
  width: 26px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition:
    background 0.3s ease,
    width 0.45s cubic-bezier(0.2, 0.85, 0.2, 1);
}
.edp-dot:hover { background: rgba(0, 0, 0, 0.28); }
.edp-dot.is-active {
  background: rgba(0, 0, 0, 0.85);
  width: 44px;
  cursor: default;
}

/* Reveal applied to the deck itself instead of each card */
.editor-deck[data-reveal] { opacity: 0; transform: translateY(36px); }
.editor-deck[data-reveal].in { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
  .editor-tabs {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .editor-tabs::-webkit-scrollbar { display: none; }
  .editor-tab { font-size: 0.72rem; padding: 0.5rem 0.7rem; }
  .editor-stack .editor { transform: translate3d(0, 16px, 0) scale(0.97); }
  .editor-stack .editor.is-active { transform: translate3d(0, 0, 0) scale(1); }
  .editor-stack.is-dragging .editor:not(.is-active):not(.is-exiting) {
    transform:
      translate3d(0, calc((1 - var(--drag-progress)) * 16px), 0)
      scale(calc(0.97 + var(--drag-progress) * 0.03));
  }
}

@media (prefers-reduced-motion: reduce) {
  .editor-stack .editor,
  .editor.is-exiting,
  .editor-tab-indicator,
  .edp-dot { transition: opacity 0.2s ease; }
  .editor-stack .editor:not(.is-active) { opacity: 0; transform: none; }
}

/* ============================================================
   About — minimalist paragraph
   ============================================================ */
.about {
  padding: 8rem 2.4rem 7rem;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  text-align: left;
}
.about-inner {
  max-width: 860px;
}
.about-inner .section-title {
  margin-bottom: 2.4rem;
}
.about-paragraph {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 1.6rem;
  max-width: 760px;
  font-weight: 400;
}
.about-paragraph strong { color: var(--accent); font-weight: 600; }
.about-paragraph .word.is-kw > span {
  color: var(--accent);
  font-weight: 600;
}
.about-paragraph .word.is-em > span {
  color: var(--accent-warm);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
}
.about-paragraph em {
  color: var(--accent-warm);
  font-style: italic;
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
}
.about-nod {
  display: inline-block;
  font-style: normal;
  font-size: 0.92em;
  vertical-align: middle;
  margin-left: 0.1em;
  filter: grayscale(0.15);
  transition: transform 0.35s cubic-bezier(0.2, 0.85, 0.2, 1);
}
.about-paragraph:hover .about-nod { transform: scale(1.15) rotate(-8deg); }
.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2.4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.about-meta .tech-pill {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-2);
  background: var(--surface);
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.about-meta .tech-pill:hover {
  color: var(--accent);
  border-color: rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}

/* ============================================================
   Process — vertical timeline
   ============================================================ */
.process {
  padding: 6rem 2.4rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}
.process-list {
  margin-top: 3rem;
  position: relative;
  padding-left: 80px;
  perspective: 1200px;
}
.process-list::before {
  content: '';
  position: absolute;
  left: 31px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2), var(--accent-warm), transparent);
  border-radius: 2px;
}
.proc-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.6rem;
  padding: 1.3rem 1.6rem;
  margin-bottom: 1rem;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  align-items: center;
  box-shadow: var(--shadow-sm);
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.2, 0.85, 0.2, 1),
              border-color 0.4s ease, box-shadow 0.4s ease;
}
.proc-row:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-glow);
}
.proc-row::before {
  content: attr(data-num);
  position: absolute;
  left: -65px; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--grad);
  color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.35), 0 0 0 6px var(--bg);
}
.proc-body h3 {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 800;
  margin: 0 0 0.35rem;
  letter-spacing: -0.035em;
  color: var(--text);
}
.proc-body p {
  color: var(--text-2);
  font-size: 0.96rem;
  margin: 0;
  max-width: 640px;
}
.proc-side {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--accent-2);
  letter-spacing: 0.08em;
  padding: 0.3rem 0.7rem;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .process-list { padding-left: 56px; }
  .process-list::before { left: 22px; }
  .proc-row { grid-template-columns: 1fr; gap: 0.7rem; padding: 1.2rem; }
  .proc-row::before { left: -48px; width: 40px; height: 40px; font-size: 0.76rem; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.35), 0 0 0 4px var(--bg); }
  .proc-side { justify-self: start; }
}

/* ============================================================
   Discover gallery
   ============================================================ */
.discover {
  padding: 5rem 0 6rem;
  overflow: hidden;
  position: relative;
}
.discover-head {
  padding: 0 2.4rem;
  margin: 0 auto 2.6rem;
  max-width: 1400px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}
.discover-track {
  display: flex; gap: 1.2rem;
  padding: 0 2.4rem;
  animation: gallery-pan 50s linear infinite;
  width: max-content;
}
.discover-track:hover { animation-play-state: paused; }
.discover-track.is-paused { animation-play-state: paused; }
.shot {
  position: relative;
  width: 290px; height: 400px;
  border-radius: var(--radius-arch);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-3);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  transition: transform 0.5s cubic-bezier(0.2, 0.85, 0.2, 1), box-shadow 0.5s ease, border-color 0.5s ease;
}
.shot:hover { transform: translateY(-8px) scale(1.02); box-shadow: var(--shadow-glow); border-color: var(--brand); }
.shot img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.2, 0.85, 0.2, 1);
}
.shot:hover img { transform: scale(1.06); }
.shot::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(10, 10, 10, 0.82) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.10), transparent 60%);
}
.shot-cap {
  position: absolute; z-index: 2;
  left: 0; right: 0; bottom: 0;
  padding: 1rem 1.1rem 1.2rem;
  display: flex; align-items: flex-end; justify-content: space-between;
  color: var(--text);
}
.shot-cap strong {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.shot-cap span {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.95;
  color: var(--accent);
}
@keyframes gallery-pan { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ============================================================
   Contact
   ============================================================ */
.contact {
  padding: 5rem 2.4rem 6rem;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}
.contact .eyebrow { justify-content: center; }
.contact-card {
  position: relative;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  padding: 4.5rem 2.4rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform-style: preserve-3d;
}
.contact-card::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(0, 0, 0, 0.06), transparent 45%),
    radial-gradient(circle at 82% 80%, rgba(0, 0, 0, 0.05), transparent 45%);
  z-index: 0;
}
.contact-card > * { position: relative; z-index: 1; }
.massive {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  margin: 0 0 2rem;
  color: var(--text);
}
.grad-text {
  font-family: 'Instrument Serif', serif;
  font-style: italic; font-weight: 400;
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.big-btn {
  display: inline-flex;
  align-items: center; gap: 1.2rem;
  padding: 1.2rem 2rem;
  border: 1px solid var(--brand);
  border-radius: 999px;
  font-size: 1.1rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  background: var(--brand);
  transition: color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
  font-weight: 500;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.35);
}
.big-btn::before {
  content: ''; position: absolute; inset: 0;
  background: var(--brand-2);
  transform: translateY(101%);
  transition: transform 0.55s cubic-bezier(0.7, 0, 0.3, 1);
  z-index: -1;
}
.big-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.4);
}
.big-btn:hover::before { transform: translateY(0); }
.big-btn svg { transition: transform 0.4s ease; color: inherit; }
.big-btn:hover svg { transform: translateX(8px); }
.big-btn.copied {
  border-color: var(--accent-mint);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.18);
}
.contact-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.big-btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: none;
}
.big-btn-secondary::before { background: rgba(0, 0, 0, 0.06); }
.big-btn-secondary:hover {
  color: var(--text);
  border-color: var(--brand);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.18);
}
.contact-socials {
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--dim);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.contact-socials a {
  position: relative;
  color: var(--text-2);
  transition: color 0.2s ease;
}
.contact-socials a:hover { color: var(--accent); }
.contact-socials a::after {
  content: ''; position: absolute;
  left: 0; bottom: -3px;
  height: 1px; width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s ease;
}
.contact-socials a:hover::after { transform: scaleX(1); }
.contact-socials .sep { color: var(--muted); }

/* Contact cubes */
.contact .cube-wrap.ct-cube-1 {
  top: -42px; left: 8%;
  --cube-size: 70px;
  --float-y: -22px; --float-x: 14px;
  --float-dur: 9s;
  --spin-dur: 18s;
}
.contact .cube-wrap.ct-cube-2 {
  bottom: -36px; right: 12%;
  --cube-size: 50px;
  --float-y: 26px; --float-x: -12px;
  --float-dur: 7s; --float-delay: -2s;
  --spin-dur: 12s; --spin-dir: reverse;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 4rem 2.4rem 2rem;
  border-top: 1px solid var(--line);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto 3rem;
}
.footer-logo {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 0.9;
}
.footer-top p { max-width: 320px; color: var(--text-2); margin: 0; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--dim);
  letter-spacing: 0.05em;
}
.footer-bottom ul { display: flex; gap: 1.6rem; }
.footer-bottom a { transition: color 0.2s ease; }
.footer-bottom a:hover { color: var(--accent); }

/* ============================================================
   Scroll reveal system
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1.05s cubic-bezier(0.2, 0.85, 0.2, 1),
              transform 1.05s cubic-bezier(0.2, 0.85, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}
[data-reveal].in { opacity: 1; transform: translateY(0); }
[data-reveal-group] [data-reveal] { transition-delay: 0s; }
[data-reveal-group].in > [data-reveal] { opacity: 1; transform: translateY(0); }
[data-reveal-group].in > [data-reveal]:nth-child(1)  { transition-delay: 0.04s; }
[data-reveal-group].in > [data-reveal]:nth-child(2)  { transition-delay: 0.14s; }
[data-reveal-group].in > [data-reveal]:nth-child(3)  { transition-delay: 0.24s; }
[data-reveal-group].in > [data-reveal]:nth-child(4)  { transition-delay: 0.34s; }
[data-reveal-group].in > [data-reveal]:nth-child(5)  { transition-delay: 0.44s; }
[data-reveal-group].in > [data-reveal]:nth-child(6)  { transition-delay: 0.54s; }

.studio-list[data-reveal-group] > .studio-card {
  opacity: 0;
  transform: translateY(34px) scale(0.97);
  transition: opacity 0.85s cubic-bezier(0.2, 0.85, 0.2, 1),
              transform 0.85s cubic-bezier(0.2, 0.85, 0.2, 1);
}
.studio-list[data-reveal-group].in > .studio-card { opacity: 1; transform: translateY(0) scale(1); }
.studio-list[data-reveal-group].in > .studio-card:nth-child(1) { transition-delay: 0.08s; }
.studio-list[data-reveal-group].in > .studio-card:nth-child(2) { transition-delay: 0.22s; }

.stats-grid[data-reveal-group] > .big-stat-shell {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.95s cubic-bezier(0.2, 0.85, 0.2, 1),
              transform 0.95s cubic-bezier(0.2, 0.85, 0.2, 1);
}
.stats-grid[data-reveal-group].in > .big-stat-shell { opacity: 1; transform: translateY(0); }
.stats-grid[data-reveal-group].in > .big-stat-shell:nth-child(1) { transition-delay: 0.05s; }
.stats-grid[data-reveal-group].in > .big-stat-shell:nth-child(2) { transition-delay: 0.18s; }

.process-list[data-reveal-group] [data-reveal] {
  transform: translateX(-40px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.85, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.85, 0.2, 1);
}
.process-list[data-reveal-group].in [data-reveal]:nth-child(1) { transform: translateX(0); opacity: 1; transition-delay: 0.05s; }
.process-list[data-reveal-group].in [data-reveal]:nth-child(2) { transform: translateX(0); opacity: 1; transition-delay: 0.18s; }
.process-list[data-reveal-group].in [data-reveal]:nth-child(3) { transform: translateX(0); opacity: 1; transition-delay: 0.31s; }
.process-list[data-reveal-group].in [data-reveal]:nth-child(4) { transform: translateX(0); opacity: 1; transition-delay: 0.44s; }


[data-split] .word { display: inline-block; overflow: hidden; vertical-align: top; }
[data-split] .word > span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 1s cubic-bezier(0.2, 0.85, 0.2, 1),
              opacity  1s cubic-bezier(0.2, 0.85, 0.2, 1);
}
[data-split].in .word > span { transform: translateY(0); opacity: 1; }

.about-paragraph[data-split-words] .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.about-paragraph[data-split-words] .word > span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition:
    transform 0.9s cubic-bezier(0.2, 0.85, 0.2, 1),
    opacity 0.9s cubic-bezier(0.2, 0.85, 0.2, 1);
  transition-delay: calc(var(--split-base, 0s) + var(--wi, 0) * 0.038s);
}
.about-paragraph[data-split-words] .word.is-kw > span {
  transform: translateY(110%) scale(0.94);
}
.about-paragraph[data-split-words].in .word > span {
  transform: translateY(0);
  opacity: 1;
}
.about-paragraph[data-split-words].in .word.is-kw > span {
  transform: translateY(0) scale(1);
}
.about-paragraph[data-split-words] .about-nod {
  display: inline-block;
  opacity: 0;
  transform: scale(0.6) rotate(-12deg);
  transition:
    transform 0.55s cubic-bezier(0.2, 0.85, 0.2, 1),
    opacity 0.55s cubic-bezier(0.2, 0.85, 0.2, 1);
  transition-delay: calc(var(--split-base, 0s) + var(--wi, 0) * 0.038s + 0.08s);
}
.about-paragraph[data-split-words].in .about-nod {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-title .word { transform: none !important; opacity: 1 !important; }
  [data-reveal], [data-split] .word > span,
  .about-paragraph[data-split-words] .word > span,
  .about-paragraph[data-split-words] .about-nod {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================
   Hero game-tiles — forged into the background
   ============================================================ */
.hero-tiles {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to right,
      transparent  0%,
      rgba(0,0,0,0.4) 15%,
      black        50%,
      rgba(0,0,0,0.8) 85%,
      transparent  100%),
    linear-gradient(to bottom,
      transparent  0%,
      black        12%,
      black        88%,
      transparent  100%);
  -webkit-mask-composite: destination-in;
  mask-image:
    linear-gradient(to right,
      transparent  0%,
      rgba(0,0,0,0.4) 15%,
      black        50%,
      rgba(0,0,0,0.8) 85%,
      transparent  100%),
    linear-gradient(to bottom,
      transparent  0%,
      black        12%,
      black        88%,
      transparent  100%);
  mask-composite: intersect;
}

/* Tile grid — centered inside the stage, not the full hero */
.ht-grid {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -10vw;
  right: -10vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  /* Stronger 3D tilt for a more isometric look */
  transform: perspective(1400px) rotateY(-18deg) rotateX(12deg) rotateZ(-4deg) scale(1.25);
  transform-origin: center center;
  transition: transform 1.4s cubic-bezier(0.2, 0.85, 0.2, 1);
}
.hero:hover .ht-grid {
  transform: perspective(1400px) rotateY(-16deg) rotateX(10deg) rotateZ(-4deg) scale(1.25);
}

.ht-track {
  display: flex;
  width: max-content;
}

.ht-track-set {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
}

/* Pause marquee when hero is off-screen */
.hero-tiles:not(.is-visible) .ht-track {
  animation-play-state: paused;
}

/* Animations for tracks — translateX(-50%) equals exactly one .ht-track-set width */
.ht-track-1 { animation: ht-marquee-left 60s linear infinite; }
.ht-track-2 { animation: ht-marquee-right 55s linear infinite; }
.ht-track-3 { animation: ht-marquee-left 65s linear infinite; }

@keyframes ht-marquee-left {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes ht-marquee-right {
  0% { transform: translate3d(-50%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.ht-tile {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #f3f3f3;
  pointer-events: none;   /* decorative — clicks go to the links under text */
  opacity: 0;
  transition: opacity 1s ease;
  width: 280px;
  height: 160px;
  flex-shrink: 0;
}
/* Fade in staggered via JS adding .ht-visible */
.ht-tile.ht-visible { opacity: 1; }

/* Light wash overlay — images are washed into the background */
.ht-tile::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(250, 250, 250, 0.6);
  pointer-events: none;
  z-index: 2;
  transition: background 0.55s ease;
}

.ht-tile img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
  transform: scale(1.06);
}

/* Gradient-only fallback for missing thumbs (monochrome) */
.ht-sky,
.ht-blue,
.ht-stone,
.ht-green,
.ht-purple { background: linear-gradient(160deg, #e8e8e8 0%, #d8d8d8 55%, #c8c8c8 100%); }

/* Label: hidden by default, bleeds through the light overlay on hover */
.ht-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2rem 0.7rem 0.6rem;
  background: linear-gradient(to top, rgba(10,10,10,0.78) 0%, transparent 100%);
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.ht-tile:hover .ht-label { opacity: 1; transform: translateY(0); }
.ht-tile:hover::after    { background: rgba(250, 250, 250, 0.10); } /* clear on hover */

.ht-label strong {
  display: block;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f5f5f5;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ht-label span {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  color: #ffffff;
  letter-spacing: 0.04em;
  margin-top: 1px;
}

/* Make tiles hoverable (the outer links aren't, but tiles are for label reveal) */
.ht-tile {
  pointer-events: auto;
  cursor: default;
}

@media (max-width: 1200px) {
  .ht-grid { left: 38%; }
}
@media (max-width: 900px) {
  .hero-tiles-stage {
    display: none;
    min-height: 0;
    margin-bottom: 0;
  }
}

/* ============================================================
   View-all CTA (below games deck) — opens the spread gallery
   ============================================================ */
.games-deck-cta {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}
.see-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.85, 0.2, 1);
}
.see-all-btn:hover {
  color: var(--text);
  transform: translateX(2px);
}
.see-all-btn .sab-label strong {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.see-all-btn .sab-arrow {
  display: inline-flex;
  color: var(--accent-mint);
  transition: transform 0.25s ease, color 0.25s ease;
}
.see-all-btn:hover .sab-arrow {
  transform: translateX(4px);
  color: var(--accent);
}
@media (max-width: 820px) {
  .games-deck-cta { margin-top: 1.6rem; }
  .see-all-btn { font-size: 0.72rem; }
}

/* ============================================================
   Tiles Panel — full-screen spread of every game
   Opens with a flatten/tilt-back animation on the hero tiles +
   a staggered card entrance for a "cards forming rows" feel.
   ============================================================ */
.tiles-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.6s;
  contain: layout style;
}
.tiles-panel.is-open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s linear 0s;
}

.tp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(250, 250, 250, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: pointer;
}
.tiles-panel.is-open .tp-backdrop { opacity: 1; }

.tp-shell {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1240px, calc(100% - 2.6rem));
  max-height: calc(100% - 3rem);
  padding: 1.9rem 2.2rem 2rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) scale(0.94);
  transform-origin: 50% 50%;
  transition:
    transform 0.65s cubic-bezier(0.2, 0.85, 0.2, 1),
    opacity 0.45s ease;
  will-change: transform, opacity;
}
.tiles-panel.is-open .tp-shell {
  transform: translate3d(-50%, -50%, 0) scale(1);
  opacity: 1;
}
.tp-shell::-webkit-scrollbar { width: 10px; }
.tp-shell::-webkit-scrollbar-track { background: transparent; }
.tp-shell::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.14); border-radius: 999px; }
.tp-shell::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.26); }

/* Header */
.tp-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.8rem;
}
.tp-head-text { max-width: 600px; }
.tp-title {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.035em;
  font-size: clamp(1.8rem, 4.2vw, 2.8rem);
  line-height: 1.05;
  margin: 0.4rem 0 0.5rem;
}
.tp-sub {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-2);
}
.tp-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.85, 0.2, 1), border-color 0.25s ease;
}
.tp-close:hover {
  background: rgba(0, 0, 0, 0.10);
  border-color: rgba(0, 0, 0, 0.32);
  transform: rotate(90deg);
}

/* Grid */
.tp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 1.1rem;
  perspective: 1400px;
}

/* Cards */
.tp-card {
  display: block;
  border-radius: 16px;
  background: transparent;
  text-decoration: none;
  color: inherit;
  position: relative;
  transform-style: preserve-3d;
  /* Entrance state — flat, falling from above */
  opacity: 0;
  transform: translateY(30px) scale(0.96);
  transition:
    opacity 0.55s ease,
    transform 0.65s cubic-bezier(0.2, 0.85, 0.2, 1);
  transition-delay: calc(var(--tp-i, 0) * 0.025s);
}
.tiles-panel.is-open .tp-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: calc(0.18s + var(--tp-i, 0) * 0.035s);
}

.tp-card-tilt {
  display: block;
  position: relative;
  border-radius: inherit;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #ececec 100%);
  overflow: hidden;
  transform:
    rotateX(calc(var(--tilt-y, 0) * -7deg))
    rotateY(calc(var(--tilt-x, 0) * 7deg));
  transition:
    transform 0.45s cubic-bezier(0.2, 0.85, 0.2, 1),
    border-color 0.3s ease,
    box-shadow 0.45s ease;
  box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.30);
  will-change: transform;
}
.tp-card:hover .tp-card-tilt {
  border-color: rgba(0, 0, 0, 0.32);
  box-shadow:
    0 30px 60px -24px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.08);
  transition-duration: 0.08s, 0.3s, 0.45s;
}
.tp-card:focus-visible { outline: none; }
.tp-card:focus-visible .tp-card-tilt {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}

/* Thumb */
.tpc-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #ececec;
}
.tpc-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 0.7s cubic-bezier(0.2, 0.85, 0.2, 1), filter 0.5s ease;
  filter: saturate(0.92) brightness(0.96);
}
.tp-card:hover .tpc-thumb img {
  transform: scale(1.1);
  filter: saturate(1) brightness(1);
}
.tpc-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 55%);
  pointer-events: none;
}
.tpc-rank {
  position: absolute;
  top: 0.6rem;
  left: 0.7rem;
  z-index: 2;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.92);
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tpc-shine {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--shine-x, 50%) var(--shine-y, 0%),
    rgba(255, 255, 255, 0.18),
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  mix-blend-mode: screen;
}
.tp-card:hover .tpc-shine { opacity: 1; }

/* Meta */
.tpc-meta {
  display: block;
  padding: 0.9rem 1rem 0.5rem;
}
.tpc-name {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tpc-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-2);
}
.tpc-stats > span { white-space: nowrap; }
.tpc-stats > span:first-child { color: var(--accent); font-weight: 600; }
.tpc-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* CTA */
.tpc-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.25s ease;
}
.tpc-cta svg {
  color: var(--accent-mint);
  transition: transform 0.3s cubic-bezier(0.2, 0.85, 0.2, 1), color 0.25s ease;
}
.tp-card:hover .tpc-cta { color: var(--text); }
.tp-card:hover .tpc-cta svg { transform: translateX(4px); color: var(--accent); }

/* Hero behaviour while panel is open — tilt the carousel back to flat */
body.tiles-expanded { overflow: hidden; }
body.tiles-expanded .nav { pointer-events: none; opacity: 0.55; transition: opacity 0.4s ease; }
body.tiles-expanded .ht-grid {
  transform: perspective(1400px) rotateY(0deg) rotateX(0deg) rotateZ(0deg) scale(1.05) !important;
  transition: transform 0.75s cubic-bezier(0.2, 0.85, 0.2, 1) !important;
}
body.tiles-expanded .ht-track {
  animation-play-state: paused !important;
}
body.tiles-expanded .hero-tiles {
  filter: blur(2px);
  opacity: 0.25;
  transition: filter 0.55s ease, opacity 0.55s ease;
}
/* Responsive */
@media (max-width: 760px) {
  .tp-shell {
    width: calc(100% - 1rem);
    max-height: calc(100% - 1rem);
    padding: 1.3rem 1.1rem 1.4rem;
  }
  .tp-head { gap: 0.8rem; margin-bottom: 1.2rem; }
  .tp-title { font-size: 1.6rem; }
  .tp-sub { font-size: 0.7rem; }
  .tp-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.8rem;
  }
  .tpc-meta { padding: 0.7rem 0.8rem 0.4rem; }
  .tpc-name { font-size: 0.86rem; }
  .tpc-stats { font-size: 0.65rem; }
  .tpc-cta { padding: 0.55rem 0.8rem 0.75rem; font-size: 0.66rem; }
}
@media (max-width: 460px) {
  .tp-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .tp-card,
  .tp-card-tilt,
  .tp-shell,
  .tp-backdrop,
  body.tiles-expanded .ht-grid,
  body.tiles-expanded .hero-tiles {
    transition-duration: 0.2s !important;
  }
  .tp-card-tilt {
    transform: none !important;
  }
}

/* Gradient discover cards (monochrome fallback) */
.shot.shot-gradient { display: flex; align-items: flex-end; }
.shot.shot-gradient-sky,
.shot.shot-gradient-blue,
.shot.shot-gradient-stone,
.shot.shot-gradient-green,
.shot.shot-gradient-purple { background: linear-gradient(135deg, #e8e8e8 0%, #d8d8d8 60%, #c8c8c8 100%); }

/* Pending thumbnail imgs: invisible until src is set by the fetcher */
img[data-rbx-place] { opacity: 0; pointer-events: none; }

/* ============================================================
   Performance — skip layout/paint for offscreen sections.
   .roles is excluded because it hosts position:sticky studio cards
   which break under content-visibility containment.
   ============================================================ */
.stats,
.code-section,
.about,
.process,
.discover,
.contact,
.games {
  content-visibility: auto;
  contain-intrinsic-size: 1px 800px;
}
.hero { contain: layout; }
.discover-track { contain: layout style; }

/* ============================================================
   Mobile & touch — layout, spacing, interaction fixes
   ============================================================ */
body.nav-open { overflow: hidden; }

@media (max-width: 820px) {
  .hero {
    min-height: 100svh;
    padding: max(6.5rem, calc(env(safe-area-inset-top) + 5rem)) max(1.2rem, env(safe-area-inset-left)) max(2.5rem, env(safe-area-inset-bottom)) max(1.2rem, env(safe-area-inset-right));
  }
  .hero-meta {
    top: max(5rem, calc(env(safe-area-inset-top) + 4rem));
    left: max(1.2rem, env(safe-area-inset-left));
    font-size: 0.72rem;
    max-width: calc(100% - 2.4rem);
  }
  .hero-title {
    margin-bottom: 1.25rem;
    font-size: clamp(2.4rem, 14vw, 4.5rem);
  }
  .hero-tiles-stage { margin-bottom: 1.75rem; }
  .hero-foot { padding-top: 2rem; }
  .hero-lead { font-size: 1rem; }
  .scroll-indicator { display: none; }

  .roles,
  .games,
  .stats,
  .code-section,
  .about,
  .process,
  .contact,
  .footer {
    padding-left: max(1.2rem, env(safe-area-inset-left));
    padding-right: max(1.2rem, env(safe-area-inset-right));
  }
  .roles { padding-top: 4rem; padding-bottom: 3.5rem; }
  .games { padding-top: 3rem; padding-bottom: 4rem; }
  .stats { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .code-section { padding-top: 3.5rem; padding-bottom: 3rem; }
  .about { padding-top: 4.5rem; padding-bottom: 4rem; }
  .process { padding-top: 4rem; padding-bottom: 4rem; }
  .contact { padding-top: 3.5rem; padding-bottom: 4rem; }
  .footer { padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }

  .discover-head,
  .discover-track {
    padding-left: max(1.2rem, env(safe-area-inset-left));
    padding-right: max(1.2rem, env(safe-area-inset-right));
  }

  .roles-head,
  .carousel-head,
  .stats-head,
  .discover-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
  }

  .carousel-meta {
    width: 100%;
    justify-content: space-between;
  }

  .studio-card {
    position: relative;
    top: auto !important;
    padding: 1.8rem;
  }
  .studio-list { padding-bottom: 0; gap: 1.4rem; }
  .studio-stripe { display: none; }

  .deck {
    height: 720px;
    perspective: none;
  }
  .deck-card {
    width: min(94%, 920px);
    height: 100%;
  }
  .deck-card[data-offset="1"],
  .deck-card[data-offset="-1"],
  .deck-card[data-offset="2"],
  .deck-card[data-offset="-2"] {
    transform: translate(-50%, -50%) scale(0.96) translateY(-12px);
    opacity: 0;
    pointer-events: none;
  }
  .deck-card[data-offset="0"] {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .deck-card .slide-inner {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .slide-info { padding-right: 0; }
  .slide-stats { flex-direction: column; }

  .shot {
    width: 240px;
    height: 340px;
  }

  .contact-card { padding: 2.5rem 1.4rem; }
  .big-btn {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    font-size: clamp(0.92rem, 3.8vw, 1.05rem);
  }
  .big-btn span {
    word-break: break-word;
    text-align: center;
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .footer-bottom ul {
    flex-wrap: wrap;
    gap: 1rem 1.4rem;
  }

  .editor-bar {
    flex-wrap: wrap;
    gap: 0.7rem;
  }
  .bar-copy .bar-copy-text { display: none; }
  .code { font-size: 0.72rem; }
  .code .ln { padding-left: 3.2rem; }
  .code .ln::before { width: 2.4rem; }
  .editor-body { max-height: 420px; }

  .big-stat { padding: 1.5rem 1.4rem 1.6rem; }
  .big-stat .bs-num { font-size: clamp(2.6rem, 12vw, 4rem); }

  .process-list { padding-left: 48px; }
  .process-list::before { left: 18px; }
  .proc-row::before {
    left: -42px;
    width: 36px;
    height: 36px;
    font-size: 0.72rem;
  }

  .about-paragraph { font-size: 1.15rem; }

}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(2.1rem, 13vw, 3.2rem);
  }
  .hero-foot .cta-arrow { font-size: 0.98rem; }
  .hs-btn { padding: 0.5rem; }
  .hs-btn svg { width: 14px; height: 14px; }

  .deck { height: 760px; }
  .deck-card { width: 96%; }
  .cr-btn { width: 44px; height: 44px; }

  .shot { width: 210px; height: 300px; }
  .shot-cap { flex-direction: column; align-items: flex-start; gap: 0.25rem; }

  .massive { font-size: clamp(2rem, 10vw, 3rem); }
  .section-title { font-size: clamp(2rem, 9vw, 3.2rem); }
  .section-title.is-big { font-size: clamp(2.2rem, 11vw, 3.4rem); }
}

@media (hover: none) and (pointer: coarse) {
  .slide-cover .play-pill {
    opacity: 1;
    transform: translateY(0);
  }
  .deck-card[data-offset="0"] .slide-cover:hover .cover-img,
  .slide-cover:hover .cover-img {
    transform: none;
  }
  .shot:hover,
  .shot:hover img {
    transform: none;
  }
  .studio-card:hover,
  .big-stat:hover,
  .proc-row:hover {
    transform: none !important;
  }
}
