.nebula-volume {
  position:absolute; inset:0; width:100%; height:100%; display:block;
  pointer-events:none;
}

/* The artwork stays behind the reading surfaces as a long page scrolls. */
:is(.interior-layout,.studio-library) { position:relative; isolation:isolate; }
.page-nebula {
  position:fixed; inset:0; overflow:hidden; z-index:-1;
  pointer-events:none; background:var(--ex-surface);
}
.page-nebula .nebula-art {
  display:block; width:100%; height:100%; object-fit:cover;
  object-position:68% 44%;
}
.page-nebula::after {
  content:""; position:absolute; inset:0;
  background:linear-gradient(100deg,rgba(9,14,28,.82) 0%,rgba(9,14,28,.78) 39%,rgba(9,14,28,.64) 71%,rgba(9,14,28,.31) 100%);
}
[data-ex-theme=light] .page-nebula { background:#f5f3ff; }
[data-ex-theme=light] .page-nebula :is(.nebula-art,.nebula-volume) {
  filter:invert(1) hue-rotate(176deg) saturate(1.45); mix-blend-mode:multiply;
}
[data-ex-theme=light] .page-nebula::after {
  background:linear-gradient(100deg,rgba(250,249,255,.73) 0%,rgba(250,249,255,.69) 39%,rgba(250,249,255,.55) 71%,rgba(250,249,255,.24) 100%);
}
@media(max-width:640px) {
  .page-nebula .nebula-art {object-position:64% center;}
  .page-nebula::after {background:linear-gradient(100deg,rgba(9,14,28,.80),rgba(9,14,28,.62));}
  [data-ex-theme=light] .page-nebula::after {background:linear-gradient(100deg,rgba(250,249,255,.77),rgba(250,249,255,.55));}
}

/* Keep the moving filaments visible around the library's opaque example surfaces. */
.studio-library .page-nebula::after {
  background-color:color-mix(in srgb,var(--ex-bg) 34%,transparent);
}
.studio-playground-content > .ex-example-index,
.studio-playground-content > #root > .ex-theme {
  background-color:transparent;
}

/* Keep an open document in sync when the system motion preference changes. */
@media (prefers-reduced-motion:reduce) {
  .page-nebula .nebula-volume { display:none !important; }
  .page-nebula .nebula-art { visibility:visible !important; }
}

@media (forced-colors:active), print {
  .page-nebula { display:none; }
}
