:root {
  --teal-bright: #00fafa;
  --teal-light: #00cfcf;
  --teal-mid: #00a5a5;
  --teal: #008080;
  --teal-dark: #005a5a;
  --teal-deep: #003434;
  --teal-black: #001212;
  --cream: #fffff3;
  --coral-soft: #ffbdb3;
  --coral: #ff7d6c;
  --red: #fe0000;
  --red-dark: #c00000;
  --maroon: #800000;
  --maroon-deep: #460000;
  --mist: #edeff0;
  --gray-200: #c2c9cc;
  --gray-400: #9ba3a8;
  --gray-500: #7b8285;
  --gray-700: #595f61;
  --gray-800: #383b3d;
  --ink: #191b1c;
  --panel: #fffff3;
  --page: #edeff0;
  --line: rgba(25, 27, 28, 0.12);
  --shadow: 0 18px 45px rgba(25, 27, 28, 0.14);
  --hero-image: url("../img/categories/actualidad-reggaeton.jpg");
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }

.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, 320px);
  align-items: center;
  gap: 26px;
  padding: 13px clamp(18px, 5vw, 92px);
  background: rgba(255, 255, 243, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  color: var(--teal);
}

.brand-logo {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--gray-700);
  font-size: 0.88rem;
  font-weight: 800;
}

.main-nav a { padding: 8px 0; }
.main-nav a.is-active { color: var(--ink); border-bottom: 2px solid var(--teal); }

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 11px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

.search-box input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 128, 128, 0.14);
}

main {
  width: min(100% - 32px, 1120px);
  margin: 26px auto 0;
}

.home-hero,
.category-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 128, 128, 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cream), #fff 48%, rgba(0, 207, 207, 0.14));
  box-shadow: var(--shadow);
}

.home-hero {
  padding: clamp(34px, 7vw, 72px);
}

.home-hero h1,
.category-hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 5.1rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.home-hero p,
.category-hero p {
  max-width: 620px;
  color: var(--gray-700);
  font-size: 1.02rem;
  font-weight: 650;
}

.eyebrow,
.status-pill {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 12px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(0, 128, 128, 0.12);
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-count {
  margin-top: 24px;
  color: var(--maroon) !important;
}

.category-hero {
  display: flex;
  min-height: 250px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(28px, 5vw, 52px);
  background-image: linear-gradient(90deg, rgba(0, 18, 18, 0.86), rgba(0, 52, 52, 0.54), rgba(128, 0, 0, 0.3)), var(--hero-image);
  background-size: cover;
  background-position: center;
  color: var(--cream);
}

.category-hero p { color: rgba(255, 255, 243, 0.82); }
.category-hero .eyebrow { background: rgba(255, 255, 243, 0.14); color: var(--teal-bright); }

.back-link {
  flex: 0 0 auto;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 243, 0.34);
  border-radius: 999px;
  color: var(--cream);
  font-size: 0.86rem;
  font-weight: 850;
}

.section-block { margin-top: 48px; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2,
.compact-note h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.category-card {
  position: relative;
  display: flex;
  min-height: 178px;
  overflow: hidden;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px;
  border-radius: 8px;
  background-image: linear-gradient(180deg, rgba(0, 18, 18, 0.08), rgba(0, 18, 18, 0.82)), var(--category-image);
  background-size: cover;
  background-position: center;
  color: #fff;
  box-shadow: 0 16px 34px rgba(25, 27, 28, 0.14);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.category-card:nth-child(3n + 2) { background-image: linear-gradient(180deg, rgba(70, 0, 0, 0.08), rgba(70, 0, 0, 0.82)), var(--category-image); }
.category-card:nth-child(3n + 3) { background-image: linear-gradient(180deg, rgba(0, 90, 90, 0.05), rgba(25, 27, 28, 0.84)), var(--category-image); }

.category-card:hover {
  transform: translateY(-5px);
  filter: saturate(1.08);
  box-shadow: 0 20px 42px rgba(0, 52, 52, 0.24);
}

.category-era {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0, 250, 250, 0.16);
  color: var(--teal-bright);
  font-size: 0.72rem;
  font-weight: 900;
}

.category-card strong {
  max-width: 100%;
  font-size: 1.18rem;
  line-height: 1.08;
}

.category-card span:last-child {
  color: rgba(255, 255, 243, 0.78);
  font-size: 0.84rem;
  font-weight: 750;
}

.compact-note {
  max-width: 720px;
  color: var(--gray-700);
}

.player-shell {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: clamp(20px, 4vw, 36px);
  align-items: center;
  margin-top: 28px;
  padding: clamp(22px, 4vw, 34px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.visualizer-card {
  display: grid;
  min-height: 190px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--teal-deep), var(--ink));
  box-shadow: 0 18px 28px rgba(25, 27, 28, 0.2);
}

.visualizer {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 82px;
}

.visualizer span {
  width: 9px;
  height: 25px;
  border-radius: 999px;
  background: var(--teal-light);
  opacity: 0.72;
  transform-origin: bottom;
  animation: equalize 1.1s ease-in-out infinite;
  animation-play-state: paused;
}

.visualizer span:nth-child(2) { animation-delay: 0.12s; height: 48px; background: var(--coral); }
.visualizer span:nth-child(3) { animation-delay: 0.24s; height: 70px; }
.visualizer span:nth-child(4) { animation-delay: 0.36s; height: 42px; background: var(--coral-soft); }
.visualizer span:nth-child(5) { animation-delay: 0.48s; height: 58px; }
body.is-playing .visualizer span { animation-play-state: running; }

@keyframes equalize {
  0%, 100% { transform: scaleY(0.45); opacity: 0.45; }
  50% { transform: scaleY(1); opacity: 1; }
}

.player-panel h2 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.track-meta {
  margin: 10px 0 22px;
  color: var(--gray-700);
  font-weight: 700;
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--gray-700);
  font-size: 0.8rem;
  font-weight: 800;
}

input[type="range"] { accent-color: var(--teal); }
.progress-range { width: 100%; }

.control-row {
  display: grid;
  grid-template-columns: 40px 40px 58px 40px minmax(110px, 155px);
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

.icon-button,
.play-button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 40px;
  height: 40px;
  font-size: 1.55rem;
}

.icon-button:hover {
  background: rgba(0, 128, 128, 0.12);
  color: var(--teal-dark);
}

.play-button {
  width: 58px;
  height: 58px;
  background: var(--teal);
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 12px 26px rgba(0, 128, 128, 0.32);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-700);
}

.volume-control input { width: 100%; }

.track-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.track-row {
  display: grid;
  width: 100%;
  grid-template-columns: 46px minmax(0, 1fr) minmax(150px, 240px) 64px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid rgba(25, 27, 28, 0.08);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.track-row:last-child { border-bottom: 0; }
.track-row:hover { background: rgba(0, 128, 128, 0.08); }
.track-row.is-active { background: rgba(128, 0, 0, 0.08); color: var(--maroon); }

.track-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 128, 128, 0.11);
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.track-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.track-main strong,
.track-main small,
.track-album {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-main strong { font-size: 0.96rem; }
.track-main small,
.track-album,
.track-duration {
  color: var(--gray-700);
  font-size: 0.82rem;
  font-weight: 700;
}

.track-duration { text-align: right; }

.empty-state {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--gray-700);
  text-align: center;
  background: #fff;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 72px;
  padding: 30px clamp(18px, 5vw, 92px);
  background: var(--ink);
  color: rgba(255, 255, 243, 0.78);
  font-size: 0.84rem;
}

.site-footer p { margin: 6px 0 0; }
.site-footer strong { color: var(--cream); }

.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
  }

  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-hero { align-items: flex-start; flex-direction: column; }
  .player-shell { grid-template-columns: 150px 1fr; }
}

@media (max-width: 620px) {
  main { width: min(100% - 22px, 1120px); margin-top: 18px; }
  .site-header { padding: 12px 14px; }
  .main-nav { gap: 18px; }
  .home-hero { padding: 28px 20px; }
  .home-hero h1,
  .category-hero h1 { font-size: 2.25rem; line-height: 1; }
  .home-hero p,
  .category-hero p { font-size: 0.94rem; }
  .category-grid { grid-template-columns: 1fr; gap: 14px; }
  .category-card { min-height: 132px; }
  .category-hero { min-height: 190px; padding: 24px 20px; }
  .section-block { margin-top: 34px; }
  .player-shell { grid-template-columns: 92px 1fr; gap: 14px; padding: 14px; }
  .visualizer-card { min-height: 102px; }
  .visualizer { height: 58px; gap: 5px; }
  .visualizer span { width: 7px; }
  .player-panel h2 { font-size: 1.34rem; line-height: 1.08; }
  .status-pill { margin-bottom: 8px; padding: 5px 9px; font-size: 0.62rem; }
  .track-meta { margin: 8px 0 14px; font-size: 0.82rem; }
  .control-row { grid-template-columns: repeat(4, 38px); gap: 6px; margin-top: 14px; }
  .icon-button { width: 38px; height: 38px; font-size: 1.25rem; }
  .play-button { width: 42px; height: 42px; font-size: 1.05rem; }
  .volume-control { grid-column: 1 / -1; }
  .track-row { grid-template-columns: 34px minmax(0, 1fr) 54px; padding: 11px 10px; gap: 8px; }
  .track-album { display: none; }
  .track-index { width: 26px; height: 26px; }
  .site-footer { flex-direction: column; margin-top: 52px; }
  .footer-links { flex-wrap: wrap; }
}

