:root {
  --bg: #000;
  --fg: #e8e8e8;
  --muted: #a1a1a1;
  --overlay: rgba(0, 0, 0, 0.7);
  --focus: #ffffff;
  --head-font: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --text-font: Helvetica, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--text-font);
}

body.modal-open {
  overflow: hidden;
}

.page {
  width: min(1160px, 94vw);
  margin: 0 auto;
  padding: 2rem 0 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero {
  margin: 0 0 100px;
}

.logo-img {
  display: block;
  margin: 0 auto;
  width: min(900px, 78vw);
  max-height: 220px;
  object-fit: contain;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.tile {
  position: relative;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: #0e0e0e;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.tile:focus-visible,
.close:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.tile:hover,
.tile:focus-visible {
  transform: scale(1.03);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

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

.empty-msg {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
}

.footer-nav {
  margin-top: auto;
  text-align: center;
  font-family: var(--head-font);
  font-size: 1rem;
  line-height: 1.45;
  padding-top: 2rem;
}

.footer-nav a {
  color: var(--fg);
  text-decoration: none;
  font-size: clamp(0.88rem, 1.2vw, 1.02rem);
}

.footer-nav a + a {
  margin-left: 1.2rem;
}

.footer-nav a:last-child {
  display: block;
  margin-left: 0;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 2.4rem 1rem 1.4rem;
}

.backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.player-shell {
  position: relative;
  width: min(1100px, 92vw);
  z-index: 1;
}

.player-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 2;
}

.player-loading::after {
  content: "";
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: player-spin 700ms linear infinite;
}

.player-shell.is-loading .player-loading {
  opacity: 1;
}

.player-shell.is-loading .player {
  opacity: 0;
}

@keyframes player-spin {
  to {
    transform: rotate(360deg);
  }
}

.close {
  position: absolute;
  right: -0.2rem;
  top: -2.2rem;
  border: 0;
  border-radius: 0.3rem;
  background: transparent;
  color: var(--fg);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  z-index: 3;
}

.player {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 6.5rem);
  display: block;
  background: #000;
  border-radius: 4px;
  z-index: 1;
  transition: opacity 120ms ease;
}

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

@media (max-width: 1024px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .page {
    padding-top: 1.2rem;
  }

  .hero {
    margin-bottom: 2.2rem;
  }

  .logo-img {
    width: min(760px, 86vw);
    max-height: 170px;
  }

  .modal {
    padding: 2rem 0.5rem 1rem;
  }

  .player-shell {
    width: 96vw;
  }

  .close {
    top: -2rem;
    right: 0;
  }

  .footer-nav {
    font-size: 0.92rem;
    line-height: 1.4;
    padding-top: 1.4rem;
  }

  .footer-nav a + a {
    margin-left: 0.8rem;
  }
}
