:root {
  --bg: #f1f5f9;
  --bg-elev: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #cbd5e1;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --ok: #047857;
  --ok-soft: #d1fae5;
  --warn: #b45309;
  --bad: #b91c1c;
  --font: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "SF Mono", "Cascadia Code", "Consolas", ui-monospace, monospace;
  --max: 42rem;
  --pad-x: max(1rem, env(safe-area-inset-left));
  --pad-r: max(1rem, env(safe-area-inset-right));
}

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background:
    linear-gradient(180deg, #e2e8f0 0%, var(--bg) 28%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.page {
  min-height: 100dvh;
  min-height: 100svh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, #f8fafc 88%, transparent);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding:
    max(0.65rem, env(safe-area-inset-top))
    var(--pad-r)
    0.65rem
    var(--pad-x);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  background: var(--accent);
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

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

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0 var(--pad-r) max(2rem, env(safe-area-inset-bottom)) var(--pad-x);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 1.75rem;
}

.hero {
  display: grid;
  gap: 1rem;
  padding: 1.25rem 0 0.25rem;
  border-bottom: 1px solid var(--line);
}

.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-strip[data-state="loading"] {
  background: #e2e8f0;
  color: var(--muted);
}

.status-strip[data-state="down"] {
  background: #fee2e2;
  color: var(--bad);
}

.status-strip[data-state="degraded"] {
  background: #ffedd5;
  color: var(--warn);
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.status-strip[data-state="ok"] .status-dot {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pop-title {
  margin: 0.15rem 0 0;
  font-size: clamp(2.4rem, 11vw, 3.4rem);
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.pop-title .hl {
  font-family: var(--mono);
  color: var(--accent);
}

.domain-line {
  margin: 0.65rem 0 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}

.section-head {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  align-items: stretch;
}

.meter {
  display: grid;
  grid-template-rows: auto minmax(2.5rem, auto) auto auto;
  gap: 0.4rem;
  height: 100%;
  min-width: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.85rem 0.9rem;
}

.meter-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.5rem;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 0.3rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

.meter h2 {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.value {
  margin: 0;
  align-self: end;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  word-break: break-word;
}

.hint {
  margin: 0;
  min-height: 1rem;
  font-size: 0.68rem;
  font-weight: 550;
  color: var(--muted);
}

.bar {
  height: 0.4rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.45s ease;
}

.bar-spacer {
  visibility: hidden;
}

.prose-card,
.foot-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
}

.foot-card p,
.prose-card p,
.prose-card li {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}

.foot-card p + p,
.prose-card p + p {
  margin-top: 0.45rem;
}

.prose-card h1 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.prose-card h2 {
  margin: 1.1rem 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.prose-card ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

#refresh-line {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

@media (min-width: 640px) {
  :root {
    --pad-x: max(1.25rem, env(safe-area-inset-left));
    --pad-r: max(1.25rem, env(safe-area-inset-right));
  }

  .stack {
    gap: 1.75rem;
    padding-top: 2.25rem;
  }

  .meters {
    grid-template-columns: repeat(4, 1fr);
  }

  .value {
    font-size: 1.2rem;
  }
}
