@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #141413;
  --surface: #1a1a19;
  --surface-2: #1f1f1e;
  --line: #2e2e2d;
  --text: #edf6ef;
  --muted: #9ea69e;
  --faint: #6b716b;
  --ok: #21c55e;
  --warn: #f5b84a;
  --bad: #f87171;
  --maint: #8bd7ff;
  --none: #2a2c2a;
  --radius: 14px;
  --mono: ui-monospace, 'IBM Plex Mono', 'JetBrains Mono', SFMono-Regular, Menlo, monospace;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ok); }
:focus-visible { outline: 2px solid rgba(33, 197, 94, 0.6); outline-offset: 2px; border-radius: 6px; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}

.top { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; letter-spacing: -0.01em; }
.brand b { font-weight: 600; color: var(--muted); }
.toplink { color: var(--muted); font-size: 14px; }

/* overall */
.hero { padding: 28px 0 22px; }
.overall { display: flex; align-items: center; gap: 12px; }
.overall h1 { margin: 0; font-size: clamp(24px, 6vw, 32px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--faint); box-shadow: 0 0 0 4px rgba(255,255,255,0.04); }
[data-state="operational"] .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(33,197,94,0.14); animation: pulse 2.4s ease-in-out infinite; }
[data-state="degraded"] .dot, [data-state="maintenance"] .dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(245,184,74,0.15); }
[data-state="maintenance"] .dot { background: var(--maint); box-shadow: 0 0 0 4px rgba(139,215,255,0.15); }
[data-state="outage"] .dot { background: var(--bad); box-shadow: 0 0 0 4px rgba(248,113,113,0.16); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(33,197,94,0.05); } }
@media (prefers-reduced-motion: reduce) { [data-state="operational"] .dot { animation: none; } }
.checked { margin: 10px 0 0 24px; color: var(--muted); font: 13px/1.4 var(--mono); display: flex; gap: 12px; flex-wrap: wrap; }
.stale { color: var(--warn); }

/* hint (TermHint): dashed underline, explanation on hover/focus/tap */
.hint { border-bottom: 1px dashed var(--faint); cursor: help; }
.tip {
  position: fixed; z-index: 10; max-width: min(320px, calc(100vw - 32px));
  background: #232422; color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font: 13px/1.45 var(--sans); box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  pointer-events: none;
}
.tip .t-mono { font-family: var(--mono); color: var(--muted); display: block; margin-top: 2px; }

/* active incidents */
.active { display: grid; gap: 10px; margin-bottom: 18px; }
.incident-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; border-left: 3px solid var(--warn);
}
.incident-card[data-impact="outage"] { border-left-color: var(--bad); }
.incident-card[data-impact="maintenance"] { border-left-color: var(--maint); }
.incident-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.incident-card .upd { margin: 8px 0 0; color: var(--text); }
.meta { color: var(--muted); font: 12.5px/1.4 var(--mono); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pill { font: 600 11px/1 var(--sans); text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 7px; border-radius: 999px; background: rgba(245,184,74,0.14); color: var(--warn); }
.pill[data-s="resolved"], .pill[data-s="completed"] { background: rgba(33,197,94,0.12); color: var(--ok); }
.pill[data-s="investigating"] { background: rgba(248,113,113,0.13); color: var(--bad); }
.pill[data-s="scheduled"], .pill[data-s="in-progress"] { background: rgba(139,215,255,0.13); color: var(--maint); }

/* components */
.components { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.comp { border-top: 1px solid var(--line); }
.comp:first-child { border-top: 0; }
.comp > button {
  all: unset; box-sizing: border-box; display: block; width: 100%; padding: 15px 16px 13px; cursor: pointer;
}
.comp > button:hover { background: var(--surface-2); }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.name { font-weight: 550; letter-spacing: -0.01em; }
.state { font-size: 13.5px; font-weight: 550; color: var(--ok); white-space: nowrap; }
.state[data-s="degraded"] { color: var(--warn); }
.state[data-s="outage"] { color: var(--bad); }
.state[data-s="maintenance"] { color: var(--maint); }
.state[data-s="unknown"] { color: var(--faint); }
.bars { display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; height: 30px; margin: 11px 0 7px; }
.bars i { display: block; border-radius: 2px; background: var(--ok); opacity: 0.9; }
.bars i[data-w="1"] { background: var(--warn); }
.bars i[data-w="2"] { background: var(--bad); }
.bars i[data-w="-"] { background: var(--none); }
.bars i:hover { opacity: 1; transform: scaleY(1.08); }
.sub { display: flex; justify-content: space-between; color: var(--muted); font: 12.5px/1.4 var(--mono); }
.checks { display: none; margin: 0; padding: 2px 16px 14px; list-style: none; }
.comp[open] .checks { display: grid; gap: 6px; }
.check { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; color: var(--muted); }
.check .c-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.check[data-ok="false"] .c-dot { background: var(--bad); }
.check[data-ok="false"] { color: var(--text); }
.check .ms { font: 12.5px var(--mono); }
.legend { display: flex; align-items: center; gap: 10px; color: var(--faint); font: 11.5px var(--mono); margin: 8px 2px 0; }
.legend .line { flex: 1; height: 1px; background: var(--line); }

/* past incidents */
.past h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin: 34px 0 10px; color: var(--muted); }
.incidents { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.incidents li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; border-left: 3px solid var(--warn); }
.incidents li[data-impact="outage"] { border-left-color: var(--bad); }
.incidents li[data-impact="maintenance"] { border-left-color: var(--maint); }
.incidents li.empty { border: 0; background: none; }
.incidents details > summary { list-style: none; padding: 12px 14px; cursor: pointer; display: grid; gap: 4px; }
.incidents details > summary::-webkit-details-marker { display: none; }
.incidents .title { font-weight: 550; }
.incidents .updates { margin: 0; padding: 0 14px 12px; list-style: none; display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.incidents .updates p { margin: 3px 0 0; }
.empty { color: var(--faint); font: 13px var(--mono); padding: 4px 2px; }
.more { all: unset; cursor: pointer; color: var(--muted); font: 13px var(--mono); margin-top: 10px; padding: 6px 2px; }
.more:hover { color: var(--text); }

.foot { display: flex; gap: 18px; flex-wrap: wrap; color: var(--faint); font-size: 13px; margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--line); }
.noscript { text-align: center; color: var(--muted); }

@media (min-width: 640px) {
  body { font-size: 15.5px; }
  .hero { padding: 44px 0 28px; }
  .bars { height: 34px; gap: 3px; }
}
