/* PAPERVAULT — shared theme. Paper, ink, olive. No frameworks. */
:root {
  --paper: #f3efe3;        /* page background */
  --paper-2: #ece7d8;      /* panel / strip background */
  --paper-3: #e3ddcb;      /* pressed / selected background */
  --ink: #141311;          /* text, chart lines */
  --ink-2: #4a4740;        /* secondary text */
  --mute: #7b776b;         /* labels */
  --faint: #c3bead;        /* ascii texture, ticker */
  --hair: #d8d2c0;         /* hairline borders */
  --hair-2: #c5bfab;
  --olive: #5e6b3b;        /* positive numbers, selected state */
  --olive-bg: #dfe3cf;
  --brown: #6b5a2e;        /* primary button */
  --brown-2: #574a26;
  --red: #8d3b2c;          /* negative numbers */
  --red-bg: #ecd7cf;
  --amber: #8a6a1e;        /* warnings */
  --amber-bg: #efe4c4;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 4px;
  --gutter: 16px;
  --max: 1180px;
}
@media (min-width: 720px) { :root { --gutter: 28px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 0.8em; }
small { font-size: 12px; }
code { font-family: var(--mono); font-size: 0.92em; }
img, svg { max-width: 100%; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
::selection { background: var(--olive-bg); }

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

/* ---------- labels & numbers ---------- */
.lbl {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mute); font-weight: 500;
}
.lbl.dark { color: var(--ink); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.unit { font-family: var(--mono); font-size: 11px; color: var(--mute); letter-spacing: 0.04em; margin-left: 4px; }
.pos { color: var(--olive); }
.neg { color: var(--red); }
.mono { font-family: var(--mono); }
.muted { color: var(--mute); }
.ink2 { color: var(--ink-2); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 3px 7px; border: 1px solid var(--hair-2); border-radius: 3px; color: var(--ink-2); background: var(--paper);
  white-space: nowrap;
}
.badge.preview { border-color: var(--amber); color: var(--amber); background: var(--amber-bg); }
.badge.live { border-color: var(--olive); color: var(--olive); background: var(--olive-bg); }
.badge.off { border-color: var(--hair-2); color: var(--mute); }
.badge.bad { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: var(--radius); border: 1px solid var(--brown);
  background: var(--brown); color: #fff; font-weight: 600; font-size: 14px; line-height: 1;
  text-decoration: none; min-height: 42px; width: 100%; transition: background .12s;
}
.btn:hover { background: var(--brown-2); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--paper-3); border-color: var(--hair-2); color: var(--mute); cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--hair-2); }
.btn.secondary:hover { background: var(--paper-3); }
.btn.secondary:disabled { background: transparent; color: var(--faint); border-color: var(--hair); }
.btn.sm { min-height: 32px; padding: 6px 10px; font-size: 13px; width: auto; }
.btn.auto { width: auto; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-bg); }

/* bracketed text button, like [ STAKE ] */
.bk {
  display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; padding: 10px 6px; border: 1px solid transparent; background: transparent;
  white-space: nowrap;
}
.bk::before { content: "[ "; color: var(--mute); }
.bk::after { content: " ]"; color: var(--mute); }
.bk:hover { border-color: var(--hair-2); background: var(--paper-2); }
.bk.on { background: var(--olive-bg); border-color: var(--olive); color: var(--olive); }
.bk.on::before, .bk.on::after { color: var(--olive); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--hair);
}
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 54px; }
.wordmark { font-weight: 700; font-size: 21px; letter-spacing: -0.03em; text-decoration: none; white-space: nowrap; }
.wordmark i { font-style: normal; color: var(--mute); }
.nav-links { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  text-decoration: none; padding: 17px 10px 15px; font-size: 14px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.on { color: var(--ink); border-bottom-color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav .btn { width: auto; min-height: 34px; padding: 7px 12px; font-size: 13px; gap: 0; }
.wallet-pill {
  display: none; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  border: 1px solid var(--hair-2); padding: 6px 10px; border-radius: var(--radius); background: var(--paper-2);
}
.wallet-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--olive); }
.wallet-pill.wrong .dot { background: var(--red); }
.wallet-pill button { background: none; border: 0; color: var(--mute); padding: 0; font-family: var(--mono); font-size: 11px; }
@media (max-width: 600px) { .nav-links a { padding: 17px 7px 15px; font-size: 13px; } .nav .wrap { gap: 8px; } .wordmark { font-size: 18px; } .nav .btn .long { display: none; } .nav .btn { padding: 7px 10px; } .nav-links { -webkit-mask-image: linear-gradient(to right, #000 80%, transparent); mask-image: linear-gradient(to right, #000 80%, transparent); padding-right: 24px; } }

/* ---------- ticker strip ---------- */
.ticker {
  overflow: hidden; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); background: var(--paper);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.28em; color: var(--faint); text-transform: uppercase; white-space: nowrap;
  height: 30px; display: flex; align-items: center; user-select: none;
}
.ticker .track { display: inline-flex; gap: 48px; padding-left: 48px; animation: tick 60s linear infinite; }
.ticker.slow .track { animation-duration: 120s; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker .track { animation: none; } }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--hair); }
.hero .wrap { position: relative; z-index: 1; padding-top: 48px; padding-bottom: 36px; }
.ascii {
  position: absolute; inset: 0; margin: 0; z-index: 0; pointer-events: none; user-select: none; overflow: hidden;
  font-family: var(--mono); font-size: 11px; line-height: 13px; letter-spacing: 0.06em; color: var(--faint);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
  opacity: 0.7;
}
.hero-mark {
  font-size: clamp(44px, 14.5vw, 176px); font-weight: 700; letter-spacing: -0.055em; line-height: 0.92; margin: 0 0 22px -0.04em; white-space: nowrap;
}
.hero-mark i { font-style: normal; color: var(--ink-2); }
.hero-lines { font-size: clamp(19px, 2.6vw, 27px); font-weight: 500; letter-spacing: -0.015em; line-height: 1.5; max-width: 620px; }
.hero-ctas { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 26px; }
.hero-sub { margin-top: 24px; font-size: 13px; color: var(--ink-2); max-width: 560px; }

/* ---------- stats strip ---------- */
.stats { border-bottom: 1px solid var(--hair); background: var(--paper-2); position: relative; }
.stats-flag { position: absolute; right: var(--gutter); top: -13px; z-index: 2; }
.stats-flag .badge { font-size: 12px; padding: 5px 10px; }
.stats.is-preview .stat .v, .stats.is-preview .stat .v .pos, .stats.is-preview .stat .v .neg, .stats.is-preview .stat .v .unit { color: var(--mute) !important; }
.stats.is-preview .stat .v { opacity: 0.75; }
.stats .wrap { padding: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.stat { padding: 14px var(--gutter) 12px; border-bottom: 1px solid var(--hair); border-right: 1px solid var(--hair); min-width: 0; }
.stat:nth-child(2n) { border-right: 0; }
.stat .lbl { display: block; margin-bottom: 6px; }
.stat .v { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v .unit { font-size: 10px; }
.stat .sub { font-family: var(--mono); font-size: 11px; color: var(--mute); margin-top: 5px; letter-spacing: 0.02em; }
@media (min-width: 720px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stat:nth-child(2n) { border-right: 1px solid var(--hair); }
  .stat:nth-child(4n) { border-right: 0; }
}
@media (min-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(7, 1fr); }
  .stat { border-bottom: 0; }
  .stat:nth-child(4n) { border-right: 1px solid var(--hair); }
  .stat:last-child { border-right: 0; }
  .stat .v { font-size: 20px; }
}

/* ---------- sections ---------- */
.section { padding: 44px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-size: 22px; letter-spacing: -0.02em; }
.section-head .lbl { margin-bottom: 4px; display: block; }
.section-head a.more { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; }
.section-head a.more:hover { color: var(--ink); }
.lead { font-size: 16px; color: var(--ink-2); max-width: 680px; }

/* ---------- panels / cards ---------- */
.card { border: 1px solid var(--hair-2); background: var(--paper-2); border-radius: 6px; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.card-head h3 { font-size: 15px; }
.card-head .what { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.card-body { padding: 16px; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--hair); font-size: 12px; color: var(--mute); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-2 > *, .grid-3 > * { min-width: 0; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; } .grid-3 { grid-template-columns: 1fr 1fr 1fr; } .grid-2 > :not([data-panel]) { position: sticky; top: 72px; } }
.card.soon .card-body { position: relative; }

/* field rows */
.field { margin-bottom: 12px; }
.field-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 8px; }
.field-top .hint { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.field-top .hint button { background: none; border: 0; padding: 0; color: var(--olive); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-decoration: underline; text-underline-offset: 2px; }
.inp { display: flex; align-items: stretch; border: 1px solid var(--hair-2); background: var(--paper); border-radius: var(--radius); overflow: hidden; }
.inp:focus-within { border-color: var(--ink); }
.inp input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 12px; font-size: 18px; font-weight: 500; text-align: right; outline: none; font-variant-numeric: tabular-nums; }
.inp input::placeholder { color: var(--hair-2); }
.inp .tok { display: flex; align-items: center; padding: 0 12px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--ink-2); border-left: 1px solid var(--hair); background: var(--paper-2); white-space: nowrap; }
.inp .tok.l { border-left: 0; border-right: 1px solid var(--hair); }
.quick { display: flex; gap: 4px; margin-top: 6px; }
.quick button { flex: 1; border: 1px solid var(--hair-2); background: var(--paper); border-radius: 3px; padding: 5px 0; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.quick button:hover { background: var(--paper-3); }
.quick button.on { background: var(--olive-bg); border-color: var(--olive); color: var(--olive); }

/* key/value lines */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--hair); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-2); }
.kv .v { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.kv.big .v { font-size: 17px; font-weight: 600; }
.kvs { margin: 8px 0 14px; }

/* segmented toggle (Buy | Sell) */
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--hair-2); border-radius: var(--radius); padding: 3px; gap: 3px; background: var(--paper); margin-bottom: 14px; }
.seg button { border: 0; background: transparent; padding: 8px; border-radius: 3px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--olive-bg); color: var(--olive); }
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg button small { display: block; font-family: var(--mono); font-weight: 400; font-size: 10.5px; letter-spacing: 0.06em; margin-top: 2px; }

/* tier tiles (bonds: 12h / 24h / 48h) */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
@media (max-width: 379px) { .tiles .d { font-size: 16px; } }
.tile { border: 1px solid var(--hair-2); background: var(--paper); border-radius: var(--radius); padding: 10px 8px; text-align: left; }
.tile .t { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.tile .d { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }
.tile .s { font-size: 11px; color: var(--mute); margin-top: 2px; }
.tile.on { background: var(--olive-bg); border-color: var(--olive); }
.tile.on .d { color: var(--olive); }
.tile.on .t { color: var(--olive); }

/* note boxes */
.note { font-size: 12.5px; color: var(--ink-2); border-left: 2px solid var(--hair-2); padding: 6px 10px; margin: 10px 0; background: var(--paper); }
.note.warn { border-left-color: var(--amber); }
.note.ok { border-left-color: var(--olive); }
.note.bad { border-left-color: var(--red); }

/* status line under buttons */
.status { font-family: var(--mono); font-size: 11.5px; color: var(--mute); margin-top: 8px; min-height: 16px; word-break: break-word; }
.status a { color: var(--olive); }
.status.err { color: var(--red); }
.status.ok { color: var(--olive); }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--hair-2); border-radius: 6px; overflow: hidden; }
.step { padding: 18px 18px 16px; border-bottom: 1px solid var(--hair); background: var(--paper-2); }
.step:last-child { border-bottom: 0; }
.step .n { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--olive); }
.step h3 { font-size: 16px; margin: 6px 0 6px; }
.step p { font-size: 13.5px; color: var(--ink-2); margin: 0; }
@media (min-width: 860px) {
  .steps { grid-template-columns: repeat(4, 1fr); }
  .step { border-bottom: 0; border-right: 1px solid var(--hair); }
  .step:last-child { border-right: 0; }
}

/* ---------- tables ---------- */
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--hair-2); }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.r, table.t th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- FAQ ---------- */
.faq details { border-top: 1px solid var(--hair); }
.faq details:last-child { border-bottom: 1px solid var(--hair); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--mute); }
.faq details[open] summary::after { content: "–"; }
.faq .a { padding: 0 0 16px; color: var(--ink-2); font-size: 14px; max-width: 760px; }

/* ---------- chart ---------- */
.chart { position: relative; width: 100%; height: 140px; min-width: 0; overflow: hidden; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart .legend { position: absolute; top: 6px; left: 8px; display: flex; gap: 14px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.chart .legend i { display: inline-block; width: 14px; height: 0; border-top: 1.5px solid var(--ink); vertical-align: middle; margin-right: 5px; }
.chart .legend i.floor { border-top: 1.5px dashed var(--olive); }

/* ---------- docs layout ---------- */
.docs { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 36px 0 60px; }
.docs .toc { font-size: 13.5px; }
.docs .toc a { display: block; text-decoration: none; color: var(--ink-2); padding: 4px 0; }
.docs .toc a:hover { color: var(--ink); }
.docs .toc .lbl { display: block; margin: 0 0 8px; }
.docs .body { max-width: 740px; }
.docs .body h2 { font-size: 24px; margin: 36px 0 10px; padding-top: 8px; border-top: 1px solid var(--hair-2); letter-spacing: -0.02em; }
.docs .body h2:first-child { margin-top: 0; border-top: 0; }
.docs .body h3 { font-size: 16px; margin: 22px 0 6px; }
.docs .body p, .docs .body li { font-size: 15px; color: var(--ink-2); }
.docs .body li { margin-bottom: 4px; }
.docs .body strong { color: var(--ink); }
.docs .body .ex { font-family: var(--mono); font-size: 12.5px; background: var(--paper-2); border: 1px solid var(--hair); border-radius: 4px; padding: 10px 12px; margin: 10px 0 14px; white-space: pre-wrap; color: var(--ink); }
@media (min-width: 900px) {
  .docs { grid-template-columns: 200px 1fr; }
  .docs .toc { position: sticky; top: 70px; align-self: start; }
}

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--hair); margin-top: 48px; padding: 24px 0 40px; font-size: 12.5px; color: var(--mute); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- misc ---------- */
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > .btn { flex: 1; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.page-head { padding: 40px 0 22px; border-bottom: 1px solid var(--hair); }
.hero .page-head { padding: 44px var(--gutter) 30px; }
.page-head h1 { font-size: clamp(34px, 6vw, 56px); letter-spacing: -0.04em; font-weight: 700; line-height: 1; }
.page-head h1 i { font-style: normal; color: var(--ink-2); }
.page-head .lead { margin-top: 14px; }
.page-head .lbl { display: block; margin-bottom: 10px; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px; padding: 10px 14px; border-radius: 4px; max-width: calc(100vw - 32px); display: none;
}
.toast.show { display: block; }
