/*
 * ANF Solutions — Phase 1.2 Animations Layer
 * Additive CSS — does not modify any existing rules.
 * Includes: scroll-reveal fade-in, gradient mesh hero glow, smooth transitions.
 */

/* Respect user's reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll,
  .reveal-on-scroll * {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* === Scroll-reveal fade-in === */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

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

/* Staggered children */
.reveal-on-scroll.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-on-scroll.stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.reveal-on-scroll.stagger.is-visible > *:nth-child(2) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.reveal-on-scroll.stagger.is-visible > *:nth-child(3) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.reveal-on-scroll.stagger.is-visible > *:nth-child(4) { transition-delay: 0.35s; opacity: 1; transform: translateY(0); }
.reveal-on-scroll.stagger.is-visible > *:nth-child(5) { transition-delay: 0.45s; opacity: 1; transform: translateY(0); }
.reveal-on-scroll.stagger.is-visible > *:nth-child(6) { transition-delay: 0.55s; opacity: 1; transform: translateY(0); }

/* === Hero gradient mesh glow (subtle moving background) === */
.hero-mesh {
  position: relative;
  overflow: hidden;
}

.hero-mesh::before,
.hero-mesh::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
  animation: float-mesh 18s ease-in-out infinite;
}

.hero-mesh::before {
  top: -15%;
  left: -10%;
  width: 50%;
  height: 60%;
  background: radial-gradient(circle, rgba(200, 16, 46, 0.4) 0%, transparent 70%);
}

.hero-mesh::after {
  bottom: -15%;
  right: -10%;
  width: 55%;
  height: 65%;
  background: radial-gradient(circle, rgba(11, 37, 69, 0.5) 0%, transparent 70%);
  animation-delay: -9s;
}

@keyframes float-mesh {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-30px, 40px) scale(0.95); }
}

.hero-mesh > * {
  position: relative;
  z-index: 1;
}

/* === Card hover lift === */
.card-lift {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.12);
}

/* === Gentle pulse for CTAs (use sparingly: only on primary action) === */
.cta-pulse {
  position: relative;
  isolation: isolate;
}

.cta-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  z-index: -1;
  animation: cta-pulse-ring 2.4s ease-out infinite;
}

@keyframes cta-pulse-ring {
  0%   { transform: scale(1);    opacity: 0.6; }
  70%  { transform: scale(1.18); opacity: 0;   }
  100% { transform: scale(1.18); opacity: 0;   }
}
