@import url('fonts.css');

/* ═══════════════════════════════════════════════════════════════
   YT STREAMER — DESIGN SYSTEM
   Karakter: TEKNIKAL-PRESISI
   Keyword: instrument · presisi · malam
   Signature element: "TICK RAIL" — skala pengukuran 像 rack audio,
     dipakai berulang (header, search, seekbar, section divider)
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. TOKENS ────────────────────────────────────────────── */
:root {
  /* Palette: near-black base, acid-lime accent (bukan ungu-biru) */
  --bg:          #08090A;
  --bg-raise:    #0D0F11;
  --surface:     #131619;
  --surface-2:   #1A1E22;
  --surface-3:   #23282D;

  --line:        #2A3036;
  --line-soft:   #1C2126;
  --line-strong: #3A424A;

  --text:        #E9ECEF;
  --text-dim:    #A3ACB5;
  --text-mute:   #868F99;   /* 4.83:1 on --surface → WCAG AA safe */

  --accent:      #C6F24E;
  --accent-dim:  #9DBE3C;
  --accent-ink:  #0A0C05;
  --accent-wash: rgba(198, 242, 78, 0.10);

  --signal:      #FF7A45;   /* download / aksi */
  --live:        #FF4D4D;   /* status aktif */
  --error:       #FF5C5C;

  /* Status LED */
  --led-idle:    #4E7C3C;   /* siap — hijau redup */
  --led-on:      #C6F24E;   /* playing — hijau terang */

  /* Type */
  --font-ui: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  --fs-display: clamp(2.75rem, 8vw, 5rem);
  --fs-h1:      clamp(1.75rem, 4.2vw, 2.625rem);
  --fs-h2:      1.375rem;
  --fs-h3:      1.0625rem;
  --fs-body:    1.0625rem;
  --fs-sm:      0.875rem;
  --fs-xs:      0.75rem;
  --fs-label:   0.6875rem;

  /* Spacing — base 4px */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.5rem;   --s-6: 2rem;     --s-7: 3rem;     --s-8: 4rem;
  --s-9: 6rem;

  /* Shape: mostly sharp. One circle — because it IS a circle. */
  --r-sharp: 2px;
  --r-circle: 999px;

  /* Motion */
  --dur-fast: 130ms;
  --dur: 200ms;
  --dur-slow: 320ms;
  --ease: cubic-bezier(0.22, 0.68, 0.24, 1);

  /* Layout */
  --shell: 1320px;
  --rail-h: 3px;
}

/* ── 2. RESET & BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  min-height: 100dvh;
  padding-bottom: 5.5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, canvas, video { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Selection stays ENABLED (users copy titles) — only the harsh system blue
   is replaced. Android ignores ::selection on tap, so also kill the native
   tap-highlight flash that shows up as a blue rectangle. */
::selection {
  background: rgba(198, 242, 78, 0.30);
  color: #FFFFFF;
}
::selection ::selection { background: rgba(198, 242, 78, 0.42); }
/* keep text readable when selected inside the two solid-accent surfaces */
.console__go::selection,
.act--primary::selection { background: rgba(10, 12, 5, 0.80); color: #FFFFFF; }

a, button, input, summary, label, [role="button"] {
  -webkit-tap-highlight-color: rgba(198, 242, 78, 0.14);
}
/* Touch devices: rely on :active + :focus-visible, not the native flash */
@media (hover: none) {
  a, button, input, [role="button"] { -webkit-tap-highlight-color: transparent; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sharp);
}

/* Scrollbar — technical, thin */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }

/* ── 3. TYPOGRAPHY SCALE ──────────────────────────────────── */
.t-display {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.t-h1 { font-size: var(--fs-h1); font-weight: 700; line-height: 1.06; letter-spacing: -0.025em; text-wrap: balance; }
.t-h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.18; letter-spacing: -0.018em; }
.t-h3 { font-size: var(--fs-h3); font-weight: 500; line-height: 1.34; letter-spacing: -0.008em; }
.t-body { font-size: var(--fs-body); font-weight: 400; line-height: 1.6; max-width: 68ch; }
.t-sm { font-size: var(--fs-sm); line-height: 1.5; }

/* Label — the workhorse of the technical voice */
.t-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.t-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.t-accent { color: var(--accent); }
.t-dim { color: var(--text-dim); }

/* ── 4. SIGNATURE ELEMENT — TICK RAIL ───────────────────────
   Motif berulang: skala pengukuran ala rack audio. Inilah yang
   membuat web ini dikenali tanpa perlu logo.                    */
.rail {
  height: var(--rail-h);
  background-image: repeating-linear-gradient(
    90deg,
    var(--line-strong) 0 1px,
    transparent 1px 8px
  );
  opacity: 0.55;
}
.rail--accent {
  background-image: repeating-linear-gradient(
    90deg,
    var(--accent) 0 1px,
    transparent 1px 8px
  );
  opacity: 0.9;
}
/* Varian: tick panjang tiap 5 tick pendek — seperti dial meter */
.rail--major {
  background-image:
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px 8px);
}

/* ── 5. LAYOUT SHELL ──────────────────────────────────────── */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--s-4);
}
@media (min-width: 768px) { .shell { padding-inline: var(--s-5); } }

.hr { height: 1px; background: var(--line-soft); border: 0; }

/* ── 6. HEADER ────────────────────────────────────────────── */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.masthead__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: var(--s-3);
}

/* Wordmark — dipisah dari logo YT, ini identitas sendiri */
.wordmark {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
}
.wordmark__name {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.wordmark__name em {
  font-style: normal;
  color: var(--accent);
}
/* Slash sebagai pemisah, bukan ikon stok */
.wordmark__tag {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* Status LED — metafora lampu indikator panel rack.
   ready = redup tenang, playing = hijau terang + napas tipis */
.readout {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  color: var(--text-mute);
  transition: color var(--dur) var(--ease);
}
.readout__dot {
  width: 7px; height: 7px;
  flex-shrink: 0;
  border-radius: var(--r-circle);
  background: var(--led-idle);
  transition: background var(--dur) var(--ease);
}

/* ready — hijau redup, diam */
.readout[data-state="ready"] .readout__dot {
  background: var(--led-idle);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

/* playing — hijau terang, napas tipis */
.readout[data-state="playing"] {
  color: var(--text-dim);
}
.readout[data-state="playing"] .readout__dot {
  background: var(--led-on);
  animation: led-breathe 1700ms var(--ease) infinite;
}

/* busy — amber, berkedip cepat */
.readout[data-state="busy"] .readout__dot {
  background: var(--signal);
  animation: led-blink 900ms steps(2, end) infinite;
}

/* error */
.readout[data-state="error"] .readout__dot {
  background: var(--error);
  animation: led-blink 700ms steps(2, end) infinite;
}

@keyframes led-breathe {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(198, 242, 78, 0.42); }
  50%      { transform: scale(1.22); box-shadow: 0 0 0 5px rgba(198, 242, 78, 0); }
}
@keyframes led-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.28; }
}

/* ── 7. SEARCH CONSOLE ────────────────────────────────────── */
.console {
  padding-block: var(--s-2) var(--s-4);
}

.console__field {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--bg-raise);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.console__field:hover { border-color: var(--line-strong); }
.console__field:focus-within {
  border-color: var(--accent);
  background: var(--surface);
}

.console__input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: var(--s-4) var(--s-4) var(--s-4) var(--s-5);
  font-size: var(--fs-h3);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.console__input::placeholder { color: var(--text-mute); font-weight: 400; }
.console__input:focus { outline: none; }

/* Tombol submit: Perspex sedikit, ada alasan (aksen = aksi utama) */
.console__go {
  display: grid;
  place-items: center;
  gap: var(--s-1);
  align-self: stretch;
  padding-inline: var(--s-5);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.console__go:hover { background: #D4FF63; }
.console__go:active { transform: translateY(1px); }
.console__go:disabled { background: var(--surface-3); color: var(--text-mute); cursor: not-allowed; }
.console__go span { display: none; }
@media (min-width: 640px) { .console__go span { display: block; } }

/* Tick rail tepat di bawah field —_GRAND signature_ */
.console__rail { margin-top: -1px; }

/* ── 8. PLAYER — full-bleed, editorial ───────────────────── */
.deck { display: none; }
.deck[data-open="true"] { display: block; }

.deck__stage {
  position: relative;
  background: #000;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.deck__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 62dvh;
  object-fit: contain;
  background: #000;
}

.deck__art {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 340px;
  margin-inline: auto;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.04);
}

/* Waveform canvas — output nyata dari Web Audio API */
.deck__scope {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 64px;
  width: 100%;
  pointer-events: none;
  opacity: 0.9;
}

/* Overlay loading */
.deck__veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--s-3);
  background: rgba(8, 9, 10, 0.78);
  color: var(--text-dim);
}
.deck__veil[hidden] { display: none; }

.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: var(--r-circle);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 9. PLAYER INFO — grid asimetris 7/5, bukan kartu simetris ── */
.console-panel {
  display: grid;
  gap: var(--s-5);
  padding-block: var(--s-5);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .console-panel {
    grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
    gap: var(--s-7);
    align-items: start;
  }
}

.deck__title {
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.028em;
  margin-bottom: var(--s-2);
  text-wrap: balance;
}
.deck__byline {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--text-dim);
}

/* Mode switch — segmented, tajam, bukan pill bulat */
.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--bg-raise);
}
.segmented__opt {
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.segmented__opt + .segmented__opt { border-left: 1px solid var(--line); }
.segmented__opt:hover { color: var(--text); background: var(--surface); }
.segmented__opt[aria-selected="true"] {
  background: var(--surface-2);
  color: var(--accent);
}

/* Readout panel — blok detail teknis */
.spec {
  border: 1px solid var(--line-soft);
  background: var(--bg-raise);
}
.spec__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-2) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
}
.spec__rows { padding: var(--s-2) var(--s-4) var(--s-3); }
.spec__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding-block: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
}
.spec__row + .spec__row { border-top: 1px dashed var(--line-soft); }
.spec__row dt { color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.12em; }
.spec__row dd { color: var(--text-dim); font-variant-numeric: tabular-nums; text-align: right; }

/* ── 10. TRANSPORT (seekbar + kontrol) ────────────────────── */
.transport { padding-block: var(--s-4) var(--s-6); }

/* Seekbar — tick rail + progress. Konsisten dengan signature. */
.seek {
  --progress: 0%;
  position: relative;
  width: 100%;
  height: 26px;
  background: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: block;
}
.seek::-webkit-slider-runnable-track {
  height: 26px;
  background:
    /* progress fill */
    linear-gradient(90deg,
      var(--accent) 0 var(--progress),
      transparent var(--progress) 100%) no-repeat center / 100% 2px,
    /* ticks */
    repeating-linear-gradient(90deg,
      var(--line-strong) 0 1px, transparent 1px 12px) no-repeat center / 100% 9px;
}
.seek::-moz-range-track {
  height: 26px;
  background:
    linear-gradient(90deg, var(--accent) 0 var(--progress), transparent var(--progress) 100%) no-repeat center / 100% 2px,
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 12px) no-repeat center / 100% 9px;
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 3px;
  height: 26px;
  background: var(--text);
  border: none;
  border-radius: 0;
  cursor: grab;
  transition: background var(--dur-fast) var(--ease);
}
.seek::-webkit-slider-thumb:hover { background: var(--accent); }
.seek:active::-webkit-slider-thumb { cursor: grabbing; background: var(--accent); }
.seek::-moz-range-thumb {
  width: 3px; height: 26px;
  background: var(--text);
  border: none; border-radius: 0;
  cursor: grab;
}
.seek:disabled { opacity: 0.4; cursor: not-allowed; }

.timecodes {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-1);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  color: var(--text-mute);
  letter-spacing: 0.06em;
}

/* Kontrol utama: satu lingkaran (satu-satunya bentuk bundar di UI) */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-6);
  margin-top: var(--s-5);
}
.jump {
  display: grid;
  place-items: center;
  gap: 2px;
  padding: var(--s-2);
  color: var(--text-dim);
  transition: color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.jump:hover { color: var(--accent); }
.jump:active { transform: scale(0.94); }
.jump small {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
}

.play {
  display: grid;
  place-items: center;
  width: 68px; height: 68px;
  border-radius: var(--r-circle);
  background: var(--text);
  color: var(--bg);
  transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.play:hover { background: var(--accent); transform: scale(1.04); }
.play:active { transform: scale(0.97); }
.play svg { width: 24px; height: 24px; }

/* ── 11. ACTIONS (download) ──────────────────────────────── */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-5);
}

.act {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  background: var(--bg-raise);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.act:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface); }
.act:active { transform: translateY(1px); }
.act:disabled { opacity: 0.45; cursor: not-allowed; }
.act svg { width: 15px; height: 15px; }

/* Varian: aksi utama = satu-satunya yang pakai aksen penuh */
.act--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.act--primary:hover { background: #D4FF63; border-color: #D4FF63; color: var(--accent-ink); }

/* Toast status unduhan */
.toast {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-left: 2px solid var(--signal);
  background: var(--bg-raise);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  animation: toast-in var(--dur-slow) var(--ease);
}
.toast[hidden] { display: none; }
.toast__x { margin-left: auto; color: var(--text-mute); padding: var(--s-1); }
.toast__x:hover { color: var(--text); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 12. SECTION HEADER dengan nomor ──────────────────────── */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  padding-bottom: var(--s-3);
}
.section-head__num {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  color: var(--accent);
}

/* ── 13. RESULTS — daftar editorial, BUKAN grid kartu ────── */
.results { padding-block: var(--s-5) var(--s-8); }

.result {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.result:hover, .result:focus-visible { background: var(--surface); }

/* Aksen kiri muncul saat hover —sr-only rhythm */
.result::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform var(--dur) var(--ease);
}
.result:hover::before, .result:focus-visible::before { transform: scaleY(1); }

.result__idx {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
}

.result__thumb {
  position: relative;
  width: 116px;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
  flex-shrink: 0;
}
@media (max-width: 520px) { .result__thumb { width: 88px; } }
.result__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.85);
  transition: filter var(--dur) var(--ease), transform var(--dur-slow) var(--ease);
}
.result:hover .result__thumb img { filter: saturate(1.05); transform: scale(1.03); }

/* Durasi sebagai overlay technical */
.result__dur {
  position: absolute;
  right: 4px; bottom: 4px;
  padding: 1px 4px;
  background: rgba(8, 9, 10, 0.88);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.result__body { min-width: 0; }
.result__name {
  font-size: var(--fs-h3);
  font-weight: 500;
  letter-spacing: -0.008em;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result__meta {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-mute);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result__go {
  color: var(--text-mute);
  padding: var(--s-2);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.result:hover .result__go { color: var(--accent); transform: translateX(3px); }

/* ── 14. STATES: loading / empty / error ──────────────────── */
.state {
  display: grid;
  justify-items: center;
  gap: var(--s-4);
  padding: var(--s-8) var(--s-4);
  text-align: center;
}

/* Empty state: ilustrasi CSS, bukan emoji */
.idle-mark {
  width: 76px; height: 76px;
  border: 1px solid var(--line);
  position: relative;
}
.idle-mark::before,
.idle-mark::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: var(--line-strong);
}
/* Batang equalizer statis */
.idle-mark::before {
  width: 40px; height: 26px;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) 0 100% / 2px 8px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 8px 100% / 2px 18px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 16px 100% / 2px 26px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 24px 100% / 2px 14px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 32px 100% / 2px 22px no-repeat;
}
.idle-mark::after { display: none; }

/* Skeleton list */
.skel { display: grid; gap: var(--s-4); padding-block: var(--s-4); }
.skel__row { display: grid; grid-template-columns: 116px 1fr; gap: var(--s-4); align-items: center; }
.skel__box {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.skel__thumb { aspect-ratio: 16/9; }
.skel__lines { display: grid; gap: var(--s-2); }
.skel__line { height: 10px; }
.skel__line--short { width: 40%; }

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.notice {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-7) var(--s-4);
  text-align: center;
  border: 1px dashed var(--line);
  max-width: 460px;
  margin-inline: auto;
}
.notice__code {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  color: var(--error);
}

/* ── 15. FOOTER ───────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--line-soft);
  padding-block: var(--s-5) var(--s-7);
  margin-top: var(--s-6);
}
.foot__grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .foot__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.foot__col h3 { margin-bottom: var(--s-3); }
.foot__list { display: grid; gap: var(--s-2); }
.foot__list a, .foot__list span {
  font-size: var(--fs-sm);
  color: var(--text-mute);
  transition: color var(--dur) var(--ease);
}
.foot__list a:hover { color: var(--accent); }
.foot__note {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-mute);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  justify-content: space-between;
}

/* ── 16. UTILITIES ────────────────────────────────────────── */
[hidden] { display: none !important; }
/* SVG elements have no HTMLElement.hidden IDL property — hide via class instead */
.is-off { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.stack-4 { display: grid; gap: var(--s-4); }
.stack-6 { display: grid; gap: var(--s-6); }

/* ── 17. MOTION PREFERENCE ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .readout__dot { animation: none !important; }
}
/* ═══════════════════════════════════════════════════════════════
   18. TABS · BERANDA · RIWAYAT  (PRD §8)
   Aturan anti-semrawut yang dipatuhi di sini:
   - maksimal 4 section di Beranda
   - tiap section memakai SATU pola (hero / daftar / rak), tidak dicampur
   - ritme kepadatan bergantian: hero → daftar padat → rak visual
   - --accent hanya untuk: lagu yang diputar, tab aktif, tombol play utama
   - tidak ada pill / glass / shadow; sudut tetap --r-sharp
   ═══════════════════════════════════════════════════════════════ */

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
}
.tabs__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 44px;                 /* target sentuh ≥ 44px */
}
.tabs__list { display: flex; gap: var(--s-5); }
.tabs__tab {
  position: relative;
  min-height: 44px;
  padding: var(--s-3) 0;
  font-family: var(--font-ui);
  font-size: var(--fs-h3);
  font-weight: 500;
  letter-spacing: -0.008em;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease);
}
.tabs__tab:hover { color: var(--text); }
.tabs__tab::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);         /* satu-satunya aksen di navigasi */
  transform: scaleX(0);
  transition: transform var(--dur) var(--ease);
}
.tabs__tab[aria-selected="true"] { color: var(--text); }
.tabs__tab[aria-selected="true"]::after { transform: scaleX(1); }

.tabs__reset {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  color: var(--text-mute);
  transition: color var(--dur) var(--ease);
}
.tabs__reset:hover { color: var(--accent); }

/* ── Beranda: kerangka section ────────────────────────────── */
#viewBeranda, #viewRiwayat { padding-bottom: var(--s-8); }

.shelf { margin-bottom: var(--s-7); }        /* ≥ 40px antar section */
.shelf[hidden] { display: none; }

.shelf__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-4);              /* 16px di dalam section */
}
.shelf__title { display: flex; align-items: center; gap: var(--s-2); }

/* tick kecil di kiri = penanda section, lanjutan signature rail */
.shelf__tick {
  width: 10px;
  height: var(--rail-h);
  background: var(--accent);
  flex-shrink: 0;
}
.shelf__stamp {
  font-size: var(--fs-xs);
  color: var(--text-mute);
  letter-spacing: 0.08em;
  margin-top: var(--s-2);
}

/* ── 1. LANJUTKAN — satu-satunya elemen besar di Beranda ────── */
.hero {
  position: relative;
  display: block;
  width: 100%;
  cursor: pointer;
}
.hero__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  overflow: hidden;
}
.hero__thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero__play {
  position: absolute;
  right: var(--s-3);
  bottom: var(--s-3);
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--r-circle);
  background: var(--accent);
  color: var(--accent-ink);
}
.hero__progress {
  height: var(--rail-h);
  background: var(--line-soft);
  margin-top: -1px;
}
.hero__progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.hero__title {
  margin-top: var(--s-3);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.34;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero__sub {
  margin-top: var(--s-1);
  font-size: var(--fs-xs);
  color: var(--text-mute);
  letter-spacing: 0.08em;
}

/* ── 2. PALING SERING — daftar bernomor, padat, satu kolom ─── */
.nrow {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: var(--s-3);
  min-height: 56px;                      /* target sentuh */
  padding: var(--s-2) var(--s-3) var(--s-2) 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.nrow:hover, .nrow:focus-visible { background: var(--surface); }
.nrow__idx { color: var(--text-mute); font-size: var(--fs-xs); }
.nrow__thumb {
  width: 48px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
}
.nrow__title {
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.nrow__count { color: var(--text-mute); font-size: var(--fs-xs); }

/* ── 3 & 4. RAK KARTU — satu pola, tanpa tombol tambahan ──── */
.rail-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 240px;
  gap: var(--s-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* peek kartu berikutnya sebagai petunjuk scroll */
  padding-bottom: var(--s-1);
}
.rail-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) {
  .rail-scroll {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-columns: auto;
    overflow: visible;
  }
}

.card {
  scroll-snap-align: start;
  cursor: pointer;
  min-width: 0;
}
.card__thumb {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}
.card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
  transition: filter var(--dur) var(--ease);
}
.card:hover .card__thumb img, .card:focus-visible .card__thumb img { filter: saturate(1.05); }
.card__title {
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--text-mute);
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* penanda lagu yang sedang diputar — satu dari 3 kegunaan aksen */
.card[aria-current="true"] .card__thumb::after,
.nrow[aria-current="true"],
.hist-row[aria-current="true"] {
  box-shadow: inset 2px 0 0 var(--accent);
}

.card--skel .card__thumb,
.hero-skel {
  background: var(--surface-2);
}
.card--skel .skel__line {
  height: 10px;
  margin-top: var(--s-2);
  background: var(--surface-2);
}
.card--skel .skel__line--short { width: 40%; }
.hero-skel { aspect-ratio: 16 / 9; }

/* ── Cold start: indikator 5 tick ────────────────────────── */
.onboard {
  border: 1px solid var(--line-soft);
  background: var(--bg-raise);
  padding: var(--s-4);
  margin-bottom: var(--s-7);
}
.onboard .t-body { color: var(--text-dim); margin-top: var(--s-2); }
.prog-ticks { display: flex; gap: 4px; margin-top: var(--s-4); }
.prog-tick {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  transition: background var(--dur) var(--ease);
}
.prog-tick.is-on { background: var(--accent); }

/* ── Riwayat: toolbar, konfirmasi, baris ─────────────────── */
.hist-toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-block: var(--s-4) var(--s-3);
  flex-wrap: wrap;
}
.hist-filter {
  flex: 1;
  min-width: 160px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line);
  background: var(--bg-raise);
  font-size: var(--fs-sm);
}
.hist-filter:focus { outline: none; border-color: var(--accent); }
.hist-btn {
  min-height: 44px;
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--line);
  background: var(--bg-raise);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.hist-btn:hover { color: var(--text); border-color: var(--line-strong); }
.hist-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.hist-btn--danger { color: var(--error); border-color: var(--error); }

/* konfirmasi inline, bukan window.confirm (H4) */
.hist-confirm {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--error);
  border-left-width: 2px;
  margin-bottom: var(--s-4);
}
.hist-confirm[hidden] { display: none; }
.hist-confirm .t-body { flex: 1; margin: 0; }

.hist-privacy {
  font-size: var(--fs-xs);
  color: var(--text-mute);
  letter-spacing: 0.04em;
  padding-bottom: var(--s-3);
}
.hist-privacy[hidden] { display: none; }

.hist-group { margin-bottom: var(--s-5); }
/* penanda tanggal sticky di bawah tab */
.hist-group__label {
  position: sticky;
  top: 44px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  padding-block: var(--s-2);
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}
.hist-group__n { color: var(--text-mute); }

.hist-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: var(--s-3);
  min-height: 56px;
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.hist-row:hover, .hist-row:focus-visible { background: var(--surface); }
.hist-row__thumb {
  width: 56px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
}
.hist-row__body { min-width: 0; }
.hist-row__title {
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-row__meta {
  font-size: var(--fs-xs);
  color: var(--text-mute);
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-row__mode { color: var(--text-mute); display: grid; place-items: center; }
.hist-row__when { color: var(--text-mute); font-size: var(--fs-xs); white-space: nowrap; }
.hist-row__del {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;          /* target sentuh */
  color: var(--text-mute);
  transition: color var(--dur) var(--ease);
}
.hist-row__del:hover { color: var(--error); }

/* skeleton tanpa shimmer (hormati reduced-motion, §8.4) */
.card--skel .card__thumb, .hero-skel { animation: none; }
