/* Structure studied from the reference (values noted): wrap 1240px, gutter clamp(20,5vw,80), radius 8px, nav 64px,
   ease cubic-bezier(.22,1,.36,1), btn min-height 48px/transition .2s, tape 36s linear, spin 14s/9s/6s, foot mark 90s,
   nudge 1.8s, tick .6s, section padding clamp(72px,11vw,150px). No colour literals here: tokens.css owns them. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h, 120px) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: var(--s-body); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, p, ol, dl, dd, figure { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-deep); }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: var(--gutter); top: -120px; z-index: 60; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--radius); }
.skip:focus { top: 12px; color: var(--bg); }

h1, h2, .close-line { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.022em; line-height: 1.04; text-wrap: balance; }
h1 { font-size: var(--s-display); line-height: 0.98; letter-spacing: -0.03em; }
h2 { font-size: var(--s-head); }
.lead { font-size: var(--s-lead); line-height: 1.45; text-wrap: pretty; }
.fine { font-size: var(--s-small); color: var(--muted); line-height: 1.5; }

/* progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 70; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-hot)); }

/* buttons + links */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: var(--tap); padding: 0 20px; border-radius: var(--radius); border: 1px solid var(--ink); font: 500 1rem/1 var(--font-body); text-decoration: none; cursor: pointer; transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease); }
.btn:active { transform: scale(0.94); }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--bg); }
.link { display: inline-flex; align-items: center; min-height: 48px; font-weight: 500; text-decoration: underline; }
.is-inert { opacity: 0.5; cursor: default; pointer-events: none; text-decoration: none; user-select: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }

/* header: nav row + CA strip, always on screen */
.head { position: fixed; inset: 3px 0 auto 0; z-index: 50; color: var(--ink); background: transparent; border-bottom: 1px solid transparent; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
.head.is-solid { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom-color: var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
html.on-dark .head { --bg: var(--deep); --ink: var(--cream); --ink-2: color-mix(in srgb, var(--ink) 86%, var(--bg)); --muted: color-mix(in srgb, var(--ink) 66%, var(--bg)); --line: color-mix(in srgb, var(--ink) 18%, var(--bg)); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--nav-h); padding-inline: var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.01em; }
.brand:hover { color: inherit; }
.mark { width: 32px; height: 32px; transition: transform 0.6s var(--ease); }
.brand:hover .mark { transform: rotate(60deg) scale(0.86); }
.nav-links { display: none; gap: 28px; font-size: 0.9375rem; margin-left: auto; }
.nav-links a { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); min-width: var(--tap); }
.nav-links a:hover { text-decoration: underline; }
.socials { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.nav-links + .socials { margin-left: 0; }
.social { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border-radius: var(--radius); color: var(--ink); transition: background-color 0.2s, color 0.2s, transform 0.2s var(--ease); }
a.social:hover { background: var(--accent-soft); color: var(--accent-deep); }
a.social:active { transform: scale(0.92); }
.social.is-inert { opacity: 0.4; }
@media (min-width: 860px) { .nav-links { display: flex; } }

.ca-strip { padding: 6px var(--gutter) 8px; }
.ca-btn { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 1240px; margin-inline: auto; min-height: var(--tap); padding: 6px 12px; text-align: left; color: var(--ink); background: color-mix(in srgb, var(--accent) 16%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--bg)); border-radius: var(--radius); font: inherit; cursor: pointer; transition: background-color 0.2s, transform 0.2s var(--ease), border-color 0.2s; }
button.ca-btn:hover { background: color-mix(in srgb, var(--accent) 28%, var(--bg)); }
button.ca-btn:active { transform: scale(0.99); }
.ca-btn.is-done { border-color: var(--accent-hot); }
.ca-tag { flex: none; font: 700 var(--s-small)/1 var(--font-display); letter-spacing: 0.08em; color: var(--accent-deep); }
.ca-code { flex: 1; min-width: 0; font: 600 var(--s-ca)/1.25 var(--font-mono); overflow-wrap: anywhere; word-break: break-all; }
.ca-act { flex: none; min-width: 56px; text-align: center; font: 600 var(--s-small)/1 var(--font-body); padding: 8px 10px; border-radius: 6px; background: var(--ink); color: var(--bg); }
.ca-btn.is-inert .ca-act { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.ca-btn.is-inert .ca-code { color: var(--muted); font-weight: 500; }
.ca-btn.is-done .ca-act { background: var(--accent-hot); color: var(--ink); }

/* hero */
.stage { position: relative; z-index: 2; overflow: clip; }
.stage-pin { position: relative; min-height: 100svh; display: grid; align-items: center; padding-block: calc(var(--head-h, 124px) + 8px) 60px; overflow: clip; }
.mesh { position: absolute; inset: -10%; z-index: 0; pointer-events: none; filter: blur(60px); opacity: 0.9; }
.mesh i { position: absolute; width: 52vmax; height: 52vmax; border-radius: 50%; will-change: transform; }
.mesh i:nth-child(1) { left: -8%; top: -12%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 66%); animation: drift-a 22s var(--ease) infinite alternate; }
.mesh i:nth-child(2) { right: -12%; top: 8%; background: radial-gradient(circle, color-mix(in srgb, var(--accent-hot) 38%, transparent), transparent 66%); animation: drift-b 28s var(--ease) infinite alternate; }
.mesh i:nth-child(3) { left: 30%; bottom: -26%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 34%, transparent), transparent 66%); animation: drift-c 25s var(--ease) infinite alternate; }
@keyframes drift-a { to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-12vmax, 14vmax) scale(0.9); } }
@keyframes drift-c { to { transform: translate(-16vmax, -8vmax) scale(1.2); } }
.hero { position: relative; z-index: 1; display: grid; gap: clamp(14px, 2.4svh, 40px); justify-items: start; }
.hero-art { position: relative; width: min(52vw, 21svh); aspect-ratio: 1; justify-self: center; }
.hero-art > * { will-change: transform; transform: translate3d(var(--px, 0px), var(--py, 0px), 0); }
.hero-logo { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 24px 40px color-mix(in srgb, var(--accent-hot) 32%, transparent)); transform: translate3d(var(--px, 0px), var(--py, 0px), 0) perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotate(var(--rz, 0deg)) scale(var(--sc, 1)); }
.orb { position: absolute; border-radius: 50%; background: radial-gradient(circle at 32% 28%, var(--accent), var(--accent-hot) 70%, var(--accent-deep)); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-hot) 40%, transparent); }
.orb-a { width: 7%; aspect-ratio: 1; left: 2%; top: 4%; }
.orb-b { width: 9%; aspect-ratio: 1; right: -6%; top: 62%; }
.orb-c { width: 11%; aspect-ratio: 1; left: 2%; bottom: 20%; }
.hero-copy { display: grid; gap: 18px; justify-items: start; max-width: 38rem; will-change: opacity, transform; }
.hero-copy .lead { max-width: 34rem; }

.pill { display: inline-flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--bg) 70%, transparent); font-size: var(--s-small); font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-hot); position: relative; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent-hot); animation: ping 1.8s var(--ease) infinite; }
.pill.is-warn .dot, .pill.is-warn .dot::after { background: var(--muted); }
@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(3.2); opacity: 0; } }

/* tape */
.tape { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; overflow: hidden; border-top: 1px solid var(--line); display: flex; align-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.tape-run { display: flex; flex: none; white-space: nowrap; font-size: var(--s-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.tape-run.is-live { animation: tape 36s linear infinite; }
.tape-run span { padding-inline: 18px; display: inline-flex; align-items: center; }
.tape-run span::after { content: ""; width: 9px; height: 9px; margin-left: 36px; background: url("../assets/logo-128.png") center / contain no-repeat; }
.tape-run b { font-weight: 600; color: var(--ink); margin-right: 4px; }
.tape-run em { font-style: normal; }
@keyframes tape { to { transform: translateX(-50%); } }
.sk-line { width: 150px; height: 12px; border-radius: 6px; background: var(--line); animation: shimmer 1.4s ease-in-out infinite; }
.sk-line::after { display: none !important; }

/* scroll cue (reference: hidden on small screens, nudge 1.8s) */
.cue { display: none; position: absolute; left: 0; right: 0; bottom: 52px; justify-content: center; align-items: center; gap: 10px; font-size: var(--s-small); color: var(--muted); pointer-events: none; }
@media (min-width: 860px) { .cue { display: flex; } }
.cue svg { animation: nudge 1.8s var(--ease) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(3px); } }

/* dark band */
.inside { position: relative; z-index: 2; background: var(--bg); color: var(--ink); }
.sec { position: relative; padding-block: clamp(72px, 11vw, 150px); display: grid; gap: clamp(36px, 6vw, 72px); justify-items: center; }
.sec > * { width: 100%; max-width: 42rem; }
#market > * { max-width: 62rem; }
.sec-head { display: grid; gap: 20px; justify-items: center; text-align: center; }
.sec-head p:not(.lead) { color: var(--muted); text-wrap: pretty; }
#thesis > h2 { max-width: none; text-align: center; font-size: clamp(3rem, 11vw, 10rem); line-height: 0.9; letter-spacing: -0.04em; }
.chant { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); line-height: 1.18; letter-spacing: -0.015em; color: var(--accent) !important; text-wrap: balance; }

/* board */
.board { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: color-mix(in srgb, var(--ink) 4%, var(--bg)); }
.row { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 0 12px; min-height: 64px; padding: 8px 16px 8px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.row-head { min-height: 44px; border-top: 0; font-size: var(--s-small); color: var(--muted); font-weight: 500; }
.cell { min-width: 0; }
.cell-rank { text-align: center; color: var(--muted); font-weight: 600; }
.cell-price, .cell-chg, .cell-vol, .cell-liq { text-align: right; }
.cell-tok { display: flex; align-items: center; gap: 12px; padding-left: 4px; }
.tok-logo { flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--accent) 16%, var(--bg)); display: grid; place-items: center; }
.tok-img { width: 100%; height: 100%; object-fit: cover; }
.tok-img[src*="logo-128"] { object-fit: contain; padding: 3px; }
.tok-letter { font: 700 1rem/1 var(--font-display); color: var(--accent-deep); }
.tok-id { display: grid; min-width: 0; line-height: 1.2; }
.tok-id b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tok-id small { color: var(--muted); font-size: var(--s-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.row { color: inherit; text-decoration: none; }
.cell-chg.up { color: var(--ink); font-weight: 600; }
.cell-chg.up::before { content: "▲ "; font-size: 0.7em; color: var(--accent-hot); }
.cell-chg.down { color: var(--muted); }
.cell-chg.down::before { content: "▼ "; font-size: 0.7em; }
.cell.flash { animation: flash 0.6s var(--ease); }
@keyframes flash { 0% { transform: scale(1.18); color: var(--accent); } 100% { transform: none; } }
.cell { border-radius: 4px; }

/* own row */
.row-own { border-left: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg)); animation: ownPulse 2.4s ease-in-out infinite; }
.row-own.is-placeholder { cursor: default; }
.row-own .cell-rank { color: var(--accent-deep); }
@keyframes ownPulse { 0%, 100% { box-shadow: inset 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent), 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); } 50% { box-shadow: inset 6px 0 18px -6px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 24px 0 color-mix(in srgb, var(--accent) 28%, transparent); } }

/* spotlight hover */
.spot { --mx: 50%; --my: 50%; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.3s; background: radial-gradient(260px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }
.spot:hover::before { opacity: 1; }

/* skeleton + fade-in stagger */
.sk { display: inline-block; width: 64%; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--line), color-mix(in srgb, var(--ink) 18%, var(--bg)), var(--line)); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.cell-tok .sk-circle { width: 40px; height: 40px; border-radius: 50%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.is-fresh { animation: fadein 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.feed-note { min-height: 1.5em; text-align: center; color: var(--muted); font-size: var(--s-small); }

/* story */
.eras { display: grid; }
.eras li { display: grid; gap: 18px; justify-items: center; text-align: center; align-content: center; padding-block: 44px; border-top: 1px solid var(--line); }
.era-n { font-family: var(--font-display); font-weight: 800; font-size: clamp(4.5rem, 2rem + 13vw, 10.5rem); line-height: 0.86; letter-spacing: -0.045em; color: var(--accent); font-variant-numeric: lining-nums; }
.eras p { max-width: 30rem; font-size: var(--s-lead); line-height: 1.42; text-wrap: pretty; }

/* pairing */
.hops { display: grid; }
.hops li { display: grid; gap: 16px; justify-items: center; text-align: center; padding-block: 28px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.75rem, 1.2rem + 2.4vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.hop-n { position: relative; width: 40px; height: 40px; }
.hop-n::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }
.hop-n.is-lit::after { animation: ring 0.85s var(--ease); }
@keyframes ring { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(3.4); opacity: 0; } }
.hop-n img { width: 100%; height: 100%; animation: spin 14s linear infinite; }
.hops li:nth-child(2) .hop-n img { animation-duration: 9s; animation-direction: reverse; }
.hops li:nth-child(3) .hop-n img { animation-duration: 6s; }
@keyframes spin { to { transform: rotate(360deg); } }
.split > p { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); line-height: 1.18; letter-spacing: -0.015em; text-wrap: balance; text-align: center; }

/* line before the close (reference .out-line: lead-size display font, muted, centred, 56px below) */
.out-line { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); letter-spacing: -0.015em; color: var(--muted); padding-bottom: 56px; text-align: center; }

/* close */
.out { position: relative; z-index: 2; display: grid; gap: 36px; padding-block: clamp(72px, 11vw, 150px); }
.close-line { font-size: var(--s-display); max-width: 15em; }
.ca-wrap { display: grid; max-width: 40rem; }
.out .ca-btn { max-width: none; }

/* footer */
.foot { position: relative; z-index: 2; background: var(--bg); border-top: 1px solid var(--line); }
.foot-legal { padding-block: 32px; font-size: var(--s-small); line-height: 1.55; color: var(--muted); max-width: 46rem; margin-inline: 0; margin-left: max(0px, calc((100% - 1240px) / 2)); }
.foot-crop { height: calc(min(150vw, 1100px) * 0.46); overflow: hidden; }
.foot-mark { width: min(150vw, 1100px); height: min(150vw, 1100px); max-width: none; position: relative; left: 50%; translate: -50% 0; animation: spin 90s linear infinite; }

/* desktop */
@media (min-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); align-items: center; gap: 40px; }
  .hero-art { order: 2; width: min(54vw, 96svh); justify-self: start; margin-right: -22vw; margin-left: -2vw; }
  .hero-copy { gap: 24px; }
  h1 { font-size: clamp(3.25rem, 0.6rem + 4.3vw, 4.75rem); }
}
@media (min-width: 620px) { .eras { grid-template-columns: 1fr; } }
@media (min-width: 860px) { .stage-pin { height: 100svh; min-height: 620px; } }

/* scroll reveal — initial state; the spring solver in JS drives the rest */
html.js [data-rise] { opacity: 0; transform: scale(0.82); }

/* board on small screens: two lines per row */
@media (max-width: 719px) {
  .row { grid-template-columns: 30px minmax(0, 1fr) auto auto; grid-template-areas: "rank tok price chg" ". vol vol liq"; gap: 2px 10px; padding: 10px 12px 10px 0; min-height: 76px; }
  .row-head { display: none; }
  .row .cell-rank { grid-area: rank; } .row .cell-tok { grid-area: tok; } .row .cell-price { grid-area: price; } .row .cell-chg { grid-area: chg; min-width: 4.5em; }
  .row .cell-vol { grid-area: vol; text-align: left; } .row .cell-liq { grid-area: liq; }
  .cell-vol::before { content: "Vol "; color: var(--muted); } .cell-liq::before { content: "Liq "; color: var(--muted); }
  .cell-vol, .cell-liq { font-size: var(--s-small); color: var(--ink-2); }
  .cell-tok { padding-left: 0; }
  .ca-btn { flex-wrap: wrap; gap: 6px 10px; }
  .ca-code { flex-basis: 100%; order: 3; }
  .ca-act { margin-left: auto; }
}
@media (max-width: 619px) {
  .out .actions { flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media (max-height: 760px) and (max-width: 859px) {
  .hero-copy { gap: 10px; } .hero { gap: 14px; } .hero-art { width: min(30vw, 14svh); }
  h1 { font-size: 2.25rem; } .hero-copy .lead { font-size: 1rem; line-height: 1.4; }
  .btn, .link { min-height: 44px; }
}
@media (max-height: 700px) and (max-width: 859px) { .tape { display: none; } .stage-pin { padding-bottom: 16px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  html.js [data-rise] { opacity: 1; transform: none; }
  .row-own { animation: none; }
  .hero-art > *, .hero-logo { transform: none; }
  .hero-copy, .tape { opacity: 1 !important; transform: none !important; visibility: visible !important; }
}
