:root {
  --bg0: #07110e;
  --bg1: #0d1c16;
  --ink: #e8f2ea;
  --muted: #8aa394;
  --line: rgba(200, 245, 66, 0.18);
  --accent: #c8f542;
  --accent-ink: #0a140c;
  --panel: rgba(14, 32, 24, 0.72);
  --warn: #ffb454;
  --radius: 14px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(200, 245, 66, 0.16), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(56, 180, 120, 0.18), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #08140f);
  line-height: 1.55;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.top, main, footer { position: relative; z-index: 1; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 6vw;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-decoration: none;
  font-size: 1.1rem;
}
nav { display: flex; gap: 1.25rem; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
nav a:hover { color: var(--ink); }

.hero {
  padding: 12vh 6vw 10vh;
  max-width: 920px;
  animation: rise 0.9s ease both;
}
.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  margin: 0 0 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  line-height: 1.05;
  margin: 0 0 1.25rem;
  letter-spacing: -0.04em;
}
.lede {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--muted);
  max-width: 36rem;
  margin: 0 0 2rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn.tiny { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.section {
  padding: 5rem 6vw;
  border-top: 1px solid var(--line);
  animation: rise 0.8s ease both;
  animation-delay: 0.1s;
}
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.section h3 {
  font-family: var(--font-display);
  margin: 2rem 0 0.75rem;
}
.section-desc { color: var(--muted); max-width: 40rem; margin: 0 0 2rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: rgba(200, 245, 66, 0.45); }
.card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.card code {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--accent);
}

.steps { padding-left: 1.2rem; color: var(--muted); }
.steps li { margin-bottom: 0.6rem; }
.bullets { color: var(--muted); }
.code {
  background: #050a08;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.82rem;
  color: #d7f0c8;
}
.hint { color: var(--muted); margin-top: 1.5rem; }
.hint a { color: var(--accent); }

.hidden { display: none !important; }

.text { color: var(--muted); max-width: 48rem; }
.section code { color: var(--accent); font-size: 0.88em; }
.code code, .code { color: #d7f0c8; }
.section h4 {
  margin: 1.5rem 0 0.6rem;
  font-size: 0.95rem;
  color: var(--ink);
}

.tbl {
  width: 100%;
  max-width: 980px;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
}
.tbl th, .tbl td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tbl thead th:first-child { border-top-left-radius: var(--radius); }
.tbl thead th:last-child { border-top-right-radius: var(--radius); }
.tbl thead th { color: var(--ink); font-weight: 700; background: rgba(200, 245, 66, 0.06); white-space: nowrap; }
.tbl tbody th { color: var(--ink); white-space: nowrap; width: 8rem; }
.tbl td { color: var(--muted); }
.tbl tr:last-child td, .tbl tr:last-child th { border-bottom: 0; }
.tbl td:first-child code { white-space: nowrap; }

.tabs { max-width: 980px; }
.tab-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.tab {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.tabs .code { margin: 0; }

.ep {
  max-width: 980px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  scroll-margin-top: 1rem;
}
.ep[open] { border-color: rgba(200, 245, 66, 0.45); }
.ep summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  list-style: none;
}
.ep summary::-webkit-details-marker { display: none; }
.method {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}
.ep-path { font-size: 0.95rem; }
.ep-title { color: var(--ink); font-weight: 700; }
.ep-refresh { margin-left: auto; color: var(--muted); font-size: 0.8rem; }
.ep-body { padding: 0 1.2rem 1.2rem; border-top: 1px solid var(--line); }

.live-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  max-width: 1200px;
}
.live-head .section-desc { margin-bottom: 1rem; }
.live-ctrl { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.seg { display: flex; gap: 0.3rem; }
.live-status { color: var(--muted); font-size: 0.85rem; }
.live-dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: middle;
  margin-left: 0.4rem;
}
.live-dot.on { background: var(--accent); box-shadow: 0 0 0 0 rgba(200, 245, 66, 0.6); animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 245, 66, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(200, 245, 66, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 245, 66, 0); }
}
.ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.ticker strong { color: var(--ink); margin-right: 0.3rem; }
.live-meta { color: var(--muted); font-size: 0.82rem; margin: 0.2rem 0 0.4rem; }
.live-table-wrap { max-width: 1200px; overflow-x: auto; }
.live-tbl { max-width: none; min-width: 760px; }
.live-tbl td { white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; }
.live-tbl td.empty { color: var(--muted); text-align: center; padding: 2rem; }
.live-tbl sub { font-size: 0.7em; }
.live-tbl tr.flash td { animation: flash 2.5s ease-out; }
@keyframes flash { from { background: rgba(200, 245, 66, 0.22); } to { background: transparent; } }
.up { color: #5ee08a; }
.down { color: #ff6b6b; }
.tok { display: flex; align-items: center; gap: 0.6rem; }
.tok strong { display: block; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }
.ava {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(200, 245, 66, 0.12);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.8rem;
}
.addr {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.addr:hover { color: var(--accent); }

.faq {
  max-width: 980px;
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
}
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { color: var(--muted); margin: 0.6rem 0 0; }
.faq a { color: var(--accent); }

footer {
  padding: 2rem 6vw 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .top { padding: 1rem 5vw; }
  nav { gap: 0.8rem; font-size: 0.85rem; }
  .hero { padding-top: 8vh; }
  nav a:nth-child(n+3) { display: none; }
  .tbl { display: block; overflow-x: auto; }
  .ep-refresh { margin-left: 0; width: 100%; }
}
