/* Animations landing — inspirées Magnific (fade, blur, zoom, slide) */

[data-scroll] {
  opacity: 0;
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform, filter;
}

[data-scroll="fade-up"] { transform: translateY(40px); }
[data-scroll="fade-down"] { transform: translateY(-28px); }
[data-scroll="fade-left"] { transform: translateX(-40px); }
[data-scroll="fade-right"] { transform: translateX(40px); }
[data-scroll="zoom-in"] { transform: scale(0.88); }
[data-scroll="blur-up"] { transform: translateY(32px); filter: blur(10px); }
[data-scroll="flip-up"] {
  transform: perspective(900px) rotateX(14deg) translateY(28px);
  transform-origin: center bottom;
}

[data-scroll].is-animated {
  opacity: 1;
  transform: none;
  filter: none;
}

[data-scroll-stagger] > * {
  opacity: 0;
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-scroll-stagger="fade-up"] > * { transform: translateY(36px); }
[data-scroll-stagger="zoom-in"] > * { transform: scale(0.9); }
[data-scroll-stagger="blur-up"] > * { transform: translateY(28px); filter: blur(8px); }

[data-scroll-stagger].is-animated > * {
  opacity: 1;
  transform: none;
  filter: none;
}

[data-scroll-stagger].is-animated > *:nth-child(1) { transition-delay: 0.05s; }
[data-scroll-stagger].is-animated > *:nth-child(2) { transition-delay: 0.12s; }
[data-scroll-stagger].is-animated > *:nth-child(3) { transition-delay: 0.19s; }
[data-scroll-stagger].is-animated > *:nth-child(4) { transition-delay: 0.26s; }
[data-scroll-stagger].is-animated > *:nth-child(5) { transition-delay: 0.33s; }
[data-scroll-stagger].is-animated > *:nth-child(6) { transition-delay: 0.4s; }
[data-scroll-stagger].is-animated > *:nth-child(7) { transition-delay: 0.47s; }
[data-scroll-stagger].is-animated > *:nth-child(8) { transition-delay: 0.54s; }

[data-scroll-stagger="alt"] > *:nth-child(odd) { transform: translateX(-36px); }
[data-scroll-stagger="alt"] > *:nth-child(even) { transform: translateX(36px); }

[data-scroll-stagger="alt"].is-animated > *:nth-child(odd),
[data-scroll-stagger="alt"].is-animated > *:nth-child(even) {
  transform: none;
}

/* Harmonise l'existant motion-group avec le style Magnific */
.motion-group > * {
  filter: blur(6px);
}

.motion-group.is-visible > * {
  filter: none;
}

.motion-group--flip > * {
  transform: perspective(800px) rotateX(12deg) translateY(28px);
  filter: blur(5px);
}

.motion-group--slide > * {
  transform: translateX(40px);
  filter: blur(4px);
}

.motion-group--scale > * {
  transform: translateY(24px) scale(0.9);
  filter: blur(4px);
}

.motion-group--bounce.is-visible > * {
  animation: mfZoomIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.motion-group--bounce.is-visible > *:nth-child(1) { animation-delay: 0.05s; }
.motion-group--bounce.is-visible > *:nth-child(2) { animation-delay: 0.11s; }
.motion-group--bounce.is-visible > *:nth-child(3) { animation-delay: 0.17s; }
.motion-group--bounce.is-visible > *:nth-child(4) { animation-delay: 0.23s; }
.motion-group--bounce.is-visible > *:nth-child(5) { animation-delay: 0.29s; }
.motion-group--bounce.is-visible > *:nth-child(6) { animation-delay: 0.35s; }
.motion-group--bounce.is-visible > *:nth-child(7) { animation-delay: 0.41s; }

.reveal {
  filter: blur(8px);
}

.reveal.is-visible {
  filter: none;
}

@keyframes mfZoomIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.9); filter: blur(6px); }
  100% { opacity: 1; transform: none; filter: none; }
}

@keyframes mfFadeUp {
  from { opacity: 0; transform: translateY(40px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes mfZoomInView {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: none; }
}

@supports (animation-timeline: view()) {
  [data-scroll="fade-up"] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
    animation: mfFadeUp linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 40%;
  }

  [data-scroll="blur-up"] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
    animation: mfFadeUp linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 38%;
  }

  [data-scroll="zoom-in"] {
    opacity: 1;
    transform: none;
    transition: none;
    animation: mfZoomInView linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 35%;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-scroll],
  [data-scroll-stagger] > *,
  .motion-group > *,
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    animation: none !important;
  }
}
