* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: #fff;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

body.player-page {
  overflow: hidden;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#pair {
  position: absolute;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
}

.video-panel {
  width: 50%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

#floating-nav {
  position: fixed;
  top: 32px;
  right: 32px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.251);
  border-radius: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-item {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}

.nav-item.active {
  background: #000;
  color: #fff;
}

/* invisible click zones covering left/right halves of the screen */
.hit-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  cursor: pointer;
  z-index: 5;
}

#hit-left {
  left: 0;
}

#hit-right {
  right: 0;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 28px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 6;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

#arrow-left { left: 24px; }
#arrow-right { right: 24px; }

#hit-left:hover ~ #arrow-left,
#hit-right:hover ~ #arrow-right {
  opacity: 0.85;
}

#counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.1em;
  z-index: 6;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  pointer-events: none;
}

#loading, #empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  z-index: 10;
  background: #000;
}

#empty .small {
  color: #999;
  font-size: 12px;
  line-height: 1.6;
}

#empty code {
  color: #ccc;
  background: #1a1a1a;
  padding: 2px 6px;
  border-radius: 3px;
}

#empty a {
  color: #fff;
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* about / info pages */
body.dark-page {
  background: #000;
}

.dark-content {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 80px 24px;
  text-align: center;
}

.dark-content h1 {
  max-width: 900px;
  color: #fff;
  font-weight: 300;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.dark-content p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.7;
}

/* info overlay (toggled by the "Info" nav item on the player page) */
#info-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 15;
  pointer-events: none;
}

#info-overlay.visible {
  pointer-events: auto;
}

.info-card-slot {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.info-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.info-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: #f2f2f2;
  color: #333;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.info-close:hover {
  background: #e5e5e5;
}

#info-overlay.visible .info-card {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.info-card.hidden {
  display: none;
}

.info-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #000;
  text-transform: uppercase;
}

.info-desc {
  margin-top: 8px;
  font-size: 14px;
  color: #555;
}

.info-meta {
  margin-top: 2px;
  font-size: 14px;
  color: #555;
}

.info-divider {
  margin: 20px 0;
  height: 1px;
  background: #eaeaea;
}

.info-credits {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-credit-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-credit-row .info-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
}

.info-credit-row .info-value {
  font-size: 16px;
  color: #111;
}

/* index / archive page - inverted palette, full bleed */
body.archive-page {
  background: #000;
}

body.archive-page #floating-nav {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

body.archive-page .nav-item {
  color: #fff;
}

body.archive-page .nav-item.active {
  background: #fff;
  color: #000;
}

#archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0;
  padding: 0;
}

.archive-cell {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #000;
  text-decoration: none;
}

.archive-cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.archive-cell:hover video {
  opacity: 1;
}

#archive-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 32px;
  color: #888;
  font-size: 12px;
}

.archive-footer-links {
  display: flex;
  gap: 24px;
}

.archive-footer-links a {
  color: #888;
  text-decoration: none;
}

.archive-footer-links a:hover {
  color: #fff;
}

#archive-empty {
  padding: 140px 24px 40px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

#archive-empty a {
  color: #fff;
  text-decoration: underline;
}

/* mobile: stack the pair top/bottom instead of side by side,
   pin the nav to the bottom of the screen */
@media (max-width: 640px) {
  #pair {
    flex-direction: column;
  }

  .video-panel {
    width: 100%;
    height: 50%;
  }

  #floating-nav {
    top: auto;
    right: auto;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
  }

  .hit-zone {
    width: 100%;
    height: 50%;
    bottom: auto;
  }

  #hit-left {
    top: 0;
  }

  #hit-right {
    top: 50%;
    left: 0;
  }

  .arrow {
    display: none;
  }

  #counter {
    bottom: 76px;
  }

  #info-overlay {
    flex-direction: column;
  }

  .info-card-slot {
    width: 100%;
    height: 50%;
    padding: 20px;
  }

  .info-card {
    padding: 24px;
    max-height: 100%;
    overflow-y: auto;
  }

  #archive-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #archive-footer {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 100px;
  }

  .dark-content {
    padding: 24px;
    padding-bottom: 100px;
    gap: 24px;
  }
}
