/* One stylesheet, no fonts to fetch, no framework.
 *
 * Every byte here is served from the same host as the page, because the content
 * security policy forbids anything else and because a status page that waits on
 * a CDN has borrowed somebody else's outage. System fonts for the same reason:
 * a webfont is a request that can hang.
 *
 * Colour is never the only carrier of state — every pill also says the word, and
 * every bar has a title — so this reads correctly to somebody who cannot
 * distinguish the green from the red. */

:root {
  --bg: #ffffff;
  --fg: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --panel: #fafafa;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --unknown: #a1a1aa;
  --ok-soft: #f0fdf4;
  --warn-soft: #fffbeb;
  --bad-soft: #fef2f2;
  --unknown-soft: #f4f4f5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --fg: #f4f4f5;
    --muted: #a1a1aa;
    --line: #27272a;
    --panel: #131316;
    --ok: #22c55e;
    --warn: #f59e0b;
    --bad: #ef4444;
    --unknown: #71717a;
    --ok-soft: #0c1f14;
    --warn-soft: #241a06;
    --bad-soft: #260f0f;
    --unknown-soft: #1a1a1d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  /* Percentages and dates sit in columns all over this page; proportional
     figures make them ragged. */
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:hover { text-decoration: underline; }

.top, .bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem;
}
.top { border-bottom: 1px solid var(--line); }
.bottom {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.wordmark { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; text-decoration: none; }
.top nav, .bottom nav { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: 0.9rem; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--fg); }

main { max-width: 60rem; margin: 0 auto; padding: 1.75rem 1.25rem 0; }

h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 0.35rem; }
h2 { font-size: 1.05rem; letter-spacing: -0.01em; margin: 2.5rem 0 0.9rem; }
h3 { font-size: 0.98rem; margin: 0 0 0.15rem; }

/* The banner. Its border carries the state as well as its background, so it
   survives a reader who has forced their own colours. */
.banner {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
}
.banner p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.banner-operational { background: var(--ok-soft); border-left-color: var(--ok); }
/* Grey, not yellow: "status unavailable" is a statement about our measuring and
   not about the service, and colouring it like a fault would make it one. */
.banner-unknown { background: var(--unknown-soft); border-left-color: var(--unknown); }
.banner-degraded, .banner-maintenance { background: var(--warn-soft); border-left-color: var(--warn); }
.banner-partial_outage { background: var(--warn-soft); border-left-color: var(--bad); }
.banner-major_outage { background: var(--bad-soft); border-left-color: var(--bad); }

/* Shown by status.js when the page itself has stopped being refreshed. A page
   frozen on good news is the failure this whole service exists to avoid, so the
   warning is as loud as the banner. */
.stale {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--bad);
  border-radius: 10px;
  background: var(--bad-soft);
  font-size: 0.9rem;
}

.notes {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.notes li {
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  background: var(--panel);
  font-size: 0.9rem;
  color: var(--fg);
}

.components { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.component {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  background: var(--panel);
}
.component-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}
.blurb { margin: 0; color: var(--muted); font-size: 0.85rem; max-width: 44rem; }
.detail { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--fg); }

.pill {
  flex: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.pill-operational { color: var(--ok); background: var(--ok-soft); }
.pill-degraded { color: var(--warn); background: var(--warn-soft); }
.pill-down { color: var(--bad); background: var(--bad-soft); }
.pill-unknown { color: var(--unknown); background: var(--unknown-soft); }

.history { margin-top: 0.85rem; }
.bars { display: flex; gap: 2px; height: 1.6rem; align-items: stretch; }
.bar { flex: 1 1 0; border-radius: 2px; min-width: 1px; }
.bar-operational { background: var(--ok); }
.bar-degraded { background: var(--warn); }
.bar-down { background: var(--bad); }
.bar-unknown { background: var(--unknown); opacity: 0.35; }
.history-legend {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.availability { font-variant-numeric: tabular-nums; }

.spark { display: block; width: 100%; height: 2.5rem; margin-top: 0.85rem; }
.spark polyline { fill: none; stroke: var(--muted); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

.incident {
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin: 0 0 0.7rem;
  background: var(--panel);
}
.incident-critical { border-left-color: var(--bad); }
.incident-major { border-left-color: var(--bad); }
.incident-minor { border-left-color: var(--warn); }
.incident-maintenance { border-left-color: var(--unknown); }
.incident-meta { margin: 0.3rem 0 0; font-size: 0.82rem; color: var(--muted); }
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  margin-right: 0.35rem;
}
.tag-critical, .tag-major { color: var(--bad); border-color: var(--bad); }
.tag-minor { color: var(--warn); border-color: var(--warn); }
.updates { list-style: none; margin: 0.9rem 0 0; padding: 0 0 0 1rem; border-left: 1px solid var(--line); }
.updates li { margin-bottom: 0.9rem; }
.updates p { margin: 0.15rem 0 0; font-size: 0.9rem; }
.update-at { font-size: 0.75rem; color: var(--muted); }
.resolved-at { color: var(--ok); }

.method p { font-size: 0.88rem; color: var(--muted); max-width: 44rem; }
.privacy { border-top: 1px solid var(--line); padding-top: 0.9rem; }
.empty { color: var(--muted); font-size: 0.9rem; }

@media (max-width: 32rem) {
  .component-head { flex-direction: column; }
  .bars { height: 1.2rem; gap: 1px; }
  /* The gaps, not the bars, are what run out of room on a phone: ninety 2px
     gaps are most of a 320px strip. Narrowing them keeps all ninety days
     visible, which is better than showing half the window and having the
     legend lie about which half. */
  .history-legend { font-size: 0.7rem; }
}
