.case-study-hero__image,
.case-study-hero__image > .elementor-widget-container {
  position: relative;
}

.case-study-hero__image a.case-study-video__play {
  position: absolute;
  inset: auto auto 24px 24px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #161616;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  box-shadow: 0 4px 20px #0003;
  transition: background-color 150ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

@media (hover: hover) and (pointer: fine) {
  .case-study-hero__image a.case-study-video__play:hover {
    background: #333;
    color: #fff;
  }
}

.case-study-hero__image a.case-study-video__play:active {
  transform: scale(0.97);
}

.case-study-video__play svg {
  flex: none;
}

.case-study-video__play:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  box-shadow: 0 0 0 7px #161616;
}

html.case-study-video-open {
  overflow: hidden;
}

/* The dialog is a transparent frame: a close bar above the video. */
dialog.case-study-video__dialog {
  --case-study-video-bar: 52px;
  width: min(1100px, calc(100vw - 32px), calc((100vh - 32px - var(--case-study-video-bar)) * 16 / 9));
  width: min(1100px, calc(100vw - 32px), calc((100dvh - 32px - var(--case-study-video-bar)) * 16 / 9));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: none;
  color: #fff;
}

dialog.case-study-video__dialog[data-closing] {
  pointer-events: none;
}

.case-study-video__dialog::backdrop {
  background: rgb(10 10 10 / 0.88);
}

.case-study-video__bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: calc(var(--case-study-video-bar) - 44px);
}

.case-study-video__dialog button.case-study-video__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  color: #fff;
  cursor: pointer;
  transition: background-color 150ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

@media (hover: hover) and (pointer: fine) {
  .case-study-video__dialog button.case-study-video__close:hover {
    background: rgb(255 255 255 / 0.22);
  }
}

.case-study-video__dialog button.case-study-video__close:active {
  transform: scale(0.94);
}

.case-study-video__dialog :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.case-study-video__dialog video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: contain;
  background: #000;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 24px 64px rgb(0 0 0 / 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .case-study-hero__image a.case-study-video__play,
  .case-study-video__dialog button.case-study-video__close {
    transition: background-color 150ms ease;
  }

  .case-study-hero__image a.case-study-video__play:active,
  .case-study-video__dialog button.case-study-video__close:active {
    transform: none;
  }
}

@media (max-width: 767px) {
  .case-study-hero__image a.case-study-video__play {
    bottom: 16px;
    left: 16px;
  }
}
