/* Keep luminous video effects usable when a decoder flattens WebM alpha to black.
   Blend the effect's outer stacking context with this scene's background only.
   The separate astronaut image and typography retain their normal compositing. */
#nova-1,
#nova-2 {
  isolation: isolate;
}

#nova-1 .portal-layer,
#nova-2 .elementor-widget-html {
  mix-blend-mode: screen;
}

/* Supersede the earlier iOS-only blend on the inner video element. */
#nova-1 .portal-video {
  mix-blend-mode: normal !important;
  /* Fade the square video canvas before its perimeter, including decoders
     that leave a faint grey matte instead of preserving WebM transparency. */
  -webkit-mask-image: radial-gradient(circle closest-side, #000 0 68%, #000e 78%, #0006 90%, transparent 99%);
  mask-image: radial-gradient(circle closest-side, #000 0 68%, #000e 78%, #0006 90%, transparent 99%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* The second effect occupies an inset square in a 1920×1080 video, not the
   whole canvas. Follow its source centre (1365,495) through object-fit:cover.
   Container units account for the scrollbar without moving/scaling the video.
   Leave the existing phone crop and its source-aligned mask intact. */
@media (min-width: 768px) {
  #nova-2 #veil-motion-layer {
    container-type: size;
  }

  #nova-2 #veil-motion-video {
    --nova-effect-unit: max(calc(100cqw / 1920), calc(100cqh / 1080));
    --nova-effect-mask: radial-gradient(
      circle calc(var(--nova-effect-unit) * 380)
      at calc(50% + var(--nova-effect-unit) * 405) calc(50% - var(--nova-effect-unit) * 45),
      #000 0 64%, #000e 73%, #0007 84%, #0002 93%, transparent 100%
    );
    -webkit-mask-image: var(--nova-effect-mask);
    mask-image: var(--nova-effect-mask);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }
}
