/* =========================================================
   Scroll reveal animations — IntersectionObserver-driven
   ========================================================= */

/* Base: before entering viewport */
[data-reveal] {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

/* Variants */
[data-reveal="fade"]       { transform: translateY(0); }
[data-reveal="up"]         { transform: translateY(36px); }
[data-reveal="up-lg"]      { transform: translateY(64px); }
[data-reveal="left"]       { transform: translateX(-48px); }
[data-reveal="right"]      { transform: translateX(48px); }
[data-reveal="scale"]      { transform: scale(0.94); }
[data-reveal="blur"]       { filter: blur(10px); transform: translateY(20px); }

/* When in view */
[data-reveal].is-in {
  opacity: 1;
  transform: translate(0, 0) scale(1);
  filter: blur(0);
}

/* Staggered children: parent triggers, children fan in */
[data-reveal-group] > [data-reveal-child] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
[data-reveal-group].is-in > [data-reveal-child] {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-group].is-in > [data-reveal-child]:nth-child(1)  { transition-delay: 0.00s; }
[data-reveal-group].is-in > [data-reveal-child]:nth-child(2)  { transition-delay: 0.08s; }
[data-reveal-group].is-in > [data-reveal-child]:nth-child(3)  { transition-delay: 0.16s; }
[data-reveal-group].is-in > [data-reveal-child]:nth-child(4)  { transition-delay: 0.24s; }
[data-reveal-group].is-in > [data-reveal-child]:nth-child(5)  { transition-delay: 0.32s; }
[data-reveal-group].is-in > [data-reveal-child]:nth-child(6)  { transition-delay: 0.40s; }
[data-reveal-group].is-in > [data-reveal-child]:nth-child(7)  { transition-delay: 0.48s; }

/* Hero initial load (plays without scroll) */
.hero h1, .hero-sub, .hero-cta-row, .hero-stats, .hero-eyebrow, .hero-visual {
  opacity: 0;
  animation: heroIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-eyebrow   { animation-delay: 0.10s; }
.hero h1        { animation-delay: 0.18s; }
.hero-sub       { animation-delay: 0.32s; }
.hero-cta-row   { animation-delay: 0.44s; }
.hero-stats     { animation-delay: 0.56s; }
.hero-visual    { animation-delay: 0.30s; animation-duration: 1.1s; }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Kicker accent line draws in */
[data-reveal].is-in .kicker::before {
  animation: drawLine 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}
@keyframes drawLine {
  from { width: 0; }
  to   { width: 24px; }
}

/* Count-up feel for stats — subtle bump */
[data-reveal].is-in .stat-num {
  animation: numPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
}
@keyframes numPop {
  0%   { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

/* Event row: left-slide stagger */
.events-list[data-reveal-group].is-in > [data-reveal-child] {
  transform: translateX(0);
}
.events-list[data-reveal-group] > [data-reveal-child] {
  transform: translateX(-32px);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal-group] > [data-reveal-child] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    animation: none !important;
  }
  .hero h1, .hero-sub, .hero-cta-row, .hero-stats, .hero-eyebrow, .hero-visual {
    opacity: 1 !important; animation: none !important;
  }
}
