.hero-video {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  /* Pulled up behind the announcement bar (set via JS to its real, dynamic
     height) so the video shows through its translucent background instead
     of stopping short and leaving a solid strip with nothing behind it. */
  margin-top: calc(-1 * var(--announcement-bar-height, 0px));
  height: calc(100vh + var(--announcement-bar-height, 0px));
  height: calc(100dvh + var(--announcement-bar-height, 0px));
}

.hero-video__media,
.hero-video__media video,
.hero-video__media img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  object-position: 20% center;
}

@media screen and (max-width: 749px) {
  .hero-video__media,
  .hero-video__media video,
  .hero-video__media img {
    object-position: 50% center;
  }
}

.hero-video__overlay {
  position: absolute;
  inset: 0;
  background: rgb(var(--color-foreground));
  opacity: var(--hero-video-overlay-opacity, 0);
  pointer-events: none;
}

.hero-video__content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: rgb(var(--color-background));
  padding: 0 2rem;
}

.hero-video__content:empty {
  display: none;
}

.hero-video__cta {
  position: relative;
  display: inline-block;
  margin-top: 2.5rem;
  padding: 1.2rem 3rem;
  font-family: inherit;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgb(var(--color-background));
  border: none;
  background: none;
  filter: blur(0.9px) contrast(1.2) saturate(1.1);
  text-shadow:
    1.5px 0 0 rgba(255, 255, 255, 0.35),
    -1.5px 0 1px rgba(0, 0, 0, 0.3),
    0 1.5px 0 rgba(255, 255, 255, 0.15);
  animation: hero-video-shake 0.2s infinite steps(2, end);
  transform-origin: center;
}

.hero-video__cta:hover {
  color: #1f3f73;
  opacity: 1;
  animation: none;
}

.hero-video__cta-text {
  position: relative;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.hero-video__cta:hover .hero-video__cta-text {
  opacity: 0;
}

.hero-video__cta-video-src {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-video__cta-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28rem;
  height: 28rem;
  transform: translate(-50%, -50%);
  object-fit: contain;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-video__cta:hover .hero-video__cta-canvas {
  opacity: 1;
}

@keyframes hero-video-shake {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  20% {
    transform: translate(-2.5px, 2px) rotate(-1.4deg);
  }
  40% {
    transform: translate(2px, -2.5px) rotate(1.2deg);
  }
  60% {
    transform: translate(-2px, -2px) rotate(-1deg);
  }
  80% {
    transform: translate(2.5px, 2px) rotate(1.4deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-video__cta {
    animation: none;
  }
}

