/* Mouvement : tout est enveloppé dans prefers-reduced-motion, l'app reste lisible sans aucune animation. */

.reveal.is-in { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  /* apparition en cascade des fiches et des tuiles */
  /* translation seule : un scale() réduisait les boutons des fiches pas encore apparues sous 44 px */
  .reveal { opacity: 0; transform: translateY(18px); }
  .reveal.is-in {
    opacity: 1; transform: none;
    transition: opacity 520ms cubic-bezier(0.2, 0.7, 0.2, 1), transform 520ms cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--i, 0) * 60ms);
  }

  /* photo d'accueil : lent travelling avant */
  .hero__img { animation: drift 26s ease-in-out infinite alternate; transform-origin: 60% 40%; }
  @keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.14) translate(-1.5%, 1%); } }

  /* panneau d'accueil : les lignes montent l'une après l'autre */
  .hero__panel { animation: rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero__panel > * { animation: rise 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero__panel > :nth-child(1) { animation-delay: 120ms; }
  .hero__panel > :nth-child(2) { animation-delay: 190ms; }
  .hero__panel > :nth-child(3) { animation-delay: 260ms; }
  .hero__panel > :nth-child(4) { animation-delay: 330ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

  /* bandeau des pages : la photo se pose, puis glisse doucement au défilement */
  .banner__img { animation: settle 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes settle { from { transform: scale(1.12); } to { transform: scale(1); } }
  .banner__motif .icon { animation: float 7s ease-in-out infinite alternate; }
  .banner__motif .icon:nth-child(2) { animation-delay: -2s; }
  .banner__motif .icon:nth-child(3) { animation-delay: -4s; }
  @keyframes float { from { transform: translateY(-5px) rotate(-4deg); } to { transform: translateY(7px) rotate(5deg); } }
  .page-head__text { animation: rise 600ms 120ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }

  @supports (animation-timeline: scroll()) {
    .banner__img { animation: settle 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both, glide linear both; animation-timeline: auto, scroll(root); animation-range: normal, 0 420px; }
    @keyframes glide { to { translate: 0 46px; } }
  }

  /* point « en direct » */
  .live-dot { animation: ping 1.8s ease-out infinite; }
  @keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }

  /* réponses au toucher */
  .tile, .btn, .chip, .poster__img, .pulse-card, .tab, .langbar__btn { transition: transform 180ms cubic-bezier(0.2, 0.7, 0.2, 1), background-color 180ms ease, color 180ms ease; }
  .tile:active, .pulse-card:active { transform: scale(0.96); }
  .btn:active, .chip:active { transform: scale(0.97); }
  .poster:active .poster__img { transform: scale(1.06); }
  .tile__icon { transition: transform 260ms cubic-bezier(0.3, 1.5, 0.5, 1); }
  .tile:active .tile__icon { transform: rotate(-8deg) scale(1.08); }
  .tab--on .icon { animation: pop 380ms cubic-bezier(0.3, 1.6, 0.5, 1); }
  @keyframes pop { from { transform: scale(0.7); } to { transform: scale(1); } }

  .fav--on .icon { animation: pop 420ms cubic-bezier(0.3, 1.8, 0.5, 1); }
  .card--focus { animation: spotlight 1.6s ease-out; }
  @keyframes spotlight { 0%, 40% { box-shadow: 0 0 0 5px rgb(165 98 58 / 35%); } 100% { box-shadow: var(--shadow); } }

  .skeleton { animation: breathe 1.1s ease-in-out infinite alternate; }
  .skeleton:nth-child(2) { animation-delay: 150ms; }
  .skeleton:nth-child(3) { animation-delay: 300ms; }
  @keyframes breathe { from { opacity: 0.45; } to { opacity: 1; } }

  /* changement d'écran */
  ::view-transition-old(root) { animation: leave 180ms ease-in both; }
  ::view-transition-new(root) { animation: enter 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes leave { to { opacity: 0; transform: translateY(-8px); } }
  @keyframes enter { from { opacity: 0; transform: translateY(14px); } }
}
