/* cm.dekku.dev — terminal broadcaster aesthetic */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Claude CLI dark: charcoal ink background, warm cream text, burnt-orange accent */
  --bg:        oklch(0.20 0 0);        /* neutral charcoal */
  --bg-1:      oklch(0.24 0 0);        /* panel */
  --bg-2:      oklch(0.28 0 0);        /* sunken */
  --line:      oklch(0.33 0 0);
  --line-hi:   oklch(0.44 0 0);
  --fg:        oklch(0.94 0 0);        /* neutral off-white */
  --fg-dim:    oklch(0.78 0 0);
  --fg-mute:   oklch(0.58 0 0);
  --signal:    oklch(0.72 0.17 45);    /* burnt orange */
  --signal-dim: oklch(0.50 0.12 45);
  --done:      oklch(0.80 0.13 70);    /* warm amber — same family as signal */
  --fail:      oklch(0.68 0.22 25);    /* alert red */
  --link:      oklch(0.75 0.12 60);
  --space:     32px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--fg); min-height: 100vh; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

.mono, code, kbd { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.num { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ————— frame ————— */
.frame { max-width: 1720px; margin: 0 auto; padding: 36px 56px 96px; }

/* ————— masthead ————— */
.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}
.masthead h1 {
  font-weight: 700;
  font-size: 38px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.masthead h1 .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--signal); margin-right: 14px; transform: translateY(-6px);
  box-shadow: 0 0 12px oklch(0.65 0.17 45 / 0.45);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.masthead h1 small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-mute);
  margin-left: 18px;
  letter-spacing: 0;
}
.masthead .meta {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--fg-mute);
  letter-spacing: 0.02em;
  line-height: 1.7;
}
.masthead .meta strong { color: var(--fg-dim); font-weight: 500; }

/* ————— now playing strip ————— */
.nowbar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: stretch;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--signal);
  padding: 24px 32px;
  margin-bottom: 48px;
}
.nowbar .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-mute);
  font-weight: 600;
  align-self: center;
  border-right: 1px solid var(--line);
  padding-right: 28px;
  line-height: 1.5;
}
.nowbar .feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.nowbar .slot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 14px;
  align-items: center;
}
.nowbar .slot .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  text-transform: uppercase;
  border: 1px solid var(--line-hi);
  padding: 3px 10px;
}
.nowbar .slot .title { font-size: 15px; color: var(--fg); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowbar .slot .title .sz { color: var(--fg-mute); margin-left: 10px; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.nowbar .slot .rate { font-family: 'JetBrains Mono', monospace; font-size: 16px; color: var(--signal); font-weight: 500; }
.nowbar .slot .rate::after { content: ' MB/s'; color: var(--fg-mute); font-size: 11px; font-weight: 400; margin-left: 2px; }
.nowbar .slot.idle .rate { color: var(--fg-mute); }
.nowbar .slot.idle .title { color: var(--fg-mute); font-style: italic; }

/* ————— stat row ————— */
.statrow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 36px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 28px 32px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: none; }
.stat .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-mute);
  font-weight: 600;
  margin-bottom: 14px;
}
.stat .v {
  font-family: 'JetBrains Mono', monospace;
  font-size: 34px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat .v .unit {
  font-size: 14px;
  color: var(--fg-mute);
  margin-left: 6px;
  font-weight: 400;
}
.stat.accent .v { color: var(--signal); }
.stat.done .v { color: var(--done); }
.stat .sub {
  margin-top: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--fg-mute);
}

/* ————— section headers ————— */
.section-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 24px;
  margin: 56px 0 22px;
}
.section-head h2 {
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.section-head .rule {
  height: 1px; background: var(--line); align-self: center;
}
.section-head .count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--fg-mute);
  letter-spacing: 0.06em;
}

/* ————— accounts ————— */
.studios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.studio {
  background: var(--bg-1);
  padding: 28px 32px;
  position: relative;
}
.studio .hdr { display: grid; grid-template-columns: 1fr auto; align-items: baseline; margin-bottom: 24px; }
.studio .name { font-weight: 700; font-size: 24px; letter-spacing: -0.02em; }
.studio .name .host { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 400; color: var(--fg-mute); margin-left: 12px; }
.studio .badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--signal);
  text-transform: uppercase;
  border: 1px solid var(--signal-dim);
  padding: 3px 10px;
}
.studio.offline .badge { color: var(--fg-mute); border-color: var(--line-hi); }
.studio.offline .name { color: var(--fg-dim); }

.studio .metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 18px 0;
  border-top: 1px dashed var(--line-hi);
  border-bottom: 1px dashed var(--line-hi);
}
.studio .metrics .m .k { font-size: 10px; letter-spacing: 0.2em; color: var(--fg-mute); text-transform: uppercase; font-weight: 600; margin-bottom: 6px; }
.studio .metrics .m .v { font-family: 'JetBrains Mono', monospace; font-size: 26px; color: var(--fg); font-weight: 500; line-height: 1.1; }
.studio .metrics .m .v .unit { font-size: 12px; color: var(--fg-mute); margin-left: 3px; }

.studio .fill {
  margin-top: 20px;
  height: 3px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.studio .fill span { position: absolute; inset: 0 auto 0 0; background: var(--signal); }
.studio .chspread { margin-top: 14px; display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; }
.studio .chspread i {
  display: block; height: 14px;
  background: linear-gradient(to top, var(--signal) var(--pct,0%), var(--bg-2) var(--pct,0%));
  border: 1px solid var(--line);
}

/* ————— channel grid ————— */
.chan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.chan {
  background: var(--bg-1);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 4px;
  align-items: baseline;
}
.chan .n {
  grid-column: 1;
  grid-row: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.chan .p {
  grid-column: 2;
  grid-row: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--signal);
  text-align: right;
}
.chan .sz {
  grid-column: 1 / 3;
  grid-row: 2;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.02em;
}

/* ————— log tail ————— */
.log {
  background: var(--bg-1);
  border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  overflow: hidden;
}
.log .row {
  display: grid;
  grid-template-columns: 88px 80px 1fr 100px 80px 24px;
  align-items: center;
  column-gap: 24px;
  padding: 13px 28px;
  border-bottom: 1px solid var(--line);
}
.log .row:last-child { border-bottom: none; }
.log .row .t { color: var(--fg-mute); font-size: 12px; }
.log .row .acct { color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; font-weight: 600; }
.log .row .title { color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.log .row .sz { color: var(--fg-dim); text-align: right; font-size: 12px; }
.log .row .rate { color: var(--signal); text-align: right; font-size: 13px; }
.log .row .rate.fail { color: var(--fail); }
.log .row .ok { color: var(--done); }
.log .row .bad { color: var(--fail); }
.log .row.fail .title { color: var(--fg-dim); font-style: italic; }

/* ————— footer ————— */
.foot {
  margin-top: 60px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
}
.foot a { color: var(--fg-dim); text-decoration: none; border-bottom: 1px dotted var(--line-hi); }
.foot a:hover { color: var(--signal); }

/* ————— responsive ————— */
@media (max-width: 1100px) {
  .statrow { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(3) { border-right: none; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--line); }
  .studios { grid-template-columns: 1fr; }
  .nowbar .feed { grid-template-columns: 1fr; row-gap: 10px; }
  .frame { padding: 20px; }
}
