/* ==========================================================================
   PCPMotion — global cinematic background
   --------------------------------------------------------------------------
   Visual primitives for PCPMotion.CinematicBackground / AmbientGlow
   (assets/js/motion-engine.js), activated once per page by assets/js/cinematic.js.
   This is the one shared, fixed, full-viewport atmosphere layer sitting
   behind every page's real content — never duplicated per section.

   Deliberately restrained: gold reads as light — very low opacity, a soft
   radial falloff — never as an outline or a filled shape. There is no
   filter: blur anywhere here; the softness comes entirely from the
   radial-gradient's own falloff, which paints once and never needs to run
   every frame.
   ========================================================================== */

.pcp-cinematic-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.pcp-ambient-glow {
  position: absolute;
  left: calc(var(--glow-x, 50%) - var(--glow-size, 60vw) / 2);
  top: calc(var(--glow-y, 50%) - var(--glow-size, 60vw) / 2);
  width: var(--glow-size, 60vw);
  height: var(--glow-size, 60vw);
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow-color, #D4AF37), transparent 58%);
  opacity: var(--glow-opacity, 0.1);
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .pcp-ambient-glow { transform: none !important; }
}

/* ==========================================================================
   Ambience channels — driven by assets/js/ambience.js
   --------------------------------------------------------------------------
   Each layer is addressed by what it is FOR (data-glow) rather than by its
   position in a list, so the controller never has to know how many glows
   exist or in what order they were created.

   0.5 on a channel reproduces the site's existing tuning, so adopting this
   re-balanced nothing. The fallbacks mean the layers look exactly as they did
   if the controller never runs at all.
   ========================================================================== */
.pcp-ambient-glow[data-glow="light"] {
  /* Gold is the only light source, and Phoenix energy lifts it further. */
  opacity: calc(var(--glow-opacity) * (0.5 + 1.0 * var(--amb-light, 0.5) + 0.5 * var(--amb-phoenix, 0.1)));
}
.pcp-ambient-glow[data-glow="haze"] {
  opacity: calc(var(--glow-opacity) * (0.5 + 1.1 * var(--amb-haze, 0.5)));
}
.pcp-ambient-glow[data-glow="navy"] {
  opacity: calc(var(--glow-opacity) * (0.45 + 1.2 * var(--amb-navy, 0.5)));
}
/* Particle canvases fade with the same channel that thins their count, so a
   density change reads as the air clearing rather than motes blinking out. */
.pcp-cinematic-bg .pcp-canvas-layer {
  /* Scales straight from --amb-particles, with no 0.4 floor. The floor meant
     a section asking for zero dust still rendered the field at 40% opacity,
     so "no particles here" was never actually possible. The dust profiles in
     ambience.js now carry the final opacity directly, so the density in the
     range that keeps its dust is unchanged. Fallback 0: if the ambience
     script never runs, the field stays dark rather than switching itself on. */
  opacity: var(--amb-particles, 0);
  transition: opacity 900ms ease;
}
