:root {
  --bg: #15100d;
  --bg-elevated: #1e1712;
  --bg-elevated-hover: #261d16;
  --text: #efe7dd;
  --text-muted: #9c8d7e;
  --text-faint: #6b5f54;
  --accent: #a3424e;
  --accent-bright: #c25a67;
  --accent-soft: rgba(163, 66, 78, 0.16);
  --gold: #c9a227;
  --border: rgba(239, 231, 221, 0.08);
  --border-strong: rgba(239, 231, 221, 0.16);

  --serif: "Fraunces", Georgia, serif;
  --sans: "Work Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

/* subtle film-grain texture so the flat dark background doesn't feel like a template default */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

header.site-header,
main,
footer.site-footer {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  padding-top: 64px;
  padding-bottom: 8px;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.1rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.tagline {
  color: var(--text-muted);
  margin: 6px 0 0;
  font-size: 0.95rem;
}

main {
  padding-top: 40px;
  padding-bottom: 40px;
}

/* ---------- Now playing ---------- */

.now-playing {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px 28px 24px;
  margin-bottom: 8px;
}

.np-eyebrow {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.np-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.np-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 8px 0 0;
  max-width: 52ch;
}

.transport {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.tbtn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s ease;
}

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

.tbtn:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.tbtn-play {
  background: var(--accent);
  color: var(--text);
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.tbtn-play:hover {
  background: var(--accent-bright);
  color: var(--text);
}

.time {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  min-width: 34px;
}

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

.scrubber {
  position: relative;
  flex: 1;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.scrubber-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-strong);
  border-radius: 1px;
}

.scrubber-fill {
  position: absolute;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--gold);
  border-radius: 1px;
}

.scrubber-handle {
  position: absolute;
  left: 0%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateX(-50%);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.15);
}

.scrubber:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---------- Tracklist ---------- */

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

.track {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.12s ease;
}

.track:hover {
  background: var(--bg-elevated);
}

.track:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: -2px;
}

.track-index {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  width: 20px;
  flex-shrink: 0;
  text-align: right;
}

.track.is-active .track-index {
  color: var(--gold);
}

.track-body {
  flex: 1;
  min-width: 0;
}

.track-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0;
}

.track.is-active .track-title {
  color: var(--accent-bright);
}

.track-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-duration {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  flex-shrink: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-bottom: 64px;
  padding-top: 24px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--text);
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .site-header {
    padding-top: 40px;
  }

  .now-playing {
    padding: 20px 18px;
  }

  .transport {
    flex-wrap: wrap;
  }

  .scrubber {
    order: 5;
    flex-basis: 100%;
  }

  .track-note {
    display: none;
  }
}

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