/* One stylesheet for both faces of the pipeline.
 *
 * Colours are declared once as tokens on :root and redefined for dark mode,
 * so nothing below this block names a hex value. The chart's single series is
 * one hue: this page never puts two categorical colours side by side, which
 * is the case that needs a validated palette rather than a choice.
 */
:root {
  color-scheme: light;
  --plane:      #f9f9f7;
  --surface:    #fcfcfb;
  --ink:        #0b0b0b;
  --ink-2:      #52514e;
  --muted:      #898781;
  --grid:       #e1e0d9;
  --axis:       #c3c2b7;
  --border:     rgba(11, 11, 11, 0.10);
  --series:     #2a78d6;
  --good:       #0ca30c;
  --warning:    #fab219;
  --serious:    #ec835a;
  --critical:   #d03b3b;
  --shadow:     0 1px 2px rgba(11, 11, 11, 0.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --plane:      #0d0d0d;
    --surface:    #1a1a19;
    --ink:        #ffffff;
    --ink-2:      #c3c2b7;
    --muted:      #898781;
    --grid:       #2c2c2a;
    --axis:       #383835;
    --border:     rgba(255, 255, 255, 0.10);
    --series:     #3987e5;
    --shadow:     none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 64px; }

/* Header ------------------------------------------------------------- */

header.top {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
header.top .wrap {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding-top: 16px; padding-bottom: 16px;
}
.brand { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.brand a { color: inherit; text-decoration: none; }
nav.top-nav { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; }
nav.top-nav a { color: var(--ink-2); text-decoration: none; font-size: 14px; }
nav.top-nav a:hover { color: var(--ink); text-decoration: underline; }

/* Hero --------------------------------------------------------------- */

.hero { padding: 56px 0 40px; }
.hero h1 {
  margin: 0 0 12px; font-size: 34px; line-height: 1.2;
  font-weight: 680; letter-spacing: -0.02em; max-width: 22ch;
}
.hero p.lede { margin: 0; max-width: 62ch; color: var(--ink-2); font-size: 17px; }
.hero-figure {
  font-size: 54px; line-height: 1.05; font-weight: 700; letter-spacing: -0.03em;
  margin: 0 0 4px;
}
.hero-figure-label { color: var(--ink-2); margin: 0 0 28px; }

/* Cards and tiles ----------------------------------------------------- */

section { margin-top: 40px; }
section > h2 {
  margin: 0 0 4px; font-size: 13px; font-weight: 650;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
section > p.note { margin: 0 0 16px; color: var(--ink-2); max-width: 68ch; }
/* A second heading inside a section starts a new block, not a new line. */
section > h2 ~ h2 { margin-top: 36px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.tiles {
  display: grid; gap: 12px; margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
/* Four short tiles fit a row of their own rather than leaving an orphan. */
.tiles.four { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow);
}
.tile .v { font-size: 26px; font-weight: 660; letter-spacing: -0.02em; }
.tile .k { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.tile .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* Tables -------------------------------------------------------------- */

.scroll { overflow-x: auto; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td {
  text-align: left; padding: 9px 12px;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
thead th {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nw, th.nw { white-space: nowrap; }
td.mono, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}
td.err { color: var(--ink-2); max-width: 46ch; }
.empty { color: var(--muted); padding: 14px 0; }

/* Status. Colour never carries the meaning on its own: every badge prints a
 * word, and the leading mark is there for the reader who sees no hue. */
.badge {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: "\25CF"; font-size: 10px; }
.badge.ok       { color: var(--good); }
.badge.warn     { color: var(--warning); }
.badge.serious  { color: var(--serious); }
.badge.bad      { color: var(--critical); }
.badge.idle     { color: var(--muted); }
.badge.idle::before { content: "\25CB"; }
.badge.bad::before  { content: "\25A0"; }
.badge.warn::before { content: "\25B2"; }

/* Meters: one hue, more-is-darker; the number is always printed beside it.
 * Drawn as SVG rather than a div whose width is set inline, because the
 * page's content policy forbids inline style — and a meter is geometry
 * anyway. */
.meter { display: flex; align-items: center; gap: 10px; }
.meter svg { width: 110px; height: 6px; display: block; flex: none; }
/* The track is neutral rather than a pale step of the series hue: a low fill
 * is drawn in a status colour, and a blue track behind it reads as data. */
.meter .track { fill: var(--grid); }
.meter .fill { fill: var(--series); }
.meter .fill.low { fill: var(--critical); }
.meter .fill.mid { fill: var(--warning); }
.meter .val { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 4ch; }

/* Chart --------------------------------------------------------------- */

.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--series); }
.chart .bar:hover { fill: var(--ink); }
.chart .peak { fill: var(--ink-2); font-size: 11px; font-weight: 600; text-anchor: middle; }
.chart .none { fill: var(--muted); font-size: 13px; }

details.data { margin-top: 10px; }
details.data summary {
  cursor: pointer; color: var(--ink-2); font-size: 13px;
}
details.data table { margin-top: 8px; max-width: 420px; }

/* Forms and flashes ---------------------------------------------------- */

.flash {
  margin-top: 16px; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); font-size: 14px;
}
button {
  font: inherit; font-size: 13px; padding: 4px 10px; cursor: pointer;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--axis); border-radius: 6px;
}
button:hover { border-color: var(--ink-2); }
form.inline { display: inline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Sign-in --------------------------------------------------------------- */

.signin { max-width: 380px; margin-top: 64px; }
.signin-form { display: flex; flex-direction: column; gap: 6px; }
.signin-form label {
  font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); margin-top: 8px;
}
.signin-form input {
  font: inherit; padding: 8px 10px; border-radius: 6px;
  border: 1px solid var(--axis); background: var(--plane); color: var(--ink);
}
.signin-form input:focus { outline: 2px solid var(--series); outline-offset: 1px; }
.signin-form button { margin-top: 16px; padding: 8px 10px; }
.signin-error { margin: 0 0 4px; }

form.signout { display: flex; align-items: baseline; gap: 8px; }
.who { color: var(--muted); font-size: 13px; }

/* Prose --------------------------------------------------------------- */

.cols {
  display: grid; gap: 20px; margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.cols h3 { margin: 0 0 6px; font-size: 15px; }
.cols p { margin: 0; color: var(--ink-2); }

footer.bottom {
  margin-top: 56px; padding: 20px 0; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 13px;
}
footer.bottom a { color: var(--ink-2); }

a.src { color: var(--series); text-decoration: none; }
a.src:hover { text-decoration: underline; }
