/* ==========================================================================
   Peters Safety Kwik – Animations
   Subtle scroll reveals, hovers, counters
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}

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

/* Stagger helpers via nth-child */
.card-grid .reveal:nth-child(2),
.fleet-grid .reveal:nth-child(2),
.testimonial-grid .reveal:nth-child(2),
.gallery-grid .reveal:nth-child(2) {
  transition-delay: 0.08s;
}

.card-grid .reveal:nth-child(3),
.fleet-grid .reveal:nth-child(3),
.testimonial-grid .reveal:nth-child(3),
.gallery-grid .reveal:nth-child(3) {
  transition-delay: 0.16s;
}

.card-grid .reveal:nth-child(4),
.fleet-grid .reveal:nth-child(4),
.gallery-grid .reveal:nth-child(4) {
  transition-delay: 0.24s;
}

.card-grid .reveal:nth-child(5),
.gallery-grid .reveal:nth-child(5) {
  transition-delay: 0.1s;
}

.card-grid .reveal:nth-child(6),
.gallery-grid .reveal:nth-child(6) {
  transition-delay: 0.18s;
}

.card-grid .reveal:nth-child(7),
.gallery-grid .reveal:nth-child(7) {
  transition-delay: 0.26s;
}

.card-grid .reveal:nth-child(8),
.gallery-grid .reveal:nth-child(8) {
  transition-delay: 0.32s;
}

/* Hero entrance */
.hero-content {
  animation: heroIn 0.9s ease both;
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Soft pulse on emergency CTA */
.btn-emergency {
  animation: softPulse 2.8s ease-in-out infinite;
}

@keyframes softPulse {
  0%, 100% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  }
  50% {
    box-shadow: 0 10px 36px rgba(255, 255, 255, 0.35);
  }
}

/* Service icon micro interaction */
.service-card:hover .service-icon {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

.service-icon {
  transition: background 0.28s ease, color 0.28s ease, transform 0.28s ease;
}

/* Float button entrance */
.float-actions {
  animation: floatIn 0.6s ease 0.8s both;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-content,
  .btn-emergency,
  .float-actions {
    animation: none;
  }
}
