html[data-screensaver="true"],
html[data-screensaver="true"] body {
  overflow: hidden !important;
  overscroll-behavior: none;
  background: var(--bg) !important;
}

.iom-screensaver {
  position: fixed;
  inset: 0;
  z-index: 12000;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  isolation: isolate;
}

/* DVD / Bounce ------------------------------------------------------------
   The mover is intentionally a square viewport, but JS collides the visible
   artwork bounds rather than this box. Wide, tall and asymmetric marks can
   therefore travel naturally all the way to the physical screen edge. */
.iom-dvd-mover {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(120px, 18vw, 280px);
  aspect-ratio: 1;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0,0,0);
  contain: layout paint style;
}
.iom-dvd-symbol {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  color: currentColor;
  fill: currentColor;
  transform: scale(var(--iom-dvd-optical-scale,1));
  transform-origin: 50% 50%;
  -webkit-user-drag: none;
}

/* Flying Marks ------------------------------------------------------------
   A compositor-oriented 3D field: no canvas, no WebGL, no per-frame layout
   reads. Color behaves differently from DVD: every new generated pair
   retargets an already-running linear transition. The 18s transition is
   intentionally longer than the ~12s target cadence, so the background and
   marks never settle on a palette or pause between color states. */
.iom-screensaver--flying {
  perspective: 1050px;
  perspective-origin: 50% 50%;
  transition-property: background-color, color;
  transition-duration: 18s, 18s;
  transition-timing-function: linear, linear;
  transition-delay: 0s, 0s;
}
.iom-flying-stage {
  position: absolute;
  inset: 0;
  overflow: visible;
  transform-style: preserve-3d;
  perspective: 1050px;
  perspective-origin: 50% 50%;
  contain: strict;
}
.iom-flying-mark {
  --iom-flying-size: clamp(92px, 12vw, 190px);
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--iom-flying-size);
  height: var(--iom-flying-size);
  margin-left: calc(var(--iom-flying-size) * -.5);
  margin-top: calc(var(--iom-flying-size) * -.5);
  display: grid;
  place-items: center;
  opacity: 0;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  backface-visibility: visible;
  pointer-events: none;
  will-change: transform, opacity;
  contain: layout paint style;
}
.iom-flying-symbol {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  color: currentColor;
  fill: currentColor;
  -webkit-user-drag: none;
}

@media (max-width: 720px) {
  .iom-dvd-mover { width: clamp(104px, 31vw, 180px); }
  .iom-flying-mark { --iom-flying-size: clamp(76px, 24vw, 138px); }
  .iom-screensaver--flying,
  .iom-flying-stage { perspective: 820px; }
}

@media (prefers-reduced-motion: reduce) {
  .iom-dvd-mover { width: clamp(110px, 16vw, 220px); }
}
