/* ==========================================================================
   BEAM.MBA — Animations & Motion Stylesheet
   Restrained, Editorial Micro-interactions & Accessible Motion
   ========================================================================== */

/* Keyframes: Gentle Floating for Ecosystem Cards */
@keyframes floatSlow {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-8px) rotate(0.5deg);
  }
}

@keyframes floatReverse {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(8px) rotate(-0.5deg);
  }
}

/* Subtle Golden Pulse for Live Readiness Indicators */
@keyframes goldPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(200, 148, 69, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(200, 148, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(200, 148, 69, 0);
  }
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  display: inline-block;
  animation: goldPulse 2.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

/* Scroll Reveal Classes (Driven by IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Ensure the white background section has NO content/context fades */
.theme-light .reveal,
.theme-light .chapter-inner,
.theme-light .system-nav,
.theme-light .system-preview-pane,
.theme-light .ritual-journey-list,
.theme-light .phone-mockup-wrap {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
}

/* Stagger Delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* Subtle Shimmer for High-Priority Buttons */
@keyframes subtleShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Interactive Ripple / Hover Transition */
.interactive-hover {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}

.interactive-hover:hover {
  transform: translateY(-4px);
}

/* Number Counter Animation Utility */
.counter-animate {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* Progress Fill Animation */
.animate-fill {
  width: 0%;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Respect Reduced Motion Preferences */
@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;
  }
  
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .eco-card-ritual,
  .eco-card-insight,
  .eco-card-aptitude,
  .eco-card-readiness {
    animation: none !important;
  }

  .cinematic-section,
  .story-chapter,
  .chapter-inner {
    will-change: auto !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
}

/* --------------------------------------------------------------------------
   CINEMATIC SCROLL SYSTEM — Support Styles
   -------------------------------------------------------------------------- */

/* GPU acceleration hint for sections being animated by GSAP */
.cinematic-section,
.story-chapter {
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.chapter-inner {
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* Prevent horizontal scrollbar */
body.cinematic-active {
  overflow-x: hidden;
}

/* Ensure html also clips horizontal overflow */
html:has(body.cinematic-active) {
  overflow-x: hidden;
}
