:root {
  color-scheme: dark;
  --background: #090909;
  --surface: #111111;
  --surface-hover: #171717;
  --surface-active: #211716;
  --ink: #f2f0ed;
  --muted: #85817d;
  --line: #242220;
  --accent: #a4493f;
  --accent-bright: #d06a5e;
  --player-height: 92px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { background: var(--background); }

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

.page-shell {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 calc(var(--player-height) + 44px);
}

.album-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 12px 30px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 64px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.055em;
}

.track-count {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.track-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.track-row {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 58px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.track-row:hover { background: var(--surface-hover); }
.track-row:focus-visible {
  z-index: 1;
  outline: 2px solid var(--accent-bright);
  outline-offset: -2px;
}
.track-row[aria-current="true"] { background: var(--surface-active); }
.track-row[aria-current="true"] .track-title,
.track-row[aria-current="true"] .track-number { color: var(--accent-bright); }

.track-number {
  color: #67635f;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.track-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 520;
  letter-spacing: -.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-duration {
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.playing-bars {
  display: none;
  width: 14px;
  height: 14px;
  align-items: end;
  gap: 2px;
}

.playing-bars i {
  width: 2px;
  height: 40%;
  background: var(--accent-bright);
  animation: bounce .75s ease-in-out infinite alternate;
}
.playing-bars i:nth-child(2) { height: 85%; animation-delay: -.5s; }
.playing-bars i:nth-child(3) { height: 60%; animation-delay: -.25s; }
.track-row.is-playing .track-index { display: none; }
.track-row.is-playing .playing-bars { display: flex; }

@keyframes bounce { to { height: 100%; } }

.player {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(320px, 1.45fr) minmax(130px, 1fr);
  align-items: center;
  min-height: var(--player-height);
  padding: 12px 28px;
  border-top: 1px solid #2b2927;
  background: rgba(14, 14, 14, .94);
  backdrop-filter: saturate(135%) blur(20px);
}

.now-playing {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.now-number {
  width: 26px;
  flex: 0 0 26px;
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.now-copy { min-width: 0; }
.now-copy strong,
.now-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.now-copy strong { font-size: 13px; font-weight: 600; }
.now-copy span { margin-top: 3px; color: var(--muted); font-size: 11px; }

.transport { min-width: 0; }
.transport-buttons {
  display: flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.icon-button,
.play-button {
  display: grid;
  padding: 0;
  border: 0;
  place-items: center;
  background: transparent;
  cursor: pointer;
}
.icon-button { width: 44px; height: 44px; color: #c7c3bf; }
.play-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: #111;
}
.icon-button:hover:not(:disabled) { color: #fff; }
.play-button:hover:not(:disabled) { transform: scale(1.04); }
.icon-button:focus-visible,
.play-button:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.icon-button:disabled,
.play-button:disabled { opacity: .28; cursor: default; }
.icon-button svg { width: 18px; height: 18px; fill: currentColor; }
.play-button svg { width: 17px; height: 17px; fill: currentColor; }
.pause-icon { display: none; }
.player.is-playing .play-icon { display: none; }
.player.is-playing .pause-icon { display: block; }

.timeline {
  display: grid;
  grid-template-columns: 36px minmax(60px, 1fr) 36px;
  align-items: center;
  gap: 9px;
  margin-top: 3px;
  color: #77736f;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

input[type="range"] {
  height: 16px;
  margin: 0;
  accent-color: var(--accent-bright);
  cursor: pointer;
}
input[type="range"]:disabled { cursor: default; opacity: .35; }

.volume-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.volume-control svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.volume-control input { width: min(110px, 55%); }

.toast {
  position: fixed;
  z-index: 40;
  right: 18px;
  bottom: calc(var(--player-height) + 18px);
  max-width: min(380px, calc(100vw - 36px));
  padding: 11px 14px;
  border: 1px solid #4d2c28;
  background: #211513;
  color: #f2c4bd;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

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

@media (max-width: 720px) {
  :root { --player-height: 126px; }
  .page-shell { width: 100%; padding: 34px 14px calc(var(--player-height) + 24px); }
  .album-header { padding: 0 10px 24px; }
  .track-row { grid-template-columns: 44px minmax(0, 1fr) auto; min-height: 56px; padding: 0 10px; }
  .player {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 50px 52px;
    padding: 7px 14px 10px;
  }
  .now-playing { grid-column: 1; grid-row: 1; }
  .transport { display: contents; }
  .transport-buttons { grid-column: 2; grid-row: 1; gap: 2px; }
  .timeline { grid-column: 1 / -1; grid-row: 2; margin: 0; }
  .volume-control { display: none; }
  .toast { bottom: calc(var(--player-height) + 12px); }
}

@media (max-width: 420px) {
  .track-count { font-size: 12px; }
  .track-duration { padding-left: 10px; }
  .track-title { font-size: 14px; }
  .now-number { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
