@font-face {
  font-family: 'Instrument Sans';
  src: url('./instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('./jetbrains-mono.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-canvas: #f8faf9;
  --bg-surface: #ffffff;
  --bg-dark: #0b1614;
  --bg-dark-elevated: #122320;
  --ink-primary: #0f1c18;
  --ink-secondary: #475852;
  --ink-muted: #6b7d76;
  --border-subtle: #e2e8e5;
  --border-strong: #cdd7d2;
  --accent: #0f6b4e;
  --signal-ok: #10b981;
  --signal-ok-bright: #34d399;
  --signal-warn: #f59e0b;
  --signal-down: #ef4444;
  --signal-maint: #3b82f6;
  --bar-empty: #e4eae7;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[hidden] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.container {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: rgba(248, 250, 249, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-primary);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.015em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
}

.brand-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f4ef;
  color: var(--accent);
  border: 1px solid #cce6dc;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  font-weight: 500;
}

.header-nav a {
  color: var(--ink-secondary);
}

.header-nav a:hover {
  color: var(--ink-primary);
  text-decoration: none;
}

/* Main */
.main-content {
  padding-top: 32px;
  padding-bottom: 56px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Hero status banner */
.hero-status {
  background: linear-gradient(155deg, var(--bg-dark) 0%, var(--bg-dark-elevated) 100%);
  color: #f3f7f5;
  border-radius: var(--radius-lg);
  padding: 28px 28px 20px;
  border: 1px solid rgba(52, 211, 153, 0.18);
  box-shadow: 0 12px 32px rgba(11, 22, 20, 0.12);
}

.hero-status.state-degraded {
  border-color: rgba(245, 158, 11, 0.35);
}

.hero-status.state-outage,
.hero-status.state-partial_outage {
  border-color: rgba(239, 68, 68, 0.45);
}

.hero-status.state-maintenance {
  border-color: rgba(59, 130, 246, 0.4);
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-headline-group {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 560px;
}

.status-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 8px;
  flex: 0 0 14px;
  background: #64748b;
  box-shadow: 0 0 0 5px rgba(100, 116, 139, 0.25);
}

.state-operational .status-indicator {
  background: var(--signal-ok-bright);
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.22);
  animation: pulse 2.6s ease-in-out infinite;
}

.state-degraded .status-indicator {
  background: var(--signal-warn);
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.25);
}

.state-outage .status-indicator,
.state-partial_outage .status-indicator {
  background: var(--signal-down);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.28);
}

.state-maintenance .status-indicator {
  background: var(--signal-maint);
  box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.28);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.22);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(52, 211, 153, 0.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .state-operational .status-indicator {
    animation: none;
  }
}

.hero-status h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.hero-detail {
  margin: 6px 0 0;
  font-size: 14px;
  color: #b4c8c0;
}

.hero-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.meta-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #88a399;
}

.meta-value {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.hero-foot {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #8fa89e;
}

.refresh-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  color: #e6f2ed;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.refresh-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Sections */
.section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.section-note {
  font-size: 12px;
  color: var(--ink-muted);
}

.section-link {
  font-size: 13px;
  font-weight: 500;
}

/* Services */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.service-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(15, 28, 24, 0.03);
}

.service-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.service-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.service-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
}

.service-mode-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f3;
  color: var(--ink-secondary);
  border: 1px solid var(--border-subtle);
}

.service-desc {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--ink-secondary);
}

.service-status-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-latency {
  font-size: 12px;
  color: var(--ink-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.status-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-badge.badge-operational {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.status-badge.badge-operational::before {
  background: var(--signal-ok);
}

.status-badge.badge-degraded {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.status-badge.badge-degraded::before {
  background: var(--signal-warn);
}

.status-badge.badge-down {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.status-badge.badge-down::before {
  background: var(--signal-down);
}

/* 90-day uptime bars */
.uptime-bars {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr));
  gap: 2px;
  height: 30px;
  align-items: stretch;
}

.uptime-bar {
  border: 0;
  padding: 0;
  border-radius: 2px;
  background: var(--bar-empty);
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.1s ease;
}

.uptime-bar:hover,
.uptime-bar:focus-visible {
  transform: scaleY(1.12);
  filter: brightness(0.92);
  outline: none;
}

.uptime-bar.bar-ok {
  background: var(--signal-ok);
}

.uptime-bar.bar-degraded {
  background: var(--signal-warn);
}

.uptime-bar.bar-down {
  background: var(--signal-down);
}

.uptime-legend {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-muted);
}

.uptime-legend-mid {
  font-weight: 600;
  color: var(--ink-secondary);
}

/* Tooltip */
.bar-tooltip {
  position: fixed;
  z-index: 50;
  background: var(--bg-dark);
  color: #f3f7f5;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(11, 22, 20, 0.25);
  max-width: 240px;
}

.bar-tooltip-date {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}

.bar-tooltip-meta {
  color: #b8ccc4;
}

/* Incidents */
.incident-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.incident-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.incident-card.sev-outage {
  border-left-color: var(--signal-down);
}

.incident-card.sev-degraded {
  border-left-color: var(--signal-warn);
}

.incident-card.sev-maintenance {
  border-left-color: var(--signal-maint);
}

.incident-card.sev-resolved {
  border-left-color: var(--border-strong);
}

.incident-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.incident-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.incident-title a {
  color: var(--ink-primary);
}

.incident-title a:hover {
  color: var(--accent);
}

.incident-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.incident-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: capitalize;
  background: #f1f5f3;
  color: var(--ink-secondary);
}

.incident-tag.tag-outage {
  background: #fef2f2;
  color: #991b1b;
}

.incident-tag.tag-degraded {
  background: #fffbeb;
  color: #92400e;
}

.incident-tag.tag-maintenance {
  background: #eff6ff;
  color: #1e40af;
}

.incident-tag.tag-resolved {
  background: #ecfdf5;
  color: #065f46;
}

.incident-body {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  white-space: pre-line;
}

.incident-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.empty-state {
  margin: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  font-size: 14px;
  color: var(--ink-secondary);
}

.service-skeleton {
  height: 116px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #edf2f0 25%, #f5f8f7 50%, #edf2f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 24px 0 32px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-note {
  max-width: 520px;
}

.footer-note strong {
  color: var(--ink-primary);
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--ink-secondary);
}

.footer-links a:hover {
  color: var(--ink-primary);
}

@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    min-height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 10px 16px;
  }

  .header-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 13px;
  }

  .hero-status {
    padding: 22px 18px 16px;
  }

  .service-card {
    padding: 16px;
  }

  .uptime-bars {
    gap: 1px;
    height: 26px;
  }
}
