:root {
  --bg: #f7f8fa;
  --bg-elevated: #ffffff;
  --text: #16181d;
  --text-muted: #5f6672;
  --border: #e3e6eb;
  --accent: #3b5bdb;
  --accent-text: #ffffff;
  --shadow: 0 1px 2px rgba(16, 18, 24, .06), 0 8px 24px rgba(16, 18, 24, .06);
  --radius: 14px;
}

:root[data-theme="dark"] {
  --bg: #0f1116;
  --bg-elevated: #171a21;
  --text: #eceef2;
  --text-muted: #9aa2b1;
  --border: #262b35;
  --accent: #748ffc;
  --accent-text: #0f1116;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1116;
    --bg-elevated: #171a21;
    --text: #eceef2;
    --text-muted: #9aa2b1;
    --border: #262b35;
    --accent: #748ffc;
    --accent-text: #0f1116;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--text);
}

.brand span { color: var(--accent); }

.nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .925rem;
}

.nav a:hover { color: var(--text); }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle:hover { border-color: var(--accent); }

/* ---------- Layout ---------- */

main {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1rem, 4vw, 2rem);
}

section + section { margin-top: clamp(3rem, 8vw, 5rem); }

/* ---------- Hero ---------- */

.eyebrow {
  margin: 0 0 .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -.03em;
}

.lead {
  max-width: 52ch;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-muted);
}

.cta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  padding: .7rem 1.35rem;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--bg-elevated);
}

.btn-ghost:hover { border-color: var(--accent); }

/* ---------- Features ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-icon { font-size: 1.6rem; }

.card h2 {
  margin: .5rem 0 .35rem;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: .925rem;
}

/* ---------- Status ---------- */

.status h2 {
  margin: 0 0 .35rem;
  font-size: 1.4rem;
  letter-spacing: -.02em;
}

.muted {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: .925rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  margin: 0 0 1.75rem;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.status-grid > div {
  background: var(--bg-elevated);
  padding: 1rem 1.15rem;
}

.status-grid dt {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.status-grid dd {
  margin: .25rem 0 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ping-count {
  margin-left: .75rem;
  color: var(--text-muted);
  font-size: .925rem;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  margin-top: clamp(3rem, 8vw, 6rem);
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
}

.footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: .875rem;
  text-align: center;
}
