/* =========================================================
   animations.css — Keyframes + scroll reveal
   ========================================================= */

/* ---------- Keyframes ---------- */

/* Fade up from below */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gentle pulse (badge / CTA ring) */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,.4); }
  50%       { box-shadow: 0 0 0 10px rgba(37,99,235,.0); }
}

/* Float up and down (hero center phone) */
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-12px) scale(1); }
}

/* ---------- Utility animation classes ---------- */
.animate-float {
  animation: float 5s ease-in-out infinite;
}

.animate-pulse-ring {
  animation: pulse 2.4s ease-in-out infinite;
}

/* ---------- Scroll Reveal ---------- */

/* Initial hidden state — set before JS runs so there's no flash */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

/* Stagger children */
.reveal-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

/* Visible state — added by IntersectionObserver in main.js */
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for .reveal-children items */
.reveal-children.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-children.visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-children.visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-children.visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-children.visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-children.visible > *:nth-child(6) { transition-delay: 400ms; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-children > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .animate-float,
  .animate-pulse-ring {
    animation: none;
  }
}

/* ── SCROLL-TRIGGERED ANIMATION CLASSES ── */

.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.scale-up {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Visible state — added by IntersectionObserver */
.fade-up.is-visible,
.fade-left.is-visible,
.fade-right.is-visible,
.fade-in.is-visible,
.scale-up.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays for .stagger-children grids */
.stagger-children > *:nth-child(1) { transition-delay: 0s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.24s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.36s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.48s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.60s; }

@media (prefers-reduced-motion: reduce) {
  .fade-up, .fade-left, .fade-right, .fade-in, .scale-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
