/* ============================================================================
   VSN STRAPS — ANIMATIONS
   Reveal au scroll (IntersectionObserver côté JS), keyframes, transitions.
   Uniquement transform / opacity / clip-path pour rester fluide.
   ============================================================================ */

/* --- Reveal on scroll ------------------------------------------------------
   app.js ajoute .is-in quand l'élément entre dans le viewport.
   data-reveal="up|fade|clip" choisit l'effet ; --reveal-delay décale. */
[data-reveal] {
  opacity: 0;
  transition:
    opacity 900ms var(--ease-luxury),
    transform 900ms var(--ease-luxury),
    clip-path var(--dur-slow) var(--ease-luxury);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="up"]   { transform: translateY(16px); }   /* plus subtil */
[data-reveal="fade"] { transform: none; }
[data-reveal="clip"] { clip-path: inset(0 0 100% 0); transform: translateY(6px); }
[data-reveal].is-in  { opacity: 1; transform: none; clip-path: none; }
/* 10.10.2026 : le masque final ne reste que sur l'effet « clip », le seul qui
   en a besoin pour s'animer. Pose sur tous les blocs, il decoupait tout ce qui
   depasse de leur boite : l'ombre et la sangle penchee de la Communaute
   etaient coupees net en rectangle, comme l'ombre du plateau du vote. */
[data-reveal="clip"].is-in { clip-path: inset(0 0 0% 0); }

/* --- Keyframes ------------------------------------------------------------- */
@keyframes vsn-fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes vsn-fade {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes vsn-pulse {
  0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); }
}
@keyframes vsn-toast {
  0%   { opacity: 0; transform: translateY(14px); }
  12%  { opacity: 1; transform: none; }
  86%  { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(8px); }
}
@keyframes vsn-shimmer {
  from { background-position: -200% 0; } to { background-position: 200% 0; }
}

/* Pulse du compteur panier après ajout */
.cart-count.pulse { animation: vsn-pulse 480ms var(--ease-luxury); }

/* Fondu léger lors d'un changement de langue / devise / page */
#view.swapping, .lang-swap.swapping { opacity: 0; transition: opacity var(--dur-fast) var(--ease-ui); }
#view, .lang-swap { transition: opacity var(--dur-fast) var(--ease-ui); }

/* Menu mobile : liens en cascade */
.mobile-menu.open .mobile-link {
  opacity: 0; animation: vsn-fade-up 480ms var(--ease-luxury) forwards;
}
.mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 60ms; }
.mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 120ms; }
.mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 180ms; }
.mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 240ms; }
.mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 300ms; }
.mobile-menu.open .mobile-link:nth-child(6) { animation-delay: 360ms; }
.mobile-menu.open .mobile-link:nth-child(7) { animation-delay: 420ms; }

/* --- Accessibilité : mouvement réduit -------------------------------------
   Les animations non essentielles sont désactivées ; le contenu reste
   entièrement visible et fonctionnel. */
@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;
  }
  /* Exceptions : les carrousels (hero + bandeau) gardent une transition douce
     même en mouvement réduit, car leur défilement automatique est conservé
     (CONFIG.motion.autoplayAlways). */
  .hero-slide, .hero-slide .hero-copy > *, .hero-slide .hero-visual,
  .hline-in, .hero-progress-fill, .tick-item {
    transition-duration: 620ms !important;
  }
  .hero-progress-fill { transition-duration: var(--hero-ms, 5500ms) !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .hero-slide.is-active .hero-copy > *, .hero-slide.is-active .hero-visual,
  .hero-slide.is-active .hline-in { opacity: 1 !important; transform: none !important; }
}
