.zoom[open]:has(.scene-depth) {
  inset: 0;
  width: 100%;
  height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #090d11;
}

.zoom:has(.scene-depth) .zoom-toolbar,
.zoom:has(.scene-depth) .zoom-footer {
  position: relative;
  z-index: 2;
  min-height: 44px;
  padding-block: 3px;
  padding-inline: max(10px, env(safe-area-inset-left));
  border-color: rgb(var(--scene-color, 107 135 145) / .48);
  background: linear-gradient(105deg, rgb(var(--scene-color, 107 135 145) / .13), transparent 72%), #0b1117;
}

.zoom:has(.scene-depth) .zoom-footer {
  padding-bottom: max(3px, env(safe-area-inset-bottom));
  color: #d0d8de;
}

.zoom:has(.scene-depth) .zoom-view {
  background: #0a0d10;
  isolation: isolate;
  perspective: 850px;
}

.zoom:has(.scene-depth) .zoom-view::before {
  content: none;
}

.zoom:has(.scene-depth) .zoom-flight {
  z-index: 1;
}

.zoom:has(.scene-depth) .zoom-art {
  box-shadow: 0 0 32px #04060988;
}

.scene-depth {
  --scene-ink: 34 46 51;
  --scene-light: 98 136 139;
  --scene-x: 0px;
  --scene-y: 0px;
  --scene-tilt-x: 0deg;
  --scene-tilt-y: 0deg;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  isolation: isolate;
  background: rgb(var(--scene-ink) / .25);
  visibility: hidden;
}

.zoom-view[data-scene-depth] .scene-depth[data-ready] {
  visibility: visible;
}

.scene-depth__world,
.scene-depth__haze {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene-depth__world {
  transform: translate3d(calc(var(--scene-x) * -.65), calc(var(--scene-y) * -.65), 0)
    scale(1.07) rotateX(var(--scene-tilt-x)) rotateY(var(--scene-tilt-y));
  opacity: .34;
}

.scene-depth__haze {
  background:
    radial-gradient(ellipse at 51% 45%, transparent 22%, #080b0e89 75%, #080b0ed9 100%),
    linear-gradient(110deg, rgb(var(--scene-light) / .22), transparent 55%, rgb(var(--scene-ink) / .28));
  transform: translate3d(calc(var(--scene-x) * .35), calc(var(--scene-y) * .35), 0) scale(1.06);
}

.scene-depth::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .26;
  background:
    repeating-conic-gradient(from 11deg at 50% 49%, transparent 0deg 4deg, rgb(var(--scene-light) / .14) 4.16deg 4.35deg, transparent 4.5deg 8deg),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='ink'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23ink)' opacity='.4'/%3E%3C/svg%3E");
  mask-image: radial-gradient(ellipse at center, transparent 28%, #000 100%);
  mix-blend-mode: screen;
  transform: translate3d(calc(var(--scene-x) * .85), calc(var(--scene-y) * .85), 0) scale(1.11);
}

body[data-motion="off"] .scene-depth,
body[data-motion="off"] .scene-depth__world,
body[data-motion="off"] .scene-depth__haze,
body[data-motion="off"] .scene-depth::after {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .scene-depth,
  .scene-depth__world,
  .scene-depth__haze,
  .scene-depth::after {
    transform: none;
  }
}

@media (max-width: 600px) {
  .zoom:has(.scene-depth) .zoom-toolbar,
  .zoom:has(.scene-depth) .zoom-footer {
    padding-inline: max(6px, env(safe-area-inset-left));
  }
}
/* Keep the panel in a continuous field of darkness, with light touch controls. */
.zoom[open]:has(.scene-depth) { display:block; }
.zoom:has(.scene-depth) .zoom-view { position:absolute; inset:0; width:100%; height:100%; }
.zoom:has(.scene-depth) .zoom-toolbar {
  position:absolute;
  inset: max(10px,env(safe-area-inset-top)) 10px auto;
  background:none;
  border:0;
  pointer-events:none;
  padding:0;
}
.zoom-toolbar-start, .zoom-controls { pointer-events:auto; }
.zoom:has(.scene-depth) .zoom-toolbar button {
  background:#08101bd9;
  border:0;
  border-radius:4px;
  min-height:44px;
}
.zoom:has(.scene-depth) .zoom-footer {
  position:absolute;
  inset:auto 12px max(9px,env(safe-area-inset-bottom));
  border:0;
  background:none;
  padding:0;
  pointer-events:none;
}
.zoom-footer button { pointer-events:auto; background:#08101bd9; }
.zoom:has(.scene-depth) #zoom-close span { display:none; }
.zoom:has(.scene-depth) #zoom-close { min-width:44px; }
.zoom-controls, #zoom-soundtrack, .zoom-footer {
  opacity:0;
  transition:opacity .25s;
  visibility:hidden;
}
.zoom[data-controls] :is(.zoom-controls,#zoom-soundtrack,.zoom-footer),
.zoom:focus-within :is(.zoom-controls:focus-within,#zoom-soundtrack:focus,.zoom-footer:focus-within) {
  opacity:1;
  visibility:visible;
}
.scene-depth__world { opacity:.09; }
.scene-depth__haze { background:radial-gradient(ellipse at center,transparent 10%,#060a10db 78%); }
.scene-depth::after { display:none; }
.zoom:has(.scene-depth) .zoom-art { box-shadow:0 18px 70px #000b; }
@media(max-width:400px){
  .zoom:has(.scene-depth) .zoom-toolbar { inset-inline:5px; }
  .zoom:has(.scene-depth) .zoom-toolbar button { min-width:35px; padding-inline:3px; }
}

.zoom:has(.scene-depth) .zoom-art { transition:box-shadow .35s ease; }
.zoom:has(.scene-depth) .zoom-view:active .zoom-art {
  box-shadow:0 18px 70px #000b,0 0 36px rgb(var(--scene-light,98 136 139) / .18);
}
@media(prefers-reduced-motion:reduce){
  .zoom:has(.scene-depth) .zoom-art {transition:none}
}
