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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: #111111;
  color: #ffffff;
  font-family: 'IBM Plex Mono', monospace;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Light mode */
body.light-mode {
  background: #fafafa;
  color: #111111;
}

.container {
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.carousel {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 48px);
  padding: 0 calc(50vw - clamp(130px, 13vw, 190px));
  transition: transform 0.3s ease-out;
  will-change: transform;
}

/* Logo card */
.logo-card {
  flex-shrink: 0;
  width: clamp(260px, 26vw, 380px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 0.5;
  cursor: pointer;
}

.logo-card.active {
  opacity: 1;
}

/* Mini logo - shown when main logo is off-viewport */
.mini-logo {
  position: fixed;
  /* Centered between seek bar (28px) and top of active card (50vh - half scaled height) */
  top: calc((28px + 50vh - clamp(297px, 29.7vw, 429px)) / 2);
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.mini-logo img {
  height: 64px;
  width: auto;
}

.mini-logo.visible {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.logo-img {
  max-width: 100%;
  height: auto;
}

/* Mix cards */
.card {
  flex-shrink: 0;
  width: clamp(260px, 26vw, 380px);
  height: clamp(540px, 54vw, 780px);
  border-radius: 8px;
  border: 0.5px solid rgba(128, 128, 128, 0.55);
  overflow: hidden;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 0.5;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.card.active {
  transform: scale(1.1);
  opacity: 1;
}

.card-artwork-wrapper {
  position: relative;
  flex-shrink: 0;
}

.card-artwork {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.play-button {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.play-button svg {
  width: 24px;
  height: 24px;
  margin-left: 2px; /* Optical alignment for play icon */
}

.play-button:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.9);
}

.card-info {
  padding: 16px 24px 24px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.card-number {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 32px;
  line-height: 1.3;
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.card-number:hover {
  opacity: 0.7;
}

.card-tracks {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.5;
  list-style-position: inside;
  padding-left: 0;
  overflow: hidden;
}

.card-tracks li {
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.card-tracks li:hover {
  opacity: 0.6;
}

.card.active .card-tracks li {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.card-tracks li::marker {
  font-family: 'IBM Plex Mono', monospace;
}

.track-title {
  font-weight: 600;
}

.track-artist {
  font-weight: 400;
  opacity: 0.8;
}

.card-curator {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: auto;
}

.instructions {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  opacity: 0.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 14px;
}

/* Mobile: vertical scroll */
@media (max-width: 768px) {
  html, body {
    height: auto;
    overflow: auto;
  }

  .container {
    height: auto;
    align-items: flex-start;
    overflow: visible;
    padding: 24px 0 90px; /* Bottom space for player bar */
  }

  .carousel {
    flex-direction: column;
    padding: 0;
    gap: 32px;
    align-items: center;
    width: 100%;
    transform: none !important;
    transition: none;
  }

  .logo-card {
    width: 280px;
    opacity: 1;
  }

  .card {
    width: calc(100vw - 48px);
    max-width: none;
    height: auto;
    opacity: 1;
    transform: none;
  }

  .card.active {
    transform: none;
  }

  .card-info {
    min-height: auto;
  }

  .card-number {
    font-size: 32px;
  }

  .card-tracks {
    font-size: 14px !important;
    line-height: 1.5;
  }

  .card-tracks li {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    margin-bottom: 3px;
  }

  .card-curator {
    font-size: 11px !important;
    margin-top: 12px;
  }

  .instructions {
    display: none;
  }

  .mini-logo {
    display: none;
  }

  .player-info {
    width: 70px;
    padding: 0 10px;
  }

  .player-number {
    font-size: 16px;
  }

  .player-label {
    display: none;
  }

  .player-close {
    margin: 0 8px;
  }
}

/* Player Bar */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  z-index: 100;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

.player-bar.active {
  transform: translateY(0);
}

.player-info {
  width: 100px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.player-number {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 20px;
  color: #ffffff;
}

.player-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
}

.player-widget {
  flex: 1;
  height: 60px;
  background: #26292C;
  border-radius: 4px;
  overflow: hidden;
}

.player-widget iframe {
  width: 100%;
  height: 60px;
  border: none;
  display: block;
}

.player-close {
  width: 48px;
  height: 48px;
  margin: 0 12px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.player-close svg {
  width: 24px;
  height: 24px;
}

.player-close:hover {
  color: #ffffff;
}

/* Search Modal */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.search-modal.active {
  opacity: 1;
  visibility: visible;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.search-container {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 24px;
  transform: translateY(-20px);
  transition: transform 0.15s ease;
}

.search-modal.active .search-container {
  transform: translateY(0);
}

.search-input {
  width: 100%;
  padding: 16px 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 400;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}

.search-results {
  margin-top: 12px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.search-result:hover,
.search-result.selected {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.search-result-artwork {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.search-result-number {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 18px;
  color: #ffffff;
}

.search-result-matches {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

.search-result-matches mark {
  background: rgba(255, 204, 0, 0.3);
  color: #ffffff;
  padding: 1px 2px;
  border-radius: 2px;
}

.search-empty {
  padding: 24px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
}

.instructions .divider {
  margin: 0 12px;
  opacity: 0.3;
}

.instructions .cmd-key {
  font-size: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 86px;
  left: 16px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 99;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .toast {
    bottom: 80px;
    left: 8px;
    right: 8px;
    text-align: center;
  }
}

/* =============================================================================
   SEEK BAR
   Quick navigation ruler at top of page. Click/drag to jump to position.
   ============================================================================= */

.seek-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  user-select: none;
  /* Generous hit area - full width, extends well below the visible bar */
  padding: 0 calc(50% - 287.5px) 80px;
}

/* The visible content container */
.seek-bar .seek-track {
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Reveal on hover anywhere in the hit area */
.seek-bar:hover .seek-track {
  opacity: 1;
  transform: translateY(0);
}

.seek-track {
  display: flex;
  width: 100%;
  justify-content: space-between;
}

.seek-tick {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 0 2px;
}

/* The actual tick mark line */
.seek-tick::before {
  content: '';
  width: 1px;
  height: 10px;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.1s ease;
}

.seek-tick.major::before {
  height: 14px;
  background: rgba(255, 255, 255, 0.4);
}

.seek-tick.active::before {
  background: #ffffff;
}

.seek-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 7px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 2px;
}

/* Hide seek bar on mobile */
@media (max-width: 768px) {
  .seek-bar {
    display: none;
  }
}

/* =============================================================================
   RESPONSIVE CARD SIZING
   Fluid scaling via clamp() in base styles. Typography scales at smaller sizes.
   ============================================================================= */

@media (max-width: 1000px) {
  .card-number {
    font-size: clamp(20px, 2.5vw, 32px);
  }

  .card-tracks {
    font-size: clamp(10px, 1.1vw, 12px);
  }
}

/* =============================================================================
   LIGHT MODE OVERRIDES
   ============================================================================= */

body.light-mode .card {
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .card.active {
  /* Layered smooth shadow - mimics natural light falloff */
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.02),
    0 4px 8px rgba(0, 0, 0, 0.02),
    0 8px 16px rgba(0, 0, 0, 0.03),
    0 16px 32px rgba(0, 0, 0, 0.03),
    0 32px 64px rgba(0, 0, 0, 0.04);
}

body.light-mode .logo-img,
body.light-mode .mini-logo img {
  filter: invert(1);
}

body.light-mode .card-info {
  background: rgba(0, 0, 0, 0.03);
}

body.light-mode .card-number,
body.light-mode .card-tracks,
body.light-mode .card-curator {
  color: #111111;
}

body.light-mode .track-artist {
  opacity: 0.6;
}

body.light-mode .play-button {
  background: rgba(255, 255, 255, 0.8);
  color: #111111;
}

body.light-mode .play-button:hover {
  background: rgba(255, 255, 255, 0.95);
}

body.light-mode .seek-tick::before {
  background: rgba(0, 0, 0, 0.2);
}

body.light-mode .seek-tick.major::before {
  background: rgba(0, 0, 0, 0.4);
}

body.light-mode .seek-tick.active::before {
  background: #111111;
}

body.light-mode .seek-label {
  color: rgba(0, 0, 0, 0.4);
}

body.light-mode .player-bar {
  background: #f0f0f0;
  border-top-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .player-number {
  color: #111111;
}

body.light-mode .player-label {
  color: rgba(0, 0, 0, 0.5);
}

body.light-mode .player-close {
  color: rgba(0, 0, 0, 0.5);
}

body.light-mode .player-close:hover {
  color: #111111;
}

body.light-mode .instructions {
  color: #111111;
}

body.light-mode .key {
  border-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .search-backdrop {
  background: rgba(255, 255, 255, 0.85);
}

body.light-mode .search-input {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
  color: #111111;
}

body.light-mode .search-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

body.light-mode .search-input:focus {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.3);
}

body.light-mode .search-result {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .search-result:hover,
body.light-mode .search-result.selected {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .search-result-number {
  color: #111111;
}

body.light-mode .search-result-matches {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .search-result-matches mark {
  background: rgba(255, 200, 0, 0.4);
  color: #111111;
}

body.light-mode .search-empty {
  color: rgba(0, 0, 0, 0.4);
}

body.light-mode .toast {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .mode-toggle {
  color: rgba(0, 0, 0, 0.4);
}

body.light-mode .mode-toggle:hover {
  color: #111111;
}

/* Mode toggle button */
.mode-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-toggle:hover {
  color: #ffffff;
}

.mode-toggle svg {
  width: 16px;
  height: 16px;
}
