/* style.css — theme-matched to dzhub.xyz's dark surface.
   Tokens live at the top; the rest of the file only reads them. */

:root {
  color-scheme: dark;

  --bg:          oklch(15% 0.005 280);
  --bg-deep:     oklch(11% 0.005 280);
  --bg-card:    oklch(17% 0.005 280);
  --line:        oklch(24% 0.005 280);
  --line-mid:    oklch(30% 0.005 280);
  --text:        oklch(94% 0.005 280);
  --muted:       oklch(66% 0.005 280);
  --faint:       oklch(46% 0.005 280);

  --up:          oklch(70% 0.19 145);
  --up-dim:      oklch(45% 0.14 145);
  --degraded:    oklch(78% 0.18 75);
  --degraded-dim: oklch(52% 0.14 75);
  --down:        oklch(66% 0.22 25);
  --down-dim:    oklch(42% 0.17 25);
  --nodata:      oklch(28% 0.005 280);

  --radius:      12px;
  --radius-sm:   6px;
  --font-body:   ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:   ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --fs-body:     14px;
  --fs-meta:     12px;
  --fs-title:    16px;
  --fs-h1:       clamp(28px, 4.5vw, 44px);
  --fs-h2:       15px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body)/1.55 var(--font-body);
  min-height: 100dvh;
}
a { color: var(--muted); }
a:hover { color: var(--text); }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ─── Brand ───────────────────────────────────────── */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}
.brand__mark {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--up) 0%, var(--up-dim) 100%);
  box-shadow: 0 0 0 1px var(--line);
}
.brand__name {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: var(--fs-title);
}
.brand__home {
  margin-left: auto;
  font-size: var(--fs-meta);
  text-decoration: none;
  color: var(--faint);
}
.brand__home:hover { color: var(--text); }

/* ─── Hero banner ─────────────────────────────────── */

.hero {
  margin-bottom: 46px;
}
.hero__title {
  margin: 0;
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--up);
}
.hero[data-status="minor"] .hero__title,
.hero[data-status="degraded"] .hero__title { color: var(--degraded); }
.hero[data-status="major"] .hero__title,
.hero[data-status="down"]  .hero__title { color: var(--down); }
.hero[data-status="loading"] .hero__title,
.hero[data-status="unknown"] .hero__title { color: var(--muted); }

.hero__sub {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: var(--fs-body);
}
.hero__sub a { text-decoration: underline; text-decoration-color: var(--line-mid); }

/* ─── Section blocks ──────────────────────────────── */

.block { margin-bottom: 36px; }
.block__title {
  margin: 0 0 14px;
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}
.block__note {
  margin: -8px 0 14px;
  color: var(--faint);
  font-size: var(--fs-meta);
}

/* ─── Service cards (with 90-day bars) ────────────── */

.cards { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.card__name {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: none;
}
.card__status {
  margin-left: auto;
  font-size: var(--fs-meta);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.card[data-status="operational"] .card__status { color: var(--up); }
.card[data-status="degraded"]    .card__status { color: var(--degraded); }
.card[data-status="down"]        .card__status { color: var(--down); }
.card[data-status="unknown"]     .card__status { color: var(--faint); }

.bars {
  display: flex;
  gap: 3px;
  height: 34px;
  align-items: stretch;
}
.bar {
  flex: 1;
  border-radius: 2px;
  background: var(--nodata);
  min-width: 3px;
  transition: transform 120ms ease-out;
  position: relative;
}
.bar[data-state="up"]       { background: var(--up-dim); }
.bar[data-state="degraded"] { background: var(--degraded-dim); }
.bar[data-state="down"]     { background: var(--down-dim); }
.bar:hover { transform: scaleY(1.08); }
.bar:hover::after {
  content: attr(data-title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}
.card__foot {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--faint);
  font-size: var(--fs-meta);
}

/* ─── Probes list ─────────────────────────────────── */

.probes {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.probe {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
}
.probe__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--nodata);
  box-shadow: 0 0 0 2px var(--bg-card);
}
.probe[data-status="up"]       .probe__dot { background: var(--up); }
.probe[data-status="degraded"] .probe__dot { background: var(--degraded); }
.probe[data-status="down"]     .probe__dot { background: var(--down); }
.probe__name {
  font-size: var(--fs-body);
  font-weight: 500;
}
.probe__ms {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.probe[data-status="down"] .probe__ms { color: var(--down); }

/* ─── Incidents ───────────────────────────────────── */

.incidents { display: flex; flex-direction: column; gap: 12px; }
.incident {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
}
.incident__name { font-weight: 600; }
.incident__when { color: var(--muted); font-size: var(--fs-meta); }
.incident__meta {
  grid-column: 1 / -1;
  color: var(--faint);
  font-size: var(--fs-meta);
  font-family: var(--font-mono);
}
.incidents__empty {
  color: var(--faint);
  font-size: var(--fs-body);
  padding: 22px;
  background: var(--bg-card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

/* ─── Footer ──────────────────────────────────────── */

.foot {
  margin-top: 48px;
  color: var(--faint);
  font-size: var(--fs-meta);
  text-align: center;
}

/* ─── Responsive ──────────────────────────────────── */

@media (max-width: 640px) {
  .wrap { padding: 24px 16px 60px; }
  .bars { height: 26px; }
  .card__foot { flex-direction: column; gap: 4px; }
}
