:root {
  color-scheme: dark;
  --bg: #0a0908;
  --bg-2: #12110f;
  --paper: #e6dccb;
  --paper-dim: #b7ad9c;
  --mute: #908674;
  --line: rgba(230, 220, 203, 0.14);
  --gold: #c2a36a;
  --gold-2: #8a7344;
}

html {
  background: var(--bg);
  color: var(--paper);
  font-family: Outfit, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

body {
  background: var(--bg);
  color: var(--paper);
  margin: 0;
  padding: 1.5rem 1.5rem 108px;
  padding-top: 4.5rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 300;
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (max-width: 600px) {
  body { padding-top: 5.25rem; }
}

/* Nav */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  background: linear-gradient(to bottom, rgba(10,9,8,.95) 0%, rgba(10,9,8,.7) 50%, rgba(10,9,8,0) 100%);
}

.mark {
  font-family: "Cormorant Garamond", serif;
  font-size: 15px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--paper);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 28px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.nav-links a {
  color: inherit;
  text-decoration: none;
}

.nav-links a:hover { color: var(--paper); }

.nav-about {
  display: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--paper-dim);
  text-decoration: none;
}

.nav-about:hover {
  color: var(--paper);
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-about { display: block; }
}

@media (max-width: 600px) {
  nav { padding: 18px 16px; }
  .nav-links { gap: 18px; }
}

/* Filters */
.filters,
.controls {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.filters button,
.sorts button,
.genres button,
.genre-select {
  background: transparent;
  color: var(--paper-dim);
  border: 1px solid var(--line);
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: border-color 0.15s, color 0.15s;
}

.filters button.active,
.sorts button.active,
.genres button.active {
  border-color: rgba(194, 163, 106, 0.5);
  color: var(--gold);
  background: rgba(10, 9, 8, 0.45);
}

.filters button:hover,
.sorts button:hover,
.genres button:hover,
.genre-select:hover,
.genre-select:focus {
  border-color: var(--gold);
  color: var(--paper);
  outline: none;
}

.separator {
  color: var(--mute);
  font-size: 1.1rem;
  opacity: 0.6;
  user-select: none;
  padding: 0 0.25rem;
}

.genre-select {
  padding-right: 2rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23908674' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1em;
}

/* Grid & cards */
#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 48px;
}

@media (max-width: 600px) {
  #grid { padding-bottom: 64px; }
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card.soon { opacity: 0.55; }
.card.playing { border-color: rgba(194, 163, 106, 0.45); }

.image-wrap,
a.image-wrap {
  position: relative;
  display: block;
  width: 100%;
  height: 280px;
  background: #161513 center/cover no-repeat;
  overflow: hidden;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.image-wrap img,
a.image-wrap img,
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid rgba(194, 163, 106, 0.45);
  color: var(--gold);
  padding: 5px 8px;
  background: rgba(10, 9, 8, 0.45);
  backdrop-filter: blur(6px);
  text-decoration: none;
  line-height: 1;
}

.badge:hover {
  color: var(--paper);
  border-color: var(--gold);
}

.soon .badge {
  opacity: 0.6;
  pointer-events: none;
}

.card .info {
  padding: 20px 20px 18px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.card .id {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 10px;
}

.card .title,
.card h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-weight: 400;
  margin: 0;
  line-height: 1.15;
}

.card .artist,
.card .by {
  color: var(--paper-dim);
  font-size: 13px;
  margin: 6px 0 14px;
}

.card .artwork,
.card .src {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--mute);
  line-height: 1.5;
  margin-top: auto;
  margin-bottom: 16px;
}

.card .actions {
  display: flex;
  gap: 10px;
}

.card .actions a,
.card .actions button,
.btn {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--paper-dim);
  background: none;
  text-decoration: none;
  cursor: pointer;
}

.card .actions a:hover,
.card .actions button:hover,
.btn:hover {
  border-color: var(--gold);
  color: var(--paper);
}

.card .actions button.play {
  min-width: 7.2em;
  text-align: center;
  display: inline-block;
}

.card .artist a { color: var(--gold); text-decoration: none; }
.card .artist a:hover { color: var(--paper); }

.card .title a,
.card h3 a {
  color: inherit;
  text-decoration: none;
}

.card .title a:hover,
.card h3 a:hover { text-decoration: underline; }

/* Brand */
.catalog-brand {
  position: fixed;
  bottom: 10px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
  opacity: 0.65;
  text-decoration: none;
  color: var(--paper);
  font-family: "Cormorant Garamond", serif;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  transition: opacity 0.15s ease;
}

.catalog-brand:hover { opacity: 1; }

.catalog-brand img {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

body::after {
  content: "";
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(to top, rgba(10, 9, 8, 0.75) 0%, rgba(10, 9, 8, 0.4) 50%, transparent 100%);
  pointer-events: none;
  z-index: 15;
}

/* Player dock */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
}

.player {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 18px 12px;
  background: rgba(10, 9, 8, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.art {
  width: 52px;
  height: 66px;
  background: #161513 center/cover no-repeat;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.player .play {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(194, 163, 106, 0.45);
  color: var(--gold);
  display: grid;
  place-items: center;
  background: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.player .play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.now { min-width: 0; }

.now-kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}

.now-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-title a {
  color: inherit;
  text-decoration: none;
}

.now-title a:hover { text-decoration: underline; }

.now-by {
  color: var(--mute);
  font-size: 12px;
}

.now-by a {
  color: var(--gold);
  text-decoration: none;
}

.now-by a:hover { color: var(--paper); }

.scrub {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.time {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--mute);
  min-width: 34px;
}

.time.end { text-align: right; }

.bar {
  position: relative;
  flex: 1;
  height: 3px;
  background: rgba(230, 220, 203, 0.14);
  cursor: pointer;
}

.bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gold);
}

.player-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  text-decoration: none;
  color: var(--paper);
  font-family: "Cormorant Garamond", serif;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  opacity: 0.7;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.player-brand:hover { opacity: 1; }

.player-brand img {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

/* Hide floating brand when dock is open */
body.dock-open .catalog-brand,
.dock:not([hidden]) ~ .catalog-brand {
  display: none;
}

@media (max-width: 860px) {
  .player {
    grid-template-columns: auto auto 1fr;
  }
  .scrub {
    grid-column: 1 / -1;
    min-width: 0;
  }
  .player-brand { display: none; }
}

.card-scrub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid transparent;
  min-height: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease, border-color 0.15s ease;
  pointer-events: none;
}

.card:hover .card-scrub,
.card.playing .card-scrub,
.card.loaded .card-scrub {
  opacity: 1;
  visibility: visible;
  border-top-color: var(--line);
  pointer-events: auto;
}

.card-scrub .time {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--mute);
  min-width: 32px;
}

.card-scrub .time.end {
  text-align: right;
}

.card-scrub .bar {
  position: relative;
  flex: 1;
  height: 3px;
  background: rgba(230, 220, 203, 0.14);
  cursor: pointer;
}

.card-scrub .fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gold);
}

.card .actions button.play {
  min-width: 7.2em;
  text-align: center;
  display: inline-block;
}

.card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(194, 163, 106, 0.5);
  box-shadow: 0 0 0 1px rgba(194, 163, 106, 0.15), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card.playing:hover {
  border-color: rgba(194, 163, 106, 0.65);
}

.card.soon:hover {
  box-shadow: none;
  border-color: var(--line);
}

.card-scrub,
.card-scrub .bar,
#release-scrub,
#release-scrub .bar {
  touch-action: pan-y;
  overscroll-behavior: auto;
}

.card-scrub .bar,
#release-scrub .bar {
  pointer-events: auto;
}