:root {
  --bg-0: #07090f;
  --bg-1: #0d111b;
  --bg-2: #131826;
  --bg-elev: #181f30;
  --text-0: #f4f6fb;
  --text-1: #c5cad8;
  --text-2: #b4bccb;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #2f7bff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(47, 123, 255, 0.1);
  --accent-glow: rgba(47, 123, 255, 0.45);
  --pos: #22c55e;
  --pos-soft: rgba(34, 197, 94, 0.12);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --neg: #f43f5e;
  --neg-soft: rgba(244, 63, 94, 0.12);
  --unk: #94a3b8;
  --unk-soft: rgba(148, 163, 184, 0.12);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 64px;
  --page-max: 1200px;
  --page-gutter: 24px;
  --aside-w: 280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg-0);
  color: var(--text-0);
  overflow-x: clip;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus { left: 12px; top: 12px; background: var(--bg-elev); padding: 8px 12px; z-index: 40; }

.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  box-sizing: border-box;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  padding: 12px 24px;
  background: color-mix(in srgb, var(--bg-0) 86%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text-0);
  text-decoration: none;
}
.brand:hover { text-decoration: none; opacity: 0.9; }
.brand-logo {
  height: 32px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}
.brand-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-0);
}
.brand-kicker {
  margin-top: 2px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
}

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--text-1);
  text-decoration: none;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
}
.nav a:hover { background: var(--bg-2); color: var(--text-0); text-decoration: none; }
.nav-cta {
  background: var(--accent);
  color: #fff !important;
}
.nav-cta:hover { background: #3d86ff !important; color: #fff !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  padding: 28px var(--page-gutter) 96px;
}
.hero,
.current,
.maint,
.incidents-board {
  width: 100%;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(47, 123, 255, 0.18), transparent 55%),
    radial-gradient(80% 80% at 100% 100%, rgba(34, 211, 238, 0.1), transparent 60%),
    linear-gradient(135deg, #0f1525 0%, #0a0e18 100%);
}
.hero[data-tone="operational"] {
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(34, 197, 94, 0.16), transparent 55%),
    linear-gradient(135deg, #0f1525 0%, #0a0e18 100%);
}
.hero[data-tone="degraded"],
.hero[data-tone="under_maintenance"] {
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(245, 158, 11, 0.16), transparent 55%),
    linear-gradient(135deg, #0f1525 0%, #0a0e18 100%);
}
.hero[data-tone="major_outage"] {
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(244, 63, 94, 0.18), transparent 55%),
    linear-gradient(135deg, #0f1525 0%, #0a0e18 100%);
}

.hero-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}
.hero h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
  text-wrap: balance;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-meta {
  margin: 10px 0 0;
  color: var(--text-1);
  font-size: 14px;
  max-width: 62ch;
}
.hero-stamp {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 12px;
}
.flash {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: var(--text-0);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.flash--visible {
  animation: flash-in 0.25s ease-out;
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 24px;
  width: 100%;
  max-width: 100%;
  align-items: start;
}
.layout > * {
  min-width: 0;
  max-width: 100%;
}
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, var(--aside-w)); }
}

.panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
  max-width: 100%;
}
.panel-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 16px 18px 0;
}
.panel-h h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.muted { color: var(--text-2); font-size: 12px; }

.group { padding: 8px 8px 12px; min-width: 0; }
.group-name {
  margin: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 16px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  transition: background 180ms var(--ease);
  min-width: 0;
}
.row:hover { background: var(--bg-2); }
.row-name { font-weight: 600; }
.row-meta { grid-column: 1 / -1; min-width: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.badge-operational { color: var(--pos); background: var(--pos-soft); }
.badge-degraded, .badge-under_maintenance { color: var(--warn); background: var(--warn-soft); }
.badge-major_outage { color: var(--neg); background: var(--neg-soft); }
.badge-status_unknown, .badge-unmonitored { color: var(--unk); background: var(--unk-soft); }

.metrics {
  display: grid;
  gap: 8px;
}
.metric-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
}
.compose {
  display: flex;
  height: 10px;
  margin-top: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-2);
}
.compose span { height: 100%; min-width: 0; }
.compose.mini { height: 6px; margin: 2px 0 6px; }
.fill { height: 100%; border-radius: inherit; }
.fill-pos { background: var(--pos); }
.fill-warn { background: var(--warn); }
.fill-unk { background: var(--unk); }

.current {
  margin-top: 20px;
  padding: 18px 18px 8px;
}
.current h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.current .lede {
  margin: 0 0 12px;
  color: var(--text-1);
  max-width: 70ch;
}

.maint {
  margin-top: 16px;
  padding: 16px 18px;
}
.maint h2 { margin: 0 0 8px; font-size: 16px; }
.maint-item { padding: 8px 0; border-top: 1px solid var(--border); }
.maint-item:first-of-type { border-top: 0; }

.cal {
  display: flex;
  gap: 1px;
  overflow: hidden;
  margin-top: 10px;
  min-height: 22px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.cal i {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 22px;
  border-radius: 2px;
  background: var(--unk);
}
.cal i.up { background: var(--pos); }
.cal i.partial { background: var(--warn); }
.cal i.down { background: var(--neg); }
.cal i.maintenance { background: var(--accent); }
.cal i.unknown { background: var(--unk); }
.cal-legend { margin: 6px 0 0; color: var(--text-2); font-size: 12px; }

.sub-comps {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}
.sub-comps label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--text-1);
  font-size: 13px;
}

.aside {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.stat {
  padding: 18px;
}
.stat-value {
  font-family: var(--font-num);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 6px 0 4px;
}
.stat p { margin: 0; color: var(--text-2); font-size: 13px; }

.incidents-board {
  margin-top: 24px;
}
.incidents-board #incident-detail:not([hidden]) {
  border-bottom: 1px solid var(--border);
}
.incident-story {
  padding: 8px 18px 18px;
}
.incident-story .back {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
}
.incident-story h2 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.incident {
  border-top: 1px solid var(--border);
}
.incident:first-child { border-top: 0; }
.incident-toggle {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 18px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.incident-toggle:hover { background: rgba(255, 255, 255, 0.02); }
.incident-expanded .incident-toggle { background: rgba(47, 123, 255, 0.06); }
.incident-row {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
}
.incident-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.incident-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}
.incident-when {
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.incident-chevron {
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  width: 1em;
  text-align: center;
}
.incident-preview {
  margin: 6px 0 0;
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.35;
}
.incident-body {
  padding: 0 18px 12px 18px;
  border-top: 1px solid var(--border);
}
.incident-body[hidden] { display: none; }
.incident-lede { margin: 8px 0 0; color: var(--text-1); font-size: 14px; }
.incident .scope, .current .scope {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 12px;
}
.incident .when { color: var(--text-2); font-size: 12px; margin-top: 6px; }
.incident .compact-meta { margin-top: 4px; }

@media (max-width: 560px) {
  .incident-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .incident-title {
    flex: 1 1 calc(100% - 2em);
    white-space: normal;
  }
  .incident-meta {
    width: 100%;
    padding-left: 0;
  }
  .incident-chevron {
    position: absolute;
    right: 18px;
    top: 12px;
  }
  .incident-toggle { position: relative; padding-right: 36px; }
}

.current .lede { margin: 8px 0 0; color: var(--text-1); font-size: 15px; line-height: 1.45; }
.current .when { margin: 6px 0 0; color: var(--text-2); font-size: 12px; }
.show-more { color: var(--accent); font-weight: 600; font-size: 13px; text-decoration: none; }
.show-more:hover { text-decoration: underline; }

.timeline { margin: 8px 0 0; padding: 0; list-style: none; }
.timeline-empty { margin: 0; font-size: 12px; }
.timeline li {
  position: relative;
  padding: 0 0 8px 12px;
  border-left: 1px solid var(--border-strong);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  font-size: 13px;
  line-height: 1.35;
}
.timeline-row .when {
  margin: 0;
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
}
.timeline-body {
  flex: 1 1 100%;
  color: var(--text-1);
}
.compact-meta { margin: 0 0 6px; font-size: 11px; }

.subscribe {
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.subscribe h2 { margin: 0; font-size: 16px; }
.subscribe .muted { margin: 0; }
.subscribe button { width: 100%; }
form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
input[type="email"] {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-0);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
}
input::placeholder { color: var(--text-1); }
button, .btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}
button:hover, .btn:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border);
}

.legal {
  margin-top: 40px;
  max-width: 72ch;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.55;
  text-wrap: pretty;
}
.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-1);
}

.skel {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-2), var(--bg-elev), var(--bg-2));
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.empty {
  padding: 18px;
  color: var(--text-2);
}
