/* ============================================
   TERRAFORMA – SCROLL ANIMATIONS
   ============================================ */

/* ---------- Hero Entrance Animations ---------- */
.hero-animate {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeUp 0.9s var(--ease) forwards;
  animation-delay: var(--delay, 0s);
}

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

/* ---------- Scroll-triggered Reveal ---------- */
/*
  Every element with .scroll-reveal starts invisible.
  When it enters the viewport → .is-visible (fade in).
  When it leaves going up → .is-hidden (fade out).
  This gives true bidirectional animation.
*/

.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity  0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}

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

/* Fade out going UP (element scrolled back above viewport) */
.scroll-reveal.is-hidden {
  opacity: 0;
  transform: translateY(40px);
}

/* Staggered children within a parent */
.services-grid .scroll-reveal:nth-child(1)  { transition-delay: 0s; }
.services-grid .scroll-reveal:nth-child(2)  { transition-delay: 0.12s; }
.services-grid .scroll-reveal:nth-child(3)  { transition-delay: 0.24s; }

.stats-grid .scroll-reveal:nth-child(1)     { transition-delay: 0s; }
.stats-grid .scroll-reveal:nth-child(2)     { transition-delay: 0.1s; }
.stats-grid .scroll-reveal:nth-child(3)     { transition-delay: 0.2s; }
.stats-grid .scroll-reveal:nth-child(4)     { transition-delay: 0.3s; }

.testimonials-grid .scroll-reveal:nth-child(1) { transition-delay: 0s; }
.testimonials-grid .scroll-reveal:nth-child(2) { transition-delay: 0.14s; }
.testimonials-grid .scroll-reveal:nth-child(3) { transition-delay: 0.28s; }

.usp-list .scroll-reveal:nth-child(1)  { transition-delay: 0s; }
.usp-list .scroll-reveal:nth-child(2)  { transition-delay: 0.1s; }
.usp-list .scroll-reveal:nth-child(3)  { transition-delay: 0.2s; }
.usp-list .scroll-reveal:nth-child(4)  { transition-delay: 0.3s; }

.process-grid .scroll-reveal:nth-child(odd) { transition-delay: 0s; }
.process-grid .scroll-reveal:nth-child(even){ transition-delay: 0.08s; }

/* Slide from left for about text */
.about-text-col.scroll-reveal {
  transform: translateX(-40px);
}

.about-text-col.scroll-reveal.is-visible {
  transform: translateX(0);
}

.about-text-col.scroll-reveal.is-hidden {
  transform: translateX(-40px);
}

/* Slide from right for about image */
.about-img-col.scroll-reveal {
  transform: translateX(40px);
}

.about-img-col.scroll-reveal.is-visible {
  transform: translateX(0);
}

.about-img-col.scroll-reveal.is-hidden {
  transform: translateX(40px);
}

/* Scale up for section headers */
.section-header.scroll-reveal {
  transform: translateY(24px) scale(0.98);
}

.section-header.scroll-reveal.is-visible {
  transform: translateY(0) scale(1);
}

.section-header.scroll-reveal.is-hidden {
  transform: translateY(24px) scale(0.98);
}

/* CTA Banner special */
.cta-inner.scroll-reveal {
  transform: scale(0.97) translateY(20px);
}

.cta-inner.scroll-reveal.is-visible {
  transform: scale(1) translateY(0);
}

.cta-inner.scroll-reveal.is-hidden {
  transform: scale(0.97) translateY(20px);
}

/* Configurator box */
.configurator-box.scroll-reveal {
  transform: translateY(50px);
  opacity: 0;
}

.configurator-box.scroll-reveal.is-visible {
  transform: translateY(0);
  opacity: 1;
  transition-duration: 0.9s;
}

/* ---------- Counter Animation ---------- */
.stat-num.counting {
  transition: none;
}

/* ---------- Parallax hero on scroll ---------- */
#hero.parallax-active .hero-content {
  transition: transform 0.1s linear;
}
