/* Managed by ansible (roles/stub_site). Edit the playbook, not this file.
 *
 * Served as a real file rather than inlined, so that loading a page costs more
 * than one request. A site that renders completely from a single response,
 * with no stylesheet and no image, is not something a browser ever produces --
 * and "exactly one 200 of always the same length per connection" was the most
 * mechanical thing about this host from the outside.
 *
 * The tokens marked "seeded" are drawn per deployment. Colours are not among
 * them: the palette is chosen for contrast in both modes, and rotating hues at
 * random would trade a real property for a cosmetic one. */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --plane:    #f9f9f7;
  --surface:  #fcfcfb;
  --ink:      #0b0b0b;
  --ink-2:    #52514e;
  --muted:    #898781;
  --grid:     #e1e0d9;
  --axis:     #c3c2b7;
  --hair:     rgba(11, 11, 11, 0.10);
  --wash:     rgba(11, 11, 11, 0.04);
  --shadow:   0 1px 2px rgba(11, 11, 11, 0.04);

  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;

  --good:     #0ca30c;
  --warning:  #fab219;
  --serious:  #ec835a;
  --critical: #d03b3b;
  --up-good:  #006300;

  --seq-1: #cde2fb;
  --seq-2: #9ec5f4;
  --seq-3: #5598e7;
  --seq-4: #256abf;
  --seq-5: #104281;

  --link: #1c5cab;

  /* seeded */
  --radius: 8px;
  --wrap: 72rem;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --plane:   #0d0d0d;
    --surface: #1a1a19;
    --ink:     #ffffff;
    --ink-2:   #c3c2b7;
    --muted:   #898781;
    --grid:    #2c2c2a;
    --axis:    #383835;
    --hair:    rgba(255, 255, 255, 0.10);
    --wash:    rgba(255, 255, 255, 0.05);
    --shadow:  none;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --up-good: #0ca30c;
    --seq-1: #104281;
    --seq-2: #184f95;
    --seq-3: #256abf;
    --seq-4: #5598e7;
    --seq-5: #9ec5f4;
    --link: #86b6ef;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plane:   #0d0d0d;
  --surface: #1a1a19;
  --ink:     #ffffff;
  --ink-2:   #c3c2b7;
  --muted:   #898781;
  --grid:    #2c2c2a;
  --axis:    #383835;
  --hair:    rgba(255, 255, 255, 0.10);
  --wash:    rgba(255, 255, 255, 0.05);
  --shadow:  none;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --up-good: #0ca30c;
  --seq-1: #104281;
  --seq-2: #184f95;
  --seq-3: #256abf;
  --seq-4: #5598e7;
  --seq-5: #9ec5f4;
  --link: #86b6ef;
}

/* -------------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 2rem 1.25rem 3rem; }
a { color: var(--link); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}
hr { border: 0; border-top: 1px solid var(--hair); margin: 2.75rem 0; }
img, svg.mark { max-width: 100%; }

/* -------------------------------------------------------------------- head */
.site {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--hair);
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: inherit; }
.brand img { width: 26px; height: 26px; flex: none; border-radius: 6px; }
.wordmark {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.tagline { color: var(--ink-2); margin: 0.2rem 0 0; font-size: 0.925rem; }

nav.main { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-left: auto; }
nav.main a {
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 7px;
}
nav.main a:hover { background: var(--wash); color: var(--ink); }
nav.main a[aria-current="page"] { background: var(--wash); color: var(--ink); font-weight: 600; }

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.seg button {
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.2;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
}
.seg button:hover { background: var(--wash); }
.seg button[aria-pressed="true"] {
  background: color-mix(in oklab, var(--s1) 12%, var(--surface));
  color: var(--ink);
  font-weight: 600;
}

/* -------------------------------------------------------------------- hero */
.lede { max-width: 40rem; }
.lede h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
.lede p { color: var(--ink-2); margin: 0 0 1rem; font-size: 1.0625rem; }
.cta { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.25rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9375rem;
  text-decoration: none;
  border-radius: 9px;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--hair);
  background: var(--surface);
  color: var(--ink);
}
.btn:hover { background: var(--wash); }
.btn.primary {
  background: var(--s1);
  border-color: var(--s1);
  color: #fff;
}
.btn.primary:hover { filter: brightness(1.06); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 0.25rem 0.7rem 0.25rem 0.55rem;
  text-decoration: none;
}
.pill .beacon {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--good);
  position: relative;
  flex: none;
}
.pill .beacon::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--good);
  animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.pill.is-warning .beacon, .pill.is-warning .beacon::after { background: var(--warning); }
@keyframes ping {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}
.hero-fig {
  font-size: 3.5rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0.9rem 0 0;
}
.hero-fig .unit { font-size: 1.5rem; font-weight: 500; color: var(--ink-2); }
.hero-cap { margin: 0.45rem 0 0; color: var(--muted); font-size: 0.8125rem; }
.hero {
  display: grid;
  grid-template-columns: minmax(14rem, 20rem) 1fr;
  gap: 1.5rem 2.5rem;
  align-items: end;
  margin-bottom: 2rem;
}
@media (max-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
}
.blurb { margin: 0; color: var(--ink-2); max-width: 34rem; }

/* ----------------------------------------------------------------- filters */
.filters {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--hair);
}
.filters .flabel {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.ghost {
  font: inherit;
  font-size: 0.8125rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}
.ghost:hover { background: var(--wash); }
.clock {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------- grid */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.85rem;
}
.card {
  grid-column: span 12;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.1rem;
  min-width: 0;
  position: relative;
}
.card.tile { grid-column: span 6; }
@media (min-width: 780px) {
  .card.tile { grid-column: span 3; }
  .card.c7 { grid-column: span 7; }
  .card.c5 { grid-column: span 5; }
  .card.c8 { grid-column: span 8; }
  .card.c4 { grid-column: span 4; }
  .card.c6 { grid-column: span 6; }
}
.card-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.card-head h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
}
.card-head .sub { font-size: 0.75rem; color: var(--muted); margin: 0; }
.card-head .act { margin-left: auto; }
.act button {
  font: inherit;
  font-size: 0.75rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
}
.act button:hover { color: var(--ink-2); background: var(--wash); }

/* -------------------------------------------------------------- stat tiles */
.tile .label { font-size: 0.75rem; color: var(--muted); margin: 0; }
.tile .value {
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0.3rem 0 0;
}
.tile .value .unit { font-size: 0.9375rem; font-weight: 500; color: var(--ink-2); }
.tile .delta { font-size: 0.75rem; color: var(--ink-2); margin: 0.3rem 0 0; }
.tile .delta .arrow { font-size: 0.6875rem; }
.tile .delta.is-good { color: var(--up-good); }
.tile .delta.is-bad  { color: var(--critical); }
.tile .spark { display: block; margin-top: 0.6rem; width: 100%; height: 28px; }

/* ------------------------------------------------------------------ charts */
.plot { position: relative; width: 100%; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot svg:focus { outline: none; }
.plot svg:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.ax { font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.ax.x { text-anchor: middle; }
.ax.y { text-anchor: end; }
.gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.endlab { font-size: 11px; fill: var(--ink-2); font-weight: 600; }
.crosshair { stroke: var(--axis); stroke-width: 1; pointer-events: none; opacity: 0; }
.cursor-dot { stroke: var(--surface); stroke-width: 2; opacity: 0; }

.legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-2);
}
.legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend i { width: 14px; height: 2px; border-radius: 1px; background: currentColor; display: inline-block; }

.tip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  min-width: 8.5rem;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(11, 11, 11, 0.10);
  padding: 0.5rem 0.6rem;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.tip.on { opacity: 1; }
.tip .when { color: var(--muted); margin-bottom: 0.3rem; font-variant-numeric: tabular-nums; }
.tip .row { display: flex; align-items: baseline; gap: 0.45rem; }
.tip .row i { width: 10px; height: 2px; border-radius: 1px; flex: none; }
.tip .row .v { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; margin-left: auto; }
.tip .row .n { color: var(--ink-2); }

/* ------------------------------------------------------------------ tables */
.tbl-wrap { max-height: 15rem; overflow: auto; margin-top: 0.25rem; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
table.tbl th, table.tbl td {
  text-align: left;
  padding: 0.35rem 0.5rem 0.35rem 0;
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
}
table.tbl th {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--muted);
  position: sticky;
  top: 0;
  background: var(--surface);
}
table.tbl td.num, table.tbl th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 0;
}
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ meters */
.meters { display: grid; gap: 0.8rem; }
.meter .top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.8125rem;
  margin-bottom: 0.3rem;
}
.meter .top .n { color: var(--ink-2); }
.meter .top .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.meter .track {
  height: 8px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--fill) 20%, var(--surface));
  overflow: hidden;
}
.meter .fill {
  height: 100%;
  border-radius: 4px;
  background: var(--fill);
  transition: width 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.meter { --fill: var(--s1); }
.meter.is-warning  { --fill: var(--warning); }
.meter.is-critical { --fill: var(--critical); }

/* -------------------------------------------------------------- node table */
.stat { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.stat .glyph { font-size: 0.6875rem; line-height: 1; }
.stat.good     { color: var(--up-good); }
.stat.warning  { color: var(--ink-2); }
.stat.serious  { color: var(--ink-2); }
.stat.critical { color: var(--critical); }
.stat.warning .glyph  { color: var(--warning); }
.stat.serious .glyph  { color: var(--serious); }
.tile .stat { display: inline; white-space: normal; }
.bar-cell { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; }
.bar-cell .track {
  width: 3.25rem; height: 6px; border-radius: 3px;
  background: color-mix(in oklab, var(--s1) 20%, var(--surface));
  overflow: hidden;
  flex: none;
}
.bar-cell .fill { height: 100%; background: var(--s1); border-radius: 3px; }

/* ----------------------------------------------------------------- heatmap */
.heat { display: block; width: 100%; height: auto; overflow: visible; }
.heat rect { rx: 2; ry: 2; }
.scale {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.6rem;
}
.scale i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }

/* -------------------------------------------------------------------- feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--hair);
  font-size: 0.8125rem;
}
.feed li:last-child { border-bottom: 0; }
.feed .ts {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  flex: none;
  min-width: 3.6rem;
}
.feed .what { color: var(--ink-2); }
.feed .what b { color: var(--ink); font-weight: 600; }
.feed li.fresh { animation: slide-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1); }
@keyframes slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------------- copy */
.note { color: var(--muted); font-size: 0.75rem; margin: 0.9rem 0 0; }
h2.section {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.9rem;
}
.prose { max-width: 42rem; }
.prose h2 { font-size: 1.25rem; letter-spacing: -0.01em; margin: 2rem 0 0.75rem; }
.prose h3 { font-size: 1rem; margin: 1.5rem 0 0.5rem; }
.prose p { margin: 0 0 1rem; color: var(--ink-2); }
.prose ul { margin: 0 0 1rem; padding-left: 1.15rem; }
.prose li { margin-bottom: 0.4rem; color: var(--ink-2); }
.prose .lead { font-size: 1.0625rem; color: var(--ink); }

.cards { display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.cards article {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.1rem;
}
.cards article h3 { margin: 0 0 0.4rem; font-size: 0.9375rem; }
.cards article p { margin: 0; color: var(--ink-2); font-size: 0.875rem; }

.entries { list-style: none; margin: 0; padding: 0; }
.entries li { padding: 0.9rem 0; border-bottom: 1px solid var(--hair); }
.entries li:last-child { border-bottom: 0; }
.entries a { font-size: 1.0625rem; text-decoration: none; font-weight: 600; }
.entries a:hover { text-decoration: underline; }
.entries p { margin: 0.25rem 0 0; color: var(--ink-2); font-size: 0.9375rem; }
.entries time { display: block; color: var(--muted); font-size: 0.75rem; margin-bottom: 0.15rem; }

dl.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; font-size: 0.9375rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 0.8125rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
footer a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
