/* 3D puzzle-piece background (puzzle-bg.js), v2 16 Nov: built so scrolling never repaints the page.
   - The colour gradient lives on one fixed layer (body::before) instead of `background-attachment: fixed`,
     which made the browser repaint the whole screen on every scroll step.
   - The film-grain overlay (mix-blend-mode over the whole screen) is gone: it cost a full-screen blend every frame.
   - The light shafts are a CSS layer (body::after) that only fades in and out, which the GPU does for free.
   An inline script in <head> sets .pz-on before the first paint. If WebGL fails, the script removes
   .pz-on and each page's own old background comes back. */
.pz { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; display: block; opacity: 0; transition: opacity .8s ease; }
html.pz-ready .pz { opacity: 1; }
html.pz-on .bg-balls { display: none; }

html.pz-on { background: #040a26; }
html.pz-on body { background: transparent !important; }

/* Gradient + light shafts: one fixed, GPU-composited layer. The shafts are the old live WebGL rays,
   drawn once into an image (make_rays.py, same maths) so they look the same and cost nothing. */
html.pz-on { --pz-rays: url("rays-wide.webp"); }
@media (orientation: portrait) { html.pz-on { --pz-rays: url("rays-tall.webp"); } }
html.pz-on body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    var(--pz-rays) center / 100% 100% no-repeat,
    radial-gradient(ellipse 85% 75% at 50% 45%, transparent 40%, rgba(1,3,16,.85) 100%),
    radial-gradient(760px 620px at 50% 38%, rgba(60,140,255,.55), rgba(30,80,230,.18) 55%, transparent 75%),
    radial-gradient(420px 360px at 50% 34%, rgba(150,210,255,.30), transparent 70%),
    linear-gradient(180deg, #0f2a86 0%, #0a1d66 35%, #07154a 70%, #040a26 100%) !important;
  mix-blend-mode: normal !important; opacity: 1 !important;
  -webkit-mask-image: none !important; mask-image: none !important;
  transform: translateZ(0);
}
html.pz-on body::after { display: none !important; }
