:root {
  --paper: #f5f6f3;
  --ink: #15171a;
  --ink-2: #5d6168;
  --ink-3: #9a9da1;
  --hair: #d8dad5;
  --band: #ebede8;
  --accent: #1d5fd1;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "DM Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 13px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ── header ── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hair);
}
.top-in { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 6px; text-decoration: none; }
.brand img { width: 40px; height: 40px; mix-blend-mode: multiply; }
.brand span { font: 500 28px/1 var(--serif); letter-spacing: -0.02em; }
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--band); border-radius: 999px; overflow-x: auto; }
.tabs a {
  padding: 5px 13px; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); white-space: nowrap; font-size: 12.5px;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.tabs a:focus-visible, .brand:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--ink-3); }
.chip.live { color: var(--ink); }
.chip.live i { background: var(--accent); border-color: var(--accent); }

/* ── type ── */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(34px, 5.2vw, 62px); line-height: 1.03; text-wrap: balance; }
h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
h2 { font-size: 20px; line-height: 1.2; margin: 34px 0 10px; }
h3 { font-size: 18px; margin-bottom: 4px; }
p { margin: 0 0 10px; color: #2c2f33; max-width: 68ch; }
p b { font-weight: 500; color: var(--ink); }
.kicker { color: var(--ink-2); text-transform: lowercase; margin-bottom: 14px; }
.lede { font: italic 400 19px/1.45 var(--serif); color: var(--ink-2); max-width: 46ch; margin-top: 18px; }
.note { color: var(--ink-2); font-size: 12px; margin-top: 8px; }
.eq {
  display: inline-block; margin-top: 22px; padding: 9px 14px;
  border: 1px solid var(--ink); border-radius: 4px; color: var(--ink);
}
.eq span { color: var(--accent); }
.eq b { font-weight: 500; }
.eq.big { font-size: 17px; margin: 4px 0 16px; }

/* ── hero ── */
.hero { padding: 64px 0 44px; }
.hero h1 { max-width: 17ch; }

.page-head { padding: 46px 0 8px; }
.page-head h1 { font-size: clamp(34px, 4.6vw, 52px); }

/* ── stat strip ── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--hair); }
.stats div { padding: 14px 16px 16px 0; }
.stats div + div { padding-left: 16px; border-left: 1px solid var(--hair); }
.stats span { display: block; color: var(--ink-2); font-size: 12px; }
.stats b { font: 400 32px/1.15 var(--serif); letter-spacing: -0.01em; }

/* ── layout ── */
.grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; }
.grid.two { grid-template-columns: 1.2fr 0.8fr; }
.col { min-width: 0; }

/* ── tables ── */
.t { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.t thead th { font-weight: 400; color: var(--ink-2); text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--ink); }
.t td, .t.kv th { padding: 5px 8px; text-align: left; }
.t.kv { border-top: 1px solid var(--ink); }
.t.kv th { font-weight: 500; }
.t.kv td { text-align: right; color: var(--ink-2); word-break: break-all; }
.t tbody tr:nth-child(even), .t.kv tr:nth-child(even) { background: var(--band); }
.t .r { text-align: right; }
.t .strong { color: var(--ink); font-weight: 500; }
.t .empty td { color: var(--ink-2); padding: 22px 8px; text-align: center; background: none; }
.t .buy { color: var(--accent); }
.scroll { overflow-x: auto; }
.scroll .t { min-width: 640px; }

.sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: baseline; }
.sw-burn { background: var(--ink); }
.sw-pool { background: var(--accent); }
.sw-hold { background: transparent; border: 1.5px solid var(--ink); }

/* ── bars ── */
.bars { border-top: 1px solid var(--ink); padding: 8px 0 10px; }
.bars > div { display: grid; grid-template-columns: 64px 1fr 48px; gap: 10px; align-items: center; padding: 3px 8px; }
.bars span { color: var(--ink-2); }
.bars b { font-weight: 400; text-align: right; }
.bar { height: 8px; background: var(--band); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .4s ease; }

/* ── ternary ── */
.tern { border-top: 1px solid var(--ink); padding-top: 10px; }
.tern svg { width: 100%; height: auto; display: block; }
.tern text { font: 400 12px var(--mono); fill: var(--ink); }
.tern .lattice { fill: var(--ink-3); }
.tern .edge { fill: none; stroke: var(--ink); stroke-width: 1; }
.tern .pt { fill: var(--ink); opacity: .55; }
.tern .pt.last { fill: var(--accent); opacity: 1; }
.tern .wait { fill: var(--paper); stroke: var(--ink); stroke-dasharray: 2 3; }

/* ── route cards ── */
.routes { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.routes article { padding: 16px 20px 14px 0; }
.routes article + article { padding-left: 20px; border-left: 1px solid var(--hair); }
.routes .sw { width: 12px; height: 12px; margin-bottom: 8px; display: block; }
.routes p { color: var(--ink-2); margin: 0; }

/* ── calculator ── */
.calc { border-top: 1px solid var(--ink); padding-top: 12px; }
.calc label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; color: var(--ink-2); }
.calc input {
  width: 150px; padding: 6px 8px; text-align: right;
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--ink-3); border-radius: 4px;
}
.calc .t { margin-top: 12px; }
.calc .warn { color: #b3261e; }

/* ── paper ── */
.paper { columns: 2; column-gap: 44px; border-top: 1px solid var(--ink); margin-top: 22px; }
.paper section { break-inside: avoid; padding-top: 2px; }
.paper h2 { margin-top: 22px; }

/* ── footer ── */
.foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 60px; padding-top: 14px; padding-bottom: 30px; border-top: 1px solid var(--hair); color: var(--ink-2); font-size: 12px; }
.foot span:first-child { font: 500 16px var(--serif); color: var(--ink); }

/* ── small screens ── */
@media (max-width: 900px) {
  .grid, .grid.two { grid-template-columns: 1fr; gap: 0; }
  .hero { padding: 36px 0 30px; }
  .paper { columns: 1; }
}
@media (max-width: 640px) {
  .top-in { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; gap: 8px 14px; }
  .tabs { order: 3; width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--hair); }
  .stats b { font-size: 26px; }
  .routes { grid-template-columns: 1fr; }
  .routes article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--hair); }
  .foot { flex-direction: column; gap: 4px; }
}
