/* ==========================================================================
   Studio Luminous — light system layers

   These three layers MUST sit outside every Bricks wrapper. Any ancestor with
   `transform`, `filter`, `will-change` or `contain` creates a containing block
   and silently breaks `position: fixed` for its descendants — and Bricks
   applies transforms through its own controls and Interactions. sl-light.php
   emits them on `wp_body_open`, which fires immediately after <body>.
   ========================================================================== */

.sl-ground {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-color: var(--sl-ground, #14110D);
  /* background-color is written by the scroll script. It is a solid-colour
     paint, not a gradient — cheap, and it cannot band. */
}

/* One layer per fixture. Gradients are built once on load; the scroll loop
   writes ONLY opacity and transform, the two compositor-only properties.
   No filter: blur() anywhere — a soft multi-stop gradient IS a blurred disc,
   at zero filter cost. Blur is a convolution whose radius is the Gaussian
   sigma, so blur(60px) means a ~360px kernel over a full-viewport layer. */
.sl-beam {
  position: fixed;
  inset: -20%;
  z-index: -2;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
  transform: translate3d(0, 0, 0);
}

/* Dither. Measured necessary, not decorative: without it this gradient holds
   flat runs of 959 device px in the dark tail at DPR 2 — bands nearly a
   screen wide. The oversize inset gives the layer room to slide without
   exposing an edge. */
.sl-grain {
  position: fixed;
  inset: -300px;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  background-repeat: repeat;
  image-rendering: pixelated;   /* never let the tile be bilinearly smoothed */
  mix-blend-mode: plus-lighter; /* constant amount regardless of backdrop */
  will-change: transform;
}

/* Content must be transparent for any of this to show through. Bricks sets a
   background on the body/wrapper by default — clear it in Theme Styles, or
   this rule handles the common case. */
#brx-content,
.brxe-section,
.brxe-container {
  background-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  /* Hold the first fixture at level; never animate the light. */
  .sl-beam { transition: none !important; }
  .sl-grain { transform: none !important; }
}
