/* ================================================
   PATHFINDER — Animations
   Respects prefers-reduced-motion
   ================================================ */

/* ---------- Scroll Reveal ---------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.pain__grid .animate-on-scroll:nth-child(2) { transition-delay: 0.06s; }
.pain__grid .animate-on-scroll:nth-child(3) { transition-delay: 0.12s; }
.pain__grid .animate-on-scroll:nth-child(4) { transition-delay: 0.18s; }
.pain__grid .animate-on-scroll:nth-child(5) { transition-delay: 0.24s; }
.pain__grid .animate-on-scroll:nth-child(6) { transition-delay: 0.30s; }
.pain__grid .animate-on-scroll:nth-child(7) { transition-delay: 0.36s; }
.pain__grid .animate-on-scroll:nth-child(8) { transition-delay: 0.42s; }

.services__grid .animate-on-scroll:nth-child(2) { transition-delay: 0.08s; }
.services__grid .animate-on-scroll:nth-child(3) { transition-delay: 0.16s; }
.services__grid .animate-on-scroll:nth-child(4) { transition-delay: 0.24s; }

.process__timeline .animate-on-scroll:nth-child(2) { transition-delay: 0.05s; }
.process__timeline .animate-on-scroll:nth-child(3) { transition-delay: 0.10s; }
.process__timeline .animate-on-scroll:nth-child(4) { transition-delay: 0.15s; }
.process__timeline .animate-on-scroll:nth-child(5) { transition-delay: 0.20s; }
.process__timeline .animate-on-scroll:nth-child(6) { transition-delay: 0.25s; }

/* ---------- Hero Title Fade In ---------- */
.hero__symbol,
.hero__title,
.hero__subtitle,
.hero__stats,
.hero__cta-group,
.hero__badges {
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero__symbol     { animation-delay: 0s; }
.hero__title      { animation-delay: 0.1s; }
.hero__subtitle   { animation-delay: 0.25s; }
.hero__stats      { animation-delay: 0.35s; }
.hero__cta-group  { animation-delay: 0.45s; }
.hero__badges     { animation-delay: 0.6s; }

@keyframes heroFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Check Panel Transition ---------- */
.check-panel {
  opacity: 0;
  transform: translateY(12px);
}

.check-panel.active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Detail Step Transition ---------- */
.detail-step {
  opacity: 0;
  transform: translateX(20px);
}

.detail-step.active {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- FAQ open/close ---------- */
.faq__answer {
  animation: faqOpen 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes faqOpen {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Result Appear ---------- */
.quick-check__result,
.detail-check__result {
  animation: resultAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes resultAppear {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ---------- Fit Bar Fill Animation ---------- */
.fit-bar__fill {
  animation: barFill 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes barFill {
  from { width: 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;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  .hero__title,
  .hero__subtitle,
  .hero__cta-group,
  .hero__badges {
    opacity: 1;
    transform: none;
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
