.mdsv {
  --mdsv-top: 0px;
  --mdsv-desktop-distance: 320svh;
  --mdsv-mobile-distance: 230svh;
  --mdsv-distance: var(--mdsv-desktop-distance);
  --mdsv-stage-height: max(1px, calc(100svh - var(--mdsv-top)));
  position: relative;
  width: 100%;
  background: #080a0c;
  isolation: isolate;
}
.mdsv, .mdsv * { box-sizing: border-box; }
.mdsv--scroll { min-height: calc(var(--mdsv-stage-height) + var(--mdsv-distance)); }
.mdsv__stage {
  position: relative;
  height: var(--mdsv-stage-height);
  overflow: hidden;
  background: #080a0c;
}
.mdsv--scroll .mdsv__stage { position: sticky; top: var(--mdsv-top); }
.mdsv .mdsv__video, .mdsv .mdsv__poster, .mdsv .mdsv__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  object-fit: cover;
  pointer-events: none;
}
.mdsv .mdsv__video { visibility: hidden; }
.mdsv[data-state="ready"] .mdsv__video { visibility: visible; }
.mdsv--bleed {
  width: var(--mdsv-viewport-width, 100%);
  max-width: none;
  margin-left: calc(50% - var(--mdsv-viewport-width, 100%) / 2);
  margin-bottom: clamp(48px, 7vw, 96px);
}
/* The original desktop overview has a fixed height. Let it contain the
   inserted scroll runway so following sections cannot overlap the video. */
.md-v4l-product.mdsv-host > .md-v4l-overview { height: auto !important; }
/* The product's overflow:hidden prevents page sticky. clip keeps clipping
   without creating a separate scroll container. */
.md-v4l-product.mdsv-host { overflow: clip !important; }
@supports not (overflow: clip) {
  .md-v4l-product.mdsv-host { overflow: visible !important; }
}
@media (max-width: 767px) {
  .mdsv { --mdsv-distance: var(--mdsv-mobile-distance); }
}
@media (prefers-reduced-motion: reduce) {
  .mdsv--scroll { min-height: 0; }
  .mdsv--scroll .mdsv__stage { position: relative; }
  .mdsv .mdsv__video { visibility: hidden; }
}

/* Match the introduction's measured top whitespace at every viewport size. */
.mdsv-host .md-v4l-overview__intro + .mdsv { margin-top: var(--mdsv-intro-gap, 124px); }
@media (max-width: 1023px) {
  .mdsv-host .md-v4l-overview__intro + .mdsv { margin-top: var(--mdsv-intro-gap, 60px); }
}

/* Match dark pixels to the page color without adding the two colors.
   Black mode leaves the original media and display styles intact. */
.mdsv-host .mdsv[data-mdsv-background="match"],
.mdsv-host .mdsv[data-mdsv-background="match"] .mdsv__stage { background: #12161e; }
.mdsv-host .mdsv[data-mdsv-background="match"] .mdsv__video,
.mdsv-host .mdsv[data-mdsv-background="match"] .mdsv__poster { mix-blend-mode: lighten; }
.mdsv-host .mdsv[data-state="ready"] .mdsv__poster { visibility: hidden; }

/* Mobile uses a bounded image sequence, independent of Safari media playback. */
.mdsv .mdsv__canvas { visibility: hidden; }
.mdsv[data-renderer="frames"] .mdsv__video { visibility: hidden; }
.mdsv[data-renderer="frames"][data-state="ready"] .mdsv__canvas { visibility: visible; }
.mdsv-host .mdsv[data-mdsv-background="match"] .mdsv__canvas { mix-blend-mode: lighten; }
@media (max-width: 1023px) and (orientation: portrait) {
  .mdsv .mdsv__video, .mdsv .mdsv__poster, .mdsv .mdsv__canvas { object-fit: contain; }
}
@supports not (height: 100svh) {
  .mdsv { --mdsv-stage-height: max(1px, calc(100vh - var(--mdsv-top))); --mdsv-distance: 320vh; }
  @media (max-width: 767px) { .mdsv { --mdsv-distance: 230vh; } }
}

/* Compact mobile flow: no full-screen letterbox or empty sticky runway. */
@media (max-width: 1023px) {
  .mdsv, .mdsv--scroll { min-height: 0; }
  .mdsv .mdsv__stage { position: relative; top: auto; height: auto; aspect-ratio: 16 / 9; }
  .mdsv-host .md-v4l-overview__intro { margin-bottom: 0; }
  .mdsv-host .md-v4l-overview__intro + .mdsv { margin-top: var(--mdsv-intro-gap, 60px); margin-bottom: var(--mdsv-title-gap, 30px); }
  .mdsv-host .mdsv + .md-v4l-overview__title { margin-top: 0; }
}

@media (max-width: 1023px) {
  .md-v4l-product.mdsv-host > .md-v4l-overview.mdsv-mobile-pin {
    height: calc(var(--mdsv-scene-height) + var(--mdsv-pin-distance, 320svh)) !important;
  }
  .mdsv-mobile-scene {
    position: sticky;
    top: var(--mdsv-pin-top, 0px);
  }
}
