/* ================================================
   Shared Entrance Animations — Pegasi Defense
   assets/css/animations.css

   Load order: last (after footer.css)
   ================================================ */

/* ── Keyframes ──────────────────────────────────── */
@keyframes pgFadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pgFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ────────────────────────────────────────────────
   Scroll-triggered utility
   JS adds .fade-in-up to observed elements.
   When IntersectionObserver fires, .visible is added.
   This ensures the classes are always defined, even
   if a per-page minified CSS omits them.
   ──────────────────────────────────────────────── */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity  0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Inner-page hero: title + subtitle entrance ──
   These are always visible immediately on page load.
   A brief fade-up gives a polished first impression
   without blocking content.
   ─────────────────────────────────────────────── */
.hero-content .hero-title {
  animation: pgFadeInUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.hero-content .hero-subtitle {
  animation: pgFadeInUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

/* ── Value cards stagger ─────────────────────────
   About page .value-card items get a sequential delay.
   ─────────────────────────────────────────────── */
.value-card:nth-child(1) { transition-delay: 0ms; }
.value-card:nth-child(2) { transition-delay: 70ms; }
.value-card:nth-child(3) { transition-delay: 140ms; }
.value-card:nth-child(4) { transition-delay: 210ms; }
.value-card:nth-child(5) { transition-delay: 280ms; }

/* ── Career / benefit cards stagger ─────────────── */
.career-card:nth-child(1),
.benefit-card:nth-child(1) { transition-delay: 0ms; }
.career-card:nth-child(2),
.benefit-card:nth-child(2) { transition-delay: 60ms; }
.career-card:nth-child(3),
.benefit-card:nth-child(3) { transition-delay: 120ms; }
.career-card:nth-child(4),
.benefit-card:nth-child(4) { transition-delay: 180ms; }
.benefit-card:nth-child(5) { transition-delay: 240ms; }
.benefit-card:nth-child(6) { transition-delay: 300ms; }
.benefit-card:nth-child(7) { transition-delay: 360ms; }
.benefit-card:nth-child(8) { transition-delay: 420ms; }

/* ── Think-piece cards stagger ───────────────────── */
.think-piece:nth-child(1) { transition-delay: 0ms; }
.think-piece:nth-child(2) { transition-delay: 80ms; }
.think-piece:nth-child(3) { transition-delay: 160ms; }
.think-piece:nth-child(4) { transition-delay: 240ms; }
.think-piece:nth-child(5) { transition-delay: 320ms; }

/* ── Form feedback states ────────────────────────── */
.form-feedback {
  border-radius: 6px;
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.form-feedback--success {
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.3);
  color: #16a34a;
}

.form-feedback--error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.28);
  color: #dc2626;
}

/* ── Reduced motion: disable everything ──────────── */
@media (prefers-reduced-motion: reduce) {
  .fade-in-up {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-content .hero-title,
  .hero-content .hero-subtitle {
    animation: none !important;
  }
}
