/* Base: reset, type, the shell, and every component the pages share. Page layouts are in site.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--blue); color: #fff; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.up { color: var(--up); }
.down { color: var(--down); }
.flame { color: var(--flame-ink); }
.blue { color: var(--blue-text); }
.fine { font-size: 13px; color: var(--muted); line-height: 1.5; }
.label { font: 500 11.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kicker { display: inline-flex; align-items: center; gap: 10px; font: 500 12px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-text); box-shadow: 0 0 0 4px var(--blue-soft); flex: none; }
.display { font-family: var(--display); font-stretch: 118%; font-weight: 800; letter-spacing: -.02em; line-height: .95; }
h1.page-title, .page-head h1 { font: 800 clamp(36px, 5.2vw, 70px)/.98 var(--display); font-stretch: 116%; letter-spacing: -.03em; text-wrap: balance; }
.page-head h1 em, h2.sec em { font-style: normal; color: var(--blue-text); }
h2.sec { font: 800 clamp(28px, 3.5vw, 46px)/1 var(--display); font-stretch: 114%; letter-spacing: -.025em; text-wrap: balance; }
.lede { font-size: clamp(17px, 1.45vw, 19px); line-height: 1.55; color: var(--ink-2); max-width: 38em; }
.lede b { color: var(--ink); font-weight: 600; }
.icon { display: inline-flex; flex: none; }

/* ---------- the frame: two corner brackets, the brand's one object ---------- */
.frame { position: relative; --fc: 14px; --fw: 2px; --fcol: var(--ink); }
.frame::before, .frame::after { content: ''; position: absolute; width: var(--fc); height: var(--fc); pointer-events: none; transition: transform .32s var(--ease); }
.frame::before { top: 0; left: 0; border-top: var(--fw) solid var(--fcol); border-left: var(--fw) solid var(--fcol); }
.frame::after { right: 0; bottom: 0; border-bottom: var(--fw) solid var(--fcol); border-right: var(--fw) solid var(--fcol); }
.frame.blue { --fcol: var(--blue-text); }
.frame.paper { --fcol: var(--night-ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border: 1px solid var(--line-3); border-radius: var(--r); background: var(--surface); color: var(--ink);
  font: 600 15px/1 var(--text); text-decoration: none; white-space: nowrap; transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .1s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.dark:hover { background: #24262f; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; }
.btn.lg { height: 54px; padding: 0 24px; font-size: 16px; }
.btn.wide { width: 100%; }
.btn[aria-disabled='true'] { opacity: .55; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: var(--r); background: transparent; }
.icon-btn:hover { background: var(--surface-2); }
button.link { border: 0; background: none; padding: 0; color: var(--blue-text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--surface); font: 500 12px/1 var(--mono); color: var(--ink-2); white-space: nowrap; }
.chip.blue { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue-ink); }
.chip.ink { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip.flame { border-color: rgba(255, 90, 31, .35); background: var(--flame-soft); color: var(--flame-ink); }
.chip.demo { border-color: transparent; background: var(--warn-bg); color: #3d2a00; }
.chip.good { border-color: rgba(10, 138, 78, .3); color: var(--up); background: rgba(10, 138, 78, .07); }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--ink); }
.pairtag { display: inline-flex; align-items: baseline; gap: 5px; font: 500 13px/1 var(--mono); white-space: nowrap; }
.pairtag .slash { color: var(--blue-text); font-weight: 700; }

/* ---------- the shell ---------- */
.demo-strip { background: var(--warn-bg); color: #2b1d00; font: 500 12.5px/1.3 var(--mono); text-align: center; padding: 7px var(--gutter); }
.demo-strip b { font-weight: 700; letter-spacing: .06em; }
#top { position: sticky; top: 0; z-index: 40; background: rgba(243, 243, 238, .9); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
#top.scrolled { border-bottom-color: var(--line-2); }
.top-bar { display: flex; align-items: center; gap: 20px; height: var(--head); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand .lock-word { display: inline-flex; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { white-space: nowrap; padding: 8px 10px; border-radius: var(--r); text-decoration: none; font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current='page'] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--blue-text); border-radius: 0; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.tabbar { display: none; }

/* the CA box and chip */
.ca { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); max-width: 560px; }
.ca .label { flex: none; }
.ca .ca-v { font: 500 13.5px/1.3 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; min-width: 0; }
.ca .ca-note { font-size: 12.5px; color: var(--muted); }
.ca-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px dashed var(--line-3); border-radius: var(--r); font: 500 12.5px/1 var(--mono); color: var(--ink-2); background: transparent; white-space: nowrap; }
.ca-chip.set { border-style: solid; background: var(--surface); }
.ca-chip b { color: var(--ink); font-weight: 600; }

/* wallet */
.wallet-box { position: relative; }
.wallet-btn { height: 40px; font-size: 14px; gap: 8px; }
.wallet-btn.on { font-family: var(--mono); font-weight: 500; font-size: 13px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px rgba(10, 138, 78, .15); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-2); box-shadow: 0 12px 40px rgba(12, 13, 18, .14); z-index: 60; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: var(--r); background: none; text-align: left; text-decoration: none; font-size: 14.5px; }
.menu-item:hover { background: var(--surface-2); }
.wallet-list { display: grid; gap: 8px; margin: 14px 0 6px; }
.wallet-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); text-align: left; }
.wallet-row:hover { border-color: var(--ink); }
.wallet-row img { width: 30px; height: 30px; border-radius: 7px; }
.wallet-name { font-weight: 600; flex: 1; }
.wallet-tag { font: 500 11.5px/1 var(--mono); color: var(--muted); }
.wallet-help { margin-top: 12px; display: grid; gap: 8px; }

/* footer: the night band */
#foot { background: var(--night); color: var(--night-ink); margin-top: 120px; }
.foot { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; padding-top: 64px; padding-bottom: 28px; }
.foot-brand p { color: var(--night-muted); margin-top: 18px; max-width: 30em; font-size: 14.5px; }
.foot-col { display: grid; align-content: start; gap: 10px; }
.foot-col .label { color: var(--night-muted); margin-bottom: 4px; }
.foot-col a { color: var(--night-ink); text-decoration: none; font-size: 14.5px; }
.foot-col a:hover { text-decoration: underline; }
.foot-base { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; border-top: 1px solid var(--night-line); padding-top: 22px; margin-top: 16px; }
.foot-base p { color: var(--night-muted); font-size: 13px; max-width: 60em; }
.foot-base button.link { color: var(--night-ink); font: 500 13px var(--mono); white-space: nowrap; }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; }
.field > .label { color: var(--ink-2); }
.input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-3); border-radius: var(--r); background: var(--surface); font-size: 16px; transition: border-color .15s; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:hover { border-color: var(--ink-2); }
.input:focus { outline: none; border-color: var(--blue-text); box-shadow: 0 0 0 3px var(--blue-soft); }
.input[aria-invalid] { border-color: var(--down); }
.prefix { display: flex; align-items: stretch; border: 1px solid var(--line-3); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.prefix:focus-within { border-color: var(--blue-text); box-shadow: 0 0 0 3px var(--blue-soft); }
.prefix > span { display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); color: var(--ink-2); border-right: 1px solid var(--line-2); }
.prefix .input { border: 0; border-radius: 0; box-shadow: none; }
.problem { color: var(--down); font-size: 13.5px; min-height: 0; }
.problem:empty { display: none; }
.hint { font-size: 13px; }

/* ---------- cards, tiles, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-2); padding: 22px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); overflow: hidden; }
.tile { display: grid; gap: 8px; padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.tile .v { font: 600 clamp(20px, 2.1vw, 26px)/1.1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .h { font-size: 12.5px; color: var(--muted); }
.tile.accent .v { color: var(--blue-text); }
.tile.burn .v { color: var(--flame-ink); }
.table { border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); overflow: hidden; }
.thead, .trow { display: grid; align-items: center; gap: 14px; padding: 0 18px; }
.thead { height: 40px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.thead > * { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.trow { min-height: 62px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.trow:last-child { border-bottom: 0; }
a.trow:hover { background: #FAFAF7; }
.r { text-align: right; justify-self: end; }
.t-coin { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-coin b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-coin .t-name { display: grid; min-width: 0; gap: 3px; }
.t-coin .t-name span { font: 500 12px/1 var(--mono); color: var(--muted); }
.t-tx { font: 500 12.5px/1 var(--mono); color: var(--blue-text); text-decoration: none; white-space: nowrap; }
.t-tx:hover { text-decoration: underline; }
.t-tx.demo { color: var(--muted); }

/* the curve bar */
.curve { position: relative; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.curve > i { position: absolute; inset: 0 auto 0 0; background: var(--ink); border-radius: 3px; }
.curve.done > i { background: var(--blue-text); }

/* segmented controls and tabs */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: var(--r); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 3px; background: transparent; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 var(--line-2), 0 0 0 1px var(--line-2); }

.empty { display: grid; justify-items: start; gap: 10px; padding: 40px 28px; border: 1px dashed var(--line-3); border-radius: var(--r-2); }
.empty h3 { font: 800 24px/1.1 var(--display); font-stretch: 112%; letter-spacing: -.02em; }
.empty .frame { width: 64px; height: 64px; --fc: 18px; --fw: 4px; margin-bottom: 6px; }
.banner { padding: 14px 18px; border: 1px solid var(--blue-line); border-radius: var(--r); background: var(--blue-soft); font-size: 15px; margin: 18px 0 0; }
.banner.good { border-color: rgba(10, 138, 78, .3); background: rgba(10, 138, 78, .07); }
.banner.warn { border-color: rgba(122, 83, 0, .3); background: #FFF6D1; }

/* skeletons */
.sk { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; border-radius: 3px; height: 14px; }
html[data-motion='on'] .sk { animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* modal and toasts */
.modal-veil { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(12, 13, 18, .42); }
.modal-panel { width: min(540px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: var(--r-2); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(12, 13, 18, .3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0 22px; }
.modal-head h2 { font: 800 22px/1.15 var(--display); font-stretch: 110%; letter-spacing: -.02em; }
.modal-panel.locked .modal-x { visibility: hidden; }
.modal-body { display: grid; gap: 16px; padding: 16px 22px 22px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.toasts { position: fixed; z-index: 120; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { padding: 12px 16px; border-radius: var(--r); background: var(--ink); color: var(--on-ink); font-size: 14.5px; box-shadow: 0 10px 30px rgba(12, 13, 18, .25); }
.toast.bad { background: var(--down); }
.flow-steps { display: grid; gap: 10px; counter-reset: s; }
.flow-steps li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.flow-steps li.done { color: var(--ink-2); }
.flow-steps li.now { color: var(--ink); font-weight: 600; }
.flow-steps li.bad { color: var(--down); font-weight: 600; }
.flow-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-3); font: 500 12px/1 var(--mono); flex: none; }
.flow-steps li.done .flow-mark { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.flow-steps li.now .flow-mark { border-color: var(--blue-text); color: var(--blue-text); box-shadow: 0 0 0 3px var(--blue-soft); }
.flow-steps li.bad .flow-mark { border-color: var(--down); color: var(--down); }
.big-line { font-size: 18px; }
.msg { white-space: pre-wrap; margin: 0; padding: 14px; background: var(--surface-2); border-radius: var(--r); font: 12.5px/1.55 var(--mono); color: var(--ink-2); max-height: 260px; overflow: auto; }

/* ---------- phones ---------- */
@media (max-width: 1080px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
}
@media (max-width: 760px) {
  :root { --head: 58px; }
  .top-bar { gap: 10px; }
  .brand .lock-word { display: none; }
  .top-cta, .ca-chip { display: none; }
  .wallet-btn.on .muted { display: none; }
  .tabbar { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(243, 243, 238, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line-2); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: grid; place-items: center; height: 56px; text-decoration: none; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
  .tabbar a[aria-current='page'] { color: var(--blue-text); }
  .tabbar a.tab-cta { color: var(--blue-text); }
  body { padding-bottom: 64px; }
  #foot { margin-top: 80px; }
  .foot { grid-template-columns: 1fr 1fr; gap: 28px; padding-top: 44px; }
  .foot-brand { grid-column: 1 / -1; }
  .foot-base { flex-direction: column; align-items: flex-start; }
  .card { padding: 18px; }
  .thead { display: none; }
}
.foot-lock { display: inline-flex; align-items: center; gap: 16px; color: var(--night-ink); text-decoration: none; }
