/* ═══════════════════════════════════════════════════════════════════
   ambient-bg.css — J.art Photographe V7
   Ambiance d'arriere-plan complementaire (halo doux global, vent
   leger, voile dore) qui s'ajoute a scene-effects.css sans
   le modifier. Premium, cinematographique, noir/or.
   Tout est purement decoratif (pointer-events:none, z-index:0).
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --ambient-gold:      #d4af37;
  --ambient-gold-soft: #e8c46c;
  --ambient-warm:      rgba(232, 196, 108, .14);
  --ambient-deep:      rgba(20, 14, 6, .35);
}

/* Couche additionnelle posee au-dessus de jart-scene-layer (z:0)
   mais derriere tout contenu (z>=1). */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  contain: strict;
}

/* === HALO DOUX GLOBAL ===
   Deux halos respirants pour donner une impression d'eclairage
   cinematographique. Tres subtils, sans saturer. */
.ambient-bg__halo {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  mix-blend-mode: screen;
  will-change: opacity, transform;
}

.ambient-bg__halo--top-right {
  top: -8vh;
  right: -10vw;
  width: 55vw;
  height: 55vw;
  max-width: 720px;
  max-height: 720px;
  background: radial-gradient(
    circle,
    rgba(232, 196, 108, .18) 0%,
    rgba(212, 175, 55, .08) 40%,
    transparent 70%
  );
  animation: ambientHaloBreathe 14s ease-in-out infinite;
}

.ambient-bg__halo--bottom-left {
  bottom: -12vh;
  left: -8vw;
  width: 50vw;
  height: 50vw;
  max-width: 640px;
  max-height: 640px;
  background: radial-gradient(
    circle,
    rgba(212, 175, 55, .12) 0%,
    rgba(102, 70, 24, .08) 45%,
    transparent 70%
  );
  animation: ambientHaloBreathe 18s ease-in-out infinite reverse;
  animation-delay: -4s;
}

@keyframes ambientHaloBreathe {
  0%, 100% { opacity: .55; transform: scale(1) translateZ(0); }
  50%      { opacity: .85; transform: scale(1.07) translateZ(0); }
}

/* === VENT DOUX ===
   Un voile lumineux qui glisse tres lentement de gauche a droite,
   evoquant un souffle d'air. Aucune particule, juste de la lumiere. */
.ambient-bg__wind {
  position: absolute;
  top: -10%;
  left: -50%;
  width: 200%;
  height: 120%;
  background:
    linear-gradient(
      105deg,
      transparent 0%,
      transparent 40%,
      rgba(255, 240, 210, .04) 48%,
      rgba(232, 196, 108, .07) 50%,
      rgba(255, 240, 210, .04) 52%,
      transparent 60%,
      transparent 100%
    );
  filter: blur(2px);
  animation: ambientWindDrift 38s linear infinite;
  mix-blend-mode: screen;
  will-change: transform;
}

@keyframes ambientWindDrift {
  0%   { transform: translate3d(-15%, 0, 0); }
  100% { transform: translate3d(15%, 0, 0); }
}

/* === VOILE SOMBRE PREMIUM ===
   Une vignette tres legere pour homogeneiser l'image et donner
   une finition cinema. Statique, aucune perf cost. */
.ambient-bg__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at center,
      transparent 50%,
      rgba(8, 6, 4, .25) 90%,
      rgba(6, 4, 2, .45) 100%
    );
}

/* === PARTICULES DOREES SUPPLEMENTAIRES ===
   Quelques petites lumieres scintillantes, encore plus discretes
   que .jart-particle. Elles ne montent pas, elles flottent sur place. */
.ambient-bg__sparkle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    var(--ambient-gold-soft) 0%,
    rgba(232, 196, 108, .4) 50%,
    transparent 70%
  );
  filter: blur(.4px);
  opacity: 0;
  animation: ambientSparkle var(--d, 6s) ease-in-out var(--delay, 0s) infinite;
  will-change: opacity, transform;
}

@keyframes ambientSparkle {
  0%, 100% { opacity: 0;   transform: scale(.6); }
  20%      { opacity: .9;  transform: scale(1.3); }
  60%      { opacity: .55; transform: scale(1); }
}

/* === MOBILE ===
   On garde l'ambiance mais on reduit l'intensite et la complexite. */
@media (max-width: 768px) {
  .ambient-bg__halo--top-right,
  .ambient-bg__halo--bottom-left {
    filter: blur(40px);
    opacity: .7;
  }
  .ambient-bg__wind {
    animation-duration: 50s;
  }
  /* Halo bottom-left reduit en taille pour eviter une zone trop chargee
     sous le contenu mobile. */
  .ambient-bg__halo--bottom-left {
    width: 70vw;
    height: 70vw;
  }
}

/* === ACCESSIBILITE — prefers-reduced-motion ===
   On stoppe les animations mais on garde les degrades pour que
   l'ambiance visuelle reste presente. */
@media (prefers-reduced-motion: reduce) {
  .ambient-bg__halo--top-right,
  .ambient-bg__halo--bottom-left,
  .ambient-bg__wind,
  .ambient-bg__sparkle {
    animation: none !important;
  }
  .ambient-bg__halo--top-right { opacity: .55; }
  .ambient-bg__halo--bottom-left { opacity: .45; }
  .ambient-bg__wind { opacity: .3; }
  .ambient-bg__sparkle { opacity: .35; }
}

/* === MODE IMPRESSION ===
   On masque tous ces effets a l'impression. */
@media print {
  .ambient-bg { display: none !important; }
}
