/* v3 video. Figma: Video 11001:2953 (1440), mobile 11310:3912 (430). The card grows from a small rounded card to full width while it scrolls into view. */
.v3-video {
  --vd-dash: repeating-linear-gradient(180deg, var(--v3-gray-50) 0 3px, transparent 3px 5px);
  --vd-from: 0.62;               /* start scale of the appear animation */
  position: relative;
  background: var(--v3-bg-light);
  overflow-x: clip;
  isolation: isolate;
}
.v3-video::before {              /* dashed guide lines: 5 on desktop, 2 on mobile */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  max-width: var(--v3-container-max);
  margin-inline: auto;
  pointer-events: none;
  background:
    var(--vd-dash) 3.47% 0 / 1px 100% no-repeat,
    var(--vd-dash) 26.94% 0 / 1px 100% no-repeat,
    var(--vd-dash) 50% 0 / 1px 100% no-repeat,
    var(--vd-dash) 73.06% 0 / 1px 100% no-repeat,
    var(--vd-dash) 96.53% 0 / 1px 100% no-repeat;
}

.v3-video__frame {
  --p: 1;                        /* scroll progress 0..1, set by js/v3/sections/video.js where animation-timeline is unsupported */
  position: relative;
  aspect-ratio: 1316 / 692;
  overflow: hidden;
  border-radius: var(--v3-radius-lg);
  background: var(--v3-dark);
  transform: scale(calc(var(--vd-from) + (1 - var(--vd-from)) * var(--p)));
  transform-origin: 50% 50%;
  will-change: transform;
}
.v3-video__poster,
.v3-video__frame > iframe,
.v3-video__frame > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.v3-video__poster { object-fit: cover; object-position: 50% 0; }

.v3-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}
.v3-video__play:hover { transform: translate(-50%, -50%) scale(1.08); }
.v3-video__play:focus-visible { outline: 2px solid var(--v3-primary); outline-offset: 4px; }
.v3-video__play img { display: block; width: 100%; height: 100%; }

@supports (animation-timeline: view()) {
  .v3-video__frame {
    transform: none;
    animation: v3-video-grow linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 38%;
  }
}
@keyframes v3-video-grow {
  from { transform: scale(var(--vd-from)); }
  to { transform: scale(1); }
}

@media (max-width: 768px) {
  .v3-video { --vd-from: 0.8; }
  .v3-video::before {
    max-width: none;
    background:
      var(--vd-dash) 16px 0 / 1px 100% no-repeat,
      var(--vd-dash) calc(100% - 16px) 0 / 1px 100% no-repeat;
  }
  .v3-video__frame { aspect-ratio: 390 / 320; border-radius: var(--v3-radius-md); }
}

@media (prefers-reduced-motion: reduce) {
  .v3-video__frame { transform: none; animation: none; will-change: auto; }
  .v3-video__play { transition: none; }
}
