/* =========================================================
   FLATTO — Animations
   Principi Nielsen Norman:
   200-400ms micro-interazioni, 400-600ms transizioni sezione
   Easing: ease-out per entrata, ease-in-out per transizioni
   Rispetta prefers-reduced-motion
   ========================================================= */

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 340ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

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

/* ---- Hero headline stagger entrance ---- */
.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: heroWord 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

/* ---- Float card (hero card) ---- */
.float-card {
  animation: floatY 4s ease-in-out 2;
}

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

/* ---- Pulse CTA — single bounce ---- */
.pulse {
  animation: pulse 1.6s ease-out 1;
}

.pulse:hover {
  animation: none;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

/* ---- Skill cards hover lift (handled in style.css) ---- */

/* ---- FAQ open ---- */
.faq-item.open .faq-answer {
  /* max-height set via JS for smooth */
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .float-card,
  .pulse {
    animation: none;
  }

}
