/* A body stacking context keeps both background planes above the page canvas. */
body { isolation: isolate; }
.world-mark { z-index: -2; }
/* ==========================================================================
   Mark 1 Quantum Spatial Rift (owner tuning: amplitudes ×1.8, brightness ×1.3)
   Readable text remains 100% still; only background space tears.
   ========================================================================== */


.avos-quantum-field {
  position: fixed;
  inset: 0;
  z-index: -1; /* Background plane: never filters foreground text. */
  pointer-events: none;
  overflow: hidden;
  contain: layout paint style;
}


.avos-quantum-band {
  position: absolute;
  left: -12vw;
  right: -12vw;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  filter: brightness(1.3); /* +30% only on the effect, never page text. */
  /* Вакуумная щель + интерференционная решётка + холодный призматический край */
  background:
    linear-gradient(90deg,
      transparent 4%,
      rgba(7, 18, 31, 0.92) 18%,
      rgba(23, 98, 194, 0.34) 48%,
      rgba(136, 222, 247, 0.42) 50%,
      rgba(7, 18, 31, 0.94) 82%,
      transparent 96%),
    repeating-linear-gradient(90deg,
      transparent 0px,
      transparent 10px,
      rgba(136, 222, 247, 0.16) 10px,
      rgba(136, 222, 247, 0.16) 11px);
  backdrop-filter: blur(3px) brightness(1.38) contrast(1.25);
  -webkit-backdrop-filter: blur(3px) brightness(1.38) contrast(1.25);
  border-top: 1px solid rgba(155, 228, 255, 0.78);
  border-bottom: 1px solid rgba(23, 98, 194, 0.62);
  box-shadow:
    0 0 28px rgba(136, 222, 247, 0.28),
    inset 0 1px 0 rgba(235, 245, 255, 0.55);
}


/* Тонкий лазерный шов разрыва горизонта */
.avos-quantum-band::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 1.5px;
  transform: translateY(-50%);
  background: linear-gradient(90deg,
    transparent 0%,
    #367ce0 18%,
    #88def7 45%,
    #ebf5ff 50%,
    #88def7 55%,
    #1762c2 82%,
    transparent 100%);
  box-shadow: 0 0 16px rgba(136, 222, 247, 0.85);
}


.avos-quantum-band--primary {
  height: var(--rift-h-1, 46px);
  top: var(--rift-y-1, 28vh);
}


.avos-quantum-band--secondary {
  height: var(--rift-h-2, 24px);
  top: var(--rift-y-2, 62vh);
}


.avos-quantum-band--micro {
  height: var(--rift-h-3, 12px);
  top: var(--rift-y-3, 44vh);
}


/* Фаза активного квантового разрыва при силе 260% */
html.is-quantum-rifting .avos-quantum-band--primary {
  animation: avos-quantum-tear-primary 120ms steps(4, end) both;
}


html.is-quantum-rifting .avos-quantum-band--secondary {
  animation: avos-quantum-tear-secondary 120ms steps(3, end) both;
}


html.is-quantum-rifting .avos-quantum-band--micro {
  animation: avos-quantum-tear-micro 120ms steps(2, end) both;
}


/* Преломление фонового крыла Antiverso и стеклянных диагоналей в момент импульса */
html.is-quantum-rifting .watching-mark,
html.is-quantum-rifting .world-mark,
html.is-quantum-rifting .glass-crossing {
  filter: brightness(1.3) url(#avos-quantum-rift-260) drop-shadow(-25.2px 0 0 rgba(136, 222, 247, 0.28)) drop-shadow(25.2px 0 0 rgba(23, 98, 194, 0.32));
}


@keyframes avos-quantum-tear-primary {
  100% { opacity: 0; transform: translate3d(0,0,0); }
  0%, 99.9% { opacity: .96; }
  0% { transform: translate3d(calc(var(--rift-dir,1) * 140.4px),0,0) skewX(calc(var(--rift-dir,1) * -19.8deg)) scaleY(1.15); }
  50% { transform: translate3d(calc(var(--rift-dir,1) * -93.6px),0,0) skewX(calc(var(--rift-dir,1) * 12.6deg)) scaleY(.9); }
  99% { transform: translate3d(calc(var(--rift-dir,1) * 39.6px),0,0) scaleY(.5); }
}
@keyframes avos-quantum-tear-secondary {
  100% { opacity: 0; transform: translate3d(0,0,0); }
  0%, 99.9% { opacity: .88; }
  0% { transform: translate3d(calc(var(--rift-dir,1) * -115.2px),0,0) skewX(calc(var(--rift-dir,1) * 16.2deg)) scaleY(1.1); }
  99% { transform: translate3d(calc(var(--rift-dir,1) * 61.2px),0,0) scaleY(.75); }
}
@keyframes avos-quantum-tear-micro {
  100% { opacity: 0; transform: translate3d(0,0,0); }
  0%, 99.9% { opacity: .92; }
  0% { transform: translate3d(calc(var(--rift-dir,1) * 165.6px),0,0); }
  99% { transform: translate3d(calc(var(--rift-dir,1) * -68.4px),0,0); }
}
/* Small spatial jitter only; no repeated brightness flashes or page shake. */
html.is-quantum-rifting .avos-quantum-field { animation: avos-rift-jitter 120ms steps(1,end) both; }
@keyframes avos-rift-jitter {
  0%,100% { transform: translate3d(0,0,0); }
  25% { transform: translate3d(1px,0,0); }
  50% { transform: translate3d(-1px,1px,0); }
  75% { transform: translate3d(0,-1px,0); }
}

/* Полное отключение в спокойном режиме и при prefers-reduced-motion */
.motion-paused .avos-quantum-field,
html.motion-paused .avos-quantum-band {
  display: none !important;
  animation: none !important;
  opacity: 0 !important;
}


@media (prefers-reduced-motion: reduce) {
  .avos-quantum-field,
  .avos-quantum-band {
    display: none !important;
    animation: none !important;
    opacity: 0 !important;
  }
}

/* Defensive CSS: stop the shader immediately, before controller callbacks. */
html.motion-paused.is-quantum-rifting :is(.watching-mark,.world-mark,.glass-crossing) { filter: none !important; }
@media (prefers-reduced-motion: reduce) { html.is-quantum-rifting :is(.watching-mark,.world-mark,.glass-crossing) { filter: none !important; } }

/* Hidden SVG definitions: stylesheet rule keeps strict CSP styles. */
.quantum-filter-definitions{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}
