:root {
  --sans: "Geist", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 6px;
  --tap: 44px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: 140px; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
h1, h2, h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
@media (max-width: 520px) { .wrap { padding-inline: 16px; } }

/* sticky top stack: contract slot + header */
.top-stack { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); }

.ca-bar { border-bottom: 1px solid var(--line); background: var(--surface); }
.ca-inner { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; min-height: 56px; padding-block: 8px; }
.ca-label { font: 500 13px/1 var(--mono); color: var(--muted); letter-spacing: 0.02em; }
.ca-val {
  font: 500 clamp(17px, 2.2vw, 24px)/1.25 var(--mono);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1 1 280px;
  text-align: left;
}
button.ca-val { background: none; border: 0; padding: 0; cursor: copy; color: var(--fg); }
button.ca-val:hover { text-decoration: underline; text-underline-offset: 4px; }
.ca-val.inert { color: var(--muted); font-weight: 400; cursor: default; }
.ca-date, .ca-fb { font: 12px/1 var(--mono); color: var(--muted); }
.ca-copy {
  font: 12px var(--mono); color: var(--muted); background: none; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 6px 12px; min-width: 64px;
}
.ca-copy:hover { color: var(--fg); }
.ca-fb { min-width: 56px; }

header.top { background: var(--bg); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 28px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand b { font: 500 16px/1 var(--mono); letter-spacing: -0.01em; }
.brand-mark { display: block; background: var(--tile); padding: 3px 3px; border-radius: 4px; box-sizing: content-box; }
::selection { background: var(--accent); color: var(--tile); }
.spacer { flex: 1; }
nav.main { display: flex; gap: 20px; }
nav.main a { text-decoration: none; color: var(--muted); font-size: 14px; }
nav.main a:hover, nav.main a.active { color: var(--fg); }
.rail { display: flex; align-items: center; gap: 4px; }

.xlink {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--r); color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer;
}
a.xlink:hover, button.xlink:hover { color: var(--fg); background: var(--hover); }
.xlink[aria-disabled="true"] { cursor: default; color: var(--faint); }
.xlink[aria-disabled="true"]:hover { color: var(--faint); background: none; }

@media (max-width: 720px) {
  /* phones: only the contract slot stays pinned; navigation lives in the bottom bar */
  .top-stack { display: contents; }
  .ca-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
  .ca-inner { gap: 4px 12px; min-height: 0; padding-block: 8px; }
  .ca-label { order: 0; }
  .ca-date, .ca-fb, .ca-wait { order: 1; }
  .ca-fb { flex: 1; min-width: 0; text-align: right; }
  .ca-val { order: 2; flex: 1 1 100%; }
  .ca-copy { display: none; }
  html { scroll-padding-top: 110px; }
  header.top .wrap { gap: 12px; }
  nav.main {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--bg); border-top: 1px solid var(--line);
    justify-content: space-around; gap: 0;
    padding: 0 8px env(safe-area-inset-bottom, 0px);
  }
  nav.main a { flex: 1; display: grid; place-items: center; min-height: var(--tap); padding: 6px 8px; font-size: 14px; }
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r);
  padding: 8px 14px; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn.glow { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
.btn.glow:hover { opacity: 0.88; background: var(--ink); }

.input {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: 9px 11px; outline: none;
}
.input:focus { border-color: var(--fg); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-h h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.eyebrow { font: 12px/1 var(--mono); color: var(--muted); }

.tabs { display: flex; gap: 16px; flex-wrap: wrap; }
.tab { background: none; border: 0; border-bottom: 1px solid transparent; color: var(--muted); padding: 2px 0; cursor: pointer; font-size: 14px; }
.tab:hover { color: var(--fg); }
.tab.on { color: var(--fg); border-bottom-color: var(--fg); }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font: 12px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid currentColor; }
.pill.running { color: var(--fg); }
.pill.running i { width: 8px; height: 8px; background: var(--accent); border-color: var(--accent); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.intro { padding-block: 56px 36px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; }
.intro h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.02; margin: 0 0 14px; font-weight: 600; }
.intro h1 span { color: var(--muted); font-weight: 400; }
.intro p { margin: 0 0 20px; color: var(--muted); max-width: 557px; }
.intro .ctas { display: flex; gap: 8px; flex-wrap: wrap; }
.split { font: 13px/1.7 var(--mono); color: var(--muted); min-width: 220px; }
.split div { display: flex; justify-content: space-between; gap: 24px; }
.split b { color: var(--fg); font-weight: 500; }
.split .total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.split .note { display: block; margin-top: 6px; font-size: 12px; line-height: 1.4; color: var(--muted); }
@media (max-width: 760px) { .intro { grid-template-columns: 1fr; padding-block: 32px 24px; } }

.statline { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-block: 14px; font: 13px var(--mono); color: var(--muted); border-block: 1px solid var(--line); }
.statline b { color: var(--fg); font-weight: 500; }
.statline .asof { margin-left: auto; font-size: 12px; }
@media (max-width: 720px) { .statline .asof { margin-left: 0; flex-basis: 100%; } }

.nursery {
  display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 14px 18px;
  border: 1px dashed var(--muted); border-radius: 12px; background: var(--hover);
}
.nursery .n-text { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.nursery .n-text b { color: var(--fg); font-weight: 600; }
.nursery .n-meta { display: flex; align-items: center; gap: 14px; flex: none; font: 13px var(--mono); color: var(--muted); }
.nursery .n-clock { color: var(--fg); border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 10px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .nursery { flex-wrap: wrap; } .nursery .n-meta { width: 100%; justify-content: space-between; } }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; margin-block: 28px 64px; align-items: start; }
@media (max-width: 960px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.explore-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.explore-h h2 { margin: 0; font-size: 18px; }
.search-input { max-width: 220px; padding: 6px 10px; font-size: 14px; }
.gate-note { font: 12.5px/1.45 var(--mono); padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--hover); margin-bottom: 12px; overflow-wrap: anywhere; }
.gate-note[hidden] { display: none; }

.scroll-x { overflow-x: auto; }
.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th { text-align: left; font: 12px var(--mono); color: var(--muted); font-weight: 400; padding: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list th.r { text-align: right; }
.list th button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 4px; width: 100%; padding: 8px 12px; cursor: pointer; font: inherit; color: inherit; }
.list th.r button { justify-content: flex-end; }
.list th button:hover, .list th.on button { color: var(--fg); }
.list th button:focus-visible { outline: 2px solid var(--fg); outline-offset: -2px; border-radius: 4px; }
.list th .arrow { opacity: 0.35; font-size: 11px; }
.list th.on .arrow { opacity: 1; }
.list td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
@media (max-width: 640px) { .list .hide-sm { display: none; } .list th button { padding-inline: 8px; } }

aside .explore-h { margin-bottom: 0; padding-bottom: 12px; }
.feed { border-top: 1px solid var(--line); max-height: 760px; overflow: auto; }
.foot-note { font-size: 12px; margin-top: 12px; }

.ff { margin: 16px 0 20px; padding: 20px; display: grid; gap: 14px; justify-items: center; }
.ff-src { display: flex; align-items: center; gap: 10px; }
.ff-lanes { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; border-top: 1px solid var(--line-strong); padding-top: 16px; }
.ff-lane { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; }
.ff-split { display: grid; gap: 6px; }
.ff-node { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 12px; display: grid; gap: 2px; min-width: 0; }
.ff-node b { font-size: 14px; font-weight: 600; }
.ff-node span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ff-fee { background: var(--ink); border-color: var(--ink); }
.ff-fee b { color: var(--ink-fg); font-size: 22px; letter-spacing: -0.02em; }
.ff-fee span { color: var(--ink-fg); opacity: 0.7; }
.ff-pct { font-family: var(--mono); font-size: 13px; font-weight: 500; text-align: center; padding-bottom: 2px; }
.ff-arrow { width: 24px; height: 12px; flex: none; color: var(--faint); transform: rotate(90deg); align-self: center; margin: 4px 0; }
@media (max-width: 640px) { .ff { padding: 16px; } .ff-lanes { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 40px 0 12px; }
.sec-h h2 { margin: 0; font-size: 18px; }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font: 12px var(--mono); color: var(--muted); font-weight: 400; padding: 9px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 16px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-variant-numeric: tabular-nums; vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.w { overflow-wrap: anywhere; min-width: 160px; }
.state { display: inline-flex; align-items: center; gap: 6px; }
.state i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid currentColor; }
.state.stated { color: var(--fg); }
.state.stated i { background: currentColor; }
.state.absent, .state.unconfirmed { color: var(--muted); }
.state.unconfirmed i { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }

footer.foot { border-top: 1px solid var(--line); padding-block: 24px; color: var(--muted); font-size: 13px; margin-top: 64px; }
footer.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-links { display: inline-flex; gap: 18px; align-items: center; flex-wrap: wrap; font: 13px var(--mono); }
.foot-links span { overflow-wrap: anywhere; }

/* touch: every control reaches 44 x 44 */
@media (max-width: 960px), (pointer: coarse) {
  .xlink { width: var(--tap); height: var(--tap); }
  .btn { min-height: var(--tap); }
  .tab { min-height: var(--tap); min-width: var(--tap); padding-inline: 4px; }
  .tabs { gap: 8px; }
  .input.search-input { min-height: var(--tap); }
  .list th button { min-height: var(--tap); }
  .ca-copy { min-height: var(--tap); }
  .pair-link { display: inline-flex; align-items: center; min-height: var(--tap); }
  button.ca-val { min-height: var(--tap); }
}

/* live board */
.tok { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tok span:last-child { font: 12px var(--mono); color: var(--muted); }
.logo { width: 24px; height: 24px; flex: none; border-radius: 50%; overflow: hidden; background: var(--hover); display: grid; place-items: center; font: 500 12px var(--mono); color: var(--muted); }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pair-link { font-weight: 500; text-decoration: none; }
.pair-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.list tbody tr.pair-row:hover td { background: var(--hover); }
.list td { transition: background-color 0.15s ease; }
.pair-row { animation: rowin 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes rowin { from { opacity: 0; transform: translateY(6px); } }
td.empty[data-state="error"] { color: var(--fg); }

/* skeleton loaders */
.sk-b { display: inline-block; height: 10px; border-radius: 3px; background: var(--line); vertical-align: middle; animation: shimmer 1.4s ease-in-out infinite; }
.sk-b.w1 { width: 90px; } .sk-b.w2 { width: 56px; } .sk-b.w3 { width: 32px; }
.sk-dot { display: inline-block; width: 24px; height: 24px; border-radius: 50%; background: var(--line); vertical-align: middle; margin-right: 10px; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: 0.4; } }

/* block ticker: a short settle when a figure changes */
.bump { display: inline-block; animation: bump 0.3s ease-out; }
@keyframes bump { from { opacity: 0.3; transform: translateY(-3px); } }

/* micro-interactions */
.btn, .xlink, .tab, .ca-copy, nav.main a, .list th button { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease; }
.btn:active, .xlink:active, .tab:active, .ca-copy:active { transform: scale(0.97); }
a.xlink:hover, button.xlink:hover { transform: translateY(-1px); }
.btn.glow:hover { transform: translateY(-1px); }
.input:focus { box-shadow: 0 0 0 3px var(--hover); transition: box-shadow 0.15s ease, border-color 0.15s ease; }
.ff-node { transition: border-color 0.15s ease, transform 0.15s ease; }
.ff-node:hover { border-color: var(--line-strong); transform: translateY(-2px); }
table.t tbody tr { transition: background-color 0.15s ease; }
table.t tbody tr:hover { background: var(--hover); }

/* motion: reveal and hover easing are our own; the blink and the 1s clock tick are the measured reference values */
html.js .rv { opacity: 0; transform: translateY(16px); transition: opacity 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
html.js .rv.in { opacity: 1; transform: none; }
a, button, .input, .xlink, .btn, .tab, .list th button, .nav a, nav.main a, .ca-copy, .list tbody tr { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease; }
.btn:active, .xlink:active { opacity: 0.7; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .rv { opacity: 1 !important; transform: none !important; }
}
