:root {
  --bg: #0b1120;
  --bg-soft: #0f172a;
  --surface: #111c30;
  --surface-2: #16233b;
  --border: #233146;
  --border-soft: #1b2638;
  --text: #e7edf5;
  --text-dim: #9fb0c5;
  --text-mute: #6c7d96;
  --accent: #10b981;
  --accent-soft: #0e7d5a;
  --ok: #22c55e;
  --degraded: #f59e0b;
  --down: #ef4444;
  --maint: #6366f1;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 10px 30px -18px rgba(0,0,0,0.8);
  --maxw: 880px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(16,185,129,0.10), transparent 70%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #04130d;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(11,17,32,0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; }
.brand-sub { color: var(--text-mute); font-weight: 600; }
.header-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.92rem;
}
.header-nav a { color: var(--text-dim); }
.header-nav a:hover { color: var(--text); text-decoration: none; }
.btn-ghost {
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--text) !important;
}
.btn-ghost:hover { border-color: var(--accent); }

/* Banner */
.banner {
  margin-top: 28px;
}
.banner-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.banner--ok { --banner-color: var(--ok); }
.banner--degraded { --banner-color: var(--degraded); }
.banner--down { --banner-color: var(--down); }
.banner-inner {
  border-left: 4px solid var(--banner-color, var(--ok));
}
.banner-icon {
  color: var(--banner-color, var(--ok));
  display: inline-flex;
  flex: none;
}
.banner-copy { flex: 1 1 auto; min-width: 0; }
.banner-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.banner-meta {
  margin: 4px 0 0;
  color: var(--text-mute);
  font-size: 0.86rem;
}
.banner-uptime {
  text-align: right;
  flex: none;
}
.banner-uptime-num {
  display: block;
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
}
.banner-uptime-label {
  font-size: 0.74rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 4px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Active incident */
.incident-active {
  border-color: rgba(245,158,11,0.35);
  background: linear-gradient(180deg, rgba(245,158,11,0.06), var(--surface) 120px);
}
.incident-active-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.incident-active-head h2 {
  margin: 0;
  font-size: 1.18rem;
}

/* Severity pills */
.sev-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.sev-minor { background: rgba(245,158,11,0.16); color: #fbbf24; }
.sev-major { background: rgba(239,68,68,0.16); color: #f87171; }
.sev-maint { background: rgba(99,102,241,0.18); color: #a5b4fc; }

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 0 0 18px 4px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 22px;
  bottom: -2px;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-tag {
  position: relative;
  flex: none;
  width: 104px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-left: 22px;
  line-height: 1.7;
  color: var(--text-dim);
}
.timeline-tag::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-mute);
  box-shadow: 0 0 0 3px var(--surface);
}
.tag-investigating { color: #f87171; }
.tag-investigating::before { background: var(--down); }
.tag-identified { color: #fbbf24; }
.tag-identified::before { background: var(--degraded); }
.tag-monitoring { color: #60a5fa; }
.tag-monitoring::before { background: #3b82f6; }
.tag-resolved { color: #34d399; }
.tag-resolved::before { background: var(--ok); }
.timeline-item.is-current .timeline-tag::before {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px rgba(96,165,250,0.25);
}
.timeline-body {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 1px;
}
.timeline-body p {
  margin: 0 0 4px;
  font-size: 0.94rem;
  color: var(--text);
}
.timeline-body time {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-mute);
}

/* Components */
.components-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.76rem;
  color: var(--text-mute);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-up { background: var(--ok); }
.dot-degraded { background: var(--degraded); }
.dot-down { background: var(--down); }
.dot-maint { background: var(--maint); }

.component-list { list-style: none; margin: 0; padding: 0; }
.component-row {
  padding: 16px 0;
  border-top: 1px solid var(--border-soft);
}
.component-row:first-child { border-top: none; padding-top: 4px; }
.component-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.component-name {
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 9px;
}
.component-name .dot { width: 10px; height: 10px; }
.component-desc {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-mute);
  margin-top: 1px;
  padding-left: 19px;
}
.component-status {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-up { color: #34d399; }
.status-degraded { color: #fbbf24; }
.status-down { color: #f87171; }
.status-maint { color: #a5b4fc; }

/* 90-day uptime bar */
.uptime-bar {
  display: flex;
  gap: 2px;
  align-items: stretch;
  height: 34px;
}
.uptime-cell {
  flex: 1 1 0;
  border-radius: 2px;
  background: var(--ok);
  min-width: 0;
  transition: transform 0.08s ease;
}
.uptime-cell:hover { transform: scaleY(1.12); }
.uptime-cell.c-up { background: #1f9e6b; }
.uptime-cell.c-degraded { background: var(--degraded); }
.uptime-cell.c-down { background: var(--down); }
.uptime-cell.c-maint { background: var(--maint); }
.uptime-cell.c-nodata { background: var(--border); }
.uptime-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7px;
  font-size: 0.74rem;
  color: var(--text-mute);
}
.uptime-pct { font-family: var(--mono); color: var(--text-dim); }

/* Maintenance */
.maint-item {
  display: flex;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--border-soft);
}
.maint-item:first-of-type { border-top: none; padding-top: 8px; }
.maint-when {
  flex: none;
  width: 58px;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 0;
  align-self: flex-start;
}
.maint-date { display: block; font-weight: 700; font-size: 0.92rem; }
.maint-year { display: block; font-size: 0.7rem; color: var(--text-mute); }
.maint-body h3 { margin: 0 0 5px; font-size: 1rem; font-weight: 600; }
.maint-body p { margin: 0 0 4px; font-size: 0.92rem; color: var(--text-dim); }
.maint-window { font-size: 0.84rem !important; color: var(--text-mute) !important; }
.maint-body code, .maint-body strong { color: var(--text); }
.maint-body code { font-family: var(--mono); font-size: 0.84em; }

/* History */
.history-day { margin-top: 6px; }
.history-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 0 12px;
  border-top: 1px solid var(--border-soft);
  margin: 0;
}
.history-day:first-of-type .history-date { border-top: none; padding-top: 4px; }
.history-incident header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.history-incident h4 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  flex: 1 1 240px;
}
.history-duration {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-mute);
  flex: none;
}
.timeline--compact .timeline-item { padding-bottom: 14px; }
.timeline--compact .timeline-body p { font-size: 0.9rem; color: var(--text-dim); }
.history-more { margin: 18px 0 0; font-size: 0.92rem; }

/* Subscribe */
.subscribe { background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.subscribe-copy p { margin: 6px 0 18px; color: var(--text-dim); font-size: 0.95rem; }
.subscribe-form { max-width: 520px; }
.field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text-dim);
}
.field-row { display: flex; gap: 10px; }
.field-row input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
.field-row input::placeholder { color: var(--text-mute); }
.field-row input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(16,185,129,0.18); }
.field-row input[aria-invalid="true"] { border-color: var(--down); box-shadow: 0 0 0 3px rgba(239,68,68,0.16); }
.btn-primary {
  flex: none;
  background: var(--accent);
  color: #04130d;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn-primary:hover { background: #34d399; }
.btn-primary:active { transform: translateY(1px); }
.field-error { margin: 8px 0 0; font-size: 0.84rem; color: #f87171; }
.field-note { margin: 8px 0 0; font-size: 0.8rem; color: var(--text-mute); }
.subscribe-success {
  margin: 14px 0 0;
  font-size: 0.95rem;
  color: #34d399;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 10px;
  padding: 12px 16px;
}
.subscribe-success strong { color: var(--text); }
.subscribe-alt {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-mute);
}

/* Footer */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border-soft);
  padding: 24px 0 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--text-mute);
}
.footer-inner p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer nav a { color: var(--text-dim); }

@media (max-width: 640px) {
  .banner-inner { flex-wrap: wrap; }
  .banner-uptime { text-align: left; width: 100%; padding-top: 12px; border-top: 1px solid var(--border-soft); display: flex; align-items: baseline; gap: 8px; }
  .banner-uptime-label { padding-bottom: 1px; }
  .header-nav { gap: 14px; }
  .header-nav a:not(.btn-ghost) { display: none; }
  .timeline-item { flex-direction: column; gap: 4px; }
  .timeline-item::before { display: none; }
  .timeline-tag { width: auto; padding-left: 20px; }
  .uptime-bar { height: 30px; }
  .card { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .uptime-cell { transition: none; }
}
