/* Shared look for the prototype dashboard. Quoted from the landing site
   (landing/index.html, landing/device.html): near-black ground, off-white ink,
   EB Garamond, hairline rules. Baskerville carries the numbers. Red is kept for
   one meaning only, the same as on the site: something needs attention. */

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/ebgaramond-roman.woff2) format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/ebgaramond-italic.woff2) format('woff2');
}

:root {
  --bg: #0a0a0b;
  --fg: #f2f1ec;
  --panel: #141415;
  --ink-soft: rgba(242, 241, 236, 0.52);
  --ink-faint: rgba(242, 241, 236, 0.3);
  --rule: rgba(242, 241, 236, 0.12);
  --rule-strong: rgba(242, 241, 236, 0.3);
  --alert: #ff3b30;
  --serif: 'EB Garamond', ui-serif, Georgia, serif;
  /* macOS/iOS ship Baskerville; Libre Baskerville (Google Fonts, linked per
     page) is the stand-in everywhere else. */
  --numeric: Baskerville, 'Libre Baskerville', 'Baskerville Old Face', Georgia, serif;
  --gutter: clamp(1rem, 4vw, 2.6rem);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input { font-family: var(--serif); }

/* ------------------------------------------------------------ top bar --- */
.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1.4rem;
  font-size: 1.02rem;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.25s ease;
}
.nav a:hover, .nav a:focus-visible { color: var(--fg); }
.nav a[aria-current="page"] {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.28em;
  text-decoration-thickness: 0.5px;
}

/* --------------------------------------------------------------- page --- */
.page {
  padding: 1.8rem var(--gutter) 3rem;
}

.masthead { margin-bottom: 1.6rem; }

.eyebrow {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

h1 {
  margin: 0.25rem 0 0.35rem;
  font-weight: 700;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0 0 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--rule-strong);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.status {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

.note {
  margin: 0.4rem 0 0;
  max-width: 46rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* Live indicator. Off-white and breathing while data flows (the landing
   page's depth-rail marker); red and still once the server goes quiet. */
.dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--alert);
  transform: translateY(-1px);
}
.dot.live {
  background: var(--fg);
  animation: breathe 2.9s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.34; }
  50%      { opacity: 0.95; }
}
@media (prefers-reduced-motion: reduce) {
  .dot.live { animation: none; opacity: 0.8; }
}

.is-alert { color: var(--alert); }

/* Numbers set in Baskerville, lining + tabular so columns stay steady. */
.num, td, .stat dd {
  font-family: var(--numeric);
  font-variant-numeric: lining-nums tabular-nums;
}

.mut { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }

.empty {
  padding: 0.9rem 0;
  color: var(--ink-soft);
}

/* -------------------------------------------------------------- table --- */
.wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 1.1rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: var(--bg);
  font-family: var(--serif);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom-color: var(--rule-strong);
}

/* Freshest row reads at full strength; history recedes a step. */
tbody td { color: rgba(242, 241, 236, 0.78); }
tbody td.mut { color: var(--ink-soft); }
tbody tr:first-child td { color: var(--fg); }

/* ---------------------------------------------------------- key/value --- */
.stats { margin: 0; }

.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.46rem 0;
  border-bottom: 1px solid var(--rule);
}
.stat dt { font-size: 0.95rem; color: var(--ink-soft); }
.stat dd { margin: 0; font-size: 0.95rem; }

/* ------------------------------------------------------------ buttons --- */
.btn {
  appearance: none;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--fg);
  border-radius: 0;
  background: var(--fg);
  color: var(--bg);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.btn:hover { opacity: 0.85; }
.btn:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
.btn:disabled { opacity: 0.3; cursor: default; }
.btn.ghost {
  background: none;
  color: var(--fg);
  border-color: var(--rule-strong);
}
.btn.stop {
  background: none;
  color: var(--alert);
  border-color: var(--alert);
}

input[type="checkbox"] {
  accent-color: var(--fg);
  margin: 0.3em 0 0;
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .top { flex-wrap: wrap; row-gap: 0.6rem; }
  .nav { gap: 1rem; }
}
