:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;
  --fg: #fafafa;
  --card: #09090b;
  --muted: #a1a1aa;
  --faint: #71717a;
  --line: #27272a;
  --muted-bg: #18181b;
  --primary: #fafafa;
  --primary-fg: #18181b;
  --primary-hover: #e4e4e7;
  --live: #4ade80;
  --live-soft: rgba(74, 222, 128, 0.16);
  --danger: #f87171;
  --ring: #d4d4d8;
  --art: #18181b;
  --art-mark: #a1a1aa;
  --art-fall: #18181b;
  --track: #3f3f46;
  --thumb: #fafafa;
  --panel: #141416;
  --header: rgba(9, 9, 11, 0.8);
  --display: "Syne", "Arial Black", sans-serif;
  --sans: "Inter", "Segoe UI", sans-serif;
  --radius: 12px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #09090b;
  --card: #ffffff;
  --muted: #71717a;
  --faint: #a1a1aa;
  --line: #e4e4e7;
  --muted-bg: #f4f4f5;
  --primary: #18181b;
  --primary-fg: #fafafa;
  --primary-hover: #27272a;
  --live: #16a34a;
  --live-soft: rgba(22, 163, 74, 0.12);
  --danger: #dc2626;
  --ring: #18181b;
  --art: #f4f4f5;
  --art-mark: #71717a;
  --art-fall: #f4f4f5;
  --track: #d4d4d8;
  --thumb: #18181b;
  --panel: #f4f4f5;
  --header: rgba(255, 255, 255, 0.86);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(12px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-size: 15px;
}

.brand span {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.nav a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.nav a:hover { background: var(--muted-bg); color: var(--fg); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.theme {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.theme button {
  width: 28px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.theme button:hover { color: var(--fg); }

.theme button.is-on {
  background: var(--muted-bg);
  color: var(--fg);
}

.theme svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme svg .fill { fill: currentColor; stroke: none; }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px var(--live-soft);
  animation: live 2.4s ease-in-out infinite;
}

@keyframes live {
  0%, 100% { box-shadow: 0 0 0 3px var(--live-soft); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.hero { padding: 48px 0 8px; }

#audio {
  position: absolute;
  width: 0;
  height: 0;
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.kicker,
.index {
  margin: 0 0 14px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.display {
  display: flex;
  align-items: flex-start;
  gap: 0.16em;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(4.6rem, 8vw, 7.4rem);
  line-height: 0.84;
  letter-spacing: -0.07em;
  color: var(--fg);
}

.display span {
  margin-top: 0.22em;
  color: var(--muted);
  font-size: 0.36em;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lede {
  max-width: 28rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.player {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  grid-template-areas:
    "art meta controls"
    "art timeline timeline";
  gap: 14px 20px;
  align-items: center;
  width: 100%;
  padding: 16px 16px 14px;
  background: var(--panel);
  border: 0;
  border-radius: 18px;
}

.art {
  grid-area: art;
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--art);
}

.art img,
.art-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.art img { object-fit: cover; }

.art-fallback {
  display: none;
  place-items: center;
  font-family: var(--display);
  font-size: 2.4rem;
  color: var(--art-mark);
  background: var(--art-fall);
}

.art.is-empty img { display: none; }
.art.is-empty .art-fallback { display: grid; }

.meta { grid-area: meta; min-width: 0; }

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.rate {
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rate:not(:empty)::before {
  content: "·";
  margin-right: 6px;
}

.rate:empty { display: none; }

.artist {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.album,
.next {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.album:empty,
.next:empty { display: none; }

.timeline {
  grid-area: timeline;
  min-width: 0;
}

.progress {
  position: relative;
  height: 6px;
  background: var(--track);
  border-radius: 999px;
}

.progress[hidden],
.times[hidden] { display: none; }

.progress span {
  position: relative;
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--fg);
}

.progress span::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--thumb);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transform: translate(50%, -50%);
}

.times {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.controls {
  grid-area: controls;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-right: 4px;
}

.play {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-fg);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.play:hover { background: var(--primary-hover); }
.play:active { transform: scale(0.96); }

.play svg { width: 18px; height: 18px; fill: currentColor; }
.play .icon-play { transform: translateX(1px); }
.play .icon-pause { display: none; }
.play.is-on .icon-play { display: none; }
.play.is-on .icon-pause { display: block; }
.play.is-on { box-shadow: 0 0 0 4px var(--live-soft); }

.volume {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

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

.volume input {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--fg) var(--p, 85%), var(--track) var(--p, 85%));
  cursor: pointer;
}

.volume input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--thumb);
}

.volume input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--thumb);
}

.section { padding: 28px 0; }

.section-head { margin-bottom: 14px; }

.section h2,
.prose h2,
.widget h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.widgets {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 16px;
  align-items: start;
}

.widgets.is-single { grid-template-columns: 1fr; }

.widget,
.history,
.facts {
  background: var(--panel);
  border: 0;
  border-radius: 16px;
}

.widget { padding: 16px 16px 6px; }

.slots { margin-top: 8px; }

.slot,
.request-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.slot { grid-template-columns: 118px minmax(0, 1fr); }
.request-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
.request-row[hidden] { display: none !important; }

.when {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.slot.is-now .when { color: var(--live); }

.slot strong,
.request-row strong,
.history strong {
  font-weight: 500;
  letter-spacing: -0.02em;
}

.slot em,
.request-row em,
.history em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--live);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--art);
  border: 1px solid var(--line);
}

.thumb-empty {
  display: grid;
  place-items: center;
  color: var(--art-mark);
  font-size: 13px;
  font-weight: 600;
}

.finder {
  width: 100%;
  height: 36px;
  margin: 12px 0 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
}

.finder::placeholder { color: var(--faint); }

.note {
  min-height: 0;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.note:empty { display: none; }
.note.is-ok { color: var(--live); }
.note.is-bad { color: var(--danger); }

.request-row button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.request-row button:hover { background: var(--muted-bg); }

.request-row button:disabled {
  opacity: 0.5;
  cursor: default;
  background: transparent;
}

.history {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.history li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.history li:last-child { border-bottom: 0; }
.history li:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); }

.history-art {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--art);
}

.history-art.is-empty { display: block; }

.history time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.empty {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: start;
}

.prose p {
  max-width: 40rem;
  margin: 0 0 12px;
  color: var(--muted);
}

.facts { margin: 0; padding: 4px 16px 8px; }

.facts div { padding: 12px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; }

.facts dt {
  margin: 0;
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
}

.facts dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 500;
}

.stream-link { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.stream-link:hover { color: var(--muted); }

.boot {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.boot-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.boot-mark {
  width: 48px;
  height: 48px;
  color: var(--fg);
  animation: boot-mark 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.boot-mark rect { fill: currentColor; }
.boot-mark path { fill: var(--bg); }

.boot-word {
  display: flex;
  align-items: flex-start;
  gap: 0.16em;
  margin: 16px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 0.84;
  letter-spacing: -0.07em;
  animation: boot-word 0.65s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.boot-word span {
  margin-top: 0.22em;
  color: var(--muted);
  font-size: 0.36em;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.boot-line {
  width: 56px;
  height: 1px;
  margin-top: 18px;
  background: var(--fg);
  transform-origin: center;
  animation: boot-line 0.8s 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html:not(.is-in) { overflow: hidden; }

html.is-in .boot {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

html.is-in .boot-logo {
  transform: translateY(-6px);
  transition: transform 0.5s ease;
}

html.is-in .rise:not(.is-shown) {
  opacity: 0;
  transform: translateY(12px);
}

html.is-in .rise.is-shown {
  animation: rise 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html.is-in .kicker.rise.is-shown { animation-delay: 0.05s; }
html.is-in .display.rise.is-shown { animation-delay: 0.12s; }
html.is-in .lede.rise.is-shown { animation-delay: 0.22s; }
html.is-in .player.rise.is-shown { animation-delay: 0.3s; }

html.is-in .history.rise.is-shown,
html.is-in .facts.rise.is-shown {
  animation: none;
  opacity: 1;
  transform: none;
}

html.is-in .history.rise:not(.is-settled) li,
html.is-in .facts.rise:not(.is-shown) > div {
  opacity: 0;
  transform: translateY(10px);
}

html.is-in .history.rise.is-shown:not(.is-settled) li,
html.is-in .facts.rise.is-shown > div {
  animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html.is-in .history.rise.is-shown:not(.is-settled) li:nth-child(2) { animation-delay: 0.04s; }
html.is-in .history.rise.is-shown:not(.is-settled) li:nth-child(3) { animation-delay: 0.08s; }
html.is-in .history.rise.is-shown:not(.is-settled) li:nth-child(4) { animation-delay: 0.12s; }
html.is-in .history.rise.is-shown:not(.is-settled) li:nth-child(5) { animation-delay: 0.16s; }
html.is-in .history.rise.is-shown:not(.is-settled) li:nth-child(6) { animation-delay: 0.2s; }
html.is-in .history.rise.is-shown:not(.is-settled) li:nth-child(7) { animation-delay: 0.24s; }
html.is-in .history.rise.is-shown:not(.is-settled) li:nth-child(8) { animation-delay: 0.28s; }
html.is-in .history.rise.is-shown:not(.is-settled) li:nth-child(9) { animation-delay: 0.32s; }
html.is-in .history.rise.is-shown:not(.is-settled) li:nth-child(10) { animation-delay: 0.36s; }
html.is-in .history.rise.is-shown:not(.is-settled) li:nth-child(11) { animation-delay: 0.4s; }
html.is-in .history.rise.is-shown:not(.is-settled) li:nth-child(12) { animation-delay: 0.44s; }

html.is-in .facts.rise.is-shown > div:nth-child(2) { animation-delay: 0.06s; }
html.is-in .facts.rise.is-shown > div:nth-child(3) { animation-delay: 0.12s; }
html.is-in .facts.rise.is-shown > div:nth-child(4) { animation-delay: 0.18s; }

@keyframes boot-mark {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

@keyframes boot-word {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes boot-line {
  from { opacity: 0; transform: scaleX(0.15); }
  to { opacity: 1; transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.site-footer { padding: 8px 0 28px; color: var(--faint); font-size: 13px; }

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .site-header { height: auto; }
  .site-header .wrap { flex-wrap: wrap; height: auto; padding: 10px 0; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .header-tools { margin-left: auto; }
  .stage,
  .widgets,
  .about-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
  .player {
    grid-template-columns: 88px minmax(0, 1fr);
    grid-template-areas:
      "art controls"
      "meta meta"
      "timeline timeline";
  }
  .art { width: 88px; height: 88px; }
  .controls {
    align-items: flex-end;
    justify-self: end;
  }
  .history li {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
  }
  .site-footer .wrap { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot,
  .boot-mark,
  .boot-word,
  .boot-line { animation: none; }
  .play,
  html.is-in .boot,
  html.is-in .boot-logo { transition: none; }
  html.is-in .rise:not(.is-shown),
  html.is-in .history.rise:not(.is-settled) li,
  html.is-in .facts.rise:not(.is-shown) > div {
    opacity: 1;
    transform: none;
  }
  html.is-in .rise.is-shown,
  html.is-in .history.rise.is-shown:not(.is-settled) li,
  html.is-in .facts.rise.is-shown > div { animation: none; }
}
