/* Structure and components, reading only tokens. ombre.css comes after and draws what makes Ombre itself:
   the room, the coin vignettes, the plaque, the shadow. */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100svh; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font-text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }
[hidden] { display: none !important; }

/* ---------- type ---------- */
h1, h2, .display { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.02; text-wrap: balance; }
h1 { font-size: clamp(36px, 5vw, 64px); }
h1.display { font-size: clamp(44px, 6.4vw, 88px); line-height: 0.96; }
h2 { font-size: clamp(28px, 3.2vw, 42px); }
h3, .h3 { font: 600 18px/1.3 var(--font-text); letter-spacing: -0.01em; }
.accent { color: var(--ink); }
.lede { font-size: clamp(17px, 1.4vw, 19px); color: var(--ink-2); max-width: 34em; }
.lede b { color: var(--ink); font-weight: 600; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); }
.mono, .num, .label, .kicker, .chip { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 14px; }
.kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.up { color: var(--ink); }
.down { color: var(--muted); }

/* ---------- layout ---------- */
.wrap { width: min(var(--wrap), 100% - 2 * var(--gut)); margin-inline: auto; }
.section { padding-top: clamp(48px, 7vw, 88px); }
.page-head { padding-top: clamp(36px, 5vw, 64px); padding-bottom: 24px; display: grid; gap: 12px; justify-items: start; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 18px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
main { padding-bottom: 96px; min-height: 60vh; }
main.enter { animation: page-in 320ms var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- header ---------- */
#top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: var(--border); }
.top-bar { height: var(--top-h); display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; flex: none; color: var(--ink); }
.brand svg { height: 22px; width: auto; }
.top-search { flex: 1; max-width: 420px; margin-inline: auto; position: relative; }
.top-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.top-search input { width: 100%; height: 40px; padding: 0 44px 0 40px; border-radius: var(--r-pill); border: var(--border); background: var(--surface); font-size: 14.5px; }
.top-search input::placeholder { color: var(--muted); }
.top-search input:focus { outline: none; border-color: var(--line-3); }
.top-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 12px var(--font-mono); color: var(--muted); border: var(--border); border-radius: 5px; padding: 1px 7px; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 8px 12px; border-radius: var(--r-pill); color: var(--ink-2); font-size: 14.5px; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.demo-strip { background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; text-align: center; padding: 6px var(--gut); border-bottom: var(--border); }
.demo-strip b { color: var(--ink); font-weight: 600; }
.tabbar { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: transparent; color: var(--ink); font-weight: 500; font-size: 14.5px; cursor: pointer; white-space: nowrap; transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.btn:hover { border-color: var(--line-3); background: var(--surface); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.btn.primary:hover { background: #ffffff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 15.5px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.link-arrow { color: var(--ink-2); font-size: 14.5px; }
.link-arrow:hover { color: var(--ink); }
.icon { display: inline-flex; }

/* ---------- chips, banners ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); border: var(--border); background: var(--surface); font-size: 11.5px; color: var(--ink-2); white-space: nowrap; cursor: default; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--line-3); color: var(--ink); }
.chip.done { color: var(--ink); border-color: var(--line-3); }
.chip.demo { border-style: dashed; color: var(--ink-2); }
.chip.shade { background: var(--shade-2); border-color: var(--shade); color: var(--ink); }
.banner { margin-top: 20px; padding: 14px 18px; border-radius: var(--r); border: var(--border); background: var(--surface); }
.banner.good { border-color: var(--line-3); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 0 rgba(237, 235, 230, 0.5); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- segmented controls ---------- */
.seg, .chips { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); border: var(--border); background: var(--bg-2); }
.chips { border: 0; background: none; padding: 0; gap: 6px; flex-wrap: wrap; }
.seg button, .chips button { height: 32px; padding: 0 13px; border-radius: var(--r-pill); border: 0; background: none; color: var(--ink-2); cursor: pointer; font-size: 13.5px; }
.seg button:hover, .chips button:hover { color: var(--ink); }
.chips button { border: var(--border); background: transparent; }
.seg button[aria-pressed="true"], .chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: transparent; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 18px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; margin-top: 16px; }
.field-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.count { font: 11px var(--font-mono); color: var(--muted); }
.input { width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-2); font-size: 16px; }
textarea.input { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--line-3); }
.input[aria-invalid] { border-color: var(--ink); }
.prefix { display: flex; align-items: center; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-2); padding-left: 14px; }
.prefix.suffix { padding-left: 0; padding-right: 14px; }
.prefix .input { border: 0; background: none; padding-left: 4px; }
.prefix.suffix .input { padding-left: 14px; }
.prefix:focus-within { border-color: var(--line-3); }
.prefix:has(.input[aria-invalid]) { border-color: var(--ink); }
.problem { display: flex; gap: 8px; align-items: baseline; color: var(--ink); font-size: 13.5px; }
.problem::before { content: "!"; display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 700 11px/1 var(--font-mono); transform: translateY(2px); }
.problem:empty { display: none; }
.hint { font-size: 13px; }
.drop { display: grid; place-items: center; width: 100%; min-height: 140px; border-radius: var(--r); border: 1px dashed var(--line-3); background: var(--bg-2); cursor: pointer; padding: 16px; text-align: center; color: var(--ink-2); }
.drop:hover, .drop.over { border-color: var(--ink); color: var(--ink); }
.drop img { width: 112px; height: 112px; object-fit: cover; border-radius: 50%; }
.drop-inner { display: grid; gap: 6px; justify-items: center; }
.drop-inner .muted { font-size: 13px; }

/* ---------- cards ---------- */
.card { border-radius: var(--r-lg); border: var(--border); background: var(--surface); padding: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.skeleton .sk { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.6s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- stats ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 10px 32px; }
.stat { display: grid; gap: 3px; min-width: 0; }
.stat-value { font-size: 20px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-hint { font-size: 12px; }

/* ---------- feed ---------- */
.feed { display: grid; }
.feed-row { display: grid; grid-template-columns: 84px 1fr auto 64px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: var(--border); font-size: 14px; }
.feed-row:last-child { border-bottom: 0; }
.feed-sym { color: var(--ink-2); font-size: 12.5px; }
.tx { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }
.feed-time { font-size: 12px; text-align: right; }

/* ---------- facts, costs ---------- */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { text-align: right; overflow-wrap: anywhere; }
.costs { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; margin-top: 10px; font-size: 13.5px; }
.costs dt { color: var(--ink-2); }
.costs dd { text-align: right; }
.costs .total { font-weight: 600; color: var(--ink); padding-top: 8px; border-top: var(--border); }

/* ---------- flow modal ---------- */
.flow-steps { display: grid; gap: 10px; margin: 6px 0 16px; }
.flow-steps li { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.flow-steps li.now, .flow-steps li.done { color: var(--ink); }
.flow-steps li.bad { color: var(--ink); text-decoration: line-through; text-decoration-color: var(--muted); }
.flow-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); font: 12px var(--font-mono); }
.flow-steps li.now .flow-mark { border-color: var(--ink); animation: ping 2s infinite; }
.flow-steps li.done .flow-mark { background: var(--ink); color: var(--bg); border-color: transparent; }
.big-line { font-size: 19px; margin-bottom: 8px; }

/* ---------- empty states ---------- */
.empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 56px 16px; }
.empty h1, .empty h3 { text-wrap: balance; }

/* ---------- wallet ---------- */
.wallet-box { position: relative; }
.wallet-btn.on { padding: 0 14px; gap: 9px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px; border-radius: var(--r); border: var(--border); background: var(--surface-2); box-shadow: var(--shadow); display: grid; gap: 2px; z-index: 30; }
.menu-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; color: var(--ink-2); }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-sm); border: 0; background: none; text-align: left; cursor: pointer; font-size: 14px; }
.menu-item:hover { background: var(--surface-3); }
.wallet-list { display: grid; gap: 8px; }
.wallet-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: var(--border); background: var(--bg-2); cursor: pointer; text-align: left; }
.wallet-row:hover:not([disabled]) { border-color: var(--line-3); }
.wallet-row[disabled] { opacity: 0.6; cursor: default; }
.wallet-row img { border-radius: 8px; }
.wallet-name { flex: 1; font-weight: 500; }
.wallet-tag { font: 12px var(--font-mono); color: var(--muted); }
.wallet-help { display: grid; gap: 10px; margin-top: 14px; }

/* ---------- modal, toasts ---------- */
.modal-veil { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(5, 5, 6, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade var(--t) var(--ease); }
.modal-panel { width: min(470px, 100%); max-height: calc(100svh - 32px); overflow: auto; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); padding: 22px; animation: pop var(--t) var(--ease); overflow-wrap: anywhere; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h2 { font-size: 24px; }
.modal-panel.locked .modal-x { visibility: hidden; }
.modal-body { display: grid; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.985); } }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; justify-items: center; }
.toast { padding: 10px 16px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: var(--shadow); animation: pop var(--t) var(--ease); }
.toast.bad { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-3); }

/* ---------- motion switch: off means nothing moves (the visible switch decides, not the OS setting) ---------- */
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after { animation: none !important; transition: none !important; }
