:root {
  --bg: #08090d;
  --bg-2: #0c0e14;
  --panel: #11141c;
  --panel-2: #161a24;
  --border: #1e2431;
  --border-lit: #2b3345;
  --text: #eef1f6;
  --muted: #99a2b4;
  /* 5.08:1 on --panel, 5.49:1 on --bg — the old #6a7385 measured 3.86 and
     failed WCAG AA for the small label text it is used on. */
  --faint: #7d8798;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --good: #34d399;
  --warn: #fbbf24;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* one soft light source behind the hero — depth without decoration */
body::before {
  content: '';
  position: fixed; inset: -20% 0 auto 0; height: 620px; z-index: 0; pointer-events: none;
  background:
    radial-gradient(760px 420px at 22% 0%, rgba(124, 92, 255, 0.16), transparent 70%),
    radial-gradient(620px 380px at 78% 6%, rgba(34, 211, 238, 0.10), transparent 70%);
}
main, header, footer { position: relative; z-index: 1; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------- header */
header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(8, 9, 13, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 26px; height: 62px; }
.logo {
  font-weight: 800; font-size: 19px; letter-spacing: -0.025em;
  text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 9px;
}
.logo .die {
  width: 22px; height: 22px; border-radius: 7px; display: inline-grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #0a0b10; font-size: 13px; font-weight: 900;
}
.nav a.link { color: var(--muted); text-decoration: none; font-size: 14.5px; transition: color .15s; }
.nav a.link:hover { color: var(--text); }
.nav .spacer { flex: 1; }

/* ------------------------------------------------------------------ hero */
.hero { padding: 92px 0 40px; max-width: 760px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--muted); border: 1px solid var(--border-lit); background: var(--panel);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}
.hero h1 {
  font-size: clamp(36px, 5.6vw, 60px);
  line-height: 1.08; letter-spacing: -0.035em; font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(100deg, #a78bfa, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.sub { color: var(--muted); font-size: 18.5px; margin-top: 20px; max-width: 640px; }
.cta-row { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 11px;
  font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1px solid transparent; transition: transform .12s, filter .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #6d4dfa); color: #fff;
  box-shadow: 0 6px 20px -8px rgba(124, 92, 255, 0.7);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: var(--border-lit); color: var(--text); background: rgba(255,255,255,0.02); }
.btn.ghost:hover { background: var(--panel); }

/* ------------------------------------------------------------ stats strip */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; margin: 44px 0 0;
  background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.stat { background: var(--panel); padding: 16px 20px; }
.stat .k {
  color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600;
}
.stat .v {
  font-size: 22px; font-weight: 700; margin-top: 5px;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.stat .v .unit { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 2px; }

/* -------------------------------------------------------------- sections */
section { padding: 68px 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: none; }
.sec-head { max-width: 720px; margin-bottom: 30px; }
section h2 { font-size: 27px; letter-spacing: -0.025em; line-height: 1.2; }
section p.lead { color: var(--muted); margin-top: 10px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
/* four items read as a broken 3+1 on wide screens — pin them to a 2x2 block */
.cards.two-up { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 15px; padding: 22px;
  display: flex; flex-direction: column; transition: border-color .18s, transform .18s;
}
.card:hover { border-color: var(--border-lit); transform: translateY(-2px); }
.card h3 { font-size: 16.5px; margin-bottom: 8px; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 14.5px; }
.card .num {
  display: inline-flex; width: 28px; height: 28px; border-radius: 9px;
  background: rgba(124, 92, 255, 0.14); color: #a78bfa;
  align-items: center; justify-content: center; font-weight: 700; font-size: 14px; margin-bottom: 14px;
}

/* key/value block — addresses, endpoints */
.kv {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel);
}
.kv-row {
  display: flex; gap: 16px; padding: 13px 18px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.kv-row:first-child { border-top: none; }
.kv-row .kv-k { color: var(--muted); font-size: 13px; min-width: 150px; }
.kv-row .kv-v { font-family: var(--mono); font-size: 13px; word-break: break-all; flex: 1; }
.kv-row .kv-v a { color: var(--accent-2); }

/* ------------------------------------------------------------------ code */
pre {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; tab-size: 4;
}
code { font-family: var(--mono); font-size: 0.92em; }
p code, li code, td code, .kv code {
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 6px;
}
pre .c { color: #78849a; }   /* 4.9:1 — the old #5b6577 was 3.2 */
pre .k { color: #c084fc; }
pre .t { color: #5eead4; }
pre .f { color: #93c5fd; }
pre .s { color: #fbbf24; }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border); }
th { color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.table-scroll table { min-width: 520px; }
.table-scroll tr:last-child td { border-bottom: none; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill.live { background: rgba(52, 211, 153, 0.13); color: var(--good); }
.pill.soon { background: rgba(251, 191, 36, 0.13); color: var(--warn); }

.note { color: var(--muted); font-size: 13.5px; margin-top: 14px; }

/* ------------------------------------------------------------ docs layout */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 44px; padding: 40px 0 80px; }
.toc { position: sticky; top: 86px; align-self: start; font-size: 14px; }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 5px 0; }
.toc a:hover { color: var(--text); }
.docs-body h2 { margin: 44px 0 12px; font-size: 24px; }
.docs-body h2:first-child { margin-top: 0; }
.docs-body h3 { margin: 28px 0 8px; font-size: 18px; }
.docs-body p, .docs-body li { color: #c3c9d6; font-size: 15px; }
.docs-body ul, .docs-body ol { padding-left: 22px; margin: 10px 0; }
.docs-body pre { margin: 14px 0; }
.callout {
  border-left: 3px solid var(--accent); background: var(--panel);
  border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 16px 0; font-size: 14.5px; color: #c3c9d6;
}
.callout.warn { border-left-color: var(--warn); }

footer {
  border-top: 1px solid var(--border); padding: 30px 0 46px; color: var(--faint);
  font-size: 13.5px; margin-top: 20px;
}
footer a { color: var(--muted); }

@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; }
  .toc {
    position: static; display: flex; flex-wrap: wrap; gap: 4px 18px;
    border-bottom: 1px solid var(--border); padding-bottom: 16px;
  }
  .hero { padding: 60px 0 32px; }
  section { padding: 52px 0; }
  .cards.two-up { grid-template-columns: 1fr; }
  .kv-row .kv-k { min-width: 0; flex-basis: 100%; }
}
