/* No colour literals here: everything comes from tokens.css. Structure follows the studied reference. */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--color-bg); scroll-padding-top: 80px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--color-bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
main { flex: 1 0 auto; outline: none; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul[role=list], ol[role=list] { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
::selection { background: var(--accent-line); color: var(--text); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: var(--radius-sm); }
:focus:not(:focus-visible) { outline: none; }
.tnum, .num, dd, input { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.visually-hidden { clip-path: inset(50%); white-space: nowrap; border: 0; width: 1px; height: 1px; margin: -1px; padding: 0; position: absolute; overflow: hidden; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 400; background: var(--color-accent); color: var(--color-ink); padding: 8px 16px; border-radius: var(--radius); font-weight: 600; text-decoration: none; transition: top 150ms var(--ease); }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); padding-inline: var(--gutter); margin-inline: auto; }
.section { padding-block: var(--section); }
.section + .section, .band + .section { border-top: 1px solid var(--border-soft); }

h1, .display { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: -.035em; font-weight: 600; text-wrap: balance; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: -.025em; font-weight: 600; text-wrap: balance; }
h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: -.01em; font-weight: 600; }
.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); color: var(--text-muted); text-wrap: pretty; max-width: 600px; }
.meta { font-size: var(--fs-meta); line-height: var(--lh-meta); }
.label-text { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-faint); font-weight: 500; }
.stat-value { font-size: var(--fs-stat); line-height: var(--lh-stat); letter-spacing: -.015em; font-weight: 600; }

/* progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 500; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--color-accent); transform: scaleX(0); transform-origin: 0 50%; }

/* CA strip */
.ca-strip { background: var(--surface); border-bottom: 1px solid var(--border-soft); }
.ca-inner { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding-block: 10px; }
.ca-label { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-faint); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; flex: none; }
.ca-value { display: flex; align-items: center; gap: 12px; flex: 1 1 280px; min-width: 0; min-height: 52px; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--color-bg); text-align: left; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.ca-text { flex: 1; min-width: 0; font-family: var(--mono); font-size: clamp(15px, 1.1vw + 11px, 22px); line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; color: var(--text-faint); }
.ca-act { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: var(--fs-meta); color: var(--text-muted); }
.ca-strip[data-state=stated] .ca-text { color: var(--color-accent); font-weight: 600; }
.ca-strip[data-state=stated] .ca-value { cursor: pointer; border-color: var(--accent-line); }
.ca-strip[data-state=stated] .ca-value:hover { background: var(--accent-soft); border-color: var(--color-accent); }
.ca-strip[data-state=stated] .ca-value.is-copied .ca-act { color: var(--color-accent); }
.ca-strip[data-state=absent] .ca-value { cursor: default; }
.ca-strip[data-state=absent] .ca-act { display: none; }

/* header */
.site-header { position: sticky; top: 0; z-index: 100; padding-top: env(safe-area-inset-top); background: var(--color-bg); border-bottom: 1px solid var(--border-soft); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); padding-right: 8px; border-radius: var(--radius); text-decoration: none; flex: none; }
.brand-mark { width: 28px; height: 28px; border-radius: var(--radius-sm); flex: none; }
.brand-word { font-size: 19px; line-height: 1; font-weight: 600; letter-spacing: -.02em; }
.nav { display: none; align-items: center; margin-left: 16px; }
.nav a { display: inline-flex; align-items: center; height: var(--tap); padding: 0 12px; color: var(--text-muted); font-size: var(--fs-ui); font-weight: 500; text-decoration: none; border-radius: var(--radius); transition: color var(--t-fast) var(--ease); }
.nav a:hover { color: var(--text); }
.social { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border-radius: var(--radius); color: var(--text-muted); transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
a.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn[aria-disabled=true], .inert { opacity: .45; cursor: not-allowed; }
@media (width >= 768px) { .nav { display: flex; } }

/* buttons */
.btn { --bg: var(--surface-2); --fg: var(--text); --bd: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 16px; border-radius: var(--radius); background: var(--bg); color: var(--fg); border: 1px solid var(--bd); font-size: var(--fs-ui); font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.btn:active { transform: translateY(1px); }
.btn--primary { --bg: var(--color-accent); --fg: var(--color-ink); }
.btn--primary:hover { --bg: var(--accent-hover); }
.btn--ghost { --bg: transparent; --bd: var(--border); }
.btn--ghost:hover { --bg: var(--surface-2); --bd: var(--border-strong); }
.btn--sm { font-size: var(--fs-meta); padding: 0 12px; }
.btn--lg { min-height: var(--control-lg); padding: 0 24px; font-size: 15px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* skeleton */
.skel { display: block; height: 12px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel-circle { border-radius: 50%; width: 36px; height: 36px; flex: none; }
.skel-w40 { width: 40px; } .skel-w60 { width: 72px; } .skel-w80 { width: 120px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* spotlight (cards, rows, tiles) */
[data-spot] { position: relative; isolation: isolate; }
[data-spot]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: 0; background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 70%); transition: opacity 200ms var(--ease); }
[data-spot]:hover::after { opacity: 1; }

/* hero */
.hero { position: relative; border-bottom: 1px solid var(--border-soft); padding-block: 56px 48px; overflow: clip; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.mesh { position: absolute; inset: -20%; background:
  radial-gradient(40% 50% at 20% 30%, var(--accent-glow), transparent 70%),
  radial-gradient(35% 45% at 80% 20%, color-mix(in srgb, var(--color-panel) 80%, transparent), transparent 70%),
  radial-gradient(45% 50% at 60% 90%, var(--accent-soft), transparent 70%);
  animation: meshShift 22s ease-in-out infinite alternate; }
@keyframes meshShift { 0% { transform: translate3d(-3%, -2%, 0) scale(1); } 100% { transform: translate3d(3%, 3%, 0) scale(1.08); } }
.hero-layer { position: absolute; inset: 0; will-change: transform; transform: translate3d(calc(var(--px, 0) * var(--d, 0) * 1px), calc(var(--py, 0) * var(--d, 0) * 1px), 0); }
.hero-layer--grid { --d: 28; background-image: linear-gradient(var(--border-soft) 1px, transparent 1px), linear-gradient(90deg, var(--border-soft) 1px, transparent 1px); background-size: 48px 48px; -webkit-mask-image: radial-gradient(ellipse at 30% 40%, var(--color-ink), transparent 75%); mask-image: radial-gradient(ellipse at 30% 40%, var(--color-ink), transparent 75%); }
.hero-layer--glyph { --d: 60; inset: -10% -6% -10% 52%; background: var(--color-accent); opacity: .08; -webkit-mask: url(../img/logo-glyph-256.png) center / contain no-repeat; mask: url(../img/logo-glyph-256.png) center / contain no-repeat; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: 48px; }
.hero-copy { display: grid; justify-items: start; gap: 20px; }
.hero-copy h1 { max-width: 640px; }
.hero-copy .lead { max-width: 560px; }
.eyebrow { font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--color-accent); font-weight: 500; margin-bottom: -8px; }
.tagline { font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: 500; margin-top: -8px; text-wrap: balance; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); }
.stats > div { display: grid; gap: 4px; min-width: 0; padding: 20px; border-top: 1px solid var(--border-soft); }
.stats > div:nth-child(-n+2) { border-top: 0; }
.stats > div:nth-child(2n) { border-left: 1px solid var(--border-soft); }
.stats > div:first-child { grid-column: 1 / -1; border-left: 0; }
.stats > div:first-child + div { border-top: 1px solid var(--border-soft); border-left: 0; }
.stats > div:first-child + div ~ div:nth-child(odd) { border-left: 1px solid var(--border-soft); }
.stats > div:first-child .stat-value { font-size: var(--fs-deal); line-height: var(--lh-deal); }
.stats dd { overflow-wrap: anywhere; }
.stats .skel { height: var(--lh-stat); }
@media (width <= 900px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } .hero { padding-block: 32px; } .hero-copy { gap: 16px; } .hero-copy .btn-row { width: 100%; } .hero-copy .btn-row .btn { flex: 1 1 0; padding-inline: 12px; } .stats > div { padding: 14px 16px; } .hero-layer--glyph { inset: 20% -30% -10% 30%; } }

/* ticker */
.ticker { border-bottom: 1px solid var(--border-soft); overflow: hidden; background: var(--surface); }
.ticker-track { display: flex; width: max-content; animation: marquee 42s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tick { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-right: 1px solid var(--border-soft); font-size: var(--fs-ui); white-space: nowrap; }
.tick b { font-weight: 600; } .tick .up { color: var(--color-accent); } .tick .down { color: var(--text-faint); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* market */
.market { padding-block: 48px 64px; }
.market-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--border-soft); }
.market-head h2 { padding-block: 8px; }
.tablist { display: inline-flex; gap: 24px; }
.tab { position: relative; display: inline-flex; align-items: center; min-height: 56px; padding: 0; font-size: var(--fs-ui); font-weight: 500; color: var(--text-muted); white-space: nowrap; transition: color var(--t-fast) var(--ease); }
.tab:hover, .tab[aria-selected=true] { color: var(--text); }
.tab[aria-selected=true]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--color-accent); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-full); font-size: var(--fs-label); font-weight: 500; color: var(--text-muted); margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); animation: livePulse 1.6s ease-out infinite; }
.pill[data-state=retry] .dot, .pill[data-state=load] .dot { background: var(--text-faint); animation-duration: 2.4s; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 var(--accent-line); } 100% { box-shadow: 0 0 0 8px transparent; } }
.market-src { margin-left: 12px; }
@media (width <= 767px) { .market-head { gap: 0 16px; } .tab { min-height: 48px; } .pill { margin-left: 0; } .market-src { margin: 0 0 8px auto; } .tablist { gap: 16px; } .market-head .tablist { order: 3; width: 100%; overflow-x: auto; } }

.rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.row { display: grid; grid-template-columns: 40px minmax(0, 2.2fr) repeat(4, minmax(0, 1fr)); align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.row--head { min-height: 32px; padding-block: 0; border: 0; background: none; font-size: var(--fs-label); color: var(--text-faint); font-weight: 500; margin-bottom: 4px; }
a.row:hover { border-color: var(--border); background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.num { text-align: right; font-size: var(--fs-ui); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank { font-size: var(--fs-meta); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.coin { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coin-id { display: grid; min-width: 0; }
.coin-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-sym { font-size: var(--fs-meta); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo, .tile { width: 36px; height: 36px; border-radius: var(--radius); flex: none; object-fit: cover; }
.tile { display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) var(--tile-mix, 20%), var(--color-bg)); }
.up { color: var(--color-accent); } .down { color: var(--text-muted); }
.flash { animation: flash 700ms var(--ease); }
@keyframes flash { 0% { background: var(--accent-glow); } 100% { background: transparent; } }
.row.in { animation: rowIn 360ms var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } }
.row--own { border-left: 2px solid var(--color-accent); animation: ownPulse 2.4s ease-in-out infinite; }
.row--own .rank { color: var(--color-accent); }
@keyframes ownPulse { 0% { box-shadow: 0 0 0 0 var(--accent-line); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.row--ph { cursor: default; }
.row--ph .num { color: var(--text-faint); letter-spacing: .2em; }
.row--skel { pointer-events: none; }
.board-err { margin-top: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); font-size: var(--fs-ui); }
@media (width <= 767px) {
  .row--head { display: none; }
  .row { grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 14px; }
  .row .coin { grid-column: 2 / -1; }
  .row .num { grid-column: auto; text-align: left; display: grid; font-size: var(--fs-ui); }
  .row .num::before { content: attr(data-label); font-size: var(--fs-label); color: var(--text-faint); font-weight: 400; }
  .row .c-price, .row .c-vol { grid-column: 2; } .row .c-chg, .row .c-liq { grid-column: 3; }
}

/* vault */
.section-head--split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: end; gap: 8px 48px; margin-bottom: 40px; }
@media (width <= 900px) { .section-head--split { grid-template-columns: minmax(0, 1fr); } }
.vault-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.steps { display: grid; gap: 24px; margin: 0; }
.steps li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 14px; padding: 12px; margin: -12px; border-radius: var(--radius-lg); }
.steps svg { color: var(--color-accent); margin-top: 2px; }
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--text-muted); font-size: var(--fs-ui); line-height: var(--lh-ui); max-width: 480px; }
.flow { padding: 24px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); color: var(--text-muted); }
.flow-node rect { fill: var(--surface-2); stroke: var(--border); }
.flow-node text { fill: var(--text); font: 600 15px var(--font); }
.flow-node--hot rect { stroke: var(--color-accent); fill: var(--accent-soft); }
.flow-line { fill: none; stroke: var(--border-strong); stroke-width: 2; }
.flow-line--dash { stroke: var(--color-accent); stroke-dasharray: 5 6; animation: dash 1.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -22; } }
.flow-cap { fill: var(--text-faint); font: 500 13px var(--font); }
.risk { display: flex; gap: 8px; align-items: flex-start; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-soft); color: var(--text-muted); }
.risk svg { flex: none; margin-top: 1px; color: var(--color-accent); }
@media (width <= 900px) { .vault-grid { grid-template-columns: 1fr; gap: 32px; } }

/* band + check */
.band { border-top: 1px solid var(--border-soft); padding-block: 64px; }
.band-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; }
.band-copy { display: grid; gap: 8px; max-width: 560px; }
.check { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 360px; max-width: 520px; padding: 16px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); }
.check-input { flex: 1 1 200px; min-width: 0; min-height: var(--tap); padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--color-bg); font-family: var(--mono); font-size: 16px; }
.check-input::placeholder { color: var(--text-faint); }
.check-out { flex: 1 1 100%; min-height: 20px; font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--text-muted); }
.check-out[data-v=official] { color: var(--color-accent); }
[data-unverified] { text-decoration: underline wavy var(--text-faint); }

/* faq */
.faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; gap: 24px 48px; }
.faq-side { position: sticky; top: calc(var(--header-h) + 32px); display: grid; gap: 16px; justify-items: start; }
.faq-list { border-top: 1px solid var(--border-soft); display: grid; }
.faq-item { border-bottom: 1px solid var(--border-soft); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 16px 0; font-weight: 500; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-chev { color: var(--text-faint); flex: none; transition: transform var(--t-chev) var(--ease); }
.faq-item[open] .faq-chev { color: var(--text); transform: rotate(180deg); }
.faq-a { padding: 0 0 24px; color: var(--text-muted); }
.faq-a ul { display: grid; gap: 8px; padding-left: 20px; margin: 0; }
.faq-a strong { color: var(--text); }
@media (width <= 900px) { .faq-grid { grid-template-columns: minmax(0, 1fr); } .faq-side { position: static; } }

/* footer */
.site-footer { margin-top: auto; padding-block: 64px 40px; border-top: 1px solid var(--border-soft); color: var(--text-muted); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr); grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 40px 32px; }
.footer-brand p { max-width: 320px; margin-top: 16px; line-height: 1.6; }
.footer-col h2 { font-size: 13px; line-height: 1.5; letter-spacing: 0; margin-bottom: 8px; color: var(--text); }
.footer-col ul { display: grid; margin: 0; padding: 0; list-style: none; }
.footer-col a, .footer-col .inert { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border-soft); color: var(--text-faint); font-size: 13px; line-height: 1.6; }
@media (width <= 767px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; } .footer-brand { grid-column: 1 / -1; } }

/* scroll reveal: spring-driven by motion.js; hidden state only when JS says motion is allowed */
.rv-ready [data-reveal]:not(.is-in) { opacity: 0; transform: translate3d(0, 24px, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .ticker { overflow-x: auto; }
  .hero-layer { transform: none; }
  .row--own { animation: none; }
}
