/* ── self-hosted JetBrains Mono (OFL) — no external font request ── */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/JetBrainsMono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/JetBrainsMono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/JetBrainsMono-700.woff2') format('woff2');
}

:root {
  --bg: #0d0d0d;
  --panel: #0a0a0a;
  --raise: #121212;
  --border: #1f1f1f;
  --border-hi: #2a2a2a;
  --accent: #9e1d1d;
  --accent-hi: #c62828;
  --text: #e8e8e8;
  --dim: #6a6a6a;
  --faint: #3f3f3f;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #fff; }

.terminal {
  width: 100%;
  max-width: 640px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

/* title bar */
.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--raise);
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.dot.red { background: var(--accent); }
.bar .path { margin-left: 6px; color: var(--dim); font-size: 12px; }
.bar .path b { color: var(--text); font-weight: 500; }

.body { padding: 22px; }

/* header / prompt */
.prompt { color: var(--dim); font-size: 13px; margin-bottom: 2px; }
.prompt .u { color: var(--accent-hi); }
.prompt .c { color: var(--text); }
.caret { display: inline-block; width: 8px; height: 15px; background: var(--accent);
         vertical-align: -2px; margin-left: 3px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tag { color: var(--faint); font-size: 12px; margin-top: 4px; letter-spacing: .3px; }

/* visualizer — the prabhamandala */
.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 22px 0 18px;
}
canvas { display: block; width: 240px; height: 240px; }
.stage .glyph {
  position: absolute;
  font-size: 30px;
  color: var(--accent);
  pointer-events: none;
  user-select: none;
  opacity: .9;
}

/* now playing */
.now { text-align: center; min-height: 42px; margin-bottom: 4px; }
.now .title { font-size: 15px; font-weight: 500; color: var(--text);
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now .artist { font-size: 13px; color: var(--dim); margin-top: 2px; }
.now .idle { color: var(--faint); font-size: 13px; }

/* seek */
.seek { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.seek .t { color: var(--faint); font-size: 11px; min-width: 36px; }
.seek .t.r { text-align: right; }
.track {
  flex: 1; height: 4px; background: #1a1a1a; border-radius: 2px;
  position: relative; cursor: pointer;
}
.fill { position: absolute; inset: 0 auto 0 0; width: 0%; background: var(--accent);
        border-radius: 2px; }
.knob { position: absolute; top: 50%; left: 0%; width: 9px; height: 9px;
        background: var(--accent-hi); border-radius: 50%; transform: translate(-50%, -50%);
        opacity: 0; transition: opacity .12s; }
.track:hover .knob { opacity: 1; }

/* controls */
.controls { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 6px; }
button.ctl {
  background: transparent; border: 1px solid var(--border-hi); color: var(--text);
  font-family: var(--mono); width: 40px; height: 40px; border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .12s, color .12s, background .12s;
}
button.ctl:hover { border-color: var(--accent); color: var(--accent-hi); }
button.ctl:active { background: #151515; }
button.ctl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.play { width: 48px; height: 48px; border-color: var(--accent); color: var(--accent-hi); }
button.play:hover { background: rgba(158,29,29,.10); }
.ctl svg { width: 16px; height: 16px; fill: currentColor; }
.play svg { width: 18px; height: 18px; }

.vol { display: flex; align-items: center; gap: 8px; justify-content: center;
       margin-top: 6px; color: var(--faint); }
.vol input[type=range] { -webkit-appearance: none; appearance: none; width: 90px; height: 3px;
  background: #1a1a1a; border-radius: 2px; cursor: pointer; }
.vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px;
  border-radius: 50%; background: var(--accent); }
.vol input[type=range]::-moz-range-thumb { width: 11px; height: 11px; border: none;
  border-radius: 50%; background: var(--accent); }
.vol svg { width: 14px; height: 14px; fill: var(--faint); }

/* tracklist */
.list { margin-top: 20px; border-top: 1px solid var(--border); }
.list .head { display: flex; justify-content: space-between; color: var(--faint);
  font-size: 11px; padding: 12px 4px 8px; letter-spacing: .5px; text-transform: uppercase; }
.row {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 6px; border-radius: 4px; cursor: pointer; border: 1px solid transparent;
  transition: background .1s, border-color .1s;
}
.row:hover { background: #101010; border-color: var(--border); }
.row.active { background: rgba(158,29,29,.08); border-color: rgba(158,29,29,.35); }
.row .n { color: var(--faint); font-size: 12px; text-align: right; }
.row.active .n { color: var(--accent-hi); }
.row .meta { min-width: 0; }
.row .tt { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.active .tt { color: var(--accent-hi); }
.row .aa { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .bpm { color: var(--faint); font-size: 11px; white-space: nowrap; }

/* attribution — CC-BY-NC requires credit */
.credit { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border);
  color: var(--faint); font-size: 11px; line-height: 1.7; }
.credit a { color: var(--dim); text-decoration: none; border-bottom: 1px dotted var(--faint); }
.credit a:hover { color: var(--accent-hi); border-color: var(--accent); }
.credit .lic { color: var(--dim); }

@media (max-width: 480px) {
  .body { padding: 18px; }
  canvas { width: 200px; height: 200px; }
  .row .bpm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
}
