/* sounds of — a collection of favourite mixes
   ink-navy ground · one accent per collection · didone wordmark / grotesque / mono

   The wordmark is the signature: a roman cream prefix ("Sounds of") completed by
   an italic accent-coloured suffix naming whichever collection is in view. With
   one collection it simply sits there; with several it becomes a live index. */

:root {
  --ink:        #06080e;
  --ink-raised: #0b0f1a;
  --ink-bar:    #080b13;
  --edge:       #18202f;
  --edge-soft:  #111826;

  --coral:      #ff5a2b;
  --accent:     var(--coral);
  --cream:      #f3e7d3;
  --sand:       #8f8574;
  --slate:      #2b3547;
  --dim:        #6a6355;

  --font-display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --font-body: "Archivo", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad: clamp(1.15rem, 4vw, 3.5rem);
  --wide: 1420px;
  --bar-h: 116px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 2rem;
}

body.has-player {
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
}

a { color: inherit; }

::selection { background: var(--accent); color: #0a0400; }

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

.mono { font-family: var(--font-mono); font-weight: 400; }

/* ------------------------------------------------------------ atmosphere */
/* film grain + a low sodium glow off the bottom-left, like harbour light. */

.atmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.atmos::before {
  content: "";
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.5'/></svg>");
  opacity: .05;
  animation: grain 6s steps(6) infinite;
}

.atmos::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90ch 60ch at 8% 108%, rgba(255, 90, 43, .16), transparent 62%),
    radial-gradient(70ch 50ch at 96% -8%, rgba(58, 96, 150, .16), transparent 60%),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, .022) 0 1px, transparent 1px 3px);
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-6%, 4%); }
  40%  { transform: translate(4%, -6%); }
  60%  { transform: translate(-4%, -3%); }
  80%  { transform: translate(6%, 5%); }
  100% { transform: translate(0, 0); }
}

header, main, footer { position: relative; z-index: 1; }

/* ------------------------------------------------- signature: the wordmark */

.hero {
  max-width: var(--wide);
  margin-inline: auto;
  padding: clamp(2.5rem, 7vw, 6rem) var(--pad) clamp(1.5rem, 4vw, 2.75rem);
}

.hero__mark { margin-bottom: clamp(2rem, 5vw, 3.5rem); }

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.1rem, 12.6vw, 12rem);
  font-variation-settings: "opsz" 96;
  line-height: .84;
  letter-spacing: -.035em;
  text-transform: uppercase;
  color: var(--cream);
  text-shadow: 0 0 60px rgba(255, 90, 43, .12);
}

/* the collection name that completes the sentence */
.suffix {
  margin: .08em 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-variation-settings: "opsz" 96;
  font-size: clamp(2rem, 8.2vw, 7.8rem);
  line-height: .9;
  letter-spacing: -.02em;
  color: var(--accent);
  min-height: 1em;
  padding-left: .06em;
  transition: opacity .34s var(--ease), transform .34s var(--ease);
}

.suffix.is-swapping {
  opacity: 0;
  transform: translateY(.14em);
}

.hero__rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-top: clamp(1.25rem, 2.5vw, 1.9rem);
  border-top: 1px solid var(--edge);
}

.lede {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.6;
  color: #cdbfa9;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  margin: 0;
  justify-content: flex-end;
}

.stats div { margin: 0; }

.stats dt {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sand);
}

.stats dd {
  margin: .25em 0 0;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36;
  font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- collections */

main {
  max-width: var(--wide);
  margin-inline: auto;
  padding: 0 var(--pad) 3rem;
}

.loading {
  font-family: var(--font-mono);
  color: var(--sand);
  font-size: .85rem;
  padding: 2rem 0;
}

.collection {
  padding-top: clamp(2.25rem, 5vw, 4rem);
}

.collection + .collection {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--edge-soft);
}

.collection__rule {
  height: 1px;
  background: var(--accent);
  width: clamp(2.5rem, 6vw, 5rem);
  margin-bottom: 1.1rem;
}

/* Roman caps, not the hero's italic — this is a section header, not a second
   wordmark, and the two sit close enough together to be confused. */
.collection__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-variation-settings: "opsz" 72;
  font-size: clamp(1.75rem, 4.2vw, 3.4rem);
  line-height: 1;
  letter-spacing: -.015em;
  text-transform: uppercase;
  color: var(--cream);
}

.collection__facts {
  margin: .9rem 0 0;
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: .74rem;
  letter-spacing: .06em;
  color: var(--sand);
}

.collection__facts .sep { color: var(--slate); padding: 0 .5rem; }

.collection__blurb {
  margin: 1.35rem 0 0;
  max-width: 60ch;
  font-size: 1.02rem;
  line-height: 1.65;
  color: #b9ac98;
  border-left: 1px solid var(--edge);
  padding-left: 1.15rem;
}

/* ------------------------------------------------------------- track list */

.group__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: clamp(2rem, 4vw, 3rem) 0 .35rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--edge);
}

.group__head h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .76rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cream);
}

.group__count {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: .72rem;
  color: var(--sand);
  margin-left: auto;
}

.row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--edge-soft);
  background: none;
  padding: .6rem .75rem .6rem .5rem;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  position: relative;
  transition: background .16s var(--ease);
}

.row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform .2s var(--ease);
}

.row:hover { background: rgba(255, 255, 255, .028); }
.row:hover::before { transform: scaleY(.35); }

.row.is-current { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.row.is-current::before { transform: scaleY(1); }
.row.is-current .row__title { color: var(--accent); }

/* sleeve: real cover art where it exists, a blank-label sleeve where it doesn't.
   Colours are seeded per track from --h1/--h2. */
.sleeve {
  --h1: 18;
  --h2: 340;
  position: relative;
  width: 46px;
  height: 46px;
  flex: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: #05070c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
  display: block;
}

.sleeve img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sleeve--blank {
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, .55) 18%, transparent 19%),
    repeating-radial-gradient(circle at 50% 50%,
      rgba(255, 255, 255, .06) 0 1px, transparent 1px 4px),
    conic-gradient(from 210deg,
      hsl(var(--h1) 82% 52%) 0deg,
      #0a0d16 96deg,
      hsl(var(--h2) 58% 38%) 200deg,
      #0a0d16 300deg,
      hsl(var(--h1) 82% 52%) 360deg);
}

.sleeve__glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  background: rgba(4, 6, 11, .62);
  transition: opacity .16s var(--ease);
}

.sleeve__glyph svg { width: 14px; height: 14px; fill: var(--cream); }

.row:hover .sleeve__glyph,
.sleeve:focus-visible .sleeve__glyph { opacity: 1; }

/* playing: the sleeve shows live bars instead of the play glyph */
.row.is-playing .sleeve__glyph { opacity: 1; background: rgba(4, 6, 11, .72); }
.row.is-playing .sleeve__glyph svg { display: none; }
.row.is-playing .bars { display: flex; }

.bars { display: none; gap: 2px; align-items: flex-end; height: 15px; }

.bars i {
  width: 2px;
  background: var(--accent);
  height: 30%;
  display: block;
  animation: bar 900ms var(--ease) infinite alternate;
}

.bars i:nth-child(2) { animation-duration: 640ms; }
.bars i:nth-child(3) { animation-duration: 1080ms; }
.bars i:nth-child(4) { animation-duration: 780ms; }
.bars i:nth-child(5) { animation-duration: 520ms; }

@keyframes bar { from { height: 18%; } to { height: 100%; } }

.row__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row__aside {
  font-weight: 400;
  color: var(--sand);
}

.row__dur {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: .85rem;
  color: var(--sand);
  font-variant-numeric: tabular-nums;
}

.row.is-current .row__dur { color: var(--cream); }

.row__src {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: .72rem;
  color: var(--dim);
  text-decoration: none;
  white-space: nowrap;
  padding: .25rem;
  transition: color .16s var(--ease);
}

.row__src:hover { color: var(--accent); }

.hint {
  margin: 3rem 0 0;
  font-size: .78rem;
  color: var(--dim);
  letter-spacing: .04em;
}

.hint .mono {
  color: var(--sand);
  border: 1px solid var(--edge);
  padding: .12em .45em;
  font-size: .9em;
}

.hint .sep { padding: 0 .35rem; color: var(--slate); }

/* ---------------------------------------------------------------- footer */

footer {
  max-width: var(--wide);
  margin-inline: auto;
  padding: 2rem var(--pad) 3rem;
  border-top: 1px solid var(--edge-soft);
  font-size: .82rem;
  color: var(--sand);
}

footer p { margin: 0 0 .35rem; }
.footer__meta { color: var(--dim); }

/* ---------------------------------------------------------- player bar */

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ink-bar) 92%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--edge);
  padding-bottom: env(safe-area-inset-bottom);
}

.player__inner {
  max-width: var(--wide);
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 15rem) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.75rem, 1.6vw, 1.5rem);
  padding: .8rem var(--pad);
}

/* the record on the deck: procedural grooves, cover art as the centre label */
.disc {
  --h1: 18;
  --h2: 340;
  position: relative;
  width: 58px;
  height: 58px;
  flex: none;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: #05070c;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--edge), 0 6px 24px rgba(0, 0, 0, .6);
  overflow: hidden;
}

.disc__face,
.disc__label,
.disc__hole {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.disc__face {
  inset: 0;
  background:
    repeating-radial-gradient(circle at 50% 50%,
      rgba(255, 255, 255, .07) 0 1px, transparent 1px 3px),
    conic-gradient(from 0deg,
      hsl(var(--h1) 88% 56%) 0deg,
      #0a0d16 78deg,
      hsl(var(--h2) 62% 42%) 165deg,
      #0a0d16 250deg,
      hsl(var(--h1) 88% 56%) 360deg);
  animation: spin 9s linear infinite;
  animation-play-state: paused;
}

.is-playing-global .disc__face { animation-play-state: running; }

.disc__label {
  inset: 30%;
  background: radial-gradient(circle at 34% 28%, hsl(var(--h1) 70% 62%), hsl(var(--h2) 55% 26%));
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45);
  animation: spin 9s linear infinite;
  animation-play-state: paused;
}

.is-playing-global .disc__label { animation-play-state: running; }

.disc__hole {
  inset: 45%;
  background: #05070c;
  z-index: 1;
}

@keyframes spin { to { transform: rotate(360deg); } }

.player__id { min-width: 0; }

.player__title {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__meta {
  margin: .15rem 0 0;
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: .72rem;
  color: var(--sand);
  display: flex;
  gap: .75rem;
  white-space: nowrap;
  overflow: hidden;
}

#np-artist {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source { color: var(--accent); text-decoration: none; flex: none; }
.source:hover { text-decoration: underline; }

.transport {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.tbtn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--cream);
  cursor: pointer;
  border-radius: 50%;
  transition: color .16s var(--ease), background .16s var(--ease);
}

.tbtn:hover { color: var(--accent); }

.tbtn svg { width: 17px; height: 17px; fill: currentColor; }
.tbtn svg path[d^="M16.5"],
.tbtn svg path[d^="M17 9.5"] { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tbtn svg path[d^="M7 5v14"],
.tbtn svg path[d^="M17 5v14"] { stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.tbtn--play {
  width: 46px;
  height: 46px;
  background: var(--accent);
  color: #120400;
}

.tbtn--play:hover { background: color-mix(in srgb, var(--accent) 82%, #fff); color: #120400; }
.tbtn--play svg { width: 19px; height: 19px; }

.i-pause, .i-muted { display: none; }
.is-playing-global .tbtn--play .i-play { display: none; }
.is-playing-global .tbtn--play .i-pause { display: block; }
.is-muted .i-vol { display: none; }
.is-muted .i-muted { display: block; }
.is-muted #mute { color: var(--sand); }

.scrub {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  min-width: 0;
}

.t-cur, .t-dur {
  font-size: .74rem;
  font-weight: 400;
  color: var(--sand);
  font-variant-numeric: tabular-nums;
}

.t-cur { color: var(--cream); }

.wave {
  position: relative;
  height: 42px;
  min-width: 0;
  cursor: pointer;
}

.wave canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.wave__ghost {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--cream);
  opacity: .55;
  pointer-events: none;
}

.wave__tip {
  position: absolute;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: var(--cream);
  color: var(--ink);
  font-size: .68rem;
  padding: .1rem .35rem;
  pointer-events: none;
  white-space: nowrap;
}

.vol {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.vol__range {
  -webkit-appearance: none;
  appearance: none;
  width: 74px;
  height: 3px;
  background: var(--slate);
  outline-offset: 6px;
  cursor: pointer;
}

.vol__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--cream);
}

.vol__range::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: var(--cream);
}

/* ------------------------------------------------------------- 404 page */

.oops {
  min-height: 78vh;
  display: grid;
  align-content: center;
  gap: 1rem;
  max-width: var(--wide);
  margin-inline: auto;
  padding: 3rem var(--pad);
}

.oops h1 {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  font-weight: 900;
  font-size: clamp(3rem, 12vw, 8rem);
  line-height: .85;
  letter-spacing: -.03em;
  text-transform: uppercase;
}

.oops p { margin: 0; color: var(--sand); max-width: 46ch; }

.oops a {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: .2em;
  justify-self: start;
  margin-top: .75rem;
}

/* --------------------------------------------------------------- narrow */

@media (max-width: 900px) {
  :root { --bar-h: 148px; }

  .hero__rail {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .stats { justify-content: flex-start; gap: 1rem 1.9rem; }

  .player__inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "disc id transport"
      "scrub scrub scrub";
    gap: .65rem .8rem;
    padding: .7rem var(--pad) .8rem;
  }

  .disc { grid-area: disc; width: 44px; height: 44px; }
  .player__id { grid-area: id; }
  .transport { grid-area: transport; }
  .scrub { grid-area: scrub; }
  .vol { display: none; }

  .wave { height: 34px; }

  .row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .8rem;
    padding: .55rem .25rem;
  }

  .sleeve { width: 40px; height: 40px; }
  .row__src { display: none; }
  .row__title { font-size: .95rem; }
  .collection__blurb { font-size: .96rem; }
  .hint { font-size: .72rem; }
}

@media (max-width: 460px) {
  .collection__facts { font-size: .68rem; line-height: 1.9; }
  .collection__facts .sep { padding: 0 .3rem; }
  .tbtn { width: 34px; height: 34px; }
  .tbtn--play { width: 42px; height: 42px; }
  .player__meta { font-size: .68rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .disc__face, .disc__label { animation: none; }
}
