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

:root {
  --bg: #0f0f13;
  --surface: #1a1a22;
  --border: #2a2a38;
  --accent: #7c6aff;
  --accent-dim: #4a3fbf;
  --text: #e8e8f0;
  --text-muted: #888899;
  --green: #4caf7d;
  --tag-bg: #252535;
}

html {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ── Header ── */
header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  margin-bottom: 2.5rem;
}
header nav a {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
}
header nav a:hover {
  color: #a899ff;
}

/* ── Index ── */
h1.index-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1.75rem;
  color: var(--text);
}

.digest-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.digest-list li a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.15s,
    background 0.15s;
}
.digest-list li a:hover {
  border-color: var(--accent-dim);
  background: #1e1e2c;
}
.digest-list .title {
  font-weight: 600;
}
.digest-list .count {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Single page ── */
h1.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 2rem 0 0.75rem;
}

ul {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  color: #a899ff;
}

/* ── Digest entry cards ── */
.entry-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  margin: 0.55rem 0;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
}
.entry-card:hover {
  border-color: var(--accent-dim);
  background: #1e1e2c;
}

/* stretched-link overlay: makes the entire card clickable while letting
   nested .entry-action links sit on top via z-index. */
.entry-link {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 8px;
}

.entry-art {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--tag-bg);
}
/* Skeleton-style fallback: vinyl record glyph centered on a subtle gradient.
   The shimmer keyframe gives a faint pulse so missing-art rows still feel
   alive while the next backfill pass tries to populate them. */
.entry-art-placeholder {
  position: relative;
  background: linear-gradient(135deg, #20202c, #2a2a38);
  border: 1px solid var(--border);
  overflow: hidden;
}
.entry-art-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    var(--accent-dim) 0%,
    transparent 35%
  );
  opacity: 0.18;
  animation: art-skeleton-pulse 2.4s ease-in-out infinite;
}
.entry-art-placeholder::after {
  content: "♪";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--accent);
  opacity: 0.45;
}
@keyframes art-skeleton-pulse {
  0%,
  100% {
    opacity: 0.12;
  }
  50% {
    opacity: 0.28;
  }
}

.entry-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.entry-line {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
  line-height: 1.3;
}
.entry-artist {
  font-weight: 700;
  color: var(--text);
}
.entry-sep {
  color: var(--text-muted);
}
.entry-title {
  color: var(--text-muted);
  font-weight: 500;
}

.entry-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

/* tag chips: muted, lowercase, no border — clearly subordinate to scores */
.entry-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  padding: 0.1em 0.45em;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.entry-listeners {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 0.2rem;
}

/* YT/Q action pills: sit above the stretched link so they're independently clickable */
.entry-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.entry-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}
.entry-action:hover {
  color: var(--text);
  border-color: var(--accent-dim);
  background: var(--accent-dim);
  text-decoration: none;
}
.entry-action-yt:hover {
  background: #c4302b;
  border-color: #c4302b;
  color: #fff;
}
.entry-action-q:hover {
  background: #1d6cb1;
  border-color: #1d6cb1;
  color: #fff;
}
.entry-action-lf:hover {
  background: #d51007;
  border-color: #d51007;
  color: #fff;
}
.entry-action-aoty {
  width: auto;
  padding: 0 0.5em;
}
.entry-action-aoty:hover {
  background: #2d8755;
  border-color: #2d8755;
  color: #fff;
}

/* ── Back link ── */
.back-link {
  display: inline-block;
  margin-bottom: 1.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
}
.back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Release page ── */
.release-page {
  margin-top: 0.5rem;
}

.release-hero {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.album-art {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.album-art-placeholder {
  position: relative;
  background: linear-gradient(135deg, #20202c, #2a2a38);
  overflow: hidden;
}
.album-art-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    var(--accent-dim) 0%,
    transparent 45%
  );
  opacity: 0.22;
  animation: art-skeleton-pulse 2.4s ease-in-out infinite;
}
.album-art-placeholder::after {
  content: "♪";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: var(--accent);
  opacity: 0.45;
}

.release-meta {
  flex: 1;
  min-width: 0;
}

.release-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--text);
  line-height: 1.3;
}

.release-artist {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.release-badges {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.release-kind {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: var(--accent-dim);
  color: #dde;
  border-radius: 4px;
  padding: 0.2em 0.55em;
}

.release-listeners {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── AOTY score pills ──
   Solid-fill rectangles with a leading "MC"/"USR" label so they read as
   ratings at a glance and don't blend into the muted tag chips. */
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 3px;
  padding: 0.2em 0.5em;
  letter-spacing: 0;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.score-pill::before {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.78;
}
.score-critic {
  background: #2d8755;
  color: #fff;
}
.score-critic::before {
  content: "MC";
}
.score-user {
  background: #4a6fb1;
  color: #fff;
}
.score-user::before {
  content: "USR";
}

.release-tags {
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.release-links {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.release-btn {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45em 1em;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.release-btn:hover {
  border-color: var(--accent-dim);
  background: #1e1e2c;
  color: var(--accent);
  text-decoration: none;
}

/* ── Tracklist ── */
.tracklist {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.tracklist h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}
.tracklist ol {
  padding-left: 1.75rem;
  list-style: decimal;
  margin: 0;
}
.tracklist li {
  background: none;
  border-radius: 0;
  padding: 0.3rem 0;
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.tracklist li:last-child {
  border-bottom: none;
}

/* ── Responsive (narrow screens) ── */
@media (max-width: 500px) {
  .release-hero {
    flex-direction: column;
  }
  .album-art {
    width: 100%;
    height: auto;
    max-width: 280px;
  }
}
