/* ============================================================
   PLOMBERIE NATIONALE — Animations
   ============================================================ */

/* ---- Keyframes ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- Hero entrance (immediate, keyframe-driven) ---- */
.ha-1 { animation: fadeUp 0.55s cubic-bezier(0.22,1,0.36,1) both; animation-delay: 0.05s; }
.ha-2 { animation: fadeUp 0.55s cubic-bezier(0.22,1,0.36,1) both; animation-delay: 0.14s; }
.ha-3 { animation: fadeUp 0.55s cubic-bezier(0.22,1,0.36,1) both; animation-delay: 0.23s; }
.ha-4 { animation: fadeUp 0.55s cubic-bezier(0.22,1,0.36,1) both; animation-delay: 0.32s; }
.ha-5 { animation: fadeUp 0.55s cubic-bezier(0.22,1,0.36,1) both; animation-delay: 0.41s; }
.ha-fade { animation: fadeIn 0.7s ease both; animation-delay: 0.25s; }

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.22,1,0.36,1),
              transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Delay variants for stagger */
.rd-1 { transition-delay: 0.07s; }
.rd-2 { transition-delay: 0.14s; }
.rd-3 { transition-delay: 0.21s; }
.rd-4 { transition-delay: 0.28s; }
.rd-5 { transition-delay: 0.35s; }

/* Slide from right variant */
.reveal--right {
  transform: translateX(24px);
}
.reveal--right.in-view {
  transform: none;
}

/* ---- Page transition overlay (via View Transitions API) ---- */
::view-transition-old(root) {
  animation: 220ms ease out fadeOut;
}
::view-transition-new(root) {
  animation: 260ms ease in fadeUp;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ---- Respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.in-view {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .ha-1, .ha-2, .ha-3, .ha-4, .ha-5, .ha-fade {
    animation: none !important;
    opacity: 1 !important;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}
