/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design tokens: dark mode (default) ─────────────────────── */
:root {
  --bg:         #161210;
  --bg-raised:  #1e1814;
  --bg-player:  #131008;
  --rule:       #352820;
  --rule-dash:  #453830;
  --label:      #9a8878;
  --muted:      #b09880;
  --body:       #d8cebb;
  --heading:    #f4ece0;
  --accent:     #d4884a;
  --accent-lo:  #a06030;
  --accent-hi:  #f0a868;
  --tag-color:  #b09070;
}

/* ── Light mode via OS preference (zero-JS fallback) ─────────── */
@media (prefers-color-scheme: light) {
  :root {
    --bg:         #f2ece0;
    --bg-raised:  #e8e0d0;
    --bg-player:  #dfd8c8;
    --rule:       #c0b4a0;
    --rule-dash:  #b0a490;
    --label:      #5a4a38;
    --muted:      #4a3828;
    --body:       #2a1e14;
    --heading:    #110a04;
    --accent:     #a05820;
    --accent-lo:  #c07838;
    --accent-hi:  #7a3e10;
    --tag-color:  #4a3828;
  }
}

/* ── Light / dark overrides applied by JS toggle ────────────── */
body.theme-light {
  --bg:         #f2ece0;
  --bg-raised:  #e8e0d0;
  --bg-player:  #dfd8c8;
  --rule:       #c0b4a0;
  --rule-dash:  #b0a490;
  --label:      #5a4a38;
  --muted:      #4a3828;
  --body:       #2a1e14;
  --heading:    #110a04;
  --accent:     #a05820;
  --accent-lo:  #c07838;
  --accent-hi:  #7a3e10;
  --tag-color:  #4a3828;
}

body.theme-dark {
  --bg:         #161210;
  --bg-raised:  #1e1814;
  --bg-player:  #131008;
  --rule:       #352820;
  --rule-dash:  #453830;
  --label:      #9a8878;
  --muted:      #b09880;
  --body:       #d8cebb;
  --heading:    #f4ece0;
  --accent:     #d4884a;
  --accent-lo:  #a06030;
  --accent-hi:  #f0a868;
  --tag-color:  #b09070;
}

/* ── Base ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--body);
  font-family: 'Courier Prime', 'Courier New', monospace;
  line-height: 1.5;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

.site {
  max-width: 900px;
  margin: 0 auto;
  padding: 50px 40px 80px;
}

/* ── Header ─────────────────────────────────────────────────── */
.hd {
  border-bottom: 1px solid var(--rule-dash);
  padding-bottom: 28px;
  margin-bottom: 35px;
}

.hd-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.hd-eyebrow {
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--label);
  text-transform: uppercase;
  margin-bottom: 9px;
}

.hd-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(52px, 11vw, 84px);
  color: var(--heading);
  line-height: 1;
  letter-spacing: 2px;
  font-weight: 400;
}

.hd-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  margin-top: 13px;
}

.badge {
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 1px;
}

.hd-desc {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
}

.hd-progress-wrap { margin-top: 18px; }

.hd-progress-label {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--label);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.hd-progress-track {
  height: 4px;
  background: var(--rule);
  width: 100%;
}

.hd-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.6s ease;
  min-width: 2px;
}

/* ── Theme toggle ────────────────────────────────────────────── */
.theme-btn {
  display: none;
  background: none;
  border: 1px solid var(--rule-dash);
  color: var(--label);
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 2px;
  padding: 5px 13px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 5px;
  text-transform: uppercase;
  transition: border-color 0.15s, color 0.15s;
}

.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── js-only elements ────────────────────────────────────────── */
.js-only { display: none; }

/* ── About (collapsible) ─────────────────────────────────────── */
.about {
  border: 1px solid var(--rule-dash);
  margin-bottom: 35px;
}

.about-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 18px;
  cursor: pointer;
  list-style: none; /* remove default triangle in Firefox */
  user-select: none;
  transition: background 0.1s;
}

/* Remove default marker in WebKit */
.about-toggle::-webkit-details-marker { display: none; }

.about-toggle:hover { background: var(--bg-raised); }

.about-toggle-label {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--label);
  text-transform: uppercase;
}

/* Custom +/− indicator */
.about-toggle-icon {
  width: 18px;
  height: 18px;
  position: relative;
  flex-shrink: 0;
}

.about-toggle-icon::before,
.about-toggle-icon::after {
  content: '';
  position: absolute;
  background: var(--label);
  transition: opacity 0.15s, transform 0.15s;
}

/* Horizontal bar (always visible) */
.about-toggle-icon::before {
  width: 13px;
  height: 1px;
  top: 8px;
  left: 2px;
}

/* Vertical bar (visible when closed, hidden when open) */
.about-toggle-icon::after {
  width: 1px;
  height: 13px;
  top: 3px;
  left: 8px;
}

.about[open] .about-toggle-icon::after {
  transform: scaleY(0);
  opacity: 0;
}

.about[open] .about-toggle { background: var(--bg-raised); }

.about-body {
  padding: 20px 22px 25px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.about-body p {
  font-size: 16px;
  color: var(--body);
  line-height: 1.75;
}

.about-body p.about-meta {
  font-size: 14px;
  color: var(--label);
  font-style: italic;
  padding-top: 5px;
  border-top: 1px dashed var(--rule);
  margin-top: 5px;
}

.about-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-lo);
  transition: border-color 0.1s, color 0.1s;
}

.about-body a:hover {
  color: var(--accent-hi);
  border-bottom-color: var(--accent-hi);
}

/* ── Tracklist column headers ────────────────────────────────── */
.tl-cols {
  display: grid;
  grid-template-columns: 65px 1fr 112px 60px;
  gap: 0 15px;
  padding: 0 13px 9px;
  border-bottom: 1px dashed var(--rule-dash);
  margin-bottom: 2px;
}

.tl-col {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--label);
  text-transform: uppercase;
}

.tl-col:nth-child(3) { text-align: right; }
.tl-col:last-child   { text-align: right; }

/* ── Track rows ──────────────────────────────────────────────── */
.track {
  display: grid;
  grid-template-columns: 65px 1fr 112px 60px;
  gap: 0 15px;
  align-items: center;
  padding: 14px 13px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 0.1s;
}

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

.track[aria-current="true"],
.track.is-active { background: var(--bg-raised); }

.t-num {
  font-size: 14px;
  color: var(--label);
  letter-spacing: 1px;
  font-style: italic;
}

.track[aria-current="true"] .t-num,
.track.is-active .t-num { color: var(--accent); }

.t-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.25;
}

.t-brief {
  font-size: 14px;
  color: var(--tag-color);
  font-style: italic;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t-genre {
  font-size: 13px;
  color: var(--label);
  letter-spacing: 1px;
  text-align: right;
  white-space: nowrap;
}

.t-dur {
  font-size: 15px;
  color: var(--label);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.track[aria-current="true"] .t-dur,
.track.is-active .t-dur { color: var(--muted); }

/* ── No-JS native audio fallback ─────────────────────────────── */
.native-audio {
  display: block;
  width: 100%;
  margin-top: 23px;
  accent-color: var(--accent);
}

/* ── Custom player ───────────────────────────────────────────── */
.player {
  display: none; /* shown by JS */
  margin-top: 30px;
  border: 1px solid var(--rule-dash);
  padding: 23px 25px 20px;
  background: var(--bg-player);
}

.np-label {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 13px;
}

.np-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.np-brief {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.np-btn {
  background: none;
  border: 1px solid var(--rule-dash);
  color: var(--muted);
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-size: 16px;
  width: 42px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.1s, color 0.1s;
  flex-shrink: 0;
}

.np-btn:hover { border-color: var(--accent); color: var(--heading); }
.np-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.np-btn.play {
  border-color: var(--accent-lo);
  color: var(--accent);
  width: 52px;
}

.np-btn.play:hover { border-color: var(--accent); color: var(--accent-hi); }

.np-time {
  font-size: 14px;
  color: var(--label);
  margin-left: auto;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.np-bar-wrap {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.np-bar {
  width: 100%;
  height: 3px;
  background: var(--rule);
}

.np-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  position: relative;
  transition: width 0.1s linear;
}

.np-bar-fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: -5px;
  width: 13px;
  height: 13px;
  background: var(--accent-hi);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s;
}

.np-bar-wrap:hover .np-bar-fill::after { opacity: 1; }

.np-hint {
  margin-top: 13px;
  font-size: 13px;
  color: var(--label);
  letter-spacing: 1px;
}

.np-hint kbd {
  border: 1px solid var(--rule-dash);
  padding: 2px 5px;
  font-family: inherit;
  font-size: 13px;
  color: var(--label);
  border-radius: 2px;
}

/* ── Footer ──────────────────────────────────────────────────── */
.ft {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px dashed var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.ft-note {
  font-size: 13px;
  color: var(--label);
  font-style: italic;
}

.ft-count {
  font-size: 13px;
  color: var(--label);
  letter-spacing: 1px;
}

.ft-count span { color: var(--accent); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 520px) {
  .site { padding: 30px 20px 60px; }

  .tl-cols,
  .track { grid-template-columns: 55px 1fr 70px 48px; gap: 0 10px; }

  /* Hide the brief tagline on very small screens to avoid overflow */
  .t-brief { display: none; }

  .hd-title { letter-spacing: 1px; }
}
