/* ==========================================================================
   CORE PALETTE, 3D PERSPECTIVE & CINEMA MOTION STYLES
   ========================================================================== */
:root {
  --bg-primary: #0b0c10;
  --bg-surface: #12141c;
  --accent-red: #ff2a2a;
  --accent-glow: rgba(255, 42, 42, 0.35);
  --cam-rx: 0deg;
  --cam-ry: 0deg;
  --cam-tx: 0px;
  --cam-ty: 0px;
  --scroll-z: 0px;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: #f3f4f6;
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  margin: 0;
}

/* Persistent WebGL 3D Camera Canvas */
#cameraCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

body.rig-minimal #cameraCanvas {
  opacity: 0.22;
}

/* Subtle Cinema Scanlines & Vignette */
.cinema-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 45%, transparent 45%, rgba(6, 7, 10, 0.82) 100%),
    linear-gradient(to bottom, rgba(11, 12, 16, 0.35), transparent 18%, transparent 82%, rgba(11, 12, 16, 0.85));
}

/* ==========================================================================
   MULTI-PLANE 3D HERO STAGE (perspective: 1200px, preserve-3d)
   ========================================================================== */
.hero-3d-viewport {
  perspective: 1200px;
  perspective-origin: 50% 45%;
  transform-style: preserve-3d;
}

.hero-3d-stage {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transform:
    rotateX(var(--cam-rx))
    rotateY(var(--cam-ry))
    translate3d(var(--cam-tx), var(--cam-ty), 0);
  transition: transform 0.08s linear;
}

/* Distinct Z-Depth Planes inside Hero */
.plane-bg {
  transform: translate3d(
    calc(var(--cam-tx) * -0.9),
    calc(var(--cam-ty) * -0.9),
    -120px
  ) scale(1.12);
  transform-style: preserve-3d;
  pointer-events: none;
}

.plane-mid {
  transform: translate3d(
    calc(var(--cam-tx) * 0.45),
    calc(var(--cam-ty) * 0.45),
    35px
  );
  transform-style: preserve-3d;
}

.plane-fg {
  transform: translate3d(
    calc(var(--cam-tx) * 1.15),
    calc(var(--cam-ty) * 1.15),
    85px
  );
  transform-style: preserve-3d;
}

/* Perspective Depth Grid Floor in Hero Background */
.hero-perspective-grid {
  background-image:
    linear-gradient(to right, rgba(255, 42, 42, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 42, 42, 0.14) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 74%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 25%, transparent 74%);
}

/* ==========================================================================
   INTERACTIVE 3D TILT & SPECULAR LIGHT-GLARE CARDS (.card & .program-card)
   ========================================================================== */
.card,
.program-card {
  position: relative;
  background: linear-gradient(155deg, rgba(22, 25, 36, 0.88), rgba(14, 16, 23, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.card:hover,
.program-card:hover {
  border-color: rgba(255, 42, 42, 0.48);
  box-shadow:
    0 24px 48px -16px rgba(0, 0, 0, 0.78),
    0 0 28px -6px rgba(255, 42, 42, 0.25);
}

/* Dynamic Radial Specular Glare Overlay */
.card-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: radial-gradient(
    circle 260px at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.13),
    rgba(255, 42, 42, 0.07) 40%,
    transparent 75%
  );
  z-index: 2;
}

.card:hover .card-glare,
.program-card:hover .card-glare {
  opacity: 1;
}

/* Inner 3D Pop-out Layers */
.card-pop {
  transform: translateZ(24px);
  transform-style: preserve-3d;
}

.card-pop-sm {
  transform: translateZ(14px);
}

/* ==========================================================================
   SCROLL-DRIVEN 3D DEPTH DOLLY REVEALS
   ========================================================================== */
.depth-reveal {
  opacity: 0;
  transform: perspective(1100px) translate3d(0, 44px, -70px) rotateX(9deg) scale(0.96);
  transition:
    opacity 0.78s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.depth-reveal.is-visible {
  opacity: 1;
  transform: perspective(1100px) translate3d(0, 0, 0) rotateX(0deg) scale(1);
}

/* Navigation Pill Active State */
.nav-btn.active {
  color: #ffffff;
  background: rgba(255, 42, 42, 0.16);
  border-color: rgba(255, 42, 42, 0.55);
  box-shadow: 0 0 18px rgba(255, 42, 42, 0.22);
}

/* Page Entrance Animation */
.page-section {
  display: block;
  animation: pageDollyIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageDollyIn {
  0% {
    opacity: 0;
    transform: perspective(1200px) translate3d(0, 22px, -45px) rotateX(4deg);
  }
  100% {
    opacity: 1;
    transform: perspective(1200px) translate3d(0, 0, 0) rotateX(0deg);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0b0c10;
}
::-webkit-scrollbar-thumb {
  background: #232736;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #ff2a2a;
}
