/* =============================================
   SPIDERTECH CONSULTING — animations.css
   Scroll-reveal & hover animation classes
   ============================================= */

/* ---- Base reveal state (hidden) ---- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal--right {
  transform: translateX(32px);
}

.reveal--left {
  transform: translateX(-32px);
}

/* ---- Visible state (added by JS Intersection Observer) ---- */
.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* ---- Stagger delays for sibling groups ---- */
.reveal:nth-child(2) { transition-delay: 0.10s; }
.reveal:nth-child(3) { transition-delay: 0.20s; }
.reveal:nth-child(4) { transition-delay: 0.30s; }
.reveal:nth-child(5) { transition-delay: 0.40s; }
.reveal:nth-child(6) { transition-delay: 0.50s; }

/* ---- Bar chart animated fill ---- */
.bar {
  transform-origin: bottom;
  animation: growBar 1.2s cubic-bezier(0.23, 1, 0.32, 1) both;
  animation-play-state: paused;
}
.bar.animate { animation-play-state: running; }

.bar:nth-child(1) { animation-delay: 0.0s; }
.bar:nth-child(2) { animation-delay: 0.1s; }
.bar:nth-child(3) { animation-delay: 0.2s; }
.bar:nth-child(4) { animation-delay: 0.3s; }
.bar:nth-child(5) { animation-delay: 0.4s; }
.bar:nth-child(6) { animation-delay: 0.5s; }

@keyframes growBar {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

/* ---- Active nav link indicator ---- */
.navbar__links a.active-nav {
  color: #1a3c6e;
  font-weight: 700;
}

/* ---- Smooth counter animation ---- */
.stat__num {
  animation: countUp 1s ease both;
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Pulse ring on CTA button ---- */
.btn--primary {
  position: relative;
  overflow: visible;
}
.btn--primary::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid rgba(13,157,227,0.4);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.btn--primary:hover::after {
  opacity: 1;
  transform: scale(1.05);
}

/* ---- Testimonial fade ---- */
.testimonial-slide {
  animation: testimonialFade 0.5s ease;
}

@keyframes testimonialFade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Reduced-motion accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .bar {
    animation: none;
  }
  .btn--primary::after { display: none; }
}
