:root {
  --bg: #070707;
  --surface: #131313;
  --surface-2: #1d1d1d;
  --border: #2e2e2e;
  --text: #f2f2f2;
  --muted: #a3a3a3;
  --red: #e1251b;
  --steel: #d9d9d9;
  --gold: #d4a84b;
  --done: #3ddc97;
  --radius: 6px;
  --heading: "Anton", Impact, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Filters toggle the `hidden` attribute; keep it stronger than component display rules. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(225, 37, 27, 0.16), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 255, 255, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.6 "Inter", system-ui, sans-serif;
}

a { color: var(--gold); }
a:hover { color: var(--red); }

main { max-width: 1200px; margin: 0 auto; padding: 0 16px 48px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px;
  background: rgba(15, 10, 18, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: var(--heading); font-size: 1.5rem; text-decoration: none; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text);
}
.logo:hover { color: var(--red); }
.progress { display: flex; align-items: center; gap: 12px; min-width: 0; }
.progress-bar {
  width: clamp(80px, 22vw, 240px); height: 10px; border-radius: 99px;
  background: var(--surface-2); overflow: hidden; border: 1px solid var(--border);
}
.progress-bar span {
  display: block; height: 100%; width: 0;
  background: var(--red);
  transition: width 0.3s ease;
}
.progress-label { font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.progress-label strong { color: var(--text); }

/* Overview */
.intro { padding: 40px 0 16px; max-width: 760px; }
.intro h1, .hero h1 {
  font-family: var(--heading); font-weight: 400; line-height: 1.1; margin: 0 0 12px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  text-transform: uppercase; letter-spacing: 0.02em;
}
.intro p { color: var(--muted); margin: 0; }

.filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin: 24px 0 8px; padding: 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.filters input[type="search"], .filters select {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
}
.filter-search { flex: 1 1 220px; }
.filter-search input { width: 100%; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 8px 12px; cursor: pointer; color: var(--muted); }
.segmented input:checked + span { background: var(--red); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--steel); outline-offset: -2px; }
.next-up {
  margin-left: auto; font-weight: 600; text-decoration: none;
  padding: 8px 14px; border-radius: 8px; color: #fff;
  background: var(--red);
}
.next-up:hover { color: #fff; filter: brightness(1.15); }
.empty { color: var(--muted); padding: 24px 0; }

.year-heading {
  font-family: var(--heading); font-weight: 400; font-size: 2rem; margin: 32px 0 12px;
  color: var(--gold);
}
.album-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
/* Square cards: the cover fills the card, the caption and listened badge sit on top of it. */
.album-card {
  position: relative; aspect-ratio: 1;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.15s ease, border-color 0.15s ease;
}
.album-card:hover { transform: translateY(-3px); border-color: var(--red); }
.album-card.is-listened { border-color: var(--done); }
.album-card.is-listened .cover { filter: saturate(0.55) brightness(0.75); }
.album-link { display: block; position: absolute; inset: 0; text-decoration: none; color: #fff; }
.album-link:hover { color: #fff; }
.cover { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }
.album-card .cover { position: absolute; inset: 0; }
.cover-missing {
  display: grid; place-items: center; font-family: var(--heading); font-size: 3rem; color: var(--border);
}
.album-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 36px 10px 10px;
  background: linear-gradient(to top, rgba(10, 6, 12, 0.92) 0%, rgba(10, 6, 12, 0.7) 55%, transparent 100%);
}
.album-title {
  font-weight: 700; line-height: 1.25; font-size: 0.95rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.album-artist { color: rgba(255, 255, 255, 0.75); font-size: 0.8rem; }
.album-kind {
  align-self: flex-start; margin-top: 4px; padding: 1px 6px; border-radius: 3px;
  background: var(--red); color: #fff; font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}

.listened-badge {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  display: grid; place-items: center; width: 34px; height: 34px; cursor: pointer;
  border-radius: 50%; background: rgba(10, 6, 12, 0.7); border: 1px solid rgba(255, 255, 255, 0.25);
}
.listened-badge input { width: 18px; height: 18px; margin: 0; accent-color: var(--done); cursor: pointer; }
.is-listened .listened-badge { background: rgba(10, 6, 12, 0.85); border-color: var(--done); }

.listened-toggle {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 12px; border-top: 1px solid var(--border);
  font-size: 0.9rem; color: var(--muted);
}
.listened-toggle input { width: 18px; height: 18px; accent-color: var(--done); margin: 0; }
.is-listened .listened-toggle, .listened-toggle:has(input:checked) { color: var(--done); }

/* Album page */
.crumbs { padding: 20px 0 0; }
.crumbs a { text-decoration: none; }
.hero { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 32px; padding: 24px 0; align-items: start; }
.hero-cover {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(225, 37, 27, 0.22);
}
.hero-artist { color: var(--steel); font-weight: 600; margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.08em; }
.hero-description { color: var(--muted); margin: 0 0 16px; }
.listened-big {
  display: inline-flex; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); font-size: 1rem; padding: 10px 14px;
}
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; margin: 20px 0 0; }
.facts dt { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.facts dd { margin: 0; }

.player { margin: 8px 0 32px; }
.player iframe { border-radius: var(--radius); display: block; }
.spotify-search {
  display: inline-block; padding: 12px 18px; border-radius: 8px; text-decoration: none;
  background: #1db954; color: #0b0b0b; font-weight: 700;
}
.spotify-search:hover { color: #0b0b0b; filter: brightness(1.1); }

.album-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.prose h2, .panel h2 {
  font-family: var(--heading); font-weight: 400; font-size: 1.25rem; color: var(--red); margin: 0 0 8px;
}
.prose { margin-bottom: 28px; max-width: 72ch; }
.prose p { margin: 0 0 12px; }
.source { color: var(--muted); font-size: 0.9rem; }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.people-group + .people-group { margin-top: 8px; }
.people-group summary {
  cursor: pointer; color: var(--gold); font-size: 0.85rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 0;
}
.people { list-style: none; margin: 0; padding: 0; }
.people li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.people li:last-child { border-bottom: 0; }
.people strong { display: block; }
.people span { color: var(--muted); font-size: 0.9rem; }

.tracks-note { color: var(--muted); font-size: 0.9rem; margin: 0 0 8px; }
.tracks { list-style: none; margin: 0; padding: 0; }
.track { display: grid; grid-template-columns: 2em 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.track:last-child { border-bottom: 0; }
.track-no { color: var(--muted); }
.track-title small { display: block; color: var(--muted); font-size: 0.8rem; }
.track-length { color: var(--muted); font-variant-numeric: tabular-nums; }
.track-side {
  color: var(--gold); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 10px 0 2px;
}
.ratings { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.ratings th { text-align: left; font-weight: 400; padding: 5px 0; border-bottom: 1px solid var(--border); }
.ratings td { text-align: right; color: var(--gold); padding: 5px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.pager a {
  display: block; padding: 14px 16px; border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
}
.pager a:hover { border-color: var(--red); color: var(--text); }
.pager small { display: block; color: var(--gold); }
.pager span { display: block; color: var(--muted); font-size: 0.9rem; }
.pager-next { text-align: right; }

.site-footer {
  max-width: 1200px; margin: 0 auto; padding: 24px 16px 40px;
  color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--border);
}

@media (max-width: 860px) {
  .album-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .hero-cover { max-width: 280px; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .progress-label { font-size: 0.8rem; }
  .next-up { margin-left: 0; }
  .pager { grid-template-columns: 1fr; }
}
