/* ──────────────────────────────────────────────
   ANIMATIONS — scroll reveal + keyframes
─────────────────────────────────────────────── */

/* Scroll-reveal: elements start hidden, .is-revealed (added by reveal.js) shows them */
[data-reveal] {
  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].is-revealed { opacity: 1; transform: none; }

/* Variants */
[data-reveal="left"]  { transform: translateX(-36px); }
[data-reveal="right"] { transform: translateX(36px); }
[data-reveal="zoom"]  { transform: scale(0.94); }

/* Stagger via inline --d (set by reveal.js / markup) */
[data-reveal] { transition-delay: var(--d, 0ms); }

/* Hero entrance (plays on load, independent of scroll) */
.hero__badge,
.hero__title,
.hero__sub,
.hero__cta,
.hero__meta {
  opacity: 0;
  animation: heroIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero__badge { animation-delay: 0.1s; }
.hero__title { animation-delay: 0.25s; }
.hero__sub   { animation-delay: 0.45s; }
.hero__cta   { animation-delay: 0.6s; }
.hero__meta  { animation-delay: 0.78s; }

/* Each stat pops up in sequence (numbers also count up via JS) */
.hero__stat { animation: statPop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero__stat:nth-child(1) { animation-delay: 0.95s; }
.hero__stat:nth-child(2) { animation-delay: 1.08s; }
.hero__stat:nth-child(3) { animation-delay: 1.21s; }
.hero__stat .num { display: inline-block; }
@keyframes statPop {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroGlow {
  from { opacity: 0.5; transform: translateY(0) scale(1); }
  to   { opacity: 0.9; transform: translateY(10px) scale(1.05); }
}
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(8px); }
}
@keyframes scrollDot {
  0%   { opacity: 0; transform: translateY(0); }
  40%  { opacity: 1; }
  80%  { opacity: 0; transform: translateY(10px); }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero__badge, .hero__title, .hero__sub, .hero__cta, .hero__meta, .hero__stat {
    opacity: 1 !important; animation: none !important; transform: none !important;
  }
  .hero__shine, .hero__scroll { animation: none !important; }
  /* No looping motion: hide the video and show the poster still in its place */
  .hero__video { display: none !important; }
  .hero__bg {
    background-image: url('../assets/images/hero-poster.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
  }
}
