:root {
  color-scheme: dark;
  /* Premium Dark Palette */
  --brand-primary: #e6563e;
  --brand-accent: #ff6b52;
  --brand-ink: #f8fafc;
  --brand-muted: #94a3b8;
  --brand-border: rgba(255, 255, 255, 0.08);
  --brand-surface: #0f172a;
  --brand-surface-alt: #020617;
  --brand-glass: rgba(15, 23, 42, 0.75);
  --brand-glass-border: rgba(255, 255, 255, 0.06);

  --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.4);
  --shadow-tile: 0 16px 32px rgba(0, 0, 0, 0.4);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sticky-height: 140px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family:
    'Inter',
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--brand-ink);
  background-color: var(--brand-surface-alt);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* --- Animated Mesh Gradient --- */
body::before,
body::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background: radial-gradient(circle, rgba(230, 86, 62, 0.2) 0%, rgba(15, 23, 42, 0) 60%);
  animation: mesh-move-1 20s ease-in-out infinite alternate;
}

body::after {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(15, 23, 42, 0) 60%);
  animation: mesh-move-2 25s ease-in-out infinite alternate-reverse;
}

@keyframes mesh-move-1 {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-20%, -30%) scale(1.3);
  }
  100% {
    transform: translate(-60%, -40%) scale(0.9);
  }
}

@keyframes mesh-move-2 {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-80%, -20%) scale(1.1);
  }
  100% {
    transform: translate(-30%, -70%) scale(1.4);
  }
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--brand-primary);
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

.container {
  width: min(1200px, 100% - 48px);
  margin: 0 auto;
}

/* Fixed Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s ease;
}

/* Offset content for fixed header */
body {
  padding-top: 72px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.brand img {
  height: 40px;
  width: auto;
}

.brand-text {
  font-size: 1.1rem;
}

/* Touch Targets & Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  min-height: 44px;
  min-width: 44px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 86, 62, 0.2);
}

.button:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.button-primary {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.button-primary:hover {
  background: var(--brand-accent);
  box-shadow: 0 8px 20px rgba(230, 86, 62, 0.3);
}

.button-ghost {
  border-color: var(--brand-border);
  color: var(--brand-ink);
  background: rgba(255, 255, 255, 0.03);
}

.button-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hero Section */
.hero {
  padding: 80px 0 56px;
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--brand-primary);
  font-weight: 700;
  margin-bottom: 16px;
  display: block;
}

.hero h1 {
  font-size: clamp(2.8rem, 5vw, 4rem);
  line-height: 1.1;
  margin: 0 0 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  /* Platinum Gradient */
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lede {
  font-size: 1.2rem;
  color: var(--brand-muted);
  max-width: 520px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 48px;
}

.hero-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.meta-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  border: 1px solid var(--brand-border);
  min-width: 150px;
  backdrop-filter: blur(4px);
}

.meta-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.meta-value {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
}

/* Hero Panel (Glassmorphism) */
.hero-panel-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--brand-border);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

/* Subtle gloss effect */
.hero-panel-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.hero-panel-card h2 {
  margin-top: 0;
  font-size: 1.5rem;
  color: #fff;
}

.hero-panel-card ol {
  padding-left: 20px;
  margin-bottom: 24px;
  color: var(--brand-muted);
}

.hero-panel-card li {
  margin-bottom: 12px;
}

.hero-panel-badge {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-panel-badge span {
  background: rgba(230, 86, 62, 0.12);
  color: var(--brand-accent);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid rgba(230, 86, 62, 0.15);
}

/* Catalogue Section */
.catalogue {
  padding: 32px 0 120px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 40px;
}

.section-header h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.section-header p {
  margin: 0;
  color: var(--brand-muted);
  font-size: 1rem;
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brand-ink);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
  transition: all 0.3s ease;
}

.status-pill[data-state='loading'] .status-dot,
.status-pill[data-state='buffering'] .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
  animation: pulse 1.5s infinite;
}

.status-pill[data-state='error'] .status-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-pill[data-state='paused'] .status-dot {
  background: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.status-pill[data-state='empty'] .status-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

/* Large desktop - 4+ columns */
@media (min-width: 1400px) {
  .catalogue-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
  }
}

/* Desktop - 3-4 columns */
@media (min-width: 1024px) and (max-width: 1399px) {
  .catalogue-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
  }
}

/* Mobile - ALWAYS 2 columns */
@media (max-width: 767px) {
  .catalogue-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .tile-info {
    bottom: 12px;
    left: 10px;
    right: 10px;
    gap: 3px;
  }

  .tile-title {
    font-size: 0.85rem;
    line-height: 1.2;
  }

  .tile-count {
    font-size: 0.55rem;
    margin-top: 2px;
  }

  .tile-overlay-play {
    width: 36px;
    height: 36px;
  }

  .tile-overlay-play svg {
    width: 16px;
    height: 16px;
  }
}

/* Very small mobile */
@media (max-width: 400px) {
  .tile-info {
    bottom: 8px;
    left: 8px;
    right: 8px;
    gap: 2px;
  }

  .tile-title {
    font-size: 0.75rem;
  }

  .tile-count {
    font-size: 0.5rem;
  }

  .tile-overlay-play {
    width: 32px;
    height: 32px;
  }

  .tile-overlay-play svg {
    width: 14px;
    height: 14px;
  }
}

/* Skeleton */
.tile-skeleton {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* --- Channel Tile & Spotlight Glow --- */
.channel-tile {
  position: relative;
  border-radius: var(--radius-lg);
  background: #0f172a;
  box-shadow: var(--shadow-tile);
  border: 1px solid rgba(255, 255, 255, 0.05);
  isolation: isolate;
  --channel-cover: none;
  cursor: pointer;
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.3s ease;
  view-transition-name: tile-expand;

  --mouse-x: -100px;
  --mouse-y: -100px;
}

.channel-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    500px circle at var(--mouse-x) var(--mouse-y),
    rgba(255, 255, 255, 0.5),
    transparent 40%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.catalogue-grid:hover .channel-tile::before {
  opacity: 1;
}

.channel-tile > * {
  border-radius: inherit;
}

.channel-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.tile-background {
  position: absolute;
  inset: -15%;
  background-image: var(--channel-cover);
  background-size: cover;
  background-position: center;
  filter: blur(32px) saturate(1.2) brightness(0.6);
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.tile-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  z-index: 2;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.tile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

.tile-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0) 0%,
    rgba(15, 23, 42, 0.4) 40%,
    rgba(15, 23, 42, 0.98) 100%
  );
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tile-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  background: radial-gradient(circle at top, var(--brand-primary), var(--brand-surface));
}

.tile-info {
  position: absolute;
  bottom: 24px;
  left: 20px;
  right: 20px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tile-title {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.01em;
  display: none; /* Hide channel name on tiles - only show desc + track count */
}

.tile-count {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-top: 4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Play Overlay */
.tile-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.channel-tile:hover .tile-overlay {
  opacity: 1;
  visibility: visible;
}

.tile-overlay-play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transform: scale(0.9);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 44px;
  min-height: 44px;
}

.tile-overlay-play svg {
  width: 32px;
  height: 32px;
  margin-left: 4px;
}

.channel-tile:hover .tile-overlay-play {
  transform: scale(1);
}

/* Active Tile State */
.channel-tile.is-active {
  box-shadow:
    0 0 0 2px var(--brand-primary),
    var(--shadow-tile);
  border-color: transparent;
}

/* FIX: Hide spotlight and overlay play button when active */
.channel-tile.is-active::before,
.channel-tile.is-active .tile-overlay,
.channel-tile.is-active:hover .tile-overlay,
.channel-tile.is-active .tile-background {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.channel-tile.is-active .tile-cover img {
  transform: scale(1.05);
  filter: brightness(0.6) blur(4px); /* Brighter and less blur to show art */
}

.channel-tile.is-active .tile-info {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* In-Tile Player (Desktop/Active) */
.tile-player {
  position: absolute;
  inset: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(
    to bottom,
    rgba(2, 6, 23, 0) 0%,
    rgba(2, 6, 23, 0.5) 30%,
    rgba(2, 6, 23, 0.98) 100%
  );
  backdrop-filter: blur(0);
  transition: opacity 0.3s ease;
  border-radius: var(--radius-lg);
  /* Ensure content stays within bounds */
  overflow: hidden;
}

.channel-tile.is-active .tile-player {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.player-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  margin: 0;
}

.player-status {
  font-size: clamp(0.6rem, 2.5cqi, 0.8rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.player-channel {
  font-size: clamp(0.7rem, 3.5cqi, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-accent);
  font-weight: 700;
  opacity: 0.95;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track {
  font-size: clamp(0.85rem, 5cqi, 1.4rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  word-break: break-word;
  /* Ensure consistent height based on line-clamp */
  max-height: calc(1.3em * 2);
  min-height: 1.3em;
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1.5cqi, 8px);
  text-align: center;
  padding: 0 8px;
  /* Prevent info section from growing beyond its content */
  flex-shrink: 0;
  min-height: 0;
  overflow: hidden;
}

/* Container query for tile player */
.channel-tile {
  container-type: inline-size;
  container-name: tile;
}

/* Scrub Bar Refinement */
.player-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.player-progress-container {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  display: flex;
  align-items: center;
}

.player-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--brand-primary);
  border-radius: inherit;
  width: 0%;
  pointer-events: none;
  z-index: 1;
  box-shadow: 0 0 8px rgba(230, 86, 62, 0.4);
}

input[type='range'] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
  cursor: pointer;
  height: 24px;
  margin: 0;
  position: relative;
  z-index: 2; /* Sit on top of the bar */
}

input[type='range']::-webkit-slider-runnable-track {
  width: 100%;
  height: 24px; /* Matches input height */
  background: transparent; /* Rely on .player-progress-container */
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background: #fff;
  margin-top: 5px; /* Centers thumb on the 4px line (24/2 - 14/2 = 5) */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s;
  border: 2px solid var(--brand-primary);
}

input[type='range']:hover::-webkit-slider-thumb {
  transform: scale(1.2);
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-feature-settings: 'tnum';
  margin-top: -4px;
}

/* Player Controls */
.player-controls {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
}

.icon-button {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.player-controls .icon-button.is-play {
  width: 60px;
  height: 60px;
  background: var(--brand-primary);
  box-shadow: 0 8px 24px rgba(230, 86, 62, 0.4);
}

.player-controls .icon-button.is-play:hover {
  background: var(--brand-accent);
  transform: scale(1.05);
}

.icon-button svg {
  width: 24px;
  height: 24px;
}

.icon-pause {
  display: none;
}

/* Fix: Toggle visibility properly */
.is-playing .icon-play {
  display: none !important;
}

.is-playing .icon-pause {
  display: block !important;
}

.player-meta {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
  font-weight: 600;
}

/* Loading/Buffering States */
.tile-buffer {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  opacity: 0;
  z-index: 10;
  pointer-events: none;
}

.channel-tile.is-buffering .tile-buffer {
  opacity: 1;
  animation: buffer-pulse 1.5s infinite;
}

@keyframes buffer-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* Catalogue Empty/Error */
.catalogue-empty,
.catalogue-error {
  margin-top: 32px;
  padding: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--brand-border);
  text-align: center;
}

/* Bottom padding for sticky player */
.catalogue {
  padding-bottom: 100px;
}

@media (max-width: 767px) {
  .catalogue {
    padding-bottom: 120px;
  }
}

/* ========== STICKY PLAYER - NEW DESIGN ========== */
.sticky-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--brand-glass-border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  padding: 12px 24px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease;
  display: flex;
  align-items: center;
  gap: 20px;
}

.sticky-player.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Artwork Section: [<Ch] [Cover+Play] [Ch>] */
.sticky-artwork-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Channel Navigation Arrows (chevrons) - larger for better tap targets */
.channel-nav {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--brand-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 0;
}

.channel-nav:hover {
  color: #fff;
  transform: scale(1.1);
}

.channel-nav svg {
  width: 24px;
  height: 24px;
}

.channel-nav svg path {
  stroke-width: 2.5;
}

/* Cover Art with Play Overlay */
.sticky-art-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.sticky-art {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #1e293b;
}

.sticky-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Play/Pause Overlay on Cover */
.play-overlay {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sticky-art-wrapper:hover .play-overlay,
.sticky-player.is-playing .play-overlay {
  opacity: 1;
}

.sticky-player.is-playing .play-overlay {
  background: rgba(0, 0, 0, 0.3);
}

.play-overlay svg {
  width: 24px;
  height: 24px;
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.play-overlay .icon-play {
  display: block;
}
.play-overlay .icon-pause {
  display: none;
}
.sticky-player.is-playing .play-overlay .icon-play {
  display: none;
}
.sticky-player.is-playing .play-overlay .icon-pause {
  display: block;
}

/* Track Info */
.sticky-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 0 1 180px;
}

.sticky-channel {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-track {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Track Controls (prev/play/next track) */
.sticky-track-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.track-nav {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.track-nav:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.track-nav svg {
  width: 16px;
  height: 16px;
}

/* Play button in track controls */
.track-nav.track-play {
  width: 40px;
  height: 40px;
  background: var(--brand-primary);
}

.track-nav.track-play:hover {
  background: var(--brand-accent);
  transform: scale(1.08);
}

.track-nav.track-play svg {
  width: 18px;
  height: 18px;
}

.track-nav.track-play .icon-play {
  display: block;
}
.track-nav.track-play .icon-pause {
  display: none;
}
.sticky-player.is-playing .track-nav.track-play .icon-play {
  display: none;
}
.sticky-player.is-playing .track-nav.track-play .icon-pause {
  display: block;
}

/* Progress Section */
.sticky-progress-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 120px;
}

.sticky-time {
  font-size: 0.7rem;
  color: var(--brand-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.sticky-time:first-child {
  text-align: right;
}

.sticky-time:last-child {
  text-align: left;
}

.sticky-progress {
  position: relative;
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.sticky-progress input[type='range'] {
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 24px;
  opacity: 0;
  z-index: 3;
  cursor: pointer;
}

.sticky-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-accent), var(--brand-primary));
  width: 0%;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(230, 86, 62, 0.4);
  transition: width 0.1s linear;
}

/* Progress thumb/knob */
.sticky-progress-bar::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  border: 2px solid var(--brand-primary);
  transition: transform 0.15s ease;
}

.sticky-progress:hover .sticky-progress-bar::after {
  transform: translateY(-50%) scale(1.2);
}

/* Status - text only, no background */
.sticky-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--brand-muted);
}

.sticky-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  transition: all 0.3s ease;
}

.sticky-status[data-state='loading'] .status-dot,
.sticky-status[data-state='buffering'] .status-dot {
  background: #f59e0b;
  animation: pulse 1.5s infinite;
}

.sticky-status[data-state='playing'] .status-dot {
  background: #22c55e;
}

.sticky-status[data-state='paused'] .status-dot {
  background: #38bdf8;
}

.sticky-status[data-state='error'] .status-dot {
  background: #ef4444;
}

/* ========== TABLET (768px - 1023px) ========== */
@media (max-width: 1023px) {
  .sticky-player {
    padding: 10px 16px;
    gap: 14px;
  }

  .sticky-art-wrapper {
    width: 48px;
    height: 48px;
  }

  .sticky-info {
    flex: 0 1 140px;
  }

  .sticky-track {
    font-size: 0.85rem;
  }

  .track-nav {
    width: 28px;
    height: 28px;
  }

  .track-nav svg {
    width: 14px;
    height: 14px;
  }

  .track-nav.track-play {
    width: 36px;
    height: 36px;
  }

  .track-nav.track-play svg {
    width: 16px;
    height: 16px;
  }
}

/* ========== MOBILE (<768px) ========== */
@media (max-width: 767px) {
  .sticky-player {
    flex-wrap: wrap;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .sticky-artwork-section {
    gap: 4px;
    flex-shrink: 0;
  }

  .channel-nav {
    width: 36px;
    height: 36px;
  }

  .channel-nav svg {
    width: 22px;
    height: 22px;
  }

  .sticky-art-wrapper {
    width: 44px;
    height: 44px;
  }

  .play-overlay {
    display: none;
  }

  .sticky-info {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .sticky-channel {
    font-size: 0.65rem;
  }

  .sticky-track {
    font-size: 0.85rem;
  }

  .sticky-track-controls {
    gap: 6px;
    flex-shrink: 0;
  }

  .track-nav {
    width: 32px;
    height: 32px;
  }

  .track-nav svg {
    width: 14px;
    height: 14px;
  }

  .track-nav.track-play {
    width: 40px;
    height: 40px;
  }

  .track-nav.track-play svg {
    width: 16px;
    height: 16px;
  }

  /* Progress bar visible on mobile */
  .sticky-progress-section {
    flex: 1 1 100%;
    order: 10;
    min-width: 0;
    gap: 10px;
  }

  .sticky-time {
    font-size: 0.7rem;
    min-width: 32px;
  }

  .sticky-progress {
    height: 4px;
  }

  .sticky-progress-bar::after {
    width: 14px;
    height: 14px;
    right: -7px;
  }

  .sticky-status {
    font-size: 0.7rem;
    gap: 6px;
  }

  .sticky-status .status-dot {
    width: 6px;
    height: 6px;
  }
}

/* ========== VERY SMALL MOBILE (<480px) ========== */
@media (max-width: 479px) {
  .sticky-player {
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  .sticky-artwork-section {
    gap: 2px;
  }

  .sticky-art-wrapper {
    width: 40px;
    height: 40px;
  }

  .channel-nav {
    width: 32px;
    height: 32px;
  }

  .channel-nav svg {
    width: 20px;
    height: 20px;
  }

  .sticky-info {
    flex: 1;
    min-width: 0;
  }

  .sticky-channel {
    font-size: 0.6rem;
  }

  .sticky-track {
    font-size: 0.8rem;
  }

  .track-nav {
    width: 28px;
    height: 28px;
  }

  .track-nav svg {
    width: 12px;
    height: 12px;
  }

  .track-nav.track-play {
    width: 36px;
    height: 36px;
  }

  .track-nav.track-play svg {
    width: 14px;
    height: 14px;
  }

  .sticky-time {
    font-size: 0.65rem;
    min-width: 28px;
  }

  .sticky-status .status-text {
    display: none;
  }
}

/* Active Tile Updates: Centered Art - Proportional sizing */
.tile-player-art {
  width: clamp(80px, 45cqi, 200px);
  height: clamp(80px, 45cqi, 200px);
  border-radius: clamp(8px, 4cqi, 16px);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  margin: 0 auto;
  display: none; /* Hidden by default */
  flex-shrink: 0;
}

.tile-player-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.channel-tile.is-active .tile-player-art {
  display: block;
  animation: fade-in-up 0.4s ease-out backwards;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* In-Tile Player Adjustments */
.channel-tile.is-active .tile-player {
  padding: 32px 24px;
  justify-content: space-between;
  gap: 16px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
}

.channel-tile.is-active .player-header {
  order: 1;
  margin-bottom: 0;
}

.channel-tile.is-active .tile-player-art {
  order: 2;
  margin: 0 auto;
}

.channel-tile.is-active .player-info {
  order: 3;
  margin-top: 0;
}

/* Responsive tweaks for active tile - MOBILE */
@media (max-width: 768px) {
  .tile-player-art {
    display: none; /* Hide art on mobile - use sticky player instead */
  }

  .channel-tile.is-active .tile-player {
    padding: 16px 12px;
    justify-content: center;
    gap: 10px;
  }

  .player-track {
    -webkit-line-clamp: 3;
  }

  /* Ensure playing tile text stays within bounds */
  .player-header {
    max-width: 100%;
    overflow: hidden;
  }

  .player-status,
  .player-channel,
  .player-track {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player-channel {
    font-size: clamp(0.6rem, 3cqi, 0.9rem);
  }

  .player-track {
    font-size: clamp(0.75rem, 4cqi, 1.1rem);
    word-break: break-word;
    hyphens: auto;
  }

  .player-info {
    max-width: 100%;
    overflow: hidden;
    padding: 0 4px;
  }
}

@media (max-width: 480px) {
  .channel-tile.is-active .tile-player {
    padding: 12px 10px;
    gap: 8px;
  }

  .player-channel {
    font-size: clamp(0.55rem, 2.5cqi, 0.8rem);
  }

  .player-track {
    font-size: clamp(0.7rem, 3.5cqi, 1rem);
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Fix: Center the text blocks themselves, not just text inside them */
  .hero-lede,
  .hero h1,
  .eyebrow {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions,
  .hero-meta {
    justify-content: center;
  }

  .section-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .container {
    width: min(100%, 100% - 32px); /* Tighter margins on mobile */
  }

  /* Mobile header */
  body {
    padding-top: 64px;
  }

  .header-inner {
    padding: 12px 0;
  }

  .brand img {
    height: 36px;
  }

  .button-ghost {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .channel-tile.is-active .tile-player {
    background: linear-gradient(to top, #0f172a 0%, rgba(15, 23, 42, 0.85) 100%);
  }

  .channel-tile::before {
    display: none;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 56px;
  }

  .header-inner {
    padding: 10px 0;
  }

  .brand img {
    height: 32px;
  }

  .button-ghost {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

@media (min-width: 900px) {
  .channel-tile:hover .tile-overlay {
    opacity: 1;
    visibility: visible;
  }
}

@media (hover: none) {
  .tile-overlay {
    background: rgba(0, 0, 0, 0.2);
    opacity: 1;
    visibility: visible;
  }

  .tile-overlay-play {
    transform: scale(1);
    background: rgba(255, 255, 255, 0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
