:root {
  --ground: #f5f5f3;
  --field: #e8e8e4;
  --field-2: #dcdcd7;
  --ink: #0b0b0b;
  --mute: #5f5f5b;
  --ok: #1f7a3a;
  --bad: #b3261e;
  --pad: clamp(16px, 2.2vw, 32px);
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t-hero: clamp(44px, 7.4vw, 132px);
  --t-big: clamp(40px, 6vw, 104px);
  --t-body: clamp(14px, 1vw, 16px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--mono); font-size: var(--t-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--ink); color: var(--ground); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }

/* film grain, like the label site */
.grain {
  position: fixed; inset: -50%; z-index: 80; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain .6s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0) } 25% { transform: translate(-3%, 2%) } 50% { transform: translate(2%, -3%) } 75% { transform: translate(-2%, -1%) } to { transform: translate(0) } }
@media (prefers-reduced-motion: reduce) { .grain, .marquee__track { animation: none !important; } }

/* ---------- type ---------- */
.display, .big, .hero__title, .meter, .stat__num, .wordmark { font-family: var(--font); }
.hero__title { font-size: var(--t-hero); font-weight: 600; letter-spacing: -.045em; line-height: .92; }
.big { font-size: var(--t-big); font-weight: 600; letter-spacing: -.045em; line-height: .95; }
.label { font-family: var(--mono); font-size: 13px; color: var(--mute); text-transform: lowercase; }
.mute { color: var(--mute); }
.sub { margin-top: 20px; max-width: 38em; font-size: clamp(15px, 1.2vw, 19px); font-family: var(--font); font-weight: 500; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 14px var(--pad); background: var(--ground);
  border-bottom: 2px solid var(--ink);
}
.wordmark { font-size: clamp(20px, 2vw, 28px); font-weight: 700; letter-spacing: -.05em; white-space: nowrap; }
.nav__links { display: flex; gap: clamp(14px, 2vw, 32px); font-family: var(--font); font-size: 16px; font-weight: 500; }
.nav__links a { position: relative; padding: 6px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__right { display: flex; align-items: center; gap: 10px; }
.nav .nav__menu { display: none; }

@media (max-width: 900px) {
  .nav { flex-wrap: wrap; row-gap: 12px; }
  .nav .nav__menu { display: inline-flex; }
  .nav__right { order: 3; width: 100%; justify-content: space-between; }
  .nav__links { order: 4; width: 100%; flex-direction: column; gap: 4px; display: none; padding-bottom: 8px; font-size: 22px; }
  .nav.is-open .nav__links { display: flex; }
}

/* ---------- buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 13px 20px;
  font-family: var(--font); font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background .3s, color .3s, box-shadow .3s, transform .25s var(--ease);
}
.btn:active { transform: scale(.96); }
.btn--ink { background: var(--ink); color: var(--ground); }
.btn--ink:hover { background: var(--ground); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--ghost { background: var(--field); }
.btn--ghost:hover { background: var(--ink); color: var(--ground); }
.btn--line { box-shadow: inset 0 0 0 2px var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--ground); }
.btn--sm { padding: 9px 13px; font-size: 13px; gap: 8px; }
.btn--lg { padding: 20px 28px; font-size: 17px; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.arr { display: inline-block; transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translate(3px, -3px) rotate(45deg); }

.toggle { display: inline-flex; background: var(--field); padding: 4px; }
.toggle button { padding: 9px 16px; font-family: var(--font); font-size: 14px; font-weight: 600; transition: background .3s, color .3s; }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }

.input, .textarea {
  width: 100%; background: var(--field); border: 0; border-bottom: 2px solid var(--ink);
  padding: 14px 16px; border-radius: 0; outline: none; transition: background .2s;
}
.input:focus, .textarea:focus { background: var(--field-2); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 13px; color: var(--mute); }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; }
.page { padding: clamp(48px, 7vw, 110px) var(--pad) clamp(80px, 10vw, 160px); }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 56px); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(16px, 2vw, 28px); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: clamp(16px, 2vw, 28px); }
.block { background: var(--field); padding: clamp(20px, 2.4vw, 32px); }
.block h3 { font-family: var(--font); font-size: clamp(22px, 2vw, 30px); font-weight: 600; letter-spacing: -.035em; line-height: 1; margin-bottom: 14px; }
.block ul { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; }

/* ---------- overview ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: clamp(24px, 4vw, 64px); align-items: end; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.meter {
  font-size: clamp(64px, 11vw, 190px); font-weight: 800; letter-spacing: -.05em; line-height: .8;
  font-variant-numeric: tabular-nums; text-align: right;
}
.meter__cap { display: block; margin-top: 14px; font-family: var(--mono); font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--mute); text-align: right; }
@media (max-width: 900px) { .meter, .meter__cap { text-align: left; } }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 2px; margin-top: clamp(48px, 6vw, 96px); background: var(--ink); border: 2px solid var(--ink); }
.stat { background: var(--ground); padding: 22px 24px; }
.stat__num { font-size: clamp(40px, 4.4vw, 72px); font-weight: 700; letter-spacing: -.05em; line-height: .9; font-variant-numeric: tabular-nums; }
.stat .label { display: block; margin-top: 10px; }

.marquee { background: var(--ink); color: var(--ground); overflow: hidden; padding: 18px 0; }
.marquee__track {
  display: flex; width: max-content; gap: 40px; align-items: center; animation: marquee 40s linear infinite;
  font-family: var(--font); font-size: clamp(28px, 4vw, 64px); font-weight: 800; letter-spacing: -.04em; line-height: 1; white-space: nowrap;
}
.marquee .dot { width: .3em; height: .3em; background: var(--ground); flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

.list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.list li {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--field-2);
}
.list__name { font-family: var(--font); font-size: clamp(22px, 2.6vw, 40px); font-weight: 700; letter-spacing: -.045em; line-height: 1; overflow-wrap: anywhere; }
.list__meta { text-align: right; color: var(--mute); font-size: 14px; }

/* ---------- queue cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: clamp(16px, 2vw, 28px); }
.card { background: var(--field); display: flex; flex-direction: column; }
.card video { width: 100%; aspect-ratio: 9 / 16; background: var(--ink); display: block; object-fit: cover; }
.card__body { padding: 16px; display: grid; gap: 12px; flex: 1; align-content: start; }
.card__top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.card__reason { font-size: 13px; color: var(--mute); }
.card .textarea { min-height: 150px; font-size: 13px; background: var(--ground); }
.card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card .btn--ghost, .block .btn--ghost, .song .btn--ghost { background: var(--ground); }
.card .btn--ghost:hover, .block .btn--ghost:hover, .song .btn--ghost:hover { background: var(--ink); color: var(--ground); }
.tag { display: inline-block; padding: 3px 8px; background: var(--ink); color: var(--ground); font-size: 12px; }
.tag--soft { background: var(--field-2); color: var(--ink); }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 40px; align-items: center; }

/* ---------- console ---------- */
.console {
  background: var(--ink); color: var(--ground); font-size: 13px; line-height: 1.6;
  padding: 20px; min-height: 280px; max-height: 60vh; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.console:empty::before { content: "> idle"; opacity: .5; }

.jobbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--ink); color: var(--ground);
  display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px var(--pad); font-size: 13px;
}
.jobbar__line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.pulse { width: 10px; height: 10px; background: var(--ground); flex: none; animation: pulse 1s steps(2) infinite; }
@keyframes pulse { 50% { opacity: .2; } }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border-top: 2px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--field-2); vertical-align: top; }
th { font-weight: 400; color: var(--mute); white-space: nowrap; cursor: pointer; user-select: none; }
th[aria-sort] { color: var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.cap { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- songs ---------- */
.song { display: grid; grid-template-columns: 1fr; gap: 12px; background: var(--field); padding: 20px; }
.song__name { font-family: var(--font); font-size: clamp(24px, 2.4vw, 36px); font-weight: 700; letter-spacing: -.045em; line-height: 1; }
.song audio { width: 100%; }
.song .row .input { width: auto; flex: 1; min-width: 120px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; top: 84px; right: var(--pad); z-index: 70; max-width: min(420px, calc(100vw - 32px));
  background: var(--ink); color: var(--ground); padding: 14px 18px; font-size: 14px;
  transform: translateY(-12px); opacity: 0; transition: opacity .3s, transform .4s var(--ease); pointer-events: none;
}
.toast.is-on { opacity: 1; transform: none; }
.toast.is-bad { background: var(--bad); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; padding: var(--pad); }
.login form { display: grid; gap: 14px; max-width: 460px; margin-top: 36px; }
.login .err { color: var(--bad); font-size: 14px; }
