/* =========================================================================
   MOTION — Animations & transitions.
   Toute animation vit ici. `prefers-reduced-motion: reduce` neutralise TOUT
   (CLAUDE.md §5 « Animations »).
   ========================================================================= */

/* --- Burger → croix (état ouvert) ------------------------------------- */
.nav__toggle[aria-expanded='true'] .nav__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__toggle[aria-expanded='true'] .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav__toggle[aria-expanded='true'] .nav__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Fade-in au scroll (posé par main.js via .is-inview) --------------
   État caché initial UNIQUEMENT si JS est actif (html.js) : sans JS, le
   contenu reste visible (pas de contenu masqué façon FOUC/JS-off). */
html.js .fx-fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
html.js .fx-fade-up.is-inview {
  opacity: 1;
  transform: none;
}

/* Stagger du moment : la 2e photo se révèle ~90ms après la 1re (effet vivant).
   La rotation est sur .moment__figure (élément distinct) → pas écrasée par le
   transform du fade-up porté par .moment__item. */
html.js .moment__item--right.fx-fade-up { transition-delay: 90ms; }

/* --- Marquee : défilement droite → gauche (Q6) ------------------------ */
/* Le track contient 2 copies identiques du contenu ; on translate de -50%
   pour une boucle parfaitement continue. */
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee__track {
  animation: marquee-scroll var(--marquee-duration) linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused; /* confort de lecture */
}

/* --- Point « ouvert » (page contact) : pulsation douce --- */
@keyframes contact-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(183, 0, 0, .5); }
  70%  { box-shadow: 0 0 0 10px rgba(183, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(183, 0, 0, 0); }
}
.contact-hero__dot { animation: contact-pulse 2.2s var(--ease-out) infinite; }

/* --- Pills-marquee (home §2) : droite → gauche, ~40s, pause au survol --- */
@keyframes pills-marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }  /* -50% = largeur d'un groupe → boucle sans couture */
}

.pills-marquee__track {
  animation: pills-marquee-scroll var(--pills-marquee-duration) linear infinite;
}

.pills-marquee:hover .pills-marquee__track {
  animation-play-state: paused;
}


/* =========================================================================
   REDUCED MOTION — coupe tout (CLAUDE.md §2.8 / §5)
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  /* Marquee devient statique (CLAUDE.md §3.5) */
  .marquee__track {
    animation: none !important;
    transform: none !important;
  }

  /* Pills-marquee statique : rangée fixe qui wrap, centrée, sans doublon */
  .pills-marquee__track {
    animation: none !important;
    transform: none !important;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
  }
  .pills-marquee__group {
    flex-wrap: wrap;
    justify-content: center;
  }
  .pills-marquee__group[aria-hidden='true'] {
    display: none; /* on masque le groupe dupliqué en statique */
  }

  /* Le fade-in ne doit pas laisser de contenu invisible */
  .fx-fade-up {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Appetite : pas de défilement piloté au scroll → rangée scrollable à la main */
  .appetite__viewport { overflow-x: auto; }
  .appetite__track { transform: none !important; }
}
