@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face { font-family: "Plex Mono"; src: url("/fonts/plexmono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/plexmono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/plexmono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* Dark is the primary look; light follows the OS or data-theme="light". */
:root {
  color-scheme: dark;
  --bg: #101413;
  --panel: #141917;
  --line: #262e2b;
  --grid: #1f2624;
  --ink: #ece8dd;
  --ink-2: #b9b8ae;
  --muted: #8e968f;
  --series: #4cb6cf;
  --series-wash: rgba(76, 182, 207, .10);
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --dotgrid: rgba(236, 232, 221, .06);
  --sans: "Archivo", system-ui, "Segoe UI", Ubuntu, sans-serif;
  --mono: "Plex Mono", ui-monospace, "DejaVu Sans Mono", Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f2ec; --panel: #faf9f5; --line: #d6d2c7; --grid: #e6e2d8;
    --ink: #131614; --ink-2: #3b403c; --muted: #5b625c;
    --series: #1a7891; --series-wash: rgba(26, 120, 145, .10);
    --dotgrid: rgba(19, 22, 20, .07);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f2ec; --panel: #faf9f5; --line: #d6d2c7; --grid: #e6e2d8;
  --ink: #131614; --ink-2: #3b403c; --muted: #5b625c;
  --series: #1a7891; --series-wash: rgba(26, 120, 145, .10);
  --dotgrid: rgba(19, 22, 20, .07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--sans); }
button { font: inherit; color: inherit; }
.frame { max-width: 1080px; margin: 0 auto; padding: 20px 16px 48px; }

.kicker, h2, .ro-label, .seg button, .facts, .live, .foot, .note, .copy-hint, .tag {
  font-family: var(--mono);
}
.kicker, h2, .ro-label {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; }
.mark { display: flex; align-items: center; gap: 10px; font-weight: 700; font-stretch: 112%; letter-spacing: .02em; text-transform: uppercase; font-size: 14px; min-width: 0; }
.mark svg { width: 22px; height: 22px; fill: var(--series); flex: none; }
.mark .slash { color: var(--line); font-weight: 400; }
.mark .dim { color: var(--muted); }
.live { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pulse { width: 7px; height: 7px; background: var(--muted); border-radius: 50%; }
.live.ok .pulse { background: var(--good); animation: blink 2.4s ease-in-out infinite; }
.live.stale .pulse { background: var(--warning); }
@keyframes blink { 50% { opacity: .25; } }

/* hero: an instrument face with corner brackets and a dot grid */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  gap: 32px;
  padding: 36px 32px 32px;
  border: 1px solid var(--line);
  background-color: var(--panel);
  background-image: radial-gradient(var(--dotgrid) 1px, transparent 1.2px);
  background-size: 16px 16px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--ink);
}
.hero::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.hero::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.state-word {
  display: flex; align-items: center; gap: 18px;
  margin: 10px 0 6px;
  font-size: clamp(48px, 11vw, 104px);
  line-height: .9;
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.sq { width: .34em; height: .34em; flex: none; background: var(--muted); }
.st-online .sq { background: var(--good); }
.st-starting .sq { background: var(--warning); }
.st-crashed .sq { background: var(--critical); }
.hero-line { margin: 14px 0 0; font-size: 18px; color: var(--ink); }
.hero-quip { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.join { align-self: end; border-left: 1px solid var(--line); padding-left: 28px; }
.addr {
  display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 10px 0 14px; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 2px;
  font: 600 15px var(--mono); text-align: left; cursor: pointer;
  overflow-wrap: anywhere;
}
.addr:hover { border-color: var(--ink-2); }
.addr:focus-visible, .seg button:focus-visible, .charts:focus-visible, summary:focus-visible {
  outline: 2px solid var(--series); outline-offset: 2px;
}
.copy-hint { font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); flex: none; }
.facts { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--ink-2); }
.facts li { padding: 3px 0; }
.facts li::before { content: "› "; color: var(--muted); }

.stale { margin: 12px 0 0; padding: 10px 14px; border: 1px solid var(--warning); color: var(--ink); font-size: 14px; }

/* readout strip */
.readouts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 16px; border: 1px solid var(--line);
}
.ro { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 16px; min-width: 0; }
.ro + .ro { border-left: 1px solid var(--line); }
.ro-val { font-size: 34px; font-weight: 600; font-stretch: 110%; line-height: 1.05; }
.ro-val small { font-size: 15px; font-weight: 500; color: var(--muted); font-stretch: 100%; }
.ro-sub { font: 12px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 4px; background: var(--grid); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--series); border-radius: 2px; transition: width .6s ease; }
.ro.warn .meter i { background: var(--warning); }
.ro.bad .meter i { background: var(--critical); }
.pips { display: flex; gap: 4px; height: 4px; }
.pips i { flex: 1; background: var(--grid); border-radius: 2px; }
.pips i.on { background: var(--series); }

/* sections */
section { margin-top: 36px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 2px; }
.seg button {
  background: none; border: 0; padding: 5px 12px; font-size: 12px; color: var(--muted); cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); font-weight: 600; }

/* telemetry strips */
.charts { position: relative; outline: none; }
.charts.loading { opacity: .55; }
.strip { display: grid; grid-template-columns: 170px 1fr; align-items: stretch; border-bottom: 1px solid var(--grid); }
.strip-label { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 12px 10px 0; }
.sl-name { font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sl-val { font-size: 22px; font-weight: 600; font-stretch: 108%; line-height: 1.15; }
.sl-sub { font: 11px var(--mono); color: var(--muted); }
.plot { display: block; width: 100%; height: 92px; overflow: visible; }
.axis-row { display: grid; grid-template-columns: 170px 1fr; }
.axis { display: block; width: 100%; height: 26px; overflow: visible; }
.plot text, .axis text { font: 10px var(--mono); fill: var(--muted); }
.plot .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.plot .ref { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.plot .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot .area { fill: var(--series-wash); stroke: none; }
.plot .end { fill: var(--series); stroke: var(--bg); stroke-width: 2; }
.plot .hair, .axis .hair { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; }
.axis .hair-label { fill: var(--ink); font-weight: 600; }
.axis .hair-bg { fill: var(--bg); }
.plot .empty { font: 12px var(--mono); fill: var(--muted); }
.note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

.tableview { margin-top: 14px; }
.tableview summary { cursor: pointer; font: 12px var(--mono); color: var(--ink-2); }
.table-wrap { overflow-x: auto; margin-top: 10px; max-height: 320px; overflow-y: auto; border: 1px solid var(--line); }
.tableview table { width: 100%; border-collapse: collapse; font: 12px var(--mono); font-variant-numeric: tabular-nums; }
.tableview th, .tableview td { padding: 6px 12px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.tableview th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 500; }
.tableview th:first-child, .tableview td:first-child { text-align: left; }

/* roster + maps */
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0 40px; }
.roster, .maplist { list-style: none; margin: 0; padding: 0; }
.roster li, .maplist li {
  display: flex; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--grid);
}
.roster .name { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.tag {
  font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 6px; border: 1px solid var(--line); border-radius: 2px; color: var(--ink-2);
}
.roster .where, .maplist .meta { margin-left: auto; font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.roster .empty { color: var(--muted); }
.maplist .mname { font-weight: 700; font-stretch: 112%; text-transform: uppercase; letter-spacing: .02em; }
.maplist .mstate { display: inline-flex; align-items: center; gap: 6px; font: 12px var(--mono); color: var(--ink-2); }
.maplist .mstate::before { content: ""; width: 8px; height: 8px; background: var(--muted); }
.maplist .st-online .mstate::before { background: var(--good); }
.maplist .st-starting .mstate::before { background: var(--warning); }
.maplist .st-crashed .mstate::before { background: var(--critical); }

.foot {
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 44px; padding-top: 14px;
  border-top: 1px solid var(--line); font-size: 11px; color: var(--muted);
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 26px 18px 22px; gap: 22px; }
  .join { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 18px; }
  .readouts { grid-template-columns: repeat(2, 1fr); }
  .ro:nth-child(3) { border-left: 0; }
  .ro:nth-child(n+3) { border-top: 1px solid var(--line); }
  .strip, .axis-row { grid-template-columns: 1fr; }
  .strip-label { flex-direction: row; align-items: baseline; gap: 10px; padding: 10px 0 0; }
  .sl-sub { margin-left: auto; }
  .axis-row > :first-child { display: none; }
  .split { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .live.ok .pulse { animation: none; }
  .meter i { transition: none; }
}
