/* Inside of a music box: velvet lining, brass comb, engraved plaque. */
:root {
  --velvet: #2a1727;
  --velvet-deep: #1f101d;
  --velvet-raised: #3a2236;
  --brass: #d4aa5e;
  --brass-bright: #f2d394;
  --brass-dim: #6d5638;
  --ivory: #f2e9dc;
  --mauve: #b39aad;
  --line: rgba(242, 233, 220, 0.13);

  --display: 'Gloock', 'Iowan Old Style', Georgia, serif;
  --ui: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --player-h: 88px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .85 0 0 0 0 .95 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(90% 60% at 30% 0%, #4a2645 0%, transparent 65%),
    radial-gradient(70% 50% at 100% 100%, #3a1d36 0%, transparent 70%),
    var(--velvet);
  background-attachment: fixed;
  color: var(--ivory);
  font: 400 1rem/1.55 var(--ui);
  padding-bottom: calc(var(--player-h) + var(--safe-b) + 24px);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass-bright); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--brass); color: var(--velvet-deep); padding: 8px 14px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- masthead ---------- */
.masthead {
  padding: calc(env(safe-area-inset-top, 0px) + 20px) var(--gutter) 0;
  max-width: 1240px; margin: 0 auto;
}
.brand { display: inline-flex; align-items: flex-end; gap: 12px; text-decoration: none; }
.brand-mark { height: 58px; width: auto; margin-bottom: -4px; }
.brand-word { height: 30px; width: auto; }
.brand:hover .brand-mark { transform: rotate(-4deg); }
.brand-mark { transition: transform .3s cubic-bezier(.3,1.6,.5,1); transform-origin: 50% 80%; }

main { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); outline: none; }
.loading, .empty { color: var(--mauve); padding: 18vh 0; text-align: center; }
.empty h1 { font-family: var(--display); font-weight: 400; color: var(--ivory); font-size: 2.2rem; margin: 0 0 8px; }

/* ---------- hero: newest release ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(24px, 5vw, 56px) 0 clamp(40px, 6vw, 80px);
}
.hero-art .cover { box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 40px 80px -24px rgba(10, 2, 9, .85); }
.hero-art .tile-play { width: 68px; height: 68px; right: 20px; bottom: 20px; }
.hero-art .tile-play svg { width: 30px; height: 30px; }
.hero-copy h1 a { text-decoration: none; }
.hero-copy h1 a:hover { color: var(--brass-bright); }


.cover {
  aspect-ratio: 1;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 3px;
  background: var(--velvet-raised);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 30px 60px -20px rgba(10, 2, 9, .7);
}
.hero-kicker { color: var(--mauve); margin: 0 0 10px; font-size: .95rem; }
.hero h1, .release-head h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7.5vw, 6.2rem);
  line-height: .95;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.meta { color: var(--mauve); margin: 0 0 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ivory);
  font-weight: 500; font-size: .98rem;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--brass); color: var(--brass-bright); }
.btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.btn.primary { background: var(--brass); border-color: var(--brass); color: var(--velvet-deep); font-weight: 600; }
.btn.primary:hover { background: var(--brass-bright); border-color: var(--brass-bright); color: var(--velvet-deep); }
.btn small { color: var(--mauve); font-weight: 400; font-size: .85em; }
.btn:hover small { color: inherit; }

/* ---------- catalog grid ---------- */
.section-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 22px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 42vw), 1fr));
  gap: clamp(18px, 3vw, 36px) clamp(14px, 2.4vw, 28px);
}
.tile a { text-decoration: none; display: block; }
.tile-art { position: relative; }
.tile-art .cover {
  transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s;
  outline: 1px solid rgba(212, 170, 94, 0); outline-offset: 5px;
}
.tile:hover .tile-art .cover { transform: translateY(-4px); outline-color: rgba(212, 170, 94, .45); }
.tile-play {
  position: absolute; right: 12px; bottom: 12px;
  width: 52px; height: 52px; border-radius: 999px; border: 0;
  display: grid; place-items: center;
  background: var(--brass); color: var(--velvet-deep);
  box-shadow: 0 8px 20px -6px rgba(10, 2, 9, .8);
  cursor: pointer;
  opacity: 0; transform: translateY(6px) scale(.92);
  transition: opacity .2s, transform .2s, background-color .15s;
}
.tile-play svg { width: 24px; height: 24px; fill: currentColor; }
.tile:hover .tile-play, .tile-play:focus-visible, .tile.is-playing .tile-play { opacity: 1; transform: none; }
.tile-play:hover { background: var(--brass-bright); }
@media (hover: none) { .tile-play { opacity: 1; transform: none; width: 46px; height: 46px; } }
.tile-title { display: block; margin-top: 12px; font-weight: 600; line-height: 1.3; }
.tile-meta { display: block; color: var(--mauve); font-size: .9rem; }
.tile.is-playing .tile-title { color: var(--brass-bright); }

/* Placeholder sleeve for releases without artwork */
.cover.blank {
  display: grid; place-items: center;
  background: repeating-linear-gradient(90deg, var(--velvet-raised) 0 10px, #42283e 10px 12px);
  font-family: var(--display); font-size: clamp(2rem, 6vw, 4rem); color: var(--brass-dim);
}

/* ---------- release page ---------- */
.release {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(24px, 5vw, 56px) 0;
  align-items: start;
}
.release-art { position: sticky; top: 24px; }
.release-head h1 { font-size: clamp(2.4rem, 6vw, 4.8rem); }
.notes-link { color: var(--brass); text-underline-offset: 3px; white-space: nowrap; margin-left: 4px; }
.notes-link:hover { color: var(--brass-bright); }
.disc {
  font-family: var(--display); font-weight: 400; font-size: 1.45rem;
  color: var(--brass); margin: 40px 0 0;
}
.disc + .tracks { margin-top: 12px; }

/* Liner notes: set like a booklet page */
.notes {
  margin: 64px 0 0;
  padding: clamp(24px, 4vw, 44px);
  max-width: 68ch;
  background: linear-gradient(180deg, rgba(242, 233, 220, .055), rgba(242, 233, 220, .025));
  border: 1px solid rgba(212, 170, 94, .3);
  border-radius: 4px;
  position: relative;
}
.notes::before {
  content: ''; position: absolute; inset: 6px;
  border: 1px solid rgba(212, 170, 94, .14); border-radius: 2px; pointer-events: none;
}
.notes h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  margin: 0 0 20px; color: var(--brass);
}
.notes p { font-size: 1.07rem; line-height: 1.75; margin: 0 0 1.05em; color: rgba(242, 233, 220, .92); }
.notes p:last-child { margin-bottom: 0; }
.notes.liner p:last-child { font-family: var(--display); font-size: 1.3rem; color: var(--brass-bright); }
.notes.story { margin-top: clamp(56px, 8vw, 96px); }
.notes p:first-of-type::first-letter {
  font-family: var(--display); color: var(--brass);
  float: left; font-size: 3.6em; line-height: .82; margin: .08em .1em 0 0;
}
.back { display: inline-block; color: var(--mauve); text-decoration: none; margin: 20px 0 0; }
.back:hover { color: var(--brass-bright); }

.tracks { list-style: none; margin: 34px 0 0; padding: 0; border-top: 1px solid var(--line); }
.track {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 12px;
  border-bottom: 1px solid var(--line);
}
.track-play {
  display: contents;
  cursor: pointer;
}
.track-play > * { cursor: pointer; }
.track-n { color: var(--mauve); font-variant-numeric: tabular-nums; text-align: right; padding: 16px 0; }
.track-name { font-weight: 500; padding: 16px 0; overflow-wrap: anywhere; }
.track-name small { display: block; color: var(--mauve); font-weight: 400; }
.track-time { color: var(--mauve); font-variant-numeric: tabular-nums; }
.track:hover .track-name { color: var(--brass-bright); }
.track.is-current .track-n, .track.is-current .track-name { color: var(--brass-bright); }
.track-btn {
  appearance: none; border: 0; background: none; padding: 0; text-align: inherit;
  display: grid; grid-template-columns: subgrid; grid-column: 1 / 4; align-items: center;
}
.track-dl { display: flex; gap: 2px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 999px; border: 0; background: none;
  color: var(--ivory); cursor: pointer; text-decoration: none;
  transition: color .15s, background-color .15s;
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn:hover { color: var(--brass-bright); background: rgba(242, 233, 220, .06); }
.track-dl .icon-btn { width: 40px; height: 40px; color: var(--mauve); }
.track-dl .icon-btn svg { width: 19px; height: 19px; }
.track-dl .icon-btn:hover { color: var(--brass-bright); }
.flac-tag { font-size: .66rem; font-weight: 600; letter-spacing: .02em; }

/* Equalizer glyph on the playing track */
.bars { display: inline-flex; gap: 2px; height: 14px; align-items: flex-end; }
.bars i { width: 3px; background: var(--brass-bright); border-radius: 1px; animation: bar 1s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: -.4s; }
.bars i:nth-child(3) { animation-delay: -.7s; }
.paused .bars i { animation-play-state: paused; }
@keyframes bar { 0%, 100% { height: 30%; } 50% { height: 100%; } }

/* ---------- footer ---------- */
.colophon {
  max-width: 1240px; margin: 80px auto 0; padding: 26px var(--gutter) 0;
  border-top: 1px solid var(--line);
  color: var(--mauve); font-size: .95rem;
  display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between;
}
.colophon p { margin: 0; max-width: 60ch; }
.colophon nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.colophon a:hover { color: var(--brass-bright); }
.install-hint { color: var(--ivory); }

/* ---------- player ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid;
  grid-template-columns: 56px minmax(120px, 230px) auto minmax(0, 1fr) 44px;
  grid-template-areas: "art text controls seek dl";
  align-items: center;
  gap: 0 18px;
  min-height: var(--player-h);
  padding: 12px var(--gutter) calc(12px + var(--safe-b));
  background: rgba(31, 16, 29, .94);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-top: 1px solid rgba(212, 170, 94, .28);
}
.player[hidden] { display: none; }
.player-art { grid-area: art; width: 56px; height: 56px; border-radius: 2px; object-fit: cover; background: var(--velvet-raised); }
.player-text { grid-area: text; min-width: 0; display: flex; flex-direction: column; }
.player-title { font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title:hover { color: var(--brass-bright); }
.player-sub { color: var(--mauve); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-controls { grid-area: controls; display: flex; align-items: center; gap: 2px; }
.icon-btn.play { width: 50px; height: 50px; background: var(--brass); color: var(--velvet-deep); }
.icon-btn.play:hover { background: var(--brass-bright); color: var(--velvet-deep); }
.icon-btn.play svg { width: 24px; height: 24px; }
.i-pause, .is-playing .i-play { display: none; }
.is-playing .i-pause { display: block; }
.player-seek { grid-area: seek; display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-dl { grid-area: dl; }
.time { color: var(--mauve); font-size: .85rem; font-variant-numeric: tabular-nums; min-width: 2.6em; }
.time:last-child { text-align: right; }

/* The comb: one tine per slice of the song, long bass tines to short treble tines. */
.comb {
  flex: 1; min-width: 0;
  height: 40px;
  display: flex; align-items: flex-start; gap: 3px;
  cursor: pointer;
  touch-action: none;
  position: relative;
  padding-top: 4px;
  border-top: 3px solid var(--brass-dim);
  border-radius: 2px;
}
.comb .tine {
  flex: 1;
  background: rgba(212, 170, 94, .24);
  border-radius: 0 0 2px 2px;
  transform-origin: top center;
  transition: background-color .2s;
}
.comb .tine.on { background: var(--brass); }
.comb .tine.hover { background: var(--brass-bright); opacity: .55; }
.comb .tine.pluck { background: var(--brass-bright); animation: pluck .5s ease-out infinite alternate; }
.is-paused .comb .tine.pluck { animation: none; }
@keyframes pluck {
  from { transform: rotate(-2.5deg); }
  to { transform: rotate(2.5deg); }
}

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero, .release { grid-template-columns: 1fr; align-items: start; }
  .hero-art { max-width: 520px; }
  .release-art { position: static; max-width: 440px; }
}
@media (max-width: 720px) {
  :root { --player-h: 128px; }
  .brand-mark { height: 46px; }
  .brand-word { height: 24px; }
  .player {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas: "seek seek seek" "art text controls";
    gap: 8px 12px;
    padding-top: 10px;
  }
  .player-art { width: 48px; height: 48px; }
  .player-dl { display: none; }
  .comb { height: 30px; }
  .icon-btn.play { width: 46px; height: 46px; }
  .track-dl .icon-btn.flac { display: none; }
}

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