/* The server's Content-Security-Policy allows no inline styles and no
   third-party hosts, so every rule lives here and both fonts are served from
   /fonts. app.mjs only switches classes and sets a few CSSOM properties. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --void: #07080a;
  --panel: #0c0e13;
  --rule: #1c212b;
  --rule-strong: #262b35;
  --ink: #e4e6ea;
  --ink-muted: #a3a8b3;
  --ink-soft: #b4b9c4;
  --faint: #7c828f;
  --up: #4ade80;
  --up-partial: #2f8f57;
  --down: #f87171;
  --maintenance: #3b82f6;
  --maintenance-text: #59a1ff;
  --link: #8fb4ff;
  --none: #232833;
  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink-soft); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, p, dl, dd { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--maintenance-text); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.page { max-width: 1080px; min-height: 100vh; margin: 0 auto; padding: 0 28px 64px; }

/* ── Header ─────────────────────────────────────────────────────────── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand img { display: block; }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.brand-tag {
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font: 12px var(--mono);
  letter-spacing: 0.08em;
  color: var(--faint);
}
.top-nav { display: flex; align-items: center; gap: 22px; font-size: 15px; font-weight: 500; }
.top-nav .help { color: var(--link); }
.top-nav .help:hover { color: #fff; }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero { display: flex; flex-direction: column; gap: 24px; padding: 56px 0 48px; }
.hero-state { display: flex; align-items: center; gap: 12px; font: 12px var(--mono); letter-spacing: 0.1em; }
.hero-state.up { color: var(--up); }
.hero-state.down { color: var(--down); }
.hero-state.maintenance { color: var(--maintenance-text); }
.hero-state.pending, .hero-state.unknown { color: var(--ink-muted); }
.pulse { position: relative; flex: none; width: 8px; height: 8px; }
.pulse span { position: absolute; inset: 0; border-radius: 50%; background: currentColor; }
.pulse span:first-child { opacity: 0; }
.hero-state.down .pulse span:first-child,
.hero-state.maintenance .pulse span:first-child { animation: pulse 1.8s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(3.2); opacity: 0; }
}
h1 {
  max-width: 12em;
  font-size: clamp(44px, 7.4vw, 104px);
  font-weight: 500;
  font-variation-settings: "opsz" 96;
  line-height: 0.94;
  letter-spacing: -0.045em;
  text-wrap: balance;
  color: #fff;
}
.hero-body { max-width: 34em; font-size: 19px; color: var(--ink-muted); text-wrap: pretty; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 16px; border-top: 1px solid var(--rule); }
.stats > div { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 4px 0; }
.stats dt { font: 11px var(--mono); letter-spacing: 0.1em; color: var(--faint); }
.stats dd { font-size: 28px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: #fff; }
.stats dd.down { color: var(--down); }
.stats dd.maintenance { color: var(--maintenance-text); }

/* ── Sections ───────────────────────────────────────────────────────── */
.block { display: flex; flex-direction: column; gap: 20px; padding-bottom: 88px; }
.block-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 500; line-height: 1.05; letter-spacing: -0.035em; color: #fff; }
.split { flex-direction: row; flex-wrap: wrap; gap: 24px 64px; }
.split-intro { display: flex; flex: 1 1 240px; flex-direction: column; gap: 12px; }
.split-intro p { max-width: 22em; color: var(--ink-muted); text-wrap: pretty; }
.split-body { flex: 2.4 1 520px; min-width: 0; }
.rows { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.empty { padding: 18px 0; border-bottom: 1px solid var(--rule); font-size: 15px; color: var(--faint); }
.mono-note { font: 11px var(--mono); letter-spacing: 0.06em; }
.mono-date { font: 12px var(--mono); color: var(--faint); }

.ranges { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); }
.ranges button {
  padding: 6px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font: 12px var(--mono);
  color: var(--faint);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ranges button:hover { color: var(--ink); }
.ranges button[aria-pressed="true"] { background: var(--rule); color: #fff; }

/* ── Services ───────────────────────────────────────────────────────── */
.service { display: flex; flex-direction: column; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.row-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.service-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.service-name { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; color: #fff; }
.service-host { font: 12px var(--mono); color: var(--faint); }
.service-figures { display: flex; align-items: baseline; gap: 20px; font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.service-figures .latency { color: var(--ink-muted); }
.state { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state.up { color: var(--up); }
.state.down { color: var(--down); }
.state.maintenance { color: var(--maintenance-text); }
.state.pending, .state.unknown, .state.done { color: var(--faint); }
.chevron { display: inline-block; color: var(--faint); transition: transform 0.2s ease; }
[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.bars { display: flex; gap: 2px; height: 30px; }
.bar { flex: 1; min-width: 1px; border-radius: 2px; background: var(--none); transition: opacity 0.12s ease; }
.bar.up { background: var(--up); opacity: 0.82; }
.bar.up.partial { background: var(--up-partial); }
.bar.down { background: var(--down); }
.bar.maintenance { background: var(--maintenance); }
.bars.reading .bar { opacity: 0.45; }
.bars.reading .bar.read { opacity: 1; }
.axis { display: flex; justify-content: space-between; gap: 12px; font: 11px var(--mono); letter-spacing: 0.04em; color: var(--faint); }
.readout { text-align: right; }
.readout.live { color: var(--ink); }

.detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px 40px; padding: 16px 0 4px; }
.detail-chart { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.detail-label { font: 11px var(--mono); letter-spacing: 0.1em; color: var(--faint); }
.detail-note { font-size: 14px; color: var(--ink-muted); text-wrap: pretty; }
.spark { display: block; width: 100%; height: 90px; overflow: visible; }
.facts { display: flex; flex-direction: column; align-self: start; border-top: 1px solid var(--rule); }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font: 11px var(--mono); letter-spacing: 0.08em; color: var(--faint); }
.facts dd { font-size: 14px; font-variant-numeric: tabular-nums; }

.legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 13px; color: var(--faint); }
.legend-keys { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legend-keys span { display: flex; align-items: center; gap: 7px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--none); }
.swatch.up { background: var(--up); }
.swatch.down { background: var(--down); }
.swatch.maintenance { background: var(--maintenance); }

/* ── Incidents and maintenance ──────────────────────────────────────── */
.notice { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); }
.notice .row-toggle { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 4px 20px; padding: 18px 0; }
.notice-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.notice-title { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; text-wrap: pretty; color: #fff; }
.notice-meta { font-size: 14px; color: var(--ink-muted); }
.notice .state { font: 12px var(--mono); }
.updates { display: flex; flex-direction: column; gap: 16px; padding: 0 0 22px 116px; }
.update { display: flex; flex-direction: column; gap: 4px; padding-left: 18px; border-left: 1px solid var(--rule-strong); }
.update-when { font: 11px var(--mono); letter-spacing: 0.08em; color: var(--faint); }
.update-when b { font-weight: 400; color: var(--ink); }
.update-message { max-width: 36em; font-size: 15px; line-height: 1.55; color: var(--ink-soft); text-wrap: pretty; }
.since { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; padding: 18px 0; font-size: 14px; color: var(--faint); }

/* ── Releases ───────────────────────────────────────────────────────── */
.release { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.release img { display: block; }
.release-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.release-name { font-size: 17px; font-weight: 500; color: #fff; }
.release-channel { font-size: 14px; color: var(--faint); }
.release-version { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.release-version b { font: 13px var(--mono); font-weight: 400; color: var(--ink); }
.release-version span { font-size: 13px; color: var(--ink-muted); }
.release.unverified .release-version span { color: var(--faint); }

/* ── Footer ─────────────────────────────────────────────────────────── */
.bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--faint); }
.bottom div { display: flex; gap: 20px; }
.noscript { max-width: 1080px; margin: 0 auto; padding: 0 28px 40px; color: var(--ink-muted); }

@media (max-width: 640px) {
  .page { padding: 0 20px 48px; }
  .top-nav a:not(.help) { display: none; }
  .hero { padding: 36px 0 40px; }
  .block { padding-bottom: 64px; }
  .service-figures { gap: 14px; }
  .notice .row-toggle { grid-template-columns: minmax(0, 1fr) auto; }
  .notice .row-toggle .mono-date { grid-column: 1 / -1; }
  .updates { padding-left: 0; }
  .since { grid-template-columns: 1fr; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
