.hero-shell {
  --hero-edge-height: clamp(68px, 7.8vw, 112px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero-motion,
.hero-video,
.hero-motion-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-motion {
  z-index: 0;
  overflow: hidden;
}

.hero-video {
  display: block;
  object-fit: cover;
  object-position: center bottom;
  opacity: 0;
  transition: opacity 900ms ease;
}

.hero-motion.is-playing .hero-video {
  opacity: 1;
}

.hero-motion-shade {
  background: linear-gradient(90deg, #05291db0, #05291d85 53%, #05291d00 82%);
  opacity: 0;
  transition: opacity 900ms ease;
}

.hero-motion.is-playing .hero-motion-shade {
  opacity: 1;
}

.hero-shell > .hero {
  position: relative;
  z-index: 1;
  padding-bottom: var(--hero-edge-height);
}

.hero-edge {
  position: absolute;
  z-index: 2;
  right: -1px;
  bottom: -1px;
  left: -1px;
  height: var(--hero-edge-height);
  pointer-events: none;
}

.hero-edge svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-motion-toggle {
  position: absolute;
  z-index: 3;
  right: max(24px, calc((100% - 1280px) / 2));
  bottom: calc(var(--hero-edge-height) + 12px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #dce9cd70;
  border-radius: 50%;
  background: #f9f4df24;
  color: var(--cream);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 180ms ease, border-color 180ms ease;
}

.hero-motion-toggle[hidden] {
  display: none;
}

.hero-motion-toggle:hover {
  background: #f9f4df3d;
  border-color: #dce9cdb0;
}

.hero-motion-toggle:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}

.hero-motion-toggle svg {
  width: 18px;
  height: 18px;
}

.hero-motion-toggle .motion-play,
.hero-motion-toggle[data-paused='true'] .motion-pause {
  display: none;
}

.hero-motion-toggle[data-paused='true'] .motion-play {
  display: block;
}

@media (max-width: 640px) {
  .hero-shell {
    --hero-edge-height: 68px;
  }

  .hero-shell > .hero {
    padding-bottom: calc(var(--hero-edge-height) + 62px);
  }

  .hero-motion-toggle {
    right: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
    transition: none;
  }

  .hero-motion-shade {
    opacity: 0;
    transition: none;
  }

  .hero-motion-toggle {
    display: none;
  }
}
