/*! NBC v7.048 · Ambilight
 * One fixed canvas; two finite SVG light fields; event-driven scene changes.
 * Loaded before legacy styles so this small important layer owns lighting only.
 * Never animate gradients, filters, layout, or scroll-position custom properties.
 */
@layer nbc-ambilight-premium {
  body[data-ambilight-visual="v7048"] {
    background-color: #080f0d !important;
  }

  body[data-ambilight-visual="v7048"] > .nbc-ambient-field {
    --al-key-opacity: .64;
    --al-fill-opacity: .38;
    --al-key-transform: translate(0, 0) scale(1);
    --al-fill-transform: translate(0, 0) scale(1);
    --al-level: 1;
    --al-state: 0;
    --al-response: 0;
    position: fixed !important;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    z-index: 0 !important;
    display: block !important;
    contain: strict !important;
    overflow: hidden !important;
    pointer-events: none !important;
    user-select: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: linear-gradient(158deg, #0b1512, #080f0d 46%, #080e0c) !important;
    transform: none !important;
    filter: none !important;
    mix-blend-mode: normal !important;
    animation: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  /* Embedded homepage and other legacy pseudo-fields never render alongside this owner. */
  body[data-ambilight-visual="v7048"] > .nbc-ambient-field::before,
  body[data-ambilight-visual="v7048"] > .nbc-ambient-field::after {
    content: none !important;
    display: none !important;
    animation: none !important;
    filter: none !important;
    will-change: auto !important;
  }

  body[data-ambilight-visual="v7048"] .nbc-ambient-light {
    position: absolute !important;
    display: block !important;
    pointer-events: none !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
    transform-origin: 50% 50% !important;
    filter: none !important;
    mix-blend-mode: normal !important;
    animation: none !important;
    will-change: auto !important;
    transition: transform 1.25s cubic-bezier(.22,.61,.36,1), opacity .95s ease !important;
  }

  body[data-ambilight-visual="v7048"] .nbc-ambient-light--key {
    left: 22% !important;
    top: -15% !important;
    width: 88% !important;
    height: 98% !important;
    background-image: url("./ambilight-key.v7048.svg") !important;
    transform: var(--al-key-transform) !important;
    opacity: clamp(0, calc(var(--al-key-opacity) * var(--al-level) + var(--al-state) + var(--al-response)), .72) !important;
  }

  body[data-ambilight-visual="v7048"] .nbc-ambient-light--fill {
    left: -29% !important;
    top: 25% !important;
    width: 96% !important;
    height: 96% !important;
    background-image: url("./ambilight-fill.v7048.svg") !important;
    transform: var(--al-fill-transform) !important;
    opacity: calc(var(--al-fill-opacity) * var(--al-level)) !important;
  }

  /* Different chapters occupy the same space. Small shifts retain a continuous light direction. */
  body[data-ambilight-visual="v7048"] [data-light-scene="work"] {
    --al-key-transform: translate(-4%, 12%) scale(1.04);
    --al-fill-transform: translate(10%, -5%) scale(.96);
    --al-key-opacity: .57;
    --al-fill-opacity: .42;
  }
  body[data-ambilight-visual="v7048"] [data-light-scene="reading"] {
    --al-key-transform: translate(6%, 6%) scale(.96);
    --al-fill-transform: translate(-2%, 5%) scale(1.04);
    --al-key-opacity: .37;
    --al-fill-opacity: .26;
  }
  body[data-ambilight-visual="v7048"] [data-light-scene="evidence"] {
    --al-key-transform: translate(2%, -4%) scale(1.06);
    --al-fill-transform: translate(-3%, 8%) scale(1.04);
    --al-key-opacity: .48;
    --al-fill-opacity: .34;
  }
  body[data-ambilight-visual="v7048"] [data-light-scene="close"] {
    --al-key-transform: translate(-8%, 7%) scale(1.02);
    --al-fill-transform: translate(10%, -4%) scale(.98);
    --al-key-opacity: .54;
    --al-fill-opacity: .36;
  }
  body[data-ambilight-visual="v7048"] [data-light-scene="quiet"] {
    --al-key-opacity: .27;
    --al-fill-opacity: .20;
  }
  body[data-ambilight-visual="v7048"][data-ambilight-level="quiet"] > .nbc-ambient-field {
    --al-level: .82;
  }
  body[data-ambilight-visual="v7048"][data-page-family="legal"] > .nbc-ambient-field {
    --al-level: .55;
  }
  body[data-ambilight-visual="v7048"][data-ambient-state="stable"] > .nbc-ambient-field {
    --al-state: .025;
  }
  body[data-ambilight-visual="v7048"][data-ambient-state="critical"] > .nbc-ambient-field,
  body[data-ambilight-visual="v7048"][data-ambient-state="exception"] > .nbc-ambient-field {
    --al-state: -.035;
  }
  body[data-ambilight-visual="v7048"] > .nbc-ambient-field[data-light-engaged="true"] {
    --al-response: .065;
  }
  body[data-ambilight-visual="v7048"] [data-light-engaged="true"] .nbc-ambient-light {
    transition-duration: 1.25s, .28s !important;
  }

  /* Full-page mobile shells previously hid the global plane. Cards and paper remain surfaces. */
  body[data-ambilight-visual="v7048"] > main,
  body[data-ambilight-visual="v7048"] :is(.m7h-home, .m7s-service) {
    background: transparent !important;
  }
  body[data-ambilight-visual="v7048"].page-home #auftakt,
  body[data-ambilight-visual="v7048"].page-home .home-process-opening__stage,
  body[data-ambilight-visual="v7048"].page-service .service-hero {
    background: transparent !important;
  }
  body[data-ambilight-visual="v7048"].page-home .home-process-opening__ambient {
    display: none !important;
    filter: none !important;
    animation: none !important;
    will-change: auto !important;
  }
  body[data-ambilight-visual="v7048"] :is(.m7h-scene, .m7s-scene)[data-nbc-material="deep"],
  body[data-ambilight-visual="v7048"] :is(.m7h-scene, .m7s-scene)[data-nbc-material="instrument"],
  body[data-ambilight-visual="v7048"] .m7s-scene:not(.m7s-evidence):not([data-nbc-material="paper"]):not([data-nbc-material="evidence"]),
  body[data-ambilight-visual="v7048"] .m7a-shell section[data-nbc-material="deep"],
  body[data-ambilight-visual="v7048"] .m7a-shell section[data-nbc-material="instrument"] {
    background: transparent !important;
  }

  /* Only decorative, page-wide lighting is retired; diagrams keep their functional highlights. */
  body[data-ambilight-visual="v7048"] :is(.dt-hero, .dt-result, .service-close-v6694)::before {
    content: none !important;
    display: none !important;
  }
  body[data-ambilight-visual="v7048"].service-ki #was-muesste-wahr-sein::before {
    background: none !important;
  }

  @media (max-width: 760px) {
    /* Percentages refer to the clipped viewport, never to oversized vmax surfaces. */
    body[data-ambilight-visual="v7048"] .nbc-ambient-light--key {
      left: 7% !important;
      top: -4% !important;
      width: 110% !important;
      height: 70% !important;
    }
    body[data-ambilight-visual="v7048"] .nbc-ambient-light--fill {
      left: -38% !important;
      top: 37% !important;
      width: 112% !important;
      height: 76% !important;
    }
    body[data-ambilight-visual="v7048"] [data-light-scene="work"] {
      --al-key-transform: translate(-3%, 12%) scale(1.02);
      --al-fill-transform: translate(7%, -6%) scale(1);
    }
    body[data-ambilight-visual="v7048"] [data-light-scene="reading"] {
      --al-key-transform: translate(10%, 3%) scale(.96);
      --al-key-opacity: .34;
    }
    body[data-ambilight-visual="v7048"] [data-light-scene="close"] {
      --al-key-transform: translate(-5%, 7%) scale(1.02);
    }
    body[data-ambilight-visual="v7048"][data-mobile-services-v7-active="true"] .service-hero {
      background: transparent !important;
    }
    /* Keep the guide access form's established dark contrast plate. */
    body[data-ambilight-visual="v7048"][data-page-template="guide-landing"] .dg3-access {
      background-color: rgb(7 18 12 / .72) !important;
      background-image: none !important;
    }
  }

  /* A static composition replaces all scene motion, including instantaneous position changes. */
  @media (prefers-reduced-motion: reduce) {
    body[data-ambilight-visual="v7048"] .nbc-ambient-light {
      transform: none !important;
      transition: none !important;
    }
    body[data-ambilight-visual="v7048"] .nbc-ambient-light--key {
      opacity: calc(.40 * var(--al-level)) !important;
    }
    body[data-ambilight-visual="v7048"] .nbc-ambient-light--fill {
      opacity: calc(.24 * var(--al-level)) !important;
    }
  }
  body[data-ambilight-visual="v7048"][data-ambient-paused="true"] .nbc-ambient-light {
    transition: none !important;
  }
  @media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active), print {
    body[data-ambilight-visual="v7048"] > .nbc-ambient-field {
      display: none !important;
    }
  }
}
