/* ========================================================================
   Axis Radio Archive — Styles
   ======================================================================== */

/* --- Design Tokens --- */
:root {
  --bg: #0a0a0f;
  --bg-surface: #12121a;
  --bg-surface-hover: #1a1a26;
  --bg-surface-active: #1e1e2e;
  --border: #1e1e2e;
  --border-subtle: #16161f;

  --cyan: #00d4ff;
  --cyan-dim: #0099bb;
  --cyan-glow: rgba(0, 212, 255, 0.3);
  --cyan-glow-strong: rgba(0, 212, 255, 0.5);
  --purple: #7b2ff7;
  --purple-dim: #5a1fd0;
  --magenta: #ff006e;

  --text: #e8e8ef;
  --text-secondary: #8888a0;
  --text-dim: #555568;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;

  --max-width: 56rem;
  --player-collapsed: 80px;
  --player-expanded: 300px;
  --radius: 8px;
  --radius-sm: 4px;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--cyan);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

img, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

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

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 110;
  background: var(--bg);
  padding: 2.5rem 0 0;
  text-align: center;
  overflow: hidden;
}

.site-header .container {
  padding-bottom: 2rem;
}

/* Faint scan-line overlay */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.015) 2px,
    rgba(255, 255, 255, 0.015) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.site-header .container {
  position: relative;
  z-index: 2;
}

.wordmark {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text);
  text-shadow: 0 0 20px var(--cyan-glow), 0 0 60px rgba(0, 212, 255, 0.1);
  margin-bottom: 0.25rem;
}

.wordmark span {
  color: var(--cyan);
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

/* Nav */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.site-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--cyan);
  text-decoration: none;
}

/* Gradient divider */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-dim), var(--purple), var(--cyan-dim), transparent);
  background-size: 200% 100%;
  background-position: var(--divider-x, 0%) 0;
  border: none;
  margin: 0;
}

/* --- Filter Bar --- */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0;
}

.filter-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 24px;
  background: linear-gradient(to bottom, rgba(10, 10, 15, 0.6), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.filter-bar.scrolled::after {
  opacity: 1;
}

.filter-bar .container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 180px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  border-color: var(--cyan-dim);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.1);
}

.year-filters {
  display: flex;
  gap: 0.25rem;
}

.year-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.year-btn:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.year-btn.active {
  color: var(--cyan);
  border-color: var(--cyan-dim);
  background: rgba(0, 212, 255, 0.08);
}

.sort-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}

.sort-btn:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.episode-count {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  white-space: nowrap;
  margin-left: auto;
}

main.container {
  flex: 1;
}

/* --- Episode List --- */
.episode-list {
  padding: 1.5rem 0;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* --- Episode Card --- */
.episode-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.875rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: background 0.2s, border-color 0.2s;
  cursor: default;
}

.episode-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border);
}

.episode-card.playing {
  border-color: var(--cyan-dim);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.06);
}

.episode-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 2.5rem;
  text-align: center;
}

.playing .episode-number {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
}

.episode-info {
  min-width: 0;
}

.episode-guest {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.15rem;
}

.episode-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.episode-duration,
.episode-size {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.episode-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.1);
  color: var(--cyan);
  transition: all 0.2s;
}

.play-btn:hover {
  background: rgba(0, 212, 255, 0.2);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.play-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-dim);
  transition: color 0.2s;
}

.download-btn:hover {
  color: var(--text-secondary);
}

.download-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s, opacity 0.2s;
  opacity: 0;
  margin-left: 0.375rem;
  vertical-align: middle;
}

.episode-card:hover .share-btn,
.share-btn:focus-visible {
  opacity: 1;
}

.share-btn:hover {
  color: var(--text-secondary);
}

.share-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-btn.copied {
  color: var(--cyan);
  opacity: 1;
}

/* Bonus material section */
.bonus-section {
  margin-top: 2rem;
  padding-top: 1rem;
}

.bonus-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.875rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: background 0.2s, border-color 0.2s;
}

.bonus-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border);
}

.bonus-card.playing {
  border-color: var(--cyan-dim);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.06);
}

.bonus-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.bonus-artist {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

/* --- Lost episode folds --- */
.lost-fold {
  margin-bottom: 0.5rem;
}

.lost-fold-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: none;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.lost-fold-btn:hover {
  color: var(--text-secondary);
  border-color: var(--border);
}

.lost-fold-arrow {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}

.lost-fold.open .lost-fold-arrow {
  transform: rotate(90deg);
}

.lost-fold-content {
  display: none;
  padding-top: 0.5rem;
}

.lost-fold.open .lost-fold-content {
  display: block;
}

/* Missing/lost episode cards */
.missing-card {
  opacity: 0.5;
  cursor: default;
}

.missing-card:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

.missing-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.episode-notes {
  color: var(--text-dim);
  font-style: italic;
}

/* --- Player --- */
.player {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 200;
  background: #0e0e16;
  border-top: 1px solid var(--border);
}

.player.visible {
  display: block;
}

/* Visualizer panel — collapsible above controls */
.player-visualizer {
  display: none;
  height: 150px;
  background: var(--bg);
}

.player-visualizer.open {
  display: block;
}

.player-visualizer canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Controls bar */
.player-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  height: 56px;
}

/* Waveform — inline flex item between guest info and time */
.player-waveform {
  position: relative;
  flex: 1;
  height: 36px;
  min-width: 0;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.player-waveform canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.waveform-hover-time {
  position: absolute;
  top: -24px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.player-waveform:hover .waveform-hover-time {
  opacity: 1;
}

.player-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--bg);
  transition: box-shadow 0.2s;
  flex-shrink: 0;
}

.player-play-btn:hover {
  box-shadow: 0 0 16px var(--cyan-glow-strong);
}

.player-play-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.player-info {
  flex-shrink: 0;
}

.player-guest {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-date {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.player-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.volume-control svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 2;
  flex-shrink: 0;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
}

.player-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color 0.2s;
}

.player-download-btn:hover {
  color: var(--cyan);
}

.player-download-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.player-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color 0.2s;
  padding: 0.25rem;
}

.player-expand-btn:hover {
  color: var(--text);
}

.player-expand-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.2s;
}

.player-expand-btn.open svg {
  transform: rotate(180deg);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}

.empty-state p {
  font-size: 0.9rem;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 2rem 0 3rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.site-footer a {
  color: var(--text-secondary);
}

/* --- About Page --- */
.about-content {
  padding: 2.5rem 0;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.about-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.about-content h2:first-child {
  margin-top: 0;
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.about-content strong {
  color: var(--text);
}

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

.dj-card {
  padding: 0.875rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.dj-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.dj-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0;
}

/* --- Responsive --- */

/* >= 640px */
@media (min-width: 640px) {
  .episode-meta {
    gap: 1rem;
  }
}

/* >= 768px */
@media (min-width: 768px) {
  .site-header {
    padding: 3rem 0 2.5rem;
  }

  .episode-card {
    padding: 1rem 1.25rem;
  }
}

/* < 640px — mobile overrides */
@media (max-width: 639px) {
  .filter-bar .container {
    gap: 0.5rem;
  }

  .search-input {
    min-width: 100%;
    order: -1;
  }

  .episode-count {
    display: none;
  }

  .episode-card {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .episode-number {
    display: none;
  }

  .episode-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .episode-size {
    display: none;
  }

  /* Player: hide volume on mobile */
  .volume-control {
    display: none;
  }

  .player-waveform {
    height: 28px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --- Loading skeleton --- */
.skeleton-card {
  height: 62px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

/* --- Hot dog rain easter egg --- */
.hotdog-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 9999;
}

.hotdog {
  position: absolute;
  top: -40px;
  font-size: 2rem;
  pointer-events: none;
}

.blaq-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  padding: 2rem 3rem;
  background: var(--bg-surface);
  border: 1px solid var(--cyan-dim);
  border-radius: var(--radius);
  font-size: 1.25rem;
  font-weight: 600;
  font-style: italic;
  color: var(--cyan);
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 0 30px var(--cyan-glow-strong), 0 0 80px var(--cyan-glow), inset 0 0 30px rgba(0, 212, 255, 0.05);
  animation: blaq-glow 3s ease-out forwards;
}

@keyframes blaq-glow {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.02); }
}

/* --- Resume Modal --- */

.resume-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: resume-fade-in 0.2s ease-out;
}

.resume-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.08), 0 8px 32px rgba(0, 0, 0, 0.5);
}

.resume-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem;
}

.resume-modal-info {
  font-size: 1rem;
  font-weight: 500;
  color: var(--cyan);
  margin: 0 0 0.25rem;
}

.resume-modal-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
}

.resume-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.resume-modal-btn {
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}

.resume-modal-btn.resume-btn {
  background: var(--cyan);
  color: #0a0a0f;
  border-color: var(--cyan);
}

.resume-modal-btn.resume-btn:hover {
  background: #33dfff;
  border-color: #33dfff;
}

.resume-modal-btn.cancel-btn {
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
}

.resume-modal-btn.cancel-btn:hover {
  background: var(--bg-surface-active);
  color: var(--text);
  border-color: var(--text-dim);
}

.resume-modal-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0;
  font-family: var(--font-mono);
}

@keyframes resume-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
