:root {
  --bg: #12100e;
  --surface: #1c1916;
  --surface-2: #26221e;
  --line: #342f29;
  --text: #f1ebe2;
  --muted: #a69c8f;
  --accent: #c9a46a;
  --accent-ink: #1a1510;
  --radius: 10px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --player-h: 0px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--player-h);
  -webkit-font-smoothing: antialiased;
}

body.has-player { --player-h: 84px; }

img { -webkit-user-drag: none; user-select: none; }

a { color: inherit; }

button { font: inherit; color: inherit; }

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

/* Header */
.site-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .01em;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0 18%, #2a2520 19% 22%, #0d0b09 23% 100%);
  box-shadow: 0 0 0 1px var(--line);
}

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 24px 56px; outline: none; }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 16px 32px;
  border-top: 1px solid var(--line);
}

/* Home */
.intro h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.1;
  margin: 0 0 8px;
}
.intro p { color: var(--muted); margin: 0 0 36px; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 32px;
}
.album-card { text-decoration: none; display: block; }
.album-card .art {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  transition: transform .2s ease;
}
.album-card .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-card:hover .art { transform: translateY(-3px); }
.album-card h2 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 14px 0 0; line-height: 1.2; }
.album-card .artist { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* Album page */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-size: 14px;
  margin-bottom: 28px;
}
.back-link:hover { color: var(--text); }

.album {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.sleeve { position: sticky; top: 24px; }
.sleeve .art {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
}
.sleeve .art img { width: 100%; display: block; }
.sleeve-tabs { display: flex; gap: 6px; margin-top: 14px; }
.sleeve-tabs button {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 14px; font-size: 13px; color: var(--muted); cursor: pointer;
}
.sleeve-tabs button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); border-color: var(--surface-2); }

.album-head .eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.album-head h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  margin: 6px 0 6px;
}
.album-head .artist { font-size: 17px; }
.album-head .subtitle { color: var(--muted); font-size: 14px; margin-top: 2px; }
.album-actions { display: flex; align-items: center; gap: 14px; margin: 22px 0 26px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 999px; padding: 10px 22px;
  font-weight: 600; cursor: pointer;
}
.btn-primary svg { width: 18px; height: 18px; fill: currentColor; }
.btn-primary:hover { filter: brightness(1.08); }
.album-actions .meta { color: var(--muted); font-size: 13px; }

.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.track {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  border-radius: 6px;
}
.track:hover { background: var(--surface); }
.track .num { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; font-size: 14px; }
.track .t-title { font-weight: 500; }
.track .t-writers { color: var(--muted); font-size: 13px; margin-top: 1px; }
.track .dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.track.is-current .t-title, .track.is-current .num { color: var(--accent); }
.track .eq { display: none; }
.track.is-current .eq { display: inline-flex; }
.track.is-current .n { display: none; }
.eq { gap: 2px; align-items: flex-end; height: 12px; justify-content: flex-end; width: 100%; }
.eq i { width: 3px; background: var(--accent); height: 4px; }
body.is-playing .track.is-current .eq i { animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s !important; }
.eq i:nth-child(3) { animation-delay: -.6s !important; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 12px; } }

.credits { margin-top: 32px; color: var(--muted); font-size: 13px; }
.credits h3 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text); margin: 0 0 8px; font-weight: 600; }
.credits ul { list-style: none; padding: 0; margin: 0; }
.credits li { padding: 2px 0; }

/* Player */
.player {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(28, 25, 22, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  z-index: 10;
}
.player-inner {
  max-width: 1080px; margin: 0 auto;
  height: 84px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 52px minmax(0, 220px) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.player-art { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.player-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-controls { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn svg { width: 20px; height: 20px; fill: var(--text); }
.icon-btn:hover { background: var(--surface-2); }
.play-btn { width: 44px; height: 44px; background: var(--text); }
.play-btn:hover { background: #fff; }
.play-btn svg { fill: var(--bg); width: 22px; height: 22px; }
.play-btn .i-pause { display: none; }
body.is-playing .play-btn .i-pause { display: block; }
body.is-playing .play-btn .i-play { display: none; }

.player-seek { display: flex; align-items: center; gap: 10px; }
.time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 34px; }
.time:last-child { text-align: right; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px; border-radius: 2px; cursor: pointer;
  background: linear-gradient(to right, var(--accent) var(--pct, 0%), var(--surface-2) var(--pct, 0%));
}
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--text); border: 0; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text); border: 0; }

/* Phones */
@media (max-width: 760px) {
  main { padding: 24px 16px 40px; }
  .site-header { padding: 16px; }
  .album { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .sleeve { position: static; width: 100%; max-width: 420px; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
  .album-card h2 { font-size: 19px; }

  body.has-player { --player-h: 112px; }
  .player-inner {
    height: 112px;
    padding: 8px 16px 10px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    row-gap: 6px;
    column-gap: 12px;
  }
  .player-art { width: 44px; height: 44px; }
  .player-seek { grid-column: 1 / -1; }
  .icon-btn { width: 34px; height: 34px; }
  .play-btn { width: 40px; height: 40px; }
}
