.video-coverflow {
  --coverflow-card-width: clamp(240px, 22vw, 374px);
  --coverflow-near-distance: clamp(190px, 18vw, 300px);
  --coverflow-far-distance: clamp(330px, 32vw, 510px);
  position: relative;
  width: 100%;
  padding: clamp(52px, 7vw, 88px) 0 clamp(60px, 8vw, 104px);
  overflow: hidden;
  border-block: 1px solid #e8e9e4;
  background: #faf9f5;
  color: var(--ink, #070707);
  isolation: isolate;
}

.video-coverflow__copy {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto clamp(24px, 4vw, 40px);
  text-align: center;
}

.video-coverflow__copy h2 {
  margin: 0 0 10px;
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.video-coverflow__copy p:last-child {
  margin: 0;
  color: #4f5954;
  font-size: clamp(16px, 1.7vw, 21px);
}

.video-coverflow__viewport {
  position: relative;
  width: min(100%, 1500px);
  height: clamp(520px, 49vw, 680px);
  margin: 0 auto;
  touch-action: pan-y;
  user-select: none;
}

.video-coverflow__track {
  position: absolute;
  inset: 0;
  perspective: 1400px;
}

.video-coverflow__card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--coverflow-card-width);
  aspect-ratio: 9 / 16;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #111814;
  box-shadow: 0 18px 44px rgba(13, 22, 17, 0.18);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.68);
  transform-origin: center;
  transition:
    transform 360ms cubic-bezier(0.22, 0.8, 0.2, 1),
    opacity 280ms ease,
    filter 280ms ease,
    box-shadow 280ms ease;
  will-change: transform, opacity;
}

.video-coverflow__card[data-offset="-2"] {
  z-index: 1;
  opacity: 0.32;
  pointer-events: auto;
  filter: saturate(0.62) brightness(1.05);
  transform: translate(calc(-50% - var(--coverflow-far-distance)), -50%) scale(0.72);
}

.video-coverflow__card[data-offset="-1"] {
  z-index: 2;
  opacity: 0.78;
  pointer-events: auto;
  filter: saturate(0.82) brightness(0.96);
  transform: translate(calc(-50% - var(--coverflow-near-distance)), -50%) scale(0.86);
}

.video-coverflow__card[data-offset="0"] {
  z-index: 5;
  opacity: 1;
  pointer-events: auto;
  filter: none;
  box-shadow: 0 28px 70px rgba(10, 18, 14, 0.28);
  transform: translate(-50%, -50%) scale(1);
}

.video-coverflow__card[data-offset="1"] {
  z-index: 2;
  opacity: 0.78;
  pointer-events: auto;
  filter: saturate(0.82) brightness(0.96);
  transform: translate(calc(-50% + var(--coverflow-near-distance)), -50%) scale(0.86);
}

.video-coverflow__card[data-offset="2"] {
  z-index: 1;
  opacity: 0.32;
  pointer-events: auto;
  filter: saturate(0.62) brightness(1.05);
  transform: translate(calc(-50% + var(--coverflow-far-distance)), -50%) scale(0.72);
}

.video-coverflow__card:hover[data-offset="-1"],
.video-coverflow__card:hover[data-offset="1"] {
  filter: saturate(0.96) brightness(1);
}

.video-coverflow__card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111814;
  pointer-events: none;
}

.video-coverflow__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.03) 45%, rgba(0, 0, 0, 0.82) 100%);
  pointer-events: none;
}

.video-coverflow__sound-hint {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  background: rgba(8, 14, 11, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(8px);
}

.video-coverflow__sound-hint svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.video-coverflow__sound-hint svg path:last-child {
  fill: none;
}

.video-coverflow__card[data-offset="0"]:not(.is-audible) .video-coverflow__sound-hint {
  opacity: 1;
  transform: translateY(0);
}

.video-coverflow__meta {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: flex-end;
  pointer-events: none;
}

.video-coverflow__play {
  position: relative;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.video-coverflow__play::before {
  position: absolute;
  top: 50%;
  left: 52%;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 15px solid currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.video-coverflow__card.is-playing .video-coverflow__play::before {
  width: 13px;
  height: 20px;
  border: 0;
  background: linear-gradient(90deg, currentColor 0 4px, transparent 4px 9px, currentColor 9px 13px);
}

.video-coverflow__arrow {
  position: absolute;
  top: 50%;
  z-index: 8;
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  place-items: center;
  border: 1px solid #dde1dc;
  border-radius: 50%;
  background: #fff;
  color: #111814;
  box-shadow: 0 10px 28px rgba(10, 18, 14, 0.15);
  cursor: pointer;
  transform: translateY(-50%);
  transition: border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.video-coverflow__arrow:hover {
  border-color: var(--green, #15803d);
  color: var(--green, #15803d);
  box-shadow: 0 12px 34px rgba(10, 18, 14, 0.2);
}

.video-coverflow__arrow svg {
  width: 23px;
  height: 23px;
  stroke-width: 2.2;
}

.video-coverflow__arrow--previous {
  left: clamp(14px, 6vw, 96px);
}

.video-coverflow__arrow--next {
  right: clamp(14px, 6vw, 96px);
}

.video-coverflow__dots {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.video-coverflow__dot {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.video-coverflow__dot::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #bdc5bf;
  content: "";
  transform: translate(-50%, -50%);
  transition: width 180ms ease, background 180ms ease;
}

.video-coverflow__dot[aria-current="true"]::before {
  width: 26px;
  background: var(--green, #15803d);
}

.video-coverflow__status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .video-coverflow {
    --coverflow-card-width: min(72vw, 288px);
    --coverflow-near-distance: min(43vw, 168px);
    padding: 48px 0 60px;
  }

  .video-coverflow__copy {
    margin-bottom: 20px;
  }

  .video-coverflow__copy h2 {
    font-size: clamp(30px, 10vw, 40px);
  }

  .video-coverflow__copy p:last-child {
    font-size: 16px;
  }

  .video-coverflow__viewport {
    height: clamp(470px, 128vw, 550px);
  }

  .video-coverflow__card[data-offset="-2"],
  .video-coverflow__card[data-offset="2"] {
    opacity: 0;
    pointer-events: none;
  }

  .video-coverflow__card[data-offset="-1"] {
    opacity: 0.46;
    transform: translate(calc(-50% - var(--coverflow-near-distance)), -50%) scale(0.82);
  }

  .video-coverflow__card[data-offset="1"] {
    opacity: 0.46;
    transform: translate(calc(-50% + var(--coverflow-near-distance)), -50%) scale(0.82);
  }

  .video-coverflow__arrow {
    width: 46px;
    height: 46px;
  }

  .video-coverflow__arrow--previous {
    left: 8px;
  }

  .video-coverflow__arrow--next {
    right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-coverflow__card,
  .video-coverflow__dot::before,
  .video-coverflow__arrow,
  .video-coverflow__sound-hint {
    transition: none;
  }
}
