/* Solnvim relay console.
   Instrument-panel dark: ink ground, hairline rules, one signal accent.
   Structure is set in a monospace face because every label here is a readout;
   prose falls back to the system sans. No webfonts, no gradients, no radii
   beyond 4px — the page should read as equipment, not as a marketing site. */

:root {
  --ink: #0a0c0f;
  --panel: #111419;
  --panel-2: #151922;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #e7eaf0;
  --muted: #79818f;
  --dim: #5b6270;
  --signal: #6ec1ff;
  --ok: #5bd6a5;
  --warn: #e5b567;
  --err: #f2796b;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono",
    Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --pad: 20px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }

code, pre, .mono, .table, .field__label, .connect__label, .tab, .btn,
.stats__label, .stat__label, .bar__ver, .wordmark, .pill, .synced, .pulse {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------- wordmark ---------- */

.wordmark {
  font-size: 15px;
  letter-spacing: 0.22em;
  font-weight: 600;
  text-transform: uppercase;
}
.wordmark--sm { font-size: 13px; letter-spacing: 0.2em; }
.wordmark__dot { color: var(--signal); }

/* ---------- top bar ---------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  height: 52px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 20;
}
.bar__left, .bar__right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bar__ver { color: var(--dim); font-size: 11px; letter-spacing: 0.06em; }
.bar__form { margin: 0; }

.pulse {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.pulse i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dim);
  display: inline-block;
}
.pulse.is-ok i { background: var(--ok); animation: beat 2.4s ease-in-out infinite; }
.pulse.is-ok { color: var(--ok); border-color: rgba(91, 214, 165, 0.3); }
.pulse.is-err i { background: var(--err); }
.pulse.is-err { color: var(--err); border-color: rgba(242, 121, 107, 0.3); }
@keyframes beat { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- signal strip ----------
   One tick per upstream key, height ∝ that key's window utilisation.
   This is the page's single piece of motion and it is load-bearing: a glance
   tells you how many keys are actually taking traffic right now. */

.strip {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 26px;
  padding: 5px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent);
  overflow: hidden;
}
.strip__tick {
  flex: 1 1 6px;
  min-width: 2px;
  max-width: 26px;
  height: 4px;
  background: var(--line-2);
  transition: height 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s;
  transform-origin: bottom;
}
.strip__tick.is-cool { background: rgba(229, 181, 103, 0.55); }
.strip__tick.is-hot { background: var(--signal); }
.strip__tick.is-out { background: rgba(242, 121, 107, 0.5); }

/* ---------- layout ---------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 64px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.hero__title {
  font-size: 26px;
  letter-spacing: -0.01em;
  font-family: var(--mono);
  font-weight: 600;
}
.hero__lede {
  margin-top: 8px;
  max-width: 66ch;
  color: var(--muted);
  font-size: 13.5px;
}
.hero__meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- panels ---------- */

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 4px;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.panel__head--inline { border-bottom: 1px solid var(--line); }
.panel__title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 600;
}
.panel__hint { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.panel__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- connect ---------- */

.connect { padding: 4px 0; }
.connect__row {
  display: grid;
  grid-template-columns: 168px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.connect__row:last-child { border-bottom: 0; }
.connect__label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.connect__value {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.connect__value.is-secret { color: var(--signal); letter-spacing: 0.04em; }

.snippet { border-top: 1px solid var(--line); background: var(--panel-2); }
.snippet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.snippet pre, .play__out pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #c8d2e0;
  white-space: pre;
}

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.stats--tight { margin-bottom: 22px; }
.stat {
  background: var(--panel);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.stat__label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.stat__value {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}
.stat__value small { font-size: 12px; color: var(--muted); margin-left: 4px; }
.stat--ok .stat__value { color: var(--ok); }
.stat--signal .stat__value { color: var(--signal); }
.stat--warn .stat__value { color: var(--warn); }

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  padding: 10px 16px;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--signal); }

.pane { display: none; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.pane.is-active { display: block; }
.pane .panel__head { border-bottom: 1px solid var(--line); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.022); }
.table .num { text-align: right; }
.table td.num { color: #c3cbd8; }
.table td.id { font-family: var(--mono); }

.pill {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid var(--line-2);
  color: var(--muted);
}
.pill--ok { color: var(--ok); border-color: rgba(91, 214, 165, 0.35); }
.pill--warn { color: var(--warn); border-color: rgba(229, 181, 103, 0.35); }
.pill--err { color: var(--err); border-color: rgba(242, 121, 107, 0.35); }
.pill--signal { color: var(--signal); border-color: rgba(110, 193, 255, 0.35); }

.empty { padding: 26px 16px; text-align: center; color: var(--dim); font-family: var(--mono); font-size: 12px; }

/* ---------- controls ---------- */

.btn {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 3px;
  padding: 7px 13px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.3); }
.btn--sm { padding: 5px 10px; font-size: 10.5px; }
.btn--ghost { background: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--text); }
.btn--primary {
  background: var(--signal);
  border-color: var(--signal);
  color: #06121d;
  font-weight: 600;
}
.btn--primary:hover { background: #86cdff; border-color: #86cdff; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--full { width: 100%; }

.input {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--text);
  padding: 8px 11px;
  font-family: var(--mono);
  font-size: 12.5px;
  outline: none;
}
.input:focus { border-color: var(--signal); }
.input--search { width: 190px; }
.input--area { resize: vertical; line-height: 1.55; }

.field { display: block; }
.field__label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.field__input {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--text);
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  outline: none;
}
.field__input:focus { border-color: var(--signal); }

/* ---------- playground ---------- */

.play {
  display: flex;
  gap: 10px;
  padding: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.play__field { flex: 0 0 260px; }
.play__field--grow { flex: 1 1 320px; }
.play__out { border-top: 1px solid var(--line); background: var(--panel-2); }
.play__out pre { min-height: 120px; white-space: pre-wrap; word-break: break-word; }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 18px;
  text-align: center;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* ---------- login gate ---------- */

.gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.gate__panel {
  width: 100%;
  max-width: 372px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 4px;
  padding: 30px 28px 24px;
}
.gate__mark { display: flex; gap: 3px; align-items: flex-end; height: 22px; margin-bottom: 20px; }
.gate__mark span { display: block; width: 5px; background: var(--signal); }
.gate__mark span:nth-child(1) { height: 9px; opacity: 0.5; }
.gate__mark span:nth-child(2) { height: 20px; }
.gate__mark span:nth-child(3) { height: 13px; opacity: 0.75; }
.gate__mark span:nth-child(4) { height: 22px; }
.gate__mark span:nth-child(5) { height: 7px; opacity: 0.4; }
.gate__sub {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8px;
}
.gate__form { margin-top: 26px; }
.gate__error {
  color: var(--err);
  font-family: var(--mono);
  font-size: 11.5px;
  min-height: 17px;
  margin: 9px 0 12px;
}
.gate__foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
}

/* ---------- responsive ---------- */

@media (max-width: 780px) {
  .wrap { padding: 20px 12px 48px; gap: 20px; }
  .bar { padding: 0 12px; height: 48px; }
  .hero__title { font-size: 21px; }
  .connect__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
  }
  .connect__label { flex: 0 0 100%; }
  .connect__value { flex: 1 1 100%; white-space: normal; word-break: break-all; }
  .connect__row .btn { flex: 0 0 auto; }
  .input--search { width: 100%; }
  .panel__tools { width: 100%; }
  .panel__head--inline { flex-wrap: wrap; }
  .play__field, .play__field--grow { flex: 1 1 100%; }
  .stat__value { font-size: 18px; }
  .table td, .table th { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
