/* Client testimonial video on the project pages. The cover (play button, name, length)
   is added by assets/js/testimonial-video.js and fades out once the video is playing. */

.testimonial_video_wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 2px solid #2A2B25;
  border-radius: 16px;
  background: #131615;
  box-shadow: 0 32px 64px -32px rgba(14, 16, 15, 0.55);
}

.testimonial_video_wrap video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.testimonial_video_cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(14, 16, 15, 0) 42%, rgba(14, 16, 15, 0.9) 100%);
  color: #FFFCE1;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.4s ease;
}

.testimonial_video_cover:focus-visible {
  outline: 3px solid #FFE32A;
  outline-offset: -6px;
}

.testimonial_video_wrap.is-playing .testimonial_video_cover {
  opacity: 0;
  pointer-events: none;
}

.testimonial_video_play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #FFE32A;
  color: #0E100F;
  box-shadow: 0 12px 32px rgba(14, 16, 15, 0.4);
  transform: translate(-50%, -50%);
  transition: transform 0.7s cubic-bezier(0.625, 0.05, 0, 1);
}

.testimonial_video_play::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid #FFE32A;
  border-radius: 50%;
  animation: testimonialVideoPulse 2.4s cubic-bezier(0.25, 0.6, 0.3, 1) infinite;
}

.testimonial_video_play svg {
  width: 28px;
  height: 28px;
  margin-left: 4px;
}

.testimonial_video_cover:hover .testimonial_video_play,
.testimonial_video_cover:focus-visible .testimonial_video_play {
  transform: translate(-50%, -50%) scale(1.08);
}

.testimonial_video_meta {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 22px 20px;
  font-family: 'Inter', sans-serif;
}

.testimonial_video_name {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.testimonial_video_info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1.4;
  text-transform: uppercase;
  color: rgba(255, 252, 225, 0.72);
}

.testimonial_video_duration {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 252, 225, 0.16);
  color: #FFFCE1;
  letter-spacing: 0.5px;
}

/* Spinner in the play button while the video starts */
.testimonial_video_wrap.is-loading .testimonial_video_cover {
  pointer-events: none;
}

.testimonial_video_wrap.is-loading .testimonial_video_play svg {
  opacity: 0;
}

.testimonial_video_wrap.is-loading .testimonial_video_play::before {
  animation: none;
  opacity: 0;
}

.testimonial_video_wrap.is-loading .testimonial_video_play::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(14, 16, 15, 0.25);
  border-top-color: #0E100F;
  border-radius: 50%;
  animation: testimonialVideoSpin 0.8s linear infinite;
}

@keyframes testimonialVideoPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes testimonialVideoSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .testimonial_video_play::before {
    animation: none;
    opacity: 0;
  }
}
