:root {
  --bg: #0a0a0f;
  --bg-2: #11121a;
  --bg-3: #161826;
  --fg: #f5f5f7;
  --muted: #8a8a96;
  --gold: #d4b48a;
  --gold-2: #e8c79b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --gold-bg: rgba(212, 180, 138, 0.08);
  --gold-border: rgba(212, 180, 138, 0.28);
  --up: #4ade80;
  --up-soft: rgba(74, 222, 128, 0.16);
  --up-border: rgba(74, 222, 128, 0.32);
  --degraded: #f5c563;
  --degraded-soft: rgba(245, 197, 99, 0.14);
  --degraded-border: rgba(245, 197, 99, 0.34);
  --down: #ff6b5e;
  --down-soft: rgba(255, 107, 94, 0.14);
  --down-border: rgba(255, 107, 94, 0.34);
  --unknown: #4a4a55;
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  overflow-x: hidden;
}

.bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 18% 8%, rgba(212, 180, 138, 0.14), transparent 40%),
    radial-gradient(circle at 82% 92%, rgba(212, 180, 138, 0.08), transparent 50%),
    var(--bg);
  pointer-events: none;
}

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

a {
  color: var(--gold-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
a:hover { border-bottom-color: var(--gold-2); }
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.muted { color: var(--muted); }
.gold { color: var(--gold-2); }

.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;
}
.skip-link {
  position: absolute; top: -40px; left: 12px;
  background: var(--gold);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 6px;
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--fg);
  border-bottom: none;
  letter-spacing: -0.01em;
}
.brand:hover { border-bottom: none; }
.brand-name { font-size: 16px; }
.brand-sub { color: var(--muted); font-weight: 400; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}
.nav-links {
  list-style: none; margin: 0 0 0 auto; padding: 0;
  display: flex; gap: 6px;
}
.nav-links a {
  display: inline-block;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 14px;
  border-radius: 6px;
  border-bottom: none;
}
.nav-links a:hover { color: var(--fg); border-bottom: none; }
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-inner { gap: 12px; }
}

/* Hero status banner */
.hero-status { padding: 56px 0 16px; }
@media (min-width: 800px) { .hero-status { padding: 80px 0 24px; } }

.hero-status-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 26px 30px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}
.hero-status-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.7;
  background: linear-gradient(180deg, var(--gold-bg) 0%, transparent 70%);
}
.hero-status-card[data-state="up"] { border-color: var(--up-border); }
.hero-status-card[data-state="up"]::before { background: linear-gradient(180deg, var(--up-soft) 0%, transparent 70%); }
.hero-status-card[data-state="degraded"] { border-color: var(--degraded-border); }
.hero-status-card[data-state="degraded"]::before { background: linear-gradient(180deg, var(--degraded-soft) 0%, transparent 70%); }
.hero-status-card[data-state="down"] { border-color: var(--down-border); }
.hero-status-card[data-state="down"]::before { background: linear-gradient(180deg, var(--down-soft) 0%, transparent 70%); }

.hero-status-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
}
.hero-status-card[data-state="up"] .hero-status-icon { background: var(--up-soft); border-color: var(--up-border); }
.hero-status-card[data-state="degraded"] .hero-status-icon { background: var(--degraded-soft); border-color: var(--degraded-border); }
.hero-status-card[data-state="down"] .hero-status-icon { background: var(--down-soft); border-color: var(--down-border); }

.hero-pulse {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold);
  position: relative;
  animation: pulse 2s ease-in-out infinite;
}
.hero-status-card[data-state="up"] .hero-pulse { background: var(--up); }
.hero-status-card[data-state="degraded"] .hero-pulse { background: var(--degraded); }
.hero-status-card[data-state="down"] .hero-pulse { background: var(--down); }
.hero-pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.5;
  animation: ring 2s ease-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes ring {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

.hero-status-text { flex: 1; min-width: 0; position: relative; }
.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.status-title {
  margin: 0;
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--fg);
}
.status-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.refresh-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  font-size: 13px;
  padding: 0 4px;
}

@media (max-width: 540px) {
  .hero-status-card { flex-direction: column; align-items: flex-start; padding: 22px 22px; }
  .hero-status-icon { width: 44px; height: 44px; flex-basis: 44px; }
}

/* Sections */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 800px) { .section { padding: 80px 0; } }
.section-status { padding-top: 32px; border-top: none; }

.section-title {
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.15;
  margin: 0 0 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.section-lede {
  font-size: 15px;
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 28px;
}

/* Components list */
.components {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.component-placeholder {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  background: var(--bg-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 14px;
}
.component {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 18px;
  align-items: center;
}
@media (min-width: 720px) {
  .component {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto;
  }
}
.component-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.component-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--fg);
}
.component-meta {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.component-bars {
  grid-column: 1 / -1;
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 36px;
  width: 100%;
  min-width: 0;
}
@media (min-width: 720px) {
  .component-bars { grid-column: 2 / 3; }
}
.component-bar {
  flex: 1 1 0;
  min-width: 2px;
  height: 100%;
  background: var(--unknown);
  border-radius: 2px;
  opacity: 0.85;
  transition: opacity .15s ease;
}
.component-bar.up { background: var(--up); }
.component-bar.degraded { background: var(--degraded); }
.component-bar.down { background: var(--down); }
.component-bar.unknown { background: var(--unknown); opacity: 0.45; }
.component-bar:hover, .component-bar:focus-visible { opacity: 1; outline: none; }

.component-tail {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}
.component-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--line-strong);
  background: var(--bg-3);
  color: var(--muted);
}
.component-status.up { color: var(--up); background: var(--up-soft); border-color: var(--up-border); }
.component-status.degraded { color: var(--degraded); background: var(--degraded-soft); border-color: var(--degraded-border); }
.component-status.down { color: var(--down); background: var(--down-soft); border-color: var(--down-border); }
.component-status .status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.component-uptime {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--unknown);
  border: 1px solid transparent;
}
.legend-dot.up { background: var(--up); }
.legend-dot.degraded { background: var(--degraded); }
.legend-dot.down { background: var(--down); }
.legend-dot.unknown { background: var(--unknown); }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 56px;
  margin-top: 0;
  color: var(--muted);
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
.footer-brand .brand { margin-bottom: 12px; }
.footer-tag { font-size: 13px; margin: 4px 0 0; }
.footer-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.footer-nav a {
  color: var(--muted);
  font-size: 14px;
  border-bottom: none;
}
.footer-nav a:hover { color: var(--fg); border-bottom: none; }
