/* ============================================================
   CAPITALS ENGINEERING - animations.css
   Scroll-triggered reveals · Staggered children · Hover FX
   ============================================================ */

/* ── FADE-UP REVEAL (JS-driven via IntersectionObserver) ────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s cubic-bezier(0.22,1,0.36,1),
              transform 0.75s cubic-bezier(0.22,1,0.36,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for child elements */
.reveal-stagger > *:nth-child(1)  { transition-delay: 0.05s; }
.reveal-stagger > *:nth-child(2)  { transition-delay: 0.12s; }
.reveal-stagger > *:nth-child(3)  { transition-delay: 0.19s; }
.reveal-stagger > *:nth-child(4)  { transition-delay: 0.26s; }
.reveal-stagger > *:nth-child(5)  { transition-delay: 0.33s; }
.reveal-stagger > *:nth-child(6)  { transition-delay: 0.40s; }
.reveal-stagger > *:nth-child(7)  { transition-delay: 0.47s; }
.reveal-stagger > *:nth-child(8)  { transition-delay: 0.54s; }
.reveal-stagger > *:nth-child(n+9){ transition-delay: 0.60s; }

/* ── PAGE HERO - entry animation ────────────────────────────── */
.page-hero-content,
.hero-content {
  animation: heroEntry 1.1s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes heroEntry {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-tag    { animation: heroEntry 0.9s 0.15s cubic-bezier(0.22,1,0.36,1) both; }
.hero-title  { animation: heroEntry 0.9s 0.28s cubic-bezier(0.22,1,0.36,1) both; }
.hero-subtitle { animation: heroEntry 0.9s 0.38s cubic-bezier(0.22,1,0.36,1) both; }
.hero-desc   { animation: heroEntry 0.9s 0.46s cubic-bezier(0.22,1,0.36,1) both; }
.hero-actions { animation: heroEntry 0.9s 0.56s cubic-bezier(0.22,1,0.36,1) both; }
.hero-stats  { animation: heroEntry 0.9s 0.68s cubic-bezier(0.22,1,0.36,1) both; }

/* ── FIRE PULSE - accent lines and dots ─────────────────────── */
@keyframes firePulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}
.eyebrow::before { animation: firePulse 3s ease-in-out infinite; }

/* ── SCROLL CUE ─────────────────────────────────────────────── */
@keyframes scrollLine {
  0%   { left: -40px; }
  100% { left: 40px; }
}

/* ── CARD SHIMMER on hover ───────────────────────────────────── */
.service-card,
.application-card,
.value-card,
.facility-card,
.qa-item,
.tech-item {
  position: relative;
}
.service-card::after,
.application-card::after,
.facility-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    130deg,
    rgba(255,255,255,0) 40%,
    rgba(255,255,255,0.025) 50%,
    rgba(255,255,255,0) 60%
  );
  background-size: 300% 100%;
  background-position: 200% 0;
  transition: background-position 0.6s ease;
  pointer-events: none;
}
.service-card:hover::after,
.application-card:hover::after,
.facility-card:hover::after {
  background-position: -100% 0;
}

/* ── STAT NUMBER COUNT-UP FLASH ─────────────────────────────── */
@keyframes statFlash {
  0%   { color: var(--fire); }
  100% { color: var(--amber); }
}
.div-stat-n, .hstat-n {
  animation: statFlash 1.8s ease-out both;
}

/* ── GALLERY IMAGE reveal ────────────────────────────────────── */
.gallery img {
  animation: galleryFade 0.7s ease both;
}
@keyframes galleryFade {
  from { opacity: 0; filter: blur(4px) saturate(0.5); }
  to   { opacity: 1; filter: blur(0) saturate(0.85); }
}

/* ── SPEC TAG wiggle on first view ──────────────────────────── */
@keyframes tagPop {
  0%   { transform: scale(0.88); opacity: 0; }
  70%  { transform: scale(1.04); }
  100% { transform: scale(1);    opacity: 1; }
}
.spec-tag {
  animation: tagPop 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}
.div-spec-tags .spec-tag:nth-child(1) { animation-delay: 0.10s; }
.div-spec-tags .spec-tag:nth-child(2) { animation-delay: 0.17s; }
.div-spec-tags .spec-tag:nth-child(3) { animation-delay: 0.24s; }
.div-spec-tags .spec-tag:nth-child(4) { animation-delay: 0.31s; }
.div-spec-tags .spec-tag:nth-child(5) { animation-delay: 0.38s; }
.div-spec-tags .spec-tag:nth-child(n+6) { animation-delay: 0.44s; }

/* ── NAV scroll shrink (handled in animations.js) ───────────── */
nav.scrolled {
  background: rgba(10, 13, 17, 0.96);
  border-bottom-color: rgba(240,236,228,0.12);
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .page-hero-content, .hero-content,
  .hero-tag, .hero-title, .hero-subtitle, .hero-desc, .hero-actions, .hero-stats {
    animation: none;
  }
  .gallery img { animation: none; }
  .spec-tag { animation: none; }
}