* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 40vmax;
  aspect-ratio: 3 / 2;
  border-radius: 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 0px -80px;
  border-radius: inherit;
  opacity: 1;
  transform: scale(1);
  transition: all 0ms ease;
}
.video {
  height: 100%;
  position: absolute;
  border-radius: inherit;
  inset: 0;
  z-index: -1;
  opacity: 0;
}

.container:hover .image {
    transform:  scale(1.1);
    opacity: 0;
    transition: transform 500ms ease, opacity 500ms ease 300ms;
}
.container:hover .video {
  transform:  scale(1.05);
  opacity: 1;
}
