/* Animation progressive des titres au scroll */

/* Classes pour l'animation des titres */
.scroll-reveal {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, filter, transform;
}

.scroll-reveal.revealed {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0);
}

/* Animation par mots individuels */
.scroll-reveal-words {
  overflow: hidden;
}

.scroll-reveal-words .word {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, filter, transform;
}

.scroll-reveal-words.revealed .word {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0);
}

/* Délais progressifs pour chaque mot */
.scroll-reveal-words .word:nth-child(1) { transition-delay: 0.1s; }
.scroll-reveal-words .word:nth-child(2) { transition-delay: 0.2s; }
.scroll-reveal-words .word:nth-child(3) { transition-delay: 0.3s; }
.scroll-reveal-words .word:nth-child(4) { transition-delay: 0.4s; }
.scroll-reveal-words .word:nth-child(5) { transition-delay: 0.5s; }
.scroll-reveal-words .word:nth-child(6) { transition-delay: 0.6s; }
.scroll-reveal-words .word:nth-child(7) { transition-delay: 0.7s; }
.scroll-reveal-words .word:nth-child(8) { transition-delay: 0.8s; }
.scroll-reveal-words .word:nth-child(9) { transition-delay: 0.9s; }
.scroll-reveal-words .word:nth-child(10) { transition-delay: 1.0s; }
.scroll-reveal-words .word:nth-child(11) { transition-delay: 1.1s; }
.scroll-reveal-words .word:nth-child(12) { transition-delay: 1.2s; }
.scroll-reveal-words .word:nth-child(13) { transition-delay: 1.3s; }
.scroll-reveal-words .word:nth-child(14) { transition-delay: 1.4s; }
.scroll-reveal-words .word:nth-child(15) { transition-delay: 1.5s; }
.scroll-reveal-words .word:nth-child(16) { transition-delay: 1.6s; }

/* Forcer les mots avec classes CSS à suivre la séquence */
.scroll-reveal-words .highlight-violet {
  opacity: 0 !important;
  filter: blur(8px) !important;
  transform: translateY(20px) !important;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.scroll-reveal-words.revealed .highlight-violet {
  opacity: 1 !important;
  filter: blur(0px) !important;
  transform: translateY(0) !important;
}

/* Animation pour les paragraphes */
.scroll-reveal-paragraph {
  opacity: 0;
  filter: blur(5px);
  transform: translateY(20px);
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition-delay: 0.3s;
}

.scroll-reveal-paragraph.revealed {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0);
}

/* Animation pour les boutons */
.scroll-reveal-button {
  opacity: 0;
  filter: blur(3px);
  transform: translateY(15px) scale(0.95);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition-delay: 0.5s;
}

.scroll-reveal-button.revealed {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0) scale(1);
}

/* Animation pour les sections */
.scroll-reveal-section {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(40px);
  transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-section.revealed {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0);
}

/* Optimisations pour les performances */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .scroll-reveal-words .word,
  .scroll-reveal-paragraph,
  .scroll-reveal-button,
  .scroll-reveal-section {
    transition: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
}

/* Responsive : réduction des effets sur mobile */
@media (max-width: 768px) {
  .scroll-reveal,
  .scroll-reveal-words .word,
  .scroll-reveal-paragraph,
  .scroll-reveal-button {
    filter: blur(3px);
    transform: translateY(15px);
    transition-duration: 0.5s;
  }
  
  .scroll-reveal.revealed,
  .scroll-reveal-words.revealed .word,
  .scroll-reveal-paragraph.revealed,
  .scroll-reveal-button.revealed {
    filter: blur(0px);
    transform: translateY(0);
  }
  
  /* Délais réduits sur mobile */
  .scroll-reveal-words .word:nth-child(n) {
    transition-delay: calc(0.05s * var(--word-index, 1));
  }
}
