@font-face {
  font-family: "OCR-B";
  font-style: normal;
  font-weight: 400;
  src: url("./assets/fonts/ocrb.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  touch-action: pan-y;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #000;
  display: flex;
  flex-direction: column;
  font-family: "OCR-B", monospace;
  min-height: 100vh;
  text-transform: uppercase;
}

.site-header {
  align-items: start;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.96) 0%,
    rgba(0, 0, 0, 0.7) 42%,
    rgba(0, 0, 0, 0) 100%
  );
  color: #fff;
  display: grid;
  font: 15px/1 "OCR-B", monospace;
  grid-template-columns: 1fr auto 1fr;
  inset: 0 0 auto;
  padding: 20px 24px 58px;
  pointer-events: none;
  position: fixed;
  width: 100%;
  z-index: 40;
}

.site-header-link {
  color: inherit;
  pointer-events: auto;
  text-decoration: none;
}

.site-header-link:hover {
  opacity: 0.7;
}

.site-header-title {
  grid-column: 2;
}

.site-header-buy {
  grid-column: 3;
  justify-self: end;
}

.ascii-hero {
  aspect-ratio: 3840 / 1424;
  padding-top: 102px;
  width: 100%;
}

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

.video-list {
  align-content: center;
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 0 auto;
  padding: 24px 24px 102px;
  width: 100%;
}

.site-footer {
  color: #fff;
  display: grid;
  font: 15px/1 "OCR-B", monospace;
  grid-template-columns: 1fr auto 1fr;
  padding: 0 24px 24px;
  width: 100%;
}

.site-footer-link {
  color: inherit;
  justify-self: start;
  text-decoration: none;
  width: fit-content;
}

.site-footer-link:hover {
  opacity: 0.7;
}

.site-footer-title {
  grid-column: 2;
  justify-self: center;
}

.site-footer-right {
  grid-column: 3;
  justify-self: end;
}

.video-embed {
  --video-overlay-opacity: 0.15;
  aspect-ratio: 16 / 9;
  background: #111;
  position: relative;
  width: 100%;
  z-index: 2;
}

.video-embed::before {
  background: #000;
  content: "";
  inset: 0;
  opacity: var(--video-overlay-opacity);
  pointer-events: none;
  position: absolute;
  transition: opacity 240ms ease;
  z-index: 3;
}

.video-embed.is-playing {
  --video-overlay-opacity: 0;
}

.video-spacer {
  display: none;
}

.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%;
  z-index: 4;
}

.video-meta {
  bottom: 12px;
  color: #fff;
  display: flex;
  flex-direction: column;
  font: 14px/1.2 "OCR-B", monospace;
  gap: 2px;
  left: 12px;
  pointer-events: none;
  position: absolute;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  z-index: 5;
}

.video-duration {
  opacity: 0.72;
}

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

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

.lightbox-video {
  aspect-ratio: 16 / 9;
  background: #000;
  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: 15px/1 "OCR-B", monospace;
  padding: 10px 12px;
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 101;
}

.lightbox-nav {
  appearance: none;
  background: #fff;
  border: 0;
  color: #000;
  cursor: pointer;
  font: 15px/1 "OCR-B", monospace;
  min-width: 92px;
  padding: 10px 12px;
  position: fixed;
  bottom: 24px;
  z-index: 101;
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

@media (max-width: 640px), (max-width: 1024px) and (orientation: portrait) {
  html {
    scroll-padding-top: 94px;
    scroll-snap-type: y proximity;
  }

  .site-header {
    font-size: 14px;
    padding: 17px 16px 48px;
  }

  .ascii-hero {
    aspect-ratio: 16 / 9;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
    margin: 94px 16px 0;
    overflow: hidden;
    padding-top: 0;
    position: sticky;
    scroll-snap-align: start;
    top: 94px;
    width: auto;
    z-index: 1;
  }

  .ascii-video {
    height: 100%;
    object-fit: cover;
  }

  .video-list {
    align-content: start;
    flex: none;
    gap: 24px;
    grid-template-columns: 1fr;
    padding: 24px 16px 16px;
  }

  .video-embed {
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
    position: sticky;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    top: 94px;
    z-index: var(--stack-index, 2);
  }

  .video-meta {
    bottom: 10px;
    font-size: 13px;
    left: 10px;
  }

  .video-spacer {
    aspect-ratio: 16 / 9;
    display: block;
    scroll-snap-align: start;
  }

  .site-footer {
    font-size: 14px;
    padding: 0 16px 16px;
  }

  .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;
  }
}
