/* ── tokens ───────────────────────────────────────────────── */
:root {
  --bg:        #0a0b0f;
  --bg-alt:    #0f1117;
  --panel:     #13161f;
  --panel-2:   #181c27;
  --line:      #232838;
  --text:      #e7eaf3;
  --muted:     #8b93a7;
  --accent:    #14f195;
  --accent-2:  #9945ff;
  --danger:    #ff5c6c;
  --radius:    14px;
  --wrap:      1120px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* class selectors that set `display` otherwise beat the UA rule for [hidden] */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .6rem; }
p { margin: 0 0 1rem; }
a { color: inherit; }

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

/* ── nav ──────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,11,15,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 650; text-decoration: none; letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-mark {
  width: 14px; height: 14px; border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 15px;
  transition: color .15s;
}
.nav-links a:hover { color: var(--text); }

/* ── buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: #04180f;
  font: inherit; font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: transform .12s, filter .15s, opacity .15s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; filter: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-sm { padding: 8px 15px; font-size: 14px; }

/* ── hero ─────────────────────────────────────────────────── */
.hero {
  padding: 96px 0 80px;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(153,69,255,.16), transparent 65%),
    radial-gradient(760px 380px at 88% 8%, rgba(20,241,149,.11), transparent 62%);
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  display: inline-block;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid rgba(20,241,149,.3); border-radius: 999px;
  padding: 5px 13px; margin: 0 0 24px;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); font-weight: 700; }
.lede { max-width: 62ch; font-size: 1.12rem; color: #b9c0d1; margin-top: 1.3rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 48px;
  list-style: none; margin: 3.5rem 0 0; padding: 0;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong {
  font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stats span { font-size: 14px; color: var(--muted); }

/* ── sections ─────────────────────────────────────────────── */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.section-lede { max-width: 66ch; color: var(--muted); margin-bottom: 2.6rem; }

.grid-3, .grid-2 { display: grid; gap: 18px; margin-top: 2.4rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.card h3 { font-size: 1.06rem; color: var(--text); }
.card p { color: var(--muted); font-size: 15.5px; margin: 0; }

/* ── steps ────────────────────────────────────────────────── */
.steps {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.steps li {
  position: relative;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
}
.step-n {
  display: grid; place-items: center;
  width: 30px; height: 30px; margin-bottom: 14px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04180f; font-weight: 700; font-size: 15px;
}
.steps h3 { font-size: 1.03rem; }
.steps p { color: var(--muted); font-size: 15px; margin: 0; }

.note {
  margin-top: 2.2rem; padding: 14px 18px;
  border-left: 2px solid var(--accent-2);
  background: rgba(153,69,255,.06);
  color: var(--muted); font-size: 14.5px;
  border-radius: 0 8px 8px 0;
}

/* ── demo ─────────────────────────────────────────────────── */
.demo {
  display: grid; gap: 18px;
  grid-template-columns: minmax(300px, 400px) 1fr;
  align-items: start;
}
@media (max-width: 900px) { .demo { grid-template-columns: 1fr; } }

.demo-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.panel-head h3 { font-size: 1rem; margin: 0; }
.budget, .clock { font-family: var(--mono); font-size: 14px; }
.budget #remaining { color: var(--accent); font-weight: 600; }

.allocator { display: grid; gap: 14px; }
.alloc-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.alloc-label { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.tick { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.alloc-val {
  font-family: var(--mono); font-size: 14px; color: var(--muted);
  min-width: 62px; text-align: right;
}
.alloc-row input[type=range] {
  grid-column: 1 / -1;
  width: 100%; height: 4px; margin: 0;
  -webkit-appearance: none; appearance: none;
  background: var(--panel-2); border-radius: 999px; cursor: pointer;
}
.alloc-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--text); border: none; cursor: pointer;
}
.alloc-row input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--text); border: none; cursor: pointer;
}
.alloc-row input[type=range]:disabled { opacity: .5; cursor: default; }

.demo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.demo-hint { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; min-height: 1.2em; }

#chart {
  width: 100%; height: 260px; display: block;
  background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px;
}

.leaderboard { margin-top: 18px; }
.lb-head, .lb-row {
  display: grid; grid-template-columns: 30px 1fr 92px 84px;
  gap: 10px; align-items: center;
  padding: 9px 10px; font-size: 14.5px;
}
.lb-head {
  color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: .07em; border-bottom: 1px solid var(--line);
}
.lb-row { border-bottom: 1px solid rgba(35,40,56,.55); transition: background .2s; }
.lb-row.you { background: rgba(20,241,149,.07); border-radius: 8px; }
.lb-row .rank, .lb-row .pts, .lb-row .ret { font-family: var(--mono); font-size: 13.5px; }
.lb-row .pts, .lb-row .ret { text-align: right; }
.lb-row .name { display: flex; align-items: center; gap: 8px; }
.up { color: var(--accent); }
.down { color: var(--danger); }

.result {
  margin-top: 18px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); font-size: 15px;
}
.result h4 { margin: 0 0 6px; font-size: 1rem; }
.result p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ── formula ──────────────────────────────────────────────── */
.formula {
  margin-top: 30px; padding: 26px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.formula h3 { font-size: 1rem; }
.formula pre {
  overflow-x: auto; margin: 0 0 1rem;
  padding: 16px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px;
}
.formula code { font-family: var(--mono); font-size: 13.5px; color: var(--accent); }
.formula p { color: var(--muted); font-size: 15px; margin: 0; }

/* ── timeline ─────────────────────────────────────────────── */
.timeline {
  display: grid; gap: 18px; margin-top: 2.4rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.tl-item {
  padding: 20px 22px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  border-top: 2px solid var(--line);
}
.tl-item h3 { font-size: .98rem; }
.tl-item p { color: var(--muted); font-size: 14.5px; margin: 0; }
.tl-item.done { border-top-color: var(--accent); }
.tl-item.active { border-top-color: var(--accent-2); }

.contact { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.contact h3 { font-size: 1.1rem; }

/* ── footer ───────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 34px 0; background: var(--bg-alt); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: baseline; }
.footer .muted { font-size: 13.5px; max-width: 70ch; }

/* ── format cards ─────────────────────────────────────────── */
.card-lg { padding: 30px; }
.card-lg h3 { font-size: 1.3rem; margin-top: 12px; }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 11.5px;
  letter-spacing: .09em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px;
}
.tag-green  { color: var(--accent);   background: rgba(20,241,149,.12);  border: 1px solid rgba(20,241,149,.3); }
.tag-purple { color: #c79cff;         background: rgba(153,69,255,.14);  border: 1px solid rgba(153,69,255,.35); }

.ticks { list-style: none; padding: 0; margin: 18px 0 0; }
.ticks li {
  position: relative; padding-left: 24px; margin-bottom: 9px;
  color: var(--muted); font-size: 15px;
}
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: .55em;
  width: 7px; height: 7px; border-radius: 2px; background: var(--accent);
}

.honest {
  margin-top: 2.6rem; max-width: 62ch;
  font-size: 14.5px; color: var(--muted);
  padding-left: 14px; border-left: 2px solid var(--line);
}
.honest a { color: var(--accent); }

.sub-title { margin: 3rem 0 0; font-size: 1.15rem; }
.card-warn { border-color: rgba(255,159,67,.28); background: rgba(255,159,67,.04); }
.card-warn h3 { color: #ffb974; }

/* ── demo: mode tabs + challenge config ───────────────────── */
.mode-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 11px;
}
.mode-tab {
  flex: 1; padding: 9px 10px;
  background: transparent; border: none; border-radius: 8px;
  color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer; transition: background .15s, color .15s;
}
.mode-tab:hover:not(:disabled) { color: var(--text); }
.mode-tab.is-active { background: var(--panel-2); color: var(--text); }
.mode-tab:disabled { cursor: not-allowed; opacity: .55; }

.config {
  display: grid; gap: 12px; margin-bottom: 20px;
  padding: 16px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--bg);
}
.field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.field > span { font-size: 14.5px; color: var(--muted); }
.field select {
  padding: 7px 10px; min-width: 118px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px; cursor: pointer;
}
.field select:disabled { opacity: .55; cursor: not-allowed; }

.quote {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 14px;
}
.quote strong { font-family: var(--mono); font-size: 14px; color: var(--accent); }

.asset-class {
  margin-top: 6px; font-family: var(--mono);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: #5f6779;
}
.asset-class:first-child { margin-top: 0; }

/* ── challenge tracker ────────────────────────────────────── */
.tracker {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-top: 18px; padding: 14px 4px;
  border-top: 1px solid var(--line);
}
.tracker > div { display: flex; flex-direction: column; gap: 3px; }
.tracker span { font-size: 12px; color: var(--muted); }
.tracker strong { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.tracker strong.up { color: var(--accent); }
.tracker strong.down { color: var(--danger); }

.result.win  { border-color: rgba(20,241,149,.35);  background: rgba(20,241,149,.06); }
.result.loss { border-color: rgba(255,92,108,.32);  background: rgba(255,92,108,.05); }

/* ── roadmap ──────────────────────────────────────────────── */
.status-banner {
  margin: 0 0 2.4rem; padding: 16px 20px;
  border: 1px solid rgba(255,159,67,.32); border-radius: var(--radius);
  background: rgba(255,159,67,.06);
  color: #ffcb98; font-size: 15px;
}
.tl-tag {
  display: inline-block; margin-bottom: 8px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: #5f6779;
}
.tl-item.active .tl-tag { color: var(--accent); }

@media (max-width: 720px) {
  .tracker { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .hero { padding: 64px 0 56px; }
  .hero-stats { gap: 28px; }
  .section { padding: 60px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ── docs page ────────────────────────────────────────────── */
.tag-blue { color: #8fc4ff; background: rgba(74,168,255,.12); border: 1px solid rgba(74,168,255,.32); }

.closer { margin-top: 3rem; }

.docs-head {
  padding: 64px 0 44px;
  background:
    radial-gradient(760px 340px at 12% -20%, rgba(153,69,255,.14), transparent 62%),
    radial-gradient(620px 300px at 82% 0%, rgba(20,241,149,.09), transparent 60%);
  border-bottom: 1px solid var(--line);
}
.docs-head h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); }
.docs-head .lede { font-size: 1.05rem; margin-top: 1rem; }

.docs-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 56px;
  padding-top: 52px;
  padding-bottom: 72px;
  align-items: start;
}

.docs-toc { position: sticky; top: 88px; }
.docs-toc nav { display: flex; flex-direction: column; gap: 2px; }
.toc-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: #5f6779; margin-bottom: 10px;
}
.docs-toc a {
  padding: 6px 10px; border-radius: 7px;
  color: var(--muted); text-decoration: none; font-size: 14px;
  border-left: 2px solid transparent;
  transition: color .15s, background .15s;
}
.docs-toc a:hover { color: var(--text); background: var(--panel); }

.docs-body { max-width: 74ch; }
.docs-body section { padding-bottom: 12px; margin-bottom: 44px; border-bottom: 1px solid var(--line); }
.docs-body section:last-of-type { border-bottom: none; }
.docs-body h2 {
  font-size: 1.55rem; margin: 0 0 1.1rem;
  scroll-margin-top: 84px;
}
.docs-body h3 {
  font-size: 1.05rem; margin: 2rem 0 .7rem;
  color: #cfd5e4;
}
.docs-body p { color: #b0b8ca; font-size: 16px; }
.docs-body pre {
  overflow-x: auto; margin: 1.2rem 0;
  padding: 16px 18px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px;
}
.docs-body pre code { font-family: var(--mono); font-size: 13px; color: var(--accent); line-height: 1.6; }
.docs-body p code, .docs-body li code {
  font-family: var(--mono); font-size: 13.5px;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 5px; color: #cfd5e4;
}

.doc-list { margin: 1rem 0 1rem 0; padding-left: 22px; }
.doc-list li { color: #b0b8ca; font-size: 16px; margin-bottom: 10px; }
.doc-list strong { color: var(--text); }

.caveat {
  padding: 12px 16px; border-left: 2px solid rgba(255,159,67,.5);
  background: rgba(255,159,67,.05); border-radius: 0 8px 8px 0;
  font-size: 14.5px !important; color: #d8b48c !important;
}

.table-wrap { overflow-x: auto; margin: 1.2rem 0; }
.docs-body table { border-collapse: collapse; width: 100%; min-width: 380px; }
.docs-body th, .docs-body td {
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.docs-body th {
  color: var(--muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .07em;
}
.docs-body td { font-family: var(--mono); color: #cfd5e4; }
.docs-body tbody tr:last-child td { border-bottom: none; }

.doc-footnote {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
  color: var(--muted) !important; font-size: 14px !important;
}

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 28px; }
  .docs-toc {
    position: static;
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; background: var(--panel);
  }
  .docs-toc nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
