/* ============================================
   SANFELICE LEGNAMI — Animations
   ============================================ */

/* --- Scroll Animations (triggered by Intersection Observer) --- */
[data-animate] {
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-animate="fadeInUp"] {
  transform: translateY(30px);
}

[data-animate="fadeIn"] {
  transform: none;
}

[data-animate="fadeInLeft"] {
  transform: translateX(-30px);
}

[data-animate="fadeInRight"] {
  transform: translateX(30px);
}

/* Stato animato */
[data-animate].animated {
  opacity: 1;
  transform: translate(0, 0);
}

/* --- Parallax Background --- */
.parallax-bg {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* --- Decorative Line (usata nei section-header) --- */
.line-reveal {
  width: 0;
  transition: width 0.8s ease-out;
}

.line-reveal.animated {
  width: 60px;
}

/* --- Counter Fade-In --- */
.counter-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.counter-item.animated {
  opacity: 1;
  transform: translateY(0);
}

/* --- Prefers 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;
  }

  .parallax-bg {
    background-attachment: scroll;
  }
}
