/* ==========================================================================
   FOND VIVANT ORANGE : HALOS DIFFUS AMBIANTS
   M4 Services inc. - Ambiance immersive sobre & élégante
   Opacité max 0.11 & mix-blend-mode: screen • Garanti conforme WCAG AA
   ========================================================================== */

.ambient-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  contain: strict;
  isolation: isolate;
}

/* Wrappers gérant la parallaxe souris et l'inertie sur ordinateur */
.ambient-halo-wrap {
  position: absolute;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  transition: transform 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ambient-halo-wrap--1 { top: -8vh; left: -8vw; }
.ambient-halo-wrap--2 { top: 28vh; right: -6vw; }
.ambient-halo-wrap--3 { bottom: -12vh; left: 12vw; }
.ambient-halo-wrap--4 { top: 52vh; right: 22vw; }

/* Éléments de halos diffus avec dérive autonome continue (18s à 32s) */
.ambient-halo {
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: multiply;
  filter: blur(85px);
  -webkit-filter: blur(85px);
  will-change: transform;
  opacity: 0.05; /* Calibré pour préserver un fond blanc pur et le contraste WCAG AA */
}

/* Halo 1 : Ample halo supérieur gauche (24s) */
.ambient-halo--1 {
  width: min(720px, 65vw);
  height: min(720px, 65vw);
  background: radial-gradient(circle, rgba(253, 93, 0, 0.9) 0%, rgba(253, 93, 0, 0.3) 45%, transparent 70%);
  animation: driftAmbient1 24s ease-in-out infinite alternate;
}

/* Halo 2 : Halo moyen centre droit (32s) */
.ambient-halo--2 {
  width: min(600px, 55vw);
  height: min(600px, 55vw);
  background: radial-gradient(circle, rgba(253, 93, 0, 0.8) 0%, rgba(255, 140, 60, 0.25) 50%, transparent 70%);
  animation: driftAmbient2 32s ease-in-out infinite alternate;
  animation-delay: -7s;
}

/* Halo 3 : Halo inférieur gauche (20s) */
.ambient-halo--3 {
  width: min(660px, 60vw);
  height: min(660px, 60vw);
  background: radial-gradient(circle, rgba(253, 93, 0, 0.8) 0%, rgba(253, 93, 0, 0.2) 45%, transparent 70%);
  animation: driftAmbient3 20s ease-in-out infinite alternate;
  animation-delay: -13s;
}

/* Halo 4 : Halo d'accentuation subtil centre (28s) */
.ambient-halo--4 {
  width: min(460px, 45vw);
  height: min(460px, 45vw);
  background: radial-gradient(circle, rgba(255, 140, 60, 0.7) 0%, rgba(253, 93, 0, 0.18) 40%, transparent 70%);
  animation: driftAmbient4 28s ease-in-out infinite alternate;
  animation-delay: -19s;
}

/* Keyframes de dérive autonome fluide à 60fps */
@keyframes driftAmbient1 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(10vw, 7vh, 0) scale(1.08); }
  100% { transform: translate3d(5vw, 14vh, 0) scale(0.95); }
}

@keyframes driftAmbient2 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-9vw, 11vh, 0) scale(0.92); }
  100% { transform: translate3d(-14vw, -5vh, 0) scale(1.06); }
}

@keyframes driftAmbient3 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(7vw, -12vh, 0) scale(1.1); }
  100% { transform: translate3d(-7vw, -7vh, 0) scale(0.96); }
}

@keyframes driftAmbient4 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-10vw, -9vh, 0) scale(1.07); }
  100% { transform: translate3d(9vw, 9vh, 0) scale(0.94); }
}

/* Pause automatique quand l'onglet n'est pas actif */
.ambient-bg.is-paused .ambient-halo {
  animation-play-state: paused !important;
}

/* Repli prefers-reduced-motion : halos statiques en position fixe sans animation */
@media (prefers-reduced-motion: reduce) {
  .ambient-halo-wrap {
    transform: none !important;
    transition: none !important;
  }
  .ambient-halo {
    animation: none !important;
    transform: none !important;
    opacity: 0.08 !important;
  }
}
