:root {
  --bg: #11100e;
  --bg-soft: #1a1815;
  --card: #201d19;
  --line: #322d26;
  --text: #f3ece1;
  --muted: #a99f90;
  --accent: #d9a441;
  --accent-soft: #3a2f1c;
  --radius: 16px;
  --wrap: 1040px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background:
    radial-gradient(1200px 600px at 50% -200px, #2a2520 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  padding: 56px 0 28px;
  text-align: center;
}
.brand-mark {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto 6px;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(217, 164, 65, 0.18));
}
.site-header h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 4rem);
  letter-spacing: -0.01em;
  margin: 0;
}
.tagline {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 1.02rem;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 26px;
  padding: 24px 0 64px;
}

.card {
  appearance: none;
  border: none;
  text-align: left;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.18s ease;
}
.card:hover { transform: translateY(-4px); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 8px; }

.card-art {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
}
.card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.card-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  background: rgba(17, 16, 14, 0.35);
  transition: opacity 0.18s ease;
}
.card:hover .card-play,
.card:focus-visible .card-play { opacity: 1; }
.card-play span {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1206;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  padding-left: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.card-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
.card-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin: auto 0 0;
  padding-top: 2px;
}

.status { color: var(--muted); text-align: center; padding: 40px 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  padding: 28px 0 48px;
  font-size: 0.85rem;
}
.site-footer p { margin: 0; }

/* Player overlay */
.player {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
}
.player[hidden] { display: none; }
.player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 7, 6, 0.72);
  backdrop-filter: blur(6px);
}
.player-card {
  position: relative;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 16px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.5);
  animation: rise 0.22s ease;
  max-height: 92vh;
  overflow-y: auto;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.player-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.player-close:hover { color: var(--text); }

.player-head {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}
.player-cover {
  width: 64px;
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid var(--line);
  flex: none;
}
.player-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0 0 4px;
}
.player-meta h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.35rem;
  margin: 0;
}
.player-now { color: var(--muted); margin: 6px 0 0; font-size: 0.9rem; }

.controls {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ctrl {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}
.ctrl svg { display: block; }
.ctrl svg[hidden] { display: none; }
.ctrl:hover { background: var(--accent-soft); }
.ctrl-play {
  width: 56px;
  height: 56px;
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1206;
  font-size: 1.3rem;
}
.ctrl-play:hover { background: #e7b355; }
.time { color: var(--muted); font-size: 0.85rem; margin-left: auto; font-variant-numeric: tabular-nums; }

.seek { margin: 16px 0 8px; }
#seek {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
}
#seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
}

.chapters {
  list-style: none;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  counter-reset: ch;
}
.chapters li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.14s ease;
}
.chapters li:hover { background: var(--card); }
.chapters li.active { background: var(--accent-soft); }
.ch-num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  width: 22px;
  flex: none;
}
.chapters li.active .ch-num { color: var(--accent); }
.ch-title { font-size: 0.95rem; }
.ch-eq {
  margin-left: auto;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  opacity: 0;
}
.chapters li.active .ch-eq { opacity: 1; }
.ch-eq i {
  width: 3px;
  background: var(--accent);
  border-radius: 1px;
}
/* varied resting heights so it reads as an equalizer even when paused */
.ch-eq i:nth-child(1) { height: 8px; }
.ch-eq i:nth-child(2) { height: 15px; }
.ch-eq i:nth-child(3) { height: 10px; }
.chapters.playing li.active .ch-eq i {
  animation: eq 0.85s ease-in-out infinite;
  transform-origin: bottom;
}
.chapters.playing li.active .ch-eq i:nth-child(1) { animation-delay: 0s; }
.chapters.playing li.active .ch-eq i:nth-child(2) { animation-delay: 0.28s; }
.chapters.playing li.active .ch-eq i:nth-child(3) { animation-delay: 0.52s; }
@keyframes eq {
  0%, 100% { height: 5px; }
  50% { height: 15px; }
}

@media (max-width: 520px) {
  .site-header { padding: 40px 0 16px; }
  .grid { gap: 20px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .player-card { padding: 20px; }
  .player-cover { width: 54px; }
}

audio { display: none; }
