/* Generated from upstream .ambient rule; see SOURCE.md. Specificity adapter only. */
:root:root:root :is(.site-nav__about-visual, .site-nav__item:not([data-site-section="about"]), .sky__panel, .sky__swatch, .sky__reset, .sky__freeze, .bgm, .bgm__play, .scene-preview-controls) {
  /* Effective edge widths, capped level-for-level: the cut cannot be wider
     than the body is thick (negative widths cap symmetrically). */
  --_amb-chamfer-w: max(-1 * var(--amb-thickness), min(var(--amb-chamfer-width), var(--amb-thickness)));
  --_amb-fillet-w: max(-1 * var(--amb-thickness), min(var(--amb-fillet-width), var(--amb-thickness)));
  /* Sweep-shadow helpers: the overall gate (a sheet at rest casts
     nothing), the body gate (sheets have no body: the sweep collapses to
     the single top-silhouette layer), and the shared alpha of the three
     body layers (harness-balanced against the render's contact depth). */
  --_amb-sh-gate: max(0, min(var(--amb-elevation) + var(--amb-thickness), 1));
  --_amb-body-gate: max(0, min(var(--amb-thickness), 1));
  --_amb-sweep-a: calc(
    var(--_amb-sh-gate) * var(--_amb-body-gate) * var(--_amb-sh-gain, 1) *
      max(0, 1 - var(--amb-elevation) / 3) *
      (var(--amb-thickness) * 0.02 + 0.047)
  );
  /* --_amb-sh-gain scales every filled shadow layer (default 1). A
     material that lets light through sets it below 1 and paints what
     the body's walls do on its own — see .amb-mat-glass. */
  /* Drop shadow, grounded (ambient3d/derived/notes/shadow.md): the umbra
     is the silhouette projection SWEPT from the body's bottom (elevation)
     to its top (elevation + thickness) — at rest a smooth wedge hugging
     the shadow-side edges with a mitred corner and fading outward;
     elevated, a detached blurred square. FOUR stacked layers sample the
     sweep at 1/4, 1/2, 3/4 and the full body height (offset 0.85px/mm of
     silhouette height, blur 0.60px/mm, R^2 0.99): overlaps composite
     multiplicatively, so the geometric stack itself produces the graded
     falloff, with each layer's blur erasing the steps. The FAR layer
     carries the fitted alpha model (thickness sheds part of it to the
     body layers); the three body layers share one small harness-balanced
     alpha and vanish for sheets, which keep the single-layer model.
     Residual: axis-aligned lights read deeper than diagonal,
     inexpressible in one alpha. */
  box-shadow: hsl(
        var(--amb-light-hue)
        var(--amb-light-saturation)
        0%
        / calc(
            var(--_amb-sh-gate) * var(--_amb-sh-gain, 1) *
              (
                (var(--amb-key-light-intensity) - var(--amb-fill-light-intensity))
                  * 0.13 + var(--amb-elevation) * -0.077 + 0.368 -
                  var(--_amb-body-gate) * max(0, 1 - var(--amb-elevation)) * 0.14
              )
          )
      )
      calc(
        var(--amb-light-x) *
          (var(--amb-elevation) * 6.8px + var(--amb-thickness) * 3.8px) * -1
      )
      calc(
        var(--amb-light-y) *
          (var(--amb-elevation) * 6.8px + var(--amb-thickness) * 3.8px) * -1
      )
      calc(var(--amb-elevation) * 4.8px + var(--amb-thickness) * 2.7px)
      0.8px,
    hsl(var(--amb-light-hue) var(--amb-light-saturation) 0% / var(--_amb-sweep-a))
      calc(
        var(--amb-light-x) *
          (var(--amb-elevation) * 6.8px + var(--amb-thickness) * 2.85px) * -1
      )
      calc(
        var(--amb-light-y) *
          (var(--amb-elevation) * 6.8px + var(--amb-thickness) * 2.85px) * -1
      )
      calc(var(--amb-elevation) * 4.8px + var(--amb-thickness) * 2px)
      calc(var(--amb-thickness) * 0.9px),
    hsl(var(--amb-light-hue) var(--amb-light-saturation) 0% / var(--_amb-sweep-a))
      calc(
        var(--amb-light-x) *
          (var(--amb-elevation) * 6.8px + var(--amb-thickness) * 1.9px) * -1
      )
      calc(
        var(--amb-light-y) *
          (var(--amb-elevation) * 6.8px + var(--amb-thickness) * 1.9px) * -1
      )
      calc(var(--amb-elevation) * 4.8px + var(--amb-thickness) * 1.35px)
      calc(var(--amb-thickness) * 0.6px),
    hsl(var(--amb-light-hue) var(--amb-light-saturation) 0% / var(--_amb-sweep-a))
      calc(
        var(--amb-light-x) *
          (var(--amb-elevation) * 6.8px + var(--amb-thickness) * 0.95px) * -1
      )
      calc(
        var(--amb-light-y) *
          (var(--amb-elevation) * 6.8px + var(--amb-thickness) * 0.95px) * -1
      )
      calc(var(--amb-elevation) * 4.8px + var(--amb-thickness) * 0.7px)
      calc(var(--amb-thickness) * 0.3px),
    /* Chamfer bands, grounded (ambient3d/derived/notes/chamfer.md): both
       alphas are affine and the highlight rides the fill light too — a
       45deg face keeps a residual band even when key equals fill, which
       the old proportional formulas zeroed out. hl R^2 0.99, sh R^2 0.98
       (residual: a faint band on edges perpendicular to an axis-aligned
       light, inexpressible per-edge in box-shadow). */
    inset calc(var(--amb-light-x) * var(--_amb-chamfer-w) * -1px)
      calc(var(--amb-light-y) * var(--_amb-chamfer-w) * -1px) 0px 0px
      hsl(
        var(--amb-light-hue)
        var(--amb-light-saturation)
        100%
        / calc(
            var(--amb-chamfer) * max(0, min(var(--amb-thickness), 1)) *
              (
                var(--amb-key-light-intensity) * 1.57 +
                  var(--amb-fill-light-intensity) * 0.85 - 1.03
              )
          )
      ),
    inset calc(var(--amb-light-x) * var(--_amb-chamfer-w) * 1px)
      calc(var(--amb-light-y) * var(--_amb-chamfer-w) * 1px) 0px 0px
      hsl(
        var(--amb-light-hue)
        var(--amb-light-saturation)
        0%
        / calc(
            var(--amb-chamfer) * max(0, min(var(--amb-thickness), 1)) *
              (
                (var(--amb-key-light-intensity) - var(--amb-fill-light-intensity))
                  * 0.19 + 0.24
              )
          )
      ),
    /* Fillet bands, grounded (ambient3d/derived/notes/fillet.md): same
       affine structure as the chamfer, softer and slightly wider — the
       round-over's highlight concentrates at 1.4px per width unit.
       hl R^2 0.97, sh R^2 0.96; the shadow alpha is compensated for the
       2px blur's dilution of the painted band. */
    inset calc(var(--amb-light-x) * var(--_amb-fillet-w) * -1.4px)
      calc(var(--amb-light-y) * var(--_amb-fillet-w) * -1.4px) 2px 0px
      hsl(
        var(--amb-light-hue)
        var(--amb-light-saturation)
        100%
        / calc(
            var(--amb-fillet) * max(0, min(var(--amb-thickness), 1)) *
              (
                var(--amb-key-light-intensity) * 1.44 +
                  var(--amb-fill-light-intensity) * 0.85 - 0.99
              )
          )
      ),
    inset calc(var(--amb-light-x) * var(--_amb-fillet-w) * 1.4px)
      calc(var(--amb-light-y) * var(--_amb-fillet-w) * 1.4px) 2px 0px
      hsl(
        var(--amb-light-hue)
        var(--amb-light-saturation)
        0%
        / calc(
            var(--amb-fillet) * max(0, min(var(--amb-thickness), 1)) *
              (
                (var(--amb-key-light-intensity) - var(--amb-fill-light-intensity))
                  * 0.23 + 0.3
              )
          )
      );
}
