/* Layout metrics measured off the reference: 880px column, 16px gutters, 13px body,
   12px small text, 0 radius, 40px step gutter, 2px accent rules, 0.5s ease-out rise. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--night);
  font: 13px/1.5 var(--font-sans); overflow-x: hidden;
}
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--green-dark); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
code { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }
.page { padding-bottom: 24px; }
:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; }

/* progress */
#progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50; background: var(--green-deep);
  transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}

/* contract bar + social */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--ink); color: var(--pale); border-bottom: 2px solid var(--night); }
.topbar .wrap { padding-top: 4px; padding-bottom: 10px; }
.top-row { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.ca-label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; }
.social { display: flex; gap: 4px; position: absolute; top: 4px; right: 16px; }
.social .soc {
  width: 44px; height: 44px; display: grid; place-items: center; color: var(--pale);
  background: transparent; border: 1px solid transparent; text-decoration: none;
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out);
}
.social .soc svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.social a.soc:hover { background: var(--lime); color: var(--ink); }
.social .soc.is-inert { opacity: 0.45; cursor: default; }
.ca { display: block; }
.ca-value {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%; text-align: left;
  font-family: var(--font-mono); font-size: clamp(15px, 3.1vw, 27px); line-height: 1.25; font-weight: 700;
  color: var(--lime); background: transparent; border: 0; padding: 0; cursor: pointer;
}
.ca-value code { word-break: break-all; overflow-wrap: anywhere; flex: 1 1 auto; min-width: 0; }
.ca-fb {
  flex: none; font: 700 12px/1 var(--font-sans); min-height: 44px; min-width: 64px; padding: 0 12px;
  display: inline-grid; place-items: center; background: var(--lime); color: var(--ink);
  transition: transform 150ms var(--ease-out), background 150ms;
}
.ca-value:hover .ca-fb { transform: translateY(-1px); }
.ca-value.copied .ca-fb { background: var(--pale); }
.ca.is-inert .ca-value { cursor: default; color: var(--pale); opacity: 0.7; }

/* masthead + nav */
.masthead { display: flex; gap: 16px; align-items: flex-start; margin-top: 16px; }
.brand-mark { width: 56px; height: 56px; flex: none; border: 1px solid var(--line-strong); display: block; }
h1 { font: 700 24px/1.25 var(--font-serif); letter-spacing: 0.04em; }
.tagline { font: italic 15px/1.4 var(--font-serif); color: var(--muted); }
.byline { font-size: 12px; color: var(--muted); }
.mainnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin-top: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.mainnav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 6px; }
.status-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px;
  border: 1px solid var(--line-strong); background: var(--paper); font-size: 12px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.status-pill[data-state="live"] .dot, .chip-live .dot { background: var(--green-deep); animation: livePulse 1.6s var(--ease-pulse) infinite; }
.status-pill[data-state="retry"] .dot { background: var(--green-mid); animation: livePulse 0.8s var(--ease-pulse) infinite; }
.status-pill[data-state="off"] .dot { background: transparent; border: 2px solid var(--night); }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green-deep) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

/* hero */
.hero { position: relative; margin-top: 24px; min-height: 320px; overflow: hidden; background: var(--lime); border: 1px solid var(--line-strong); border-top: 2px solid var(--line-strong); isolation: isolate; }
.mesh { position: absolute; inset: 0; z-index: -1; }
.blob { position: absolute; border-radius: 50%; filter: blur(46px); will-change: transform; animation: meshDrift 18s ease-in-out infinite alternate; }
.b1 { width: 62%; aspect-ratio: 1; left: -12%; top: -40%; background: var(--lime-hi); }
.b2 { width: 54%; aspect-ratio: 1; right: -10%; bottom: -46%; background: var(--green-mid); animation-duration: 23s; animation-direction: alternate-reverse; }
.b3 { width: 40%; aspect-ratio: 1; left: 36%; top: 18%; background: var(--pale); opacity: 0.8; animation-duration: 15s; }
@keyframes meshDrift { from { margin: 0; } to { margin: 6% 0 0 8%; } }
.hero-copy { position: relative; padding: 32px 20px 32px; max-width: 560px; }
.hero-copy h2 { font: 700 clamp(38px, 8.6vw, 68px)/0.98 var(--font-serif); letter-spacing: -0.01em; margin: 12px 0; }
.hero-copy p { font-family: var(--font-mono); font-size: 14px; line-height: 1.55; max-width: 520px; }
.chip-live { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; background: var(--ink); color: var(--pale); font-size: 12px; font-weight: 700; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-strong); color: var(--night); background: var(--paper); text-decoration: none; font-weight: 700;
  transition: transform 150ms var(--ease-out), background 150ms;
}
.btn:hover { transform: translateY(-2px); background: var(--pale); }
.btn.primary { background: var(--ink); color: var(--lime); }
.hero-art { position: absolute; right: 0; top: 0; bottom: 0; width: 46%; pointer-events: none; }
.pipe-art, .drip, .ring { position: absolute; will-change: transform; }
.pipe-art { right: 8%; top: 22%; width: 70%; height: 90px; }
.pipe-art .bar { position: absolute; left: 0; right: 0; top: 0; height: 26px; background: var(--ink); }
.pipe-art .neck { position: absolute; right: 18%; top: 26px; width: 34px; height: 58px; background: var(--ink); }
.pipe-art .nozzle { position: absolute; right: calc(18% - 8px); top: 80px; width: 50px; height: 10px; background: var(--ink); }
.drip { width: 14px; height: 20px; background: var(--ink); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; right: 20%; top: calc(22% + 100px); animation: drip 2.2s ease-in infinite; }
.d2 { right: 20%; animation-delay: 0.7s; width: 10px; height: 14px; }
.d3 { right: 20%; animation-delay: 1.4s; width: 8px; height: 12px; }
@keyframes drip { 0% { opacity: 0; translate: 0 -4px; } 20% { opacity: 1; } to { opacity: 0; translate: 0 130px; } }
.ring { border: 2px solid var(--ink); border-radius: 50%; right: 8%; bottom: 8%; opacity: 0.55; }
.r1 { width: 150px; height: 34px; right: 12%; }
.r2 { width: 230px; height: 52px; right: 4%; bottom: 4%; opacity: 0.3; }

/* ticker */
.ticker { margin-top: 0; overflow: hidden; border: 1px solid var(--line-strong); border-top: 0; background: var(--ink); color: var(--pale); }
.ticker-track { display: flex; width: max-content; }
.ticker.ready .ticker-track { animation: marquee var(--tk-dur, 40s) linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tk-set { display: flex; flex: none; }
.tk { display: inline-flex; gap: 8px; align-items: baseline; padding: 0 18px; min-height: 36px; align-items: center; font: 12px var(--font-mono); white-space: nowrap; }
.tk b { color: var(--lime); }
.tk .up { color: var(--green-mid); }
.tk .down { color: var(--pale); opacity: 0.7; }
.sk-tk { min-width: 150px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* pipe divider (measured off the reference: 8px bar, 40x6 neck) */
.pipe-divider { position: relative; margin-top: 32px; scroll-margin-top: 80px; }
.pipe { height: 8px; background: var(--green-mid); border-block: 1px solid var(--green-dark); }
.pipe-divider .neck { margin: 0 auto; width: 40px; height: 6px; background: var(--green-dark); }

/* cards + facts */
.card { position: relative; border: 1px solid var(--line-strong); border-top: 2px solid var(--line-strong); background: var(--paper); padding: 16px; }
.card-title { font: 700 16px/1.4 var(--font-serif); padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
.facts.narrow { max-width: 520px; }
.facts .pending { color: var(--muted); font-style: italic; }
.facts a { font-weight: 700; }
.wallet-form { margin-top: 20px; }
.wallet-form label { font-size: 12px; color: var(--muted); }
.wallet-form input {
  display: block; width: 100%; min-height: 44px; margin-top: 4px; padding: 6px 10px; border: 1px solid var(--grey);
  background: var(--paper); font: 14px var(--font-mono); color: var(--night); border-radius: 0; outline: none;
}
.wallet-form input:focus { border-color: var(--green-dark); box-shadow: 0 0 0 2px var(--lime); }
.small { font-size: 12px; color: var(--muted); margin-top: 4px; }
.go { margin-top: 12px; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-strong); background: var(--ink); color: var(--lime); font-weight: 700; text-decoration: none; cursor: pointer; }
.go[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.hint { margin-top: 8px; font-size: 12px; color: var(--muted); min-height: 18px; }
.hint[data-state="ok"] { color: var(--green-dark); font-weight: 700; }
.hint[data-state="bad"] { color: var(--night); text-decoration: underline wavy; }
.notice { margin-top: 12px; border: 1px solid var(--line); border-left: 4px solid var(--green-mid); padding: 8px 12px; background: var(--pale); }

/* stat tiles (md: 4 across, else 2) */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 24px; border: 1px solid var(--line-strong); background: var(--paper); }
.tile-stat { position: relative; padding: 12px; min-width: 0; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.tile-stat:nth-child(-n+2) { border-top: 0; }
.tile-stat:nth-child(odd) { border-left: 0; }
.tile-stat .k { display: block; font-size: 12px; color: var(--muted); }
.tile-stat .v { display: block; margin-top: 4px; font: 700 18px/1.3 var(--font-serif); overflow-wrap: anywhere; }
@media (min-width: 768px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tile-stat { border-top: 0; }
  .tile-stat:nth-child(odd) { border-left: 1px solid var(--line); }
  .tile-stat:first-child { border-left: 0; }
}

/* sections */
.block { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line-strong); scroll-margin-top: 80px; }
.block h2, .block-head h2 { font: 700 18px/1.3 var(--font-serif); margin-bottom: 12px; }
.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.block-head h2 { margin-bottom: 0; }
.lede { color: var(--muted); margin: 8px 0 12px; }
.tabs { display: inline-flex; border: 1px solid var(--line-strong); }
.tabs button { min-height: 44px; padding: 0 14px; background: var(--paper); border: 0; cursor: pointer; transition: background 150ms; }
.tabs button + button { border-left: 1px solid var(--line-strong); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--lime); }

/* board */
.board { border: 1px solid var(--line-strong); background: var(--paper); }
.row {
  position: relative; display: grid; align-items: center; gap: 8px; padding: 8px;
  grid-template-columns: 24px minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.1fr) 44px;
  border-bottom: 1px solid var(--line); font-size: 12px;
}
.row:last-child { border-bottom: 0; }
.row.head { background: var(--pale); color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line-strong); padding-block: 6px; }
.row > span { min-width: 0; }
.c-rank { color: var(--muted); font-family: var(--font-mono); }
.c-tok { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 32px; height: 32px; flex: none; display: grid; place-items: center; }
.logo img, .tile { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; object-fit: cover; background: var(--pale); border: 1px solid var(--line); }
.tile { font: 700 12px var(--font-sans); background: var(--green-mid); color: var(--ink); }
.nm { display: flex; flex-direction: column; min-width: 0; }
.nm b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm i { font-style: normal; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-chg.up { color: var(--green-dark); font-weight: 700; }
.c-chg.down { color: var(--night); opacity: 0.75; }
.c-act { display: grid; place-items: center; }
.copy { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; transition: background 150ms, transform 150ms var(--ease-out); }
.copy:hover { background: var(--lime); }
.copy.copied { background: var(--green-mid); }
.flash-up { animation: flashUp 900ms var(--ease-out); }
.flash-down { animation: flashDown 900ms var(--ease-out); }
@keyframes flashUp { 0% { background: var(--flash-up); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: var(--flash-down); } 100% { background: transparent; } }

/* own row #1 */
.row.is-own { border-left: 2px solid var(--color-mint); animation: ownPulse var(--pulse-dur) var(--ease-pulse) infinite; }
@keyframes ownPulse { 0%, 100% { background: transparent; } 50% { background: var(--own-wash); } }
.row.is-placeholder .c-chg, .row.is-placeholder .c-vol, .row.is-placeholder .c-liq { color: var(--muted); letter-spacing: -0.04em; }
.row.is-placeholder { cursor: default; }

/* spotlight */
.spot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 200ms;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), var(--hover), transparent 70%);
}
.spot:hover::after { opacity: 1; }

/* skeleton -> data */
.sk { display: block; height: 10px; background: linear-gradient(90deg, var(--skeleton-a), var(--skeleton-b), var(--skeleton-a)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-circle { width: 32px; height: 32px; border-radius: 50%; }
.sk-line { width: 80%; } .sk-line.short { width: 50%; margin-top: 4px; }
.sk-text { color: transparent; min-width: 56px; background: linear-gradient(90deg, var(--skeleton-a), var(--skeleton-b), var(--skeleton-a)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; display: inline-block; }
@keyframes shimmer { to { background-position: -200% 0; } }
.row.enter { animation: rowIn 500ms var(--ease-out) both; }
.row.enter.is-own { animation: rowIn 500ms var(--ease-out) both, ownPulse var(--pulse-dur) var(--ease-pulse) 500ms infinite; }
@keyframes rowIn { from { opacity: 0; transform: translateY(var(--rise-y)); } to { opacity: 1; transform: none; } }
.board-msg { padding: 12px; border-top: 1px solid var(--line-strong); font-weight: 700; }

/* essay, steps, faq */
.essay { font: 15px/1.7 var(--font-serif); max-width: 640px; display: grid; gap: 12px; }
.dropcap { float: left; font-weight: 700; font-size: 40px; line-height: 0.9; margin: 4px 6px 0 0; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.step .no { font-family: var(--font-mono); color: var(--muted); }
.step p, .qa p { color: var(--muted); }
.qa { padding: 8px 0; border-bottom: 1px solid var(--line); }
.qa h3 { font: 700 14px/1.4 var(--font-serif); }

/* footer */
.foot { position: relative; margin-top: 40px; border-top: 2px solid var(--line-strong); padding-top: 16px; font-size: 12px; color: var(--muted); display: grid; gap: 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.foot-links a, .foot-links span { display: inline-flex; align-items: center; min-height: 44px; }
.foot-links a { color: var(--green-dark); font-weight: 700; }
.foot-links .inert { color: var(--muted); }
.foot-mark { position: absolute; right: 0; top: 16px; opacity: 0.9; }
.fine { max-width: 560px; }

@media (max-width: 640px) {
  .row.head { display: none; }
  .row {
    grid-template-columns: 22px minmax(0, 1fr) auto 44px;
    grid-template-areas: "rank tok price act" ". meta meta meta";
    row-gap: 2px; padding: 10px 8px;
  }
  .row .c-rank { grid-area: rank; }
  .row .c-tok { grid-area: tok; }
  .row .c-price { grid-area: price; text-align: right; font-size: 13px; }
  .row .c-act { grid-area: act; }
  .row .c-chg, .row .c-vol, .row .c-liq { grid-row: 2; font-size: 11px; display: inline-flex; gap: 4px; }
  .row .c-chg::before, .row .c-vol::before, .row .c-liq::before { content: attr(data-label); font-family: var(--font-sans); color: var(--muted); }
  .row:not(.skeleton) { grid-template-columns: 22px minmax(0, 1fr) auto 44px; }
  .row .c-chg { grid-column: 2; justify-self: start; }
  .row .c-vol { grid-column: 3 / 4; }
  .row .c-liq { grid-column: 2; grid-row: 3; justify-self: start; }
  .row .c-vol { grid-column: 3 / 5; grid-row: 2; justify-self: end; }
  .row.skeleton .c-chg, .row.skeleton .c-vol, .row.skeleton .c-liq { display: none; }
  .hero-art { width: 100%; opacity: 0.35; }
  .hero-copy { padding: 24px 16px; }
  .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .foot-mark { display: none; }
}

/* reduced motion: everything lands instantly, nothing loops */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .ticker-track { animation: none !important; }
  .ticker { overflow-x: auto; }
  .sk, .sk-text { background: var(--skeleton-b); }
  [data-reveal], [data-reveal-item] { opacity: 1 !important; transform: none !important; }
}
