.videoAnimation {
  transition:
    border-radius 0.6s cubic-bezier(.7,1.7,.7,1),
    box-shadow 0.4s cubic-bezier(.7,1.7,.7,1),
    border-color 0.4s cubic-bezier(.7,1.7,.7,1),
    background 0.4s cubic-bezier(.7,1.7,.7,1),
    transform 0.7s cubic-bezier(.7,1.7,.7,1),
    opacity 0.5s cubic-bezier(.7,1.7,.7,1);
  opacity: 0.5;
  border: 2px solid #111;
  border-radius: 2em; /* very round at start */
  box-shadow: none;
  background: transparent;
  transform: scale(0.7);
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* Responsive 16:9 aspect ratio for the video wrapper */
.videoAnimation__video {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  background: transparent;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(.7,1.7,.7,1), transform 0.5s cubic-bezier(.7,1.7,.7,1);
  will-change: opacity, transform;
  pointer-events: auto;
  z-index: 2;
}

/* 9:16 aspect ratio (portrait/vertical) */
.videoAnimation__video.video-9-16 {
  padding-top: 177.78%; /* 9:16 aspect ratio */
}

/* Alternative approach for 9:16 */
.videoAnimation.video-9-16 .videoAnimation__video {
  padding-top: 177.78% !important;
}

/* 1:1 aspect ratio (square) */
.videoAnimation__video.video-1-1 {
  padding-top: 100%; /* 1:1 aspect ratio */
}

/* Alternative approach for 1:1 */
.videoAnimation.video-1-1 .videoAnimation__video {
  padding-top: 100% !important;
}

.videoAnimation__video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  border: none;
  display: block;
  background: transparent;
  pointer-events: auto;
  aspect-ratio: 16/9;
}

/* 9:16 iframe aspect ratio */
.videoAnimation__video.video-9-16 iframe {
  aspect-ratio: 9/16;
}

/* 1:1 iframe aspect ratio */
.videoAnimation__video.video-1-1 iframe {
  aspect-ratio: 1/1;
}

/* When in center, animate in */
.videoAnimation.is-in-center {
  opacity: 1;
  border-radius: 0.7em; /* less round, but not sharp */
  border-color: transparent;
  background: transparent;
  transform: scale(1);
}

.videoAnimation.is-in-center .videoAnimation__video {
  opacity: 1;
  pointer-events: auto;
  animation: video-bounce-in 0.6s cubic-bezier(.7,1.7,.7,1);
  transform: scale(1);
}

@keyframes video-bounce-in {
  0%   { transform: scale(0.95); }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}