/* ========================================
   AJ Nova Hub — Animations
   Scroll-triggered + keyframes + transitions
   ======================================== */

/* ── PAGE TRANSITION ────────────────────────────────────────────── */
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  animation: pageIn 0.5s ease-out;
}

/* ── SCROLL-TRIGGERED ANIMATIONS ───────────────────────────────── */
[data-animate] {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-animate="fade-in"] {
  transform: none;
}

[data-animate="slide-up"] {
  transform: translateY(48px);
}

[data-animate="slide-down"] {
  transform: translateY(-48px);
}

[data-animate="slide-left"] {
  transform: translateX(48px);
}

[data-animate="slide-right"] {
  transform: translateX(-48px);
}

[data-animate="scale-in"] {
  transform: scale(0.92);
}

[data-visible="true"] {
  opacity: 1;
  transform: translate(0, 0) scale(1) !important;
}

/* Staggered children */
[data-animate-stagger] > [data-animate] {
  transition-delay: calc(var(--stagger-index, 0) * 100ms);
}

/* ── KEYFRAMES ─────────────────────────────────────────────────── */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

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

/* ── REDUCED MOTION ────────────────────────────────────────────── */
@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;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
