/* Structure and components, reading only tokens. The direction's own stylesheet comes after this one and restyles
   what makes the project itself (the hero art, the coin card, the buttons): see references/design-system.md. */

/* ---------- 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; }
img, svg { 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; }
/* anchors (/how#costs) land below the sticky header, not under it */
[id] { scroll-margin-top: calc(var(--top-h) + 20px); }
#main:focus { outline: none; }
/* the skip link: off screen until the keyboard reaches it */
.skip { position: fixed; left: 12px; top: -60px; z-index: 70; padding: 10px 16px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- 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(38px, 5.4vw, 72px); }
h1.display { font-size: clamp(44px, 6.6vw, 92px); line-height: 0.96; }
h2 { font-size: clamp(28px, 3.4vw, 44px); }
h3, .h3 { font: 650 19px/1.3 var(--font-text); letter-spacing: -0.01em; }
.accent { color: var(--accent); }
.lede { font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); max-width: 36em; }
.muted { color: var(--muted); }
.fine { font-size: 13.5px; 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.1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 14px; }
.kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.up { color: var(--good); }
.down { color: var(--bad); }

/* ---------- layout ---------- */
.wrap { width: min(var(--wrap), 100% - 2 * var(--gut)); margin-inline: auto; }
.section { padding-top: clamp(56px, 8vw, 104px); }
.page-head { padding-top: clamp(40px, 6vw, 72px); padding-bottom: 28px; display: grid; gap: 14px; justify-items: start; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.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; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
main { padding-bottom: 120px; }
main.enter { animation: page-in var(--t) 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) 86%, transparent); backdrop-filter: blur(14px); border-bottom: var(--border); }
.top-bar { height: var(--top-h); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font: var(--display-weight) 19px/1 var(--font-display); letter-spacing: -0.02em; }
.brand-mark { width: 22px; height: 22px; border-radius: 50%; border: 5px solid var(--accent); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: var(--r-pill); color: var(--ink-2); font-size: 15px; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); background: var(--surface); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.demo-strip { background: var(--surface-2); color: var(--ink-2); font-size: 13px; text-align: center; padding: 6px var(--gut); }
.demo-strip b { color: var(--warn); font-weight: 700; }
.tabbar { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; 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(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.lg { height: 52px; padding: 0 24px; font-size: 16px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--surface); }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-arrow { color: var(--ink-2); }
.link-arrow:hover { color: var(--ink); }
.icon { display: inline-flex; }

/* ---------- chips, pills, banners ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); border: var(--border); background: var(--surface); font-size: 12px; color: var(--ink-2); white-space: nowrap; cursor: default; }
button.chip { cursor: pointer; }
.chip.done { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.chip.demo { color: var(--warn); }
.chips .chip, .chips button { cursor: pointer; }
.banner { margin-top: 20px; padding: 14px 18px; border-radius: var(--r); border: var(--border); background: var(--surface); }
.banner.good { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- segmented controls ---------- */
.seg, .chips { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); border: var(--border); background: var(--bg-2); }
.chips { border: 0; background: none; padding: 0; gap: 8px; }
.seg button, .chips button { height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: 0; background: none; color: var(--ink-2); cursor: pointer; font-size: 14px; }
.chips button { border: var(--border); background: var(--surface); }
.seg button[aria-pressed="true"], .chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }
.controls .input { margin-left: auto; max-width: 300px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; margin-top: 16px; align-content: start; }
.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(--accent); }
.input[aria-invalid] { border-color: var(--bad); }
.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(--accent); }
.problem { color: var(--bad); font-size: 13.5px; min-height: 0; }
.problem:empty { display: none; }
.hint { font-size: 13px; }
.drop { display: grid; place-items: center; width: 100%; min-height: 150px; border-radius: var(--r); border: 1.5px dashed var(--line-2); background: var(--bg-2); cursor: pointer; padding: 16px; text-align: center; }
.drop.over { border-color: var(--accent); }
.drop img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--r); }
.drop-inner { display: grid; gap: 6px; justify-items: center; }
details.links { margin-top: 18px; }
details.links summary { cursor: pointer; color: var(--ink-2); }

/* ---------- cards ---------- */
.card { border-radius: var(--r-lg); border: var(--border); background: var(--surface); padding: 22px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.coin-card { display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg); border: var(--border); background: var(--surface); box-shadow: var(--shadow); transition: transform var(--t) var(--ease), border-color var(--t) var(--ease); }
a.coin-card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.coin-card-head { display: flex; align-items: center; gap: 12px; }
.coin-card-id { min-width: 0; flex: 1; }
.coin-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-sym { font-size: 13px; color: var(--muted); }
.coin-card-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.coin-card-nums > div { display: grid; gap: 2px; }
.coin-card-nums .num { font-size: 15px; }
.coin-card-last { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-art { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.coin-art.drawn { display: inline-grid; place-items: center; font: 700 16px/1 var(--font-mono); color: hsl(var(--art-hue) 40% 82%); background: hsl(var(--art-hue) 28% 22%); }
.bar { height: 4px; border-radius: 2px; background: var(--bg-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.skeleton .sk { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--bg-2), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.6s infinite linear; }
.sk-head { height: 48px; } .sk-line { height: 14px; } .sk-line.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- stats, CA box ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.stat { display: grid; gap: 2px; }
.stat-value { font-size: 22px; }
.stat-hint { font-size: 12.5px; }
.hero-stats { margin-top: 26px; }
.coin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 22px; }
.coin-stats .stat { padding: 16px; border-radius: var(--r); border: var(--border); background: var(--surface); }
.ca { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 22px; padding: 12px 14px; border-radius: var(--r); border: 1px dashed var(--line-2); max-width: 100%; }
.ca-addr { font-size: 13px; word-break: break-all; user-select: all; }
.ca-soon { color: var(--warn); }
.ca-note { font-size: 13px; flex-basis: 100%; }
.ca.small { margin: 0; padding: 0 12px; height: 34px; border-radius: var(--r-pill); flex-wrap: nowrap; }
.ca.small .label { font-size: 10px; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; padding-top: clamp(48px, 7vw, 96px); }
.hero-copy { display: grid; justify-items: start; }
.hero-copy .lede { margin-top: 18px; }
.ctas { margin-top: 26px; }
.hero-art { min-height: 260px; display: grid; align-items: center; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 26px; }
.step { padding: 22px; border-radius: var(--r-lg); border: var(--border); background: var(--surface); display: grid; gap: 8px; align-content: start; }
.step-n { color: var(--accent); font-size: 13px; }
.band { display: grid; justify-items: start; gap: 22px; }
.feed { display: grid; }
.feed-row { display: grid; grid-template-columns: 90px 1fr auto 70px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: var(--border); font-size: 14.5px; }
.feed-sym { color: var(--ink-2); font-size: 13px; }
.tx { display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; }
.feed-time { font-size: 12.5px; text-align: right; }

/* ---------- coin page ---------- */
.coin-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding-top: 40px; }
.coin-title { display: grid; gap: 10px; }
.coin-title h1 { font-size: clamp(32px, 4.2vw, 54px); }
.wrap-row { flex-wrap: wrap; }
.coin-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; margin-top: 18px; align-items: start; }
.coin-main { display: grid; gap: 18px; }
.chart { width: 100%; }
.chart.empty { padding: 40px 0; text-align: center; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-area { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin-top: 16px; font-size: 14.5px; }
.facts dt { color: var(--muted); }
.about { display: grid; gap: 12px; }

/* ---------- launch ---------- */
.launch-grid { display: grid; grid-template-columns: 1fr 380px; gap: 22px; align-items: start; }
.launch-steps { display: grid; gap: 18px; }
.step-title { display: flex; align-items: center; gap: 12px; font: 650 21px/1.2 var(--font-text); letter-spacing: -0.01em; }
.step-title .step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 13px; }
.step-card > p { margin-top: 10px; }
.split { display: flex; height: 34px; margin-top: 16px; border-radius: var(--r-sm); overflow: hidden; border: var(--border); }
.split span { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 22%, transparent); font: 12px var(--font-mono); }
.share { margin-top: 10px; font-size: 14px; }
.launch-side { position: sticky; top: calc(var(--top-h) + 20px); display: grid; gap: 14px; }
.costs { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; margin-top: 10px; font-size: 14px; }
.costs dt { color: var(--ink-2); }
.costs dd { text-align: right; }
.costs .total { font-weight: 700; color: var(--ink); padding-top: 8px; border-top: var(--border); }
.todo { font-size: 13.5px; color: var(--ink-2); min-height: 1.4em; }
.notes { display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.notes li { display: flex; gap: 8px; align-items: flex-start; }
.notes .icon { color: var(--good); margin-top: 2px; }
.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(--bad); }
.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(--accent); animation: ping 1.8s infinite; }
.flow-steps li.done .flow-mark { background: var(--good); color: var(--bg); border-color: transparent; }
.big-line { font-size: 19px; margin-bottom: 12px; }

/* ---------- how ---------- */
.steps.big .step { padding: 26px; }
.faq { display: grid; gap: 10px; margin-top: 22px; max-width: 760px; }
.faq details { border-radius: var(--r); border: var(--border); background: var(--surface); padding: 16px 18px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin-top: 10px; color: var(--ink-2); }

/* ---------- empty states ---------- */
.empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 60px 16px; }
.more { display: grid; justify-items: center; margin-top: 24px; }
.addr-title { font-size: clamp(28px, 4vw, 44px); }

/* ---------- wallet ---------- */
.wallet-box { position: relative; }
.wallet-btn.on { padding: 0 14px; gap: 10px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 8px; 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; }
.menu-item:hover { background: var(--surface); }
.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-2); }
.wallet-row[disabled] { opacity: 0.6; cursor: default; }
.wallet-row img { border-radius: 8px; }
.wallet-name { flex: 1; font-weight: 600; }
.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(0, 0, 0, 0.6); backdrop-filter: blur(4px); animation: fade var(--t) var(--ease); }
.modal-panel { width: min(480px, 100%); max-height: calc(100svh - 32px); overflow: auto; border-radius: var(--r-lg); border: var(--border); 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: 14px; }
.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.98); } }
.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(--bad); color: #fff; }

/* ---------- footer ---------- */
#foot { border-top: var(--border); padding: 48px 0 calc(48px + env(safe-area-inset-bottom)); }
.foot { display: grid; grid-template-columns: 1fr auto; gap: 24px; }
.foot-brand .brand-word { font: var(--display-weight) 22px/1 var(--font-display); }
.foot-brand p { margin-top: 8px; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: start; color: var(--ink-2); }
.foot-base { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13.5px; padding-top: 20px; border-top: var(--border); }

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

/* ---------- between tablet and desktop: the header keeps the nav, the wallet and the one action on one line ---------- */
.nav a { white-space: nowrap; }
@media (max-width: 1120px) {
  .top-actions .ca { display: none; }
  .top-bar { gap: 20px; }
}

/* ---------- phones ---------- */
@media (max-width: 980px) {
  .hero, .launch-grid, .coin-grid, .two-col { grid-template-columns: 1fr; }
  .launch-side { position: static; }
}
@media (max-width: 860px) {
  .nav, .top-actions .ca, .top-cta { display: none; }
  /* sticky at the end of the page: it rides at the bottom of the screen while scrolling, and sits after the footer
     (never on top of the risk line) when the page ends, or when the page is captured whole */
  .tabbar { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); margin: 0 12px calc(12px + env(safe-area-inset-bottom)); z-index: 25; display: flex; justify-content: space-around; padding: 6px; border-radius: var(--r-pill); border: var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); }
  .tabbar a { padding: 8px 12px; border-radius: var(--r-pill); color: var(--ink-2); font-size: 14px; }
  .tabbar a[aria-current] { background: var(--ink); color: var(--bg); }
  .coin-head { grid-template-columns: auto 1fr; }
  .coin-actions { grid-column: 1 / -1; }
  .controls .input { margin-left: 0; max-width: none; }
  .feed-row { grid-template-columns: 70px 1fr 56px; }
  .feed-row .tx { display: none; }
}
@media (max-width: 560px) {
  .two { grid-template-columns: 1fr; }
  .ctas .btn { width: 100%; }
  .foot { grid-template-columns: 1fr; }
  .wallet-btn.on .muted { display: none; }
}
