/* Container styles. The CSS gradient is the fallback if WebGL2 is unavailable;
   the runtime also sets it inline from the look's own palette. */

.pryzm-bg {
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(135deg, #111827, #1d4ed8, #9ca3af, #d1d5db, #e5e7eb);
}

.pryzm-bg canvas {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  transform-origin: center center;
}

/*
 * Compositing hint only where it is earned. will-change promotes the canvas to
 * its own layer permanently, which on a full-viewport hero is tens of megabytes
 * of GPU memory held for the life of the page - and only the parallax cursor
 * mode ever transforms the canvas. The runtime adds this class for that mode.
 */
.pryzm-bg--parallax canvas {
  will-change: transform;
}

/* Still frame shown before the canvas mounts, and when WebGL is unavailable. */
.pryzm-poster {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
}

/* Contrast wash between the canvas and the page content above it. */
.pryzm-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Fills the nearest positioned ancestor. */
.pryzm-bg--absolute {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Pinned behind the whole page. */
.pryzm-bg--fixed {
  position: fixed;
  inset: 0;
  z-index: -1;
}

/* Put this on the section so its children sit above the canvas. */
.pryzm-host {
  position: relative;
}

.pryzm-host > *:not(.pryzm-bg) {
  position: relative;
  z-index: 1;
}

/* Shown in the builder when no look is chosen. */
.pryzm-bg--placeholder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  background: #f0f0f1;
  color: #50575e;
  font: 500 13px/1.4 system-ui, sans-serif;
}

/* Reduced motion with a poster: the still is the whole background. */
.pryzm-bg--poster-only .pryzm-poster { z-index: 1; }

/*
 * Reveal cover: opaque at first paint, then fades away to reveal the finished
 * background. Driven by CSS so it completes with or without JavaScript.
 */
.pryzm-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 1;
  animation-name: pryzm-cover-out;
  animation-duration: 800ms;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}

@keyframes pryzm-cover-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Restarted by the runtime when a deferred background finally mounts. */
.pryzm-cover.is-restarting { animation: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .pryzm-cover { animation: none; opacity: 0; }
}

/*
 * Transparent reveal: suppress the container's own gradient so the page shows
 * through while the canvas fades up. !important is needed because the runtime
 * writes the palette gradient as an inline style on the container.
 */
.pryzm-bg--reveal {
  background: none !important;
}
