/* Listening page – builds on /assets/site.css (fonts, colours, header, footer) */

:root {
  --accent: var(--ink);       /* played part of the waveform */
  --wave-rest: #d6cfc2;       /* unplayed part */
  --wave-hover: #a29c90;      /* hover preview */
}
/* dark mode (follows the device; the corner button overrides it – see /assets/site.js) */
:root[data-theme="dark"] {
  --wave-rest: #3d3933;
  --wave-hover: #6f6a61;
}

/* player – a peach panel, like an open work */
.player {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 0 24px;
  align-items: center;
  padding: 30px 14px 30px;
  background: var(--peach);
}

.art {
  width: 88px;
  height: 88px;
  background: var(--peach-deep) center / cover no-repeat;
  align-self: start;
}
.now-text { min-width: 0; }
.now-collection {
  margin: 0 0 6px;
  font: 300 13px/1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-title {
  margin: 0;
  font: 400 clamp(26px, 3vw, 34px)/1.15 var(--display);
  overflow-wrap: anywhere;
}
.now-meta {
  margin: 6px 0 0;
  font-size: 15.5px;
  line-height: 1.45;
  font-style: italic;
  color: var(--muted);
}

/* play button + waveform */
.play {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  justify-self: start;
  width: 56px;
  height: 56px;
  margin-top: 28px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: background .15s, color .15s;
}
.play svg { width: 20px; height: 20px; fill: currentColor; }
.play:hover { background: var(--ink); color: var(--peach); }
.play:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.play .i-pause,
.playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }

.wave {
  position: relative;
  height: 56px;
  margin-top: 28px;
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.wave canvas { display: block; width: 100%; height: 100%; }
.wave:focus-visible { box-shadow: 0 0 0 1.5px var(--ink); }
.wave-hover {
  position: absolute;
  top: -18px;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.controls {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.time {
  font-size: 14px;
  color: var(--muted);
  min-width: 48px;
  font-variant-numeric: tabular-nums;
}
.time-total { text-align: right; }
.steps { display: flex; gap: 18px; }
.step {
  all: unset;
  cursor: pointer;
  font: 500 11px/1 var(--text);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.step:hover { color: var(--ink); }
.step:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.notes {
  grid-column: 2;
  margin-top: 22px;
  font-size: 16.5px;
  line-height: 1.65;
  max-width: 58ch;
}
.notes p { margin: 0 0 .6em; }

/* list intro – mirrors the works count line */
.list-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin: clamp(50px, 6vw, 80px) 0 18px;
}
.count {
  font: 300 15px/1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  font: 500 15px/1 var(--text);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
}
.pill:hover { background: var(--ink); color: var(--bg); }

/* collection chips (only shown when there is more than one) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 14px;
}
.chips button {
  all: unset;
  cursor: pointer;
  font: 400 15px/1 var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  transition: .15s;
}
.chips button:hover { color: var(--ink); background: var(--grey); }
.chips button[aria-current="true"] { background: var(--ink); color: var(--bg); }
.chips[hidden] { display: none; }

.collection-desc {
  margin: 0 0 16px;
  font-size: 16.5px;
  color: var(--muted);
  max-width: 58ch;
}

/* track list – styled like the works rows */
.tracklist {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.tracklist li { border-bottom: 1px solid var(--rule); }
.tracklist button {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  width: 100%;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 22px 14px;
  transition: background .2s;
}
.tracklist button:hover { background: var(--grey); }
.tracklist button:focus-visible { outline: 1.5px solid var(--ink); outline-offset: -2px; }
.tracklist .current button { background: var(--peach); }

.t-no,
.t-dur {
  font: 300 17px/1.4 var(--display);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.t-title { font: 400 22px/1.3 var(--display); }
.t-sub {
  display: block;
  font: italic 400 15.5px/1.45 var(--text);
  color: var(--muted);
  margin-top: 3px;
}

/* playing indicator replaces the number on the current track */
.t-no .eq { display: none; }
.current .t-no .n { display: none; }
.current .t-no .eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.eq i { width: 2px; height: 3px; background: var(--ink); }
.playing .current .eq i { animation: eq .9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.3s !important; }
.eq i:nth-child(3) { animation-delay: -.6s !important; }
@keyframes eq { from { height: 2px; } to { height: 12px; } }

@media (max-width: 900px) {
  .tracklist button { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 6px 16px; }
}

@media (max-width: 520px) {
  .player { grid-template-columns: 64px minmax(0, 1fr); gap: 0 16px; padding: 22px 12px; }
  .art { width: 64px; height: 64px; }
  .play { width: 48px; height: 48px; margin-top: 22px; }
  .wave { height: 48px; margin-top: 22px; }
  .notes { grid-column: 1 / -1; }
  .controls { grid-column: 1 / -1; }
  .tracklist button { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 18px 4px; }
  .t-title { font-size: 20px; }
  .t-no, .t-dur { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .playing .current .eq i { animation: none; height: 8px; }
}

/* year sits on the title line, lighter – kept apart from notes and recording dates */
.year {
  font-weight: 300;
  font-size: .72em;
  color: var(--muted);
  white-space: nowrap;
  margin-left: .35em;
  font-variant-numeric: tabular-nums;
}
