/* Layout and motion. Colours come only from tokens.css via var().
   Metrics follow values measured on the reference page: 16/24 mono body, h1 28 -> 44 -> 64,
   h2 28 -> 44, 80px section rhythm, 1px rules, 44px square-cornered buttons, 101px tiles,
   instant hover states (0s transitions). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--stack-h, 120px) + 8px); }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/24px var(--mono);
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--brand); color: var(--bg); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 400; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--brand); color: var(--bg); font-size: 14px; font-weight: 500; transform: translateY(-200%); }
.skip:focus { transform: none; }

.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 48rem) { .wrap { padding-inline: 32px; } }

/* scroll progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 300; background: var(--brand); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); pointer-events: none; }

/* ---------- top stack: header + contract slot ---------- */
.top { position: sticky; top: 0; z-index: 100; background: var(--bg-90); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding-block: 6px; }
@media (min-width: 48rem) { .bar { min-height: 68px; padding-block: 12px; } }
.mark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 18px; font-weight: 800; letter-spacing: 0.04em; }
.mark svg { width: 28px; height: 28px; color: var(--brand); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav-links { display: none; align-items: center; }
@media (min-width: 40rem) { .nav-links { display: flex; } }
.nav-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 12px; font-size: 14px; font-weight: 500; color: var(--mute); }
.nav-links a:hover { color: var(--fg); }
.social { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--fg); }
.social svg { width: 20px; height: 20px; fill: currentColor; }
a.social:hover { background: var(--brand); color: var(--bg); }
.social.is-inert { color: var(--dim); cursor: not-allowed; }

.ca { border-top: 1px solid var(--line); }
@media (max-width: 39.99rem) {
  .top { display: contents; }
  header { border-bottom: 1px solid var(--line); }
  .ca { position: sticky; top: 0; z-index: 100; border-top: 0; border-bottom: 1px solid var(--line); background: var(--bg-90); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
.ca-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-block: 8px; }
.ca-label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--mute); text-transform: uppercase; letter-spacing: 0.12em; }
.ca-in > .btn { margin-left: auto; order: 2; }
.ca-value { order: 3; flex: 1 1 100%; min-width: 0; font-size: clamp(15px, 4.1vw, 24px); line-height: 1.35; font-weight: 500; overflow-wrap: anywhere; word-break: break-all; letter-spacing: -0.01em; color: var(--brand); }
.ca-value.is-pending { color: var(--mute); order: 2; flex: 1 1 auto; }
.ca-in > .btn[disabled] { order: 3; }
@media (min-width: 40rem) { .ca-value { order: 2; flex: 1 1 260px; } .ca-in > .btn { order: 3; margin-left: 0; } }

/* ---------- buttons (reference: 44h, 14/500, 0 18px, 1px rule, square, no transition) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 18px; border: 1px solid var(--brand); border-radius: 0; font-size: 14px; line-height: 14px; font-weight: 500; white-space: nowrap; color: var(--brand); }
.btn:hover { background: var(--brand); color: var(--bg); }
.btn-solid { background: var(--brand); color: var(--bg); }
.btn-solid:hover { background: transparent; color: var(--brand); }
.btn[disabled], .btn[aria-disabled="true"] { border-color: var(--dim); color: var(--dim); cursor: not-allowed; background: none; }
.btn.is-done { background: var(--brand); color: var(--bg); }
.btn-sm { padding: 0 12px; font-size: 13px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.layer { position: absolute; inset: 0; will-change: transform; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); }
.blob.b1 { width: 620px; height: 620px; right: -140px; top: -160px; background: radial-gradient(circle, var(--brand-deep-40), transparent 68%); animation: drift-a 22s var(--ease-io) infinite alternate; }
.blob.b2 { width: 520px; height: 520px; right: 24%; bottom: -260px; background: radial-gradient(circle, var(--brand-deep-24), transparent 68%); animation: drift-b 28s var(--ease-io) infinite alternate; }
.blob.b3 { width: 380px; height: 380px; left: -160px; top: 34%; background: radial-gradient(circle, var(--brand-deep-16), transparent 68%); animation: drift-c 34s var(--ease-io) infinite alternate; }
@keyframes drift-a { to { transform: translate3d(-90px, 70px, 0) scale(1.15); } }
@keyframes drift-b { to { transform: translate3d(110px, -60px, 0) scale(0.9); } }
@keyframes drift-c { to { transform: translate3d(80px, -90px, 0) scale(1.2); } }
.grid-lines { background-image: linear-gradient(to right, var(--brand-06) 1px, transparent 1px), linear-gradient(to bottom, var(--brand-06) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(70% 80% at 72% 40%, var(--fg) 25%, transparent 100%); -webkit-mask-image: radial-gradient(70% 80% at 72% 40%, var(--fg) 25%, transparent 100%); }
.ring { position: absolute; right: 8%; border: 1px solid var(--brand-10); border-radius: 50%; }
.ring.r1 { width: 340px; height: 340px; top: 14%; }
.ring.r2 { width: 560px; height: 560px; top: -4%; right: 1%; border-color: var(--brand-06); }
.art { display: flex; align-items: center; justify-content: flex-end; padding-right: 4%; }
.art svg { width: min(44vw, 520px); height: auto; color: var(--brand); filter: drop-shadow(0 0 28px var(--brand-deep-40)); }
.art .lv1 { opacity: 0.35; } .art .lv2 { opacity: 0.7; } .art .lv3 { opacity: 1; }
@media (max-width: 899px) { .art { align-items: flex-start; justify-content: center; padding: 28px 0 0; } .art svg { width: min(62vw, 300px); } .ring.r2 { display: none; } }

.hero-copy { display: flex; flex-direction: column; justify-content: center; min-height: 560px; padding-block: 40px 56px; }
@media (max-width: 899px) { .hero-copy { min-height: 0; padding-top: calc(min(62vw, 300px) + 40px); } }
@media (min-width: 900px) { .hero-copy { min-height: 700px; } }
.hero-copy-inner { display: flex; flex-direction: column; gap: 20px; max-width: 600px; }
.kicker { font-size: 14px; line-height: 20px; color: var(--mute); }
.caret { display: inline-block; width: 8px; height: 14px; margin-left: 4px; vertical-align: -2px; background: var(--brand); animation: caret var(--caret) step-end infinite; }
@keyframes caret { 50% { opacity: 0; } }
h1 { font-size: 28px; line-height: 1.4; font-weight: 800; letter-spacing: -0.02em; }
h1 em { font-style: normal; color: var(--brand); }
@media (min-width: 900px) { h1 { font-size: 44px; line-height: 1.2; } }
@media (min-width: 1440px) { h1 { font-size: 64px; } }
.lede { max-width: 480px; color: var(--fg-80); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.meta { font-size: 12px; line-height: 16px; color: var(--mute); }
.chips-inline { display: flex; flex-wrap: wrap; gap: 8px; }

/* pill + live dot */
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; line-height: 16px; color: var(--fg-80); background: var(--bg-70); }
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--mute); flex: none; }
.pill[data-status="live"] .dot { background: var(--brand); }
.pill[data-status="live"] .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--brand); animation: ping 1.8s var(--ease-out) infinite; }
.pill[data-status="connecting"] .dot, .pill[data-status="retrying"] .dot { animation: blink 1s step-end infinite; }
.pill[data-status="offline"] .dot { background: transparent; border: 1px solid var(--mute); }
@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 80%, 100% { transform: scale(3); opacity: 0; } }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- ticker ---------- */
.ticker { position: relative; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.ticker-track { display: flex; width: max-content; animation: tick var(--tick-dur, 60s) linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-set { display: flex; flex: none; }
@keyframes tick { to { transform: translateX(-50%); } }
.t-item { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 20px; font-size: 13px; white-space: nowrap; border-right: 1px solid var(--line); }
.t-item .sym { font-weight: 800; color: var(--brand); }
.t-item .px { color: var(--fg-80); }
.t-item .chg[data-dir="down"] { color: var(--mute); }
.ticker::before, .ticker::after { content: ""; position: absolute; top: 0; bottom: 0; width: 48px; z-index: 1; pointer-events: none; }
.ticker::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.ticker::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }

/* ---------- sections ---------- */
.sec { position: relative; padding-block: 80px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--stack-h, 120px) + 8px); }
.sec-first { padding-block: 96px; }
@media (min-width: 48rem) { .sec-first { padding-block: 128px; } }
.sec-in { display: flex; flex-direction: column; gap: 40px; }
.sec-head { display: flex; flex-direction: column; gap: 16px; max-width: 672px; }
h2 { font-size: 28px; line-height: 1.4; font-weight: 800; letter-spacing: -0.025em; }
@media (min-width: 48rem) { h2 { font-size: 44px; line-height: 1.3333; } }
.lead { font-size: 20px; line-height: 31.11px; color: var(--fg-80); }
.cap { font-size: 14px; line-height: 20px; color: var(--mute); }

.steps { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 24px; border: 1px solid var(--line); }
.step-n { font-size: 14px; line-height: 24px; color: var(--brand-deep); font-weight: 700; }
.step h3 { font-size: 24px; line-height: 32px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.step p { font-size: 14px; line-height: 22px; color: var(--fg-80); }

/* spotlight */
.spot { position: relative; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--brand-16), transparent 70%); transition: opacity var(--t-med) var(--ease-out); }
@media (hover: hover) { .spot:hover::before { opacity: 1; } .spot:hover { border-color: var(--dim); } }
@media (hover: hover) { .spot-row:hover { background-image: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), var(--brand-10), transparent 70%); } }

/* tabs + code */
.tabs { display: flex; flex-direction: column; gap: 16px; }
.tabbar { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.tablist { display: flex; flex: 1; min-width: 0; overflow-x: auto; }
.tab { min-height: 44px; padding: 12px 16px; font-size: 14px; line-height: 20px; color: var(--mute); white-space: nowrap; }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { background: var(--brand); color: var(--bg); }
.code { overflow-x: auto; padding: 20px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; line-height: 20px; white-space: pre; tab-size: 2; }
.code[hidden] { display: none; }

/* market table: horizontal scroll on narrow screens, as on the reference */
.pill-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 13px; line-height: 19.5px; }
th { padding: 8px 12px; text-align: left; font-weight: 500; color: var(--mute); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tok { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { position: relative; width: 32px; height: 32px; flex: none; border: 1px solid var(--line); background: var(--surface); overflow: hidden; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: var(--brand); }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tok-n { display: flex; flex-direction: column; min-width: 0; }
.tok-n b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.tok-n span { color: var(--mute); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.rank { color: var(--mute); width: 36px; }
.chg[data-dir="down"] { color: var(--mute); }
.chg[data-dir="up"] { font-weight: 700; color: var(--brand); }
.flash { animation: flash 900ms var(--ease-out); }
@keyframes flash { 0% { background: var(--brand-24); } 100% { background: transparent; } }

.skel { display: inline-block; height: 12px; width: 70px; border-radius: 2px; background: linear-gradient(90deg, var(--surface) 0%, var(--dim) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel.w1 { width: 36px; } .skel.w2 { width: 96px; } .skel.w3 { width: 60px; } .skel.w4 { width: 72px; }
.skel-logo { width: 32px; height: 32px; background: linear-gradient(90deg, var(--surface) 0%, var(--dim) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fade-in { opacity: 0; transform: translateY(8px); transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out); transition-delay: calc(var(--i, 0) * 45ms); }
.fade-in.in { opacity: 1; transform: none; }
.err { display: none; padding: 12px 0; font-size: 13px; color: var(--fg-80); }
.err[data-on="true"] { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* tiles: 2 / 3 / 6 columns, 12px gap, 101px tall (reference) */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 48rem) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 101px; padding: 16px; border: 1px solid var(--line); }
.tile .k { font-size: 12px; line-height: 16px; color: var(--mute); }
.tile .v { font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .v.is-pending { color: var(--mute); font-size: 14px; font-weight: 400; letter-spacing: 0; }

.records { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rec { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 16px; border: 1px solid var(--line); font-size: 14px; }
.rec .rl { font-weight: 800; }
.rec .rs { color: var(--mute); font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.rec[data-state="stated"] .rs { color: var(--brand); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 4px 10px; border: 1px solid var(--line); font-size: 12px; line-height: 16px; color: var(--mute); }
.chip b { color: var(--fg-80); font-weight: 500; }

.faq { max-width: 800px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 16px 0; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--mute); }
.faq details[open] summary::after { content: "\2212"; }
.faq .ans { padding: 0 0 20px; max-width: 692px; color: var(--mute); }

.foot { border-top: 1px solid var(--line); padding-block: 48px; }
.foot-in { display: flex; flex-direction: column; gap: 24px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.foot-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 12px; font-size: 14px; color: var(--mute); }
.foot-links a:hover { color: var(--fg); }
.fine { font-size: 13px; line-height: 20px; color: var(--mute); max-width: 640px; }

.js [data-reveal] { opacity: 0; will-change: transform, opacity; }
.js [data-reveal].is-in { will-change: auto; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .fade-in { opacity: 1; transform: none; }
  .progress { display: none; }
  .ticker { overflow-x: auto; }
  .ticker-track { transform: none; }
  .ticker-set + .ticker-set { display: none; }
  .ticker::before, .ticker::after { display: none; }
}
