* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #000;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0 auto;
  max-width: 1200px;
  padding: 24px;
  width: 100%;
}

.cover-pin {
  align-self: center;
  aspect-ratio: 1 / 1;
  max-height: 70vh;
  position: sticky;
  top: 24px;
  width: min(100%, 70vh);
  z-index: 1;
}

.cover-image {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  cursor: pointer;
  display: block;
  height: 100%;
  object-fit: cover;
  opacity: var(--cover-opacity, 1);
  touch-action: manipulation;
  transform: translate3d(0, 0, 0.01px);
  will-change: opacity;
  width: 100%;
}

.cover-image:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.cover-image.is-faded {
  pointer-events: none;
}

.cover-mini {
  -webkit-backface-visibility: hidden;
  aspect-ratio: 1 / 1;
  backface-visibility: hidden;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.34),
    0 30px 70px rgba(0, 0, 0, 0.52);
  cursor: pointer;
  left: 50%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 24px;
  touch-action: manipulation;
  transform: translate3d(-50%, -36px, 0.01px) scale3d(0.2, 0.2, 1);
  transform-origin: top center;
  transition:
    opacity 480ms cubic-bezier(0.19, 1, 0.22, 1),
    transform 700ms cubic-bezier(0.19, 1, 0.22, 1);
  width: min(calc(100vw - 48px), 70vh);
  will-change: opacity, transform;
  z-index: 4;
}

.cover-mini.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(-50%, 0, 0.01px) scale3d(0.2, 0.2, 1);
}

.cover-mini:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.video-embed {
  aspect-ratio: 16 / 9;
  position: relative;
  width: 100%;
  z-index: 2;
}

.video-embed iframe {
  border: 0;
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.video-open {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  inset: 0;
  padding: 0;
  position: absolute;
  width: 100%;
}

.lightbox {
  align-items: center;
  background: #000;
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px 24px 72px;
  position: fixed;
  z-index: 10;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-video {
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 96px);
  max-width: calc((100vh - 96px) * 16 / 9);
  position: relative;
  width: 100%;
}

.lightbox-video iframe {
  border: 0;
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.lightbox-close,
.lightbox-nav {
  border-radius: 2px;
}

.lightbox-close {
  appearance: none;
  background: #fff;
  border: 0;
  color: #000;
  cursor: pointer;
  font: 14px/1 sans-serif;
  padding: 10px 12px;
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 11;
}

.lightbox-nav {
  appearance: none;
  background: #fff;
  border: 0;
  color: #000;
  cursor: pointer;
  font: 14px/1 sans-serif;
  min-width: 92px;
  padding: 10px 12px;
  position: fixed;
  bottom: 24px;
  z-index: 11;
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

@media (max-width: 640px) {
  .video-list {
    gap: 16px;
    padding: 16px;
  }

  .cover-pin {
    top: 16px;
  }

  .cover-mini {
    top: 16px;
    width: min(calc(100vw - 32px), 70vh);
  }

  .lightbox {
    padding: 16px 16px 64px;
  }

  .lightbox-video {
    max-height: calc(100vh - 80px);
    max-width: calc((100vh - 80px) * 16 / 9);
  }

  .lightbox-close {
    right: 16px;
    top: 16px;
  }

  .lightbox-nav {
    bottom: 16px;
  }

  .lightbox-prev {
    left: 16px;
  }

  .lightbox-next {
    right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cover-image {
    transition: none;
  }

  .cover-mini {
    transition: none;
  }
}
