/* ============================================
   HOOPSTACK V2 — Responsive
   ============================================ */

:root {
  --bg-dark: #000000;
  --text-primary: #F0F0F0;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent-orange: #D95D0E;
  --accent-purple: #7B28D4;
  --font-display: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --page-pad: clamp(20px, 4vw, 48px);
}

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

html {
  background: var(--bg-dark);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  overflow: hidden;
  height: 100vh;
  overflow-x: hidden;
}

/* ---- Gradient Utility ---- */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange) 30%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   LOADER
   ============================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-brand {
  font-family: var(--font-display);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange) 30%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loader-track {
  width: clamp(120px, 20vw, 200px);
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

#loader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-purple));
  border-radius: 2px;
  transition: width 0.15s ease;
}

#loader-percent {
  font-family: var(--font-display);
  font-size: clamp(11px, 1.2vw, 13px);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 0 var(--page-pad);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: clamp(52px, 6vh, 64px);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 600;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange) 30%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 16px);
}

.nav-link {
  font-family: var(--font-body);
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-btn {
  font-family: var(--font-body);
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  padding: clamp(6px, 0.8vh, 8px) clamp(14px, 1.8vw, 20px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.nav-btn:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.04);
}

/* ============================================
   SNAP SECTIONS
   ============================================ */
.snap-section {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  visibility: hidden;
}

/* ============================================
   HERO
   ============================================ */
#hero {
  padding-top: clamp(60px, 8vh, 80px);
}

.hero-text {
  width: clamp(240px, 45%, 600px);
  padding: 0 var(--page-pad);
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vh, 28px);
}

.section-label {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(0.55rem, 0.8vw, 0.7rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5.5vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  color: var(--text-primary);
}

.hero-line {
  display: block;
}

.scroll-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: clamp(9px, 1vw, 11px);
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: scrollPulse 2s ease-in-out infinite;
  margin-top: clamp(8px, 1.5vh, 16px);
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: translateX(0); }
  50% { opacity: 0.7; transform: translateX(6px); }
}

/* ============================================
   CHAMPION SECTION
   ============================================ */
.champion-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.champion-header {
  text-align: center;
  z-index: 20;
}

.meet-brand {
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange) 30%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.champion-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(2rem, 10vw, 16rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.04em;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(0) scale(1);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.champion-title.visible {
  opacity: 1;
  transform: translateY(0);
}

.champion-title.dissolve {
  opacity: 0;
  filter: blur(16px);
  transform: translateY(-10px) scale(0.95);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
              filter 1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.typewriter-cursor {
  display: inline-block;
  width: clamp(2px, 0.3vw, 3px);
  height: 0.85em;
  background: #ffffff;
  margin-left: 4px;
  vertical-align: baseline;
  animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================
   CINEMATIC SPLIT (Intelligence + Access)
   ============================================ */
.cinema-split {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  transform: translateX(0) scale(1);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  overflow: hidden;
  will-change: transform;
}

.cinema-split.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Stage camera move on active */
.cinema-split.left-active {
  transform: translateX(clamp(16px, 2.5vw, 32px)) scale(1.045);
}

.cinema-split.right-active {
  transform: translateX(clamp(-32px, -2.5vw, -16px)) scale(1.045);
}

/* Film grain overlay */
.cinema-grain {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* Each half */
.cinema-half {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(20vh, 28vh, 30vh);
  cursor: default;
  transform: translateX(0);
  transition: transform 650ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 650ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

/* Volumetric light cone */
.cinema-light {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  height: 140%;
  background: radial-gradient(
    ellipse 50% 40% at 50% 0%,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.03) 20%,
    rgba(255, 255, 255, 0.008) 45%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1;
}

/* Text block */
.cinema-text {
  z-index: 2;
  text-align: center;
  width: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cinema-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4.5vw, 6rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.1em;
  opacity: 0.12;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  animation: idleNudge 2.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.cinema-left .cinema-title {
  animation-delay: 0s;
}

.cinema-right .cinema-title {
  animation-delay: 1.1s;
}

.cinema-half.active .cinema-title {
  animation: none;
}

@keyframes idleNudge {
  0%, 85%, 100% { transform: translateY(0); }
  90% { transform: translateY(-8px); }
  95% { transform: translateY(1px); }
}

.cinema-desc {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(13px, 1.4vw, 22px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.85;
  margin-top: clamp(20px, 4vh, 60px);
  max-width: clamp(260px, 80%, 500px);
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.7) 0%,
    rgba(200, 200, 210, 0.5) 40%,
    rgba(160, 160, 175, 0.4) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.18s,
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.18s;
}

.cinema-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(16px, 3vh, 48px);
  padding: clamp(10px, 1.4vh, 14px) clamp(20px, 2.5vw, 32px);
  font-family: var(--font-body);
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.35s,
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.35s,
              border-color 0.3s ease,
              background 0.3s ease;
}

.cinema-cta:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.cinema-half.active .cinema-cta {
  opacity: 1;
  transform: translateY(0);
}


/* ---- ACTIVE: Left side ---- */
.cinema-left.active {
  transform: translateX(8px);
}
.cinema-left.active .cinema-light {
  opacity: 1;
}
.cinema-left.active .cinema-title {
  opacity: 1;
}
.cinema-left.active .cinema-desc {
  opacity: 1;
  transform: translateY(0);
}
.cinema-split.left-active .cinema-right {
  transform: translateX(12px);
  opacity: 0.4;
}
.cinema-split.left-active .cinema-right .cinema-title {
  opacity: 0.08;
}

/* ---- ACTIVE: Right side ---- */
.cinema-right.active {
  transform: translateX(-8px);
}
.cinema-right.active .cinema-light {
  opacity: 1;
}
.cinema-right.active .cinema-title {
  opacity: 1;
}
.cinema-right.active .cinema-desc {
  opacity: 1;
  transform: translateY(0);
}
.cinema-split.right-active .cinema-left {
  transform: translateX(-12px);
  opacity: 0.4;
}
.cinema-split.right-active .cinema-left .cinema-title {
  opacity: 0.08;
}

/* ============================================
   SHARED 3D OBJECT CANVAS
   ============================================ */
#shared-object-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#shared-object-canvas.visible {
  opacity: 1;
}

/* ============================================
   FEATURE SECTIONS (Pillar pages)
   ============================================ */
.flight-overlay,
.feature-overlay {
  position: relative;
  z-index: 8;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.pillar-bg-number {
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(4rem, 20vw, 22rem);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  z-index: -1;
  bottom: 80%;
  left: 0;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, rgba(217, 93, 14, 0.08) 0%, rgba(217, 93, 14, 0.08) 30%, rgba(123, 40, 212, 0.08) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.flight-heading {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 5rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.flight-desc {
  font-family: var(--font-body);
  font-size: clamp(14px, 1.6vw, 28px);
  font-weight: 400;
  color: #9ca3af;
  line-height: 1.6;
  max-width: clamp(280px, 90%, 700px);
  margin-top: clamp(6px, 1vh, 12px);
}

/* Text on LEFT half */
.feature-left {
  justify-content: flex-start;
}

/* Text on LEFT half, object on RIGHT */
.feature-left {
  justify-content: flex-start;
}

/* Text on RIGHT half, object on LEFT */
.feature-right {
  justify-content: flex-end;
}

.feature-left .feature-text {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  padding: 0 var(--page-pad) 0 clamp(24px, 6vw, 10vw);
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 1s ease 0.2s, transform 1s ease 0.2s;
}

.feature-right .feature-text {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  padding: 0 clamp(24px, 6vw, 10vw) 0 var(--page-pad);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 1s ease 0.2s, transform 1s ease 0.2s;
}

.feature-left .feature-text.visible,
.feature-right .feature-text.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
   CTA SECTION
   ============================================ */
#confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.cta-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease 0.1s, transform 1s ease 0.1s;
  padding: 0 var(--page-pad);
}

.cta-content.visible {
  opacity: 1;
  transform: translateY(0);
}

.cta-heading {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: clamp(8px, 1.5vh, 16px);
  text-align: center;
}

.cta-btn-slide {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-btn-slide.visible {
  opacity: 1;
  transform: translateY(0);
}

.cta-sub {
  font-family: var(--font-body);
  font-size: clamp(13px, 1.2vw, 18px);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: clamp(16px, 2.5vh, 24px);
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-sub.visible {
  opacity: 1;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.cta-primary {
  color: var(--text-primary);
  background: rgba(26, 26, 26, 0.9);
  padding: clamp(10px, 1.4vh, 14px) clamp(20px, 2.5vw, 32px);
  border: 1.5px solid rgba(153, 153, 153, 0.3);
  border-radius: 8px;
}

.cta-primary:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.25);
}

/* ============================================
   ULTRAWIDE / LARGE SCREENS (> 1400px)
   ============================================ */
@media (min-width: 1400px) {
  .feature-right .feature-text {
    padding: 0 3vw 0 3vw;
  }
  .feature-left .feature-text {
    padding: 0 3vw 0 6vw;
  }
}

/* ============================================
   TABLET LANDSCAPE (768–1024px)
   ============================================ */
@media (max-width: 1024px) {
  .hero-text {
    width: 55%;
  }

  .feature-left .feature-text,
  .feature-right .feature-text {
    width: 55%;
  }

  .cinema-split.left-active {
    transform: translateX(20px) scale(1.03);
  }
  .cinema-split.right-active {
    transform: translateX(-20px) scale(1.03);
  }

  .cinema-half {
    padding-top: 25vh;
  }
}

/* ============================================
   NARROW / TABLET PORTRAIT (< 768px)
   ============================================ */
@media (max-width: 768px) {
  .hero-text {
    width: 80%;
  }

  .feature-left .feature-text,
  .feature-right .feature-text {
    width: 70%;
    padding: 0 5vw;
  }

  .cinema-half {
    padding-top: 22vh;
  }

  .cinema-split.left-active {
    transform: translateX(12px) scale(1.02);
  }
  .cinema-split.right-active {
    transform: translateX(-12px) scale(1.02);
  }

  .cinema-left.active { transform: translateX(4px); }
  .cinema-right.active { transform: translateX(-4px); }
  .cinema-split.left-active .cinema-right { transform: translateX(6px); }
  .cinema-split.right-active .cinema-left { transform: translateX(-6px); }
}

/* ============================================
   PHONE (< 500px)
   ============================================ */
@media (max-width: 500px) {
  .hero-text {
    width: 100%;
  }

  .feature-left .feature-text,
  .feature-right .feature-text {
    width: 85%;
    padding: 0 4vw;
  }

  .cinema-split {
    flex-direction: column;
  }

  .cinema-half {
    flex: none;
    height: 50vh;
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .cinema-text {
    width: 90%;
  }

  /* Both titles visible and bouncing by default */
  .cinema-title {
    opacity: 0.5;
  }

  /* Descriptions and CTA hidden by default on mobile */
  .cinema-desc {
    display: none;
  }

  .cinema-cta {
    display: none;
  }

  .cinema-light {
    opacity: 0;
    transition: opacity 0.5s ease;
  }

  /* Hide grain on mobile */
  .cinema-grain {
    display: none;
  }

  /* When a half is tapped/active — unfold */
  .cinema-half.mobile-open {
    height: 70vh;
  }

  .cinema-half.mobile-open .cinema-title {
    opacity: 1 !important;
    animation: none !important;
  }

  .cinema-half.mobile-open .cinema-desc {
    display: block;
    opacity: 1;
    transform: translateY(0);
  }

  .cinema-half.mobile-open .cinema-cta {
    display: inline-flex;
    opacity: 1;
    transform: translateY(0);
  }

  .cinema-half.mobile-open .cinema-light {
    opacity: 0.5;
  }

  /* The other half shrinks */
  .cinema-half.mobile-closed {
    height: 30vh;
  }

  .cinema-half.mobile-closed .cinema-title {
    opacity: 0.15 !important;
  }

  /* Disable all camera/drift transforms on mobile */
  .cinema-split.left-active,
  .cinema-split.right-active {
    transform: none;
  }

  .cinema-left.active,
  .cinema-right.active {
    transform: none;
  }

  .cinema-split.left-active .cinema-right,
  .cinema-split.right-active .cinema-left {
    transform: none;
  }

  .feature-left .feature-text,
  .feature-right .feature-text {
    transform: none;
  }

  .feature-left .feature-text.visible,
  .feature-right .feature-text.visible {
    transform: none;
  }
}

/* ============================================
   PORTRAIT ORIENTATION (very tall screens)
   ============================================ */
@media (max-aspect-ratio: 3/4) {
  .hero-text {
    width: 90%;
  }

  .feature-left .feature-text,
  .feature-right .feature-text {
    width: 75%;
    padding: 0 5vw;
  }

  .pillar-bg-number {
    font-size: clamp(4rem, 25vw, 12rem);
  }
}
