/* ============================================
   Aplus Pest Control — Animations
   ============================================ */

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes hero-shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Page load */
.page-loaded .hero-load > * {
  animation: heroFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.page-loaded .hero-load > *:nth-child(1) { animation-delay: 0.1s; }
.page-loaded .hero-load > *:nth-child(2) { animation-delay: 0.25s; }
.page-loaded .hero-load > *:nth-child(3) { animation-delay: 0.4s; }
.page-loaded .hero-load > *:nth-child(4) { animation-delay: 0.55s; }
.page-loaded .hero-load > *:nth-child(5) { animation-delay: 0.7s; }

.hero-load > * {
  opacity: 0;
  transform: translateY(40px);
}

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

/* Scroll reveal */
[data-animate] {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-animate="fade-up"] { transform: translateY(50px); }
[data-animate="fade-down"] { transform: translateY(-50px); }
[data-animate="fade-left"] { transform: translateX(-60px); }
[data-animate="fade-right"] { transform: translateX(60px); }
[data-animate="scale-in"] { transform: scale(0.88); }
[data-animate="clip-up"] {
  clip-path: inset(100% 0 0 0);
  transform: none;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translate(0) scale(1);
  clip-path: inset(0 0 0 0);
}

/* Stagger children */
.stagger-children > [data-animate]:nth-child(1) { transition-delay: 0s; }
.stagger-children > [data-animate]:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > [data-animate]:nth-child(3) { transition-delay: 0.2s; }
.stagger-children > [data-animate]:nth-child(4) { transition-delay: 0.3s; }
.stagger-children > [data-animate]:nth-child(5) { transition-delay: 0.4s; }
.stagger-children > [data-animate]:nth-child(6) { transition-delay: 0.5s; }

/* Custom delay attribute */
[data-delay="100"] { transition-delay: 0.1s !important; }
[data-delay="200"] { transition-delay: 0.2s !important; }
[data-delay="300"] { transition-delay: 0.3s !important; }
[data-delay="400"] { transition-delay: 0.4s !important; }
[data-delay="500"] { transition-delay: 0.5s !important; }

/* Hero parallax */
.hero__bg img {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* Floating badge */
.hero__float-badge {
  animation: float 4s ease-in-out infinite;
}

/* Image reveal on hover */
.img-reveal {
  overflow: hidden;
}

.img-reveal img {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Line draw for process */
.process-step.is-visible .process-step__num {
  animation: scaleIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes scaleIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* Text underline animation */
.animated-underline {
  position: relative;
  display: inline-block;
}

.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--blue-mid);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.is-visible .animated-underline::after,
.animated-underline:hover::after {
  width: 100%;
}

@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(37, 211, 102, 0.45); }
  50% { box-shadow: 0 8px 40px rgba(37, 211, 102, 0.7), 0 0 0 12px rgba(37, 211, 102, 0.15); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
    clip-path: none;
  }

  .hero-load > * { opacity: 1; transform: none; }
}
