/* =========================================================
   HODLER — base: tokens, reset, layout shell, header/footer,
   starfield, CRT, boot loader, route wipe
   ========================================================= */
:root {
  --bg: #07070c;
  --bg-2: #0d0d16;
  --bg-3: #141424;
  --line: #24243a;
  --line-2: #33334f;
  --text: #ecebf5;
  --muted: #9b9ab3;
  --dim: #6b6a85;
  --yellow: #F0B90B;
  --yellow-2: #ffd76a;
  --yellow-dark: #a87f00;
  --common: #9aa0a6;
  --epic: #a855f7;
  --rare: #22d3ee;
  --legendary: #F0B90B;
  --legendary-2: #ffd76a;
  --danger: #ff4d6d;
  --ok: #3ee38b;

  --f-pixel: "Press Start 2P", ui-monospace, monospace;
  --f-num: "VT323", ui-monospace, monospace;
  --f-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --px: 4px;              /* pixel unit */
  --radius: 0;
  --header-h: 68px;
  --maxw: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-step: steps(6, end);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
  overflow-x: hidden;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  overflow-x: clip;
  background: radial-gradient(1200px 700px at 80% -10%, rgba(168, 85, 247, .12), transparent 60%),
              radial-gradient(900px 600px at -10% 30%, rgba(240, 185, 11, .06), transparent 60%),
              var(--bg);
  -webkit-font-smoothing: antialiased;
}
@supports not (overflow: clip) { body { overflow-x: hidden; } }
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
img.pixel, .pixel img, .art { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--yellow); text-decoration: none; }
a:hover { color: var(--yellow-2); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--f-pixel); font-weight: 400; line-height: 1.35; margin: 0 0 .6em; letter-spacing: .02em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--yellow); color: #000; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 1000;
  background: var(--yellow); color: #000; padding: 12px 16px;
  font-family: var(--f-pixel); font-size: 10px;
}
.skip-link:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40px; text-align: center; font-family: var(--f-pixel); font-size: 12px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Starfield + CRT ---------- */
#starfield {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.crt {
  position: fixed; inset: 0; z-index: 900; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.crt::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.45) 100%);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  border-bottom: 4px solid #000;
  box-shadow: 0 4px 0 0 rgba(240,185,11,.12);
}
/* blur lives on a pseudo-element so the fixed mobile drawer isn't trapped by backdrop-filter */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(7, 7, 12, .82);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.site-header__inner {
  height: 100%; max-width: 1440px; margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-height: 44px; flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand__logo { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(240,185,11,.35)); }
.brand__word { font-family: var(--f-pixel); font-size: 14px; letter-spacing: .08em; }

.nav { margin-left: auto; }
.nav__list { display: flex; gap: 2px; }
.nav__list a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px;
  font-family: var(--f-pixel); font-size: 10px; letter-spacing: .04em;
  color: var(--muted); position: relative; text-transform: uppercase;
}
.nav__list a:hover { color: var(--text); }
.nav__list a.is-active { color: var(--yellow); }
.nav__list a.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 8px; height: 4px;
  background: var(--yellow);
  box-shadow: 0 0 10px rgba(240,185,11,.6);
}
.nav__drawer-foot { display: none; }

.header-actions { display: flex; align-items: center; gap: 12px; margin-left: 8px; }
.chain-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-pixel); font-size: 8px; letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 10px; color: var(--yellow); background: rgba(240,185,11,.08);
  box-shadow: 0 -2px 0 0 var(--yellow-dark), 0 2px 0 0 var(--yellow-dark), -2px 0 0 0 var(--yellow-dark), 2px 0 0 0 var(--yellow-dark);
  white-space: nowrap;
}
.chain-badge__dot { width: 8px; height: 8px; background: var(--yellow); box-shadow: 0 0 8px var(--yellow); animation: blink 1.6s steps(2) infinite; }
.chain-badge--header { display: none; }

.burger {
  width: 48px; height: 48px; background: var(--bg-3); border: 0;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 -3px 0 0 #000, 0 3px 0 0 #000, -3px 0 0 0 #000, 3px 0 0 0 #000, inset -3px -3px 0 rgba(0,0,0,.4), inset 3px 3px 0 rgba(255,255,255,.08);
}
.burger span { width: 22px; height: 4px; background: var(--yellow); transition: transform .2s var(--ease-out), opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

.nav-scrim { position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0,0,0,.6); z-index: 98; }

/* Mobile drawer */
@media (max-width: 1023px) {
  .nav {
    position: fixed; top: var(--header-h); right: 0; bottom: 0;
    width: min(86vw, 340px); margin: 0; z-index: 99;
    background: var(--bg-2);
    border-left: 4px solid #000;
    box-shadow: -4px 0 0 0 rgba(240,185,11,.25);
    transform: translateX(105%);
    transition: transform .32s var(--ease-out);
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto; visibility: hidden;
  }
  .nav.is-open { transform: translateX(0); visibility: visible; }
  .nav__list { flex-direction: column; gap: 4px; }
  .nav__list a { font-size: 12px; min-height: 52px; padding: 0 16px; border-left: 4px solid transparent; }
  .nav__list a.is-active { border-left-color: var(--yellow); background: rgba(240,185,11,.06); }
  .nav__list a.is-active::after { display: none; }
  .nav__drawer-foot { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; padding: 16px; }
  .nav__x { font-family: var(--f-pixel); font-size: 9px; min-height: 44px; display: flex; align-items: center; }
}
@media (min-width: 1024px) {
  .burger, .nav-scrim { display: none !important; }
  .nav { visibility: visible; }
}
@media (min-width: 1200px) {
  .chain-badge--header { display: inline-flex; }
  .nav__list a { padding: 0 14px; }
}
@media (max-width: 420px) {
  .brand__word { display: none; }
}

/* ---------- Main ---------- */
main#app {
  position: relative; z-index: 1;
  flex: 1 0 auto;
  outline: none;
  min-height: calc(100vh - var(--header-h));
}
.view { overflow-x: clip; animation: viewIn .35s var(--ease-out) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; z-index: 1;
  border-top: 4px solid #000;
  box-shadow: 0 -4px 0 0 rgba(240,185,11,.12);
  background: linear-gradient(180deg, rgba(13,13,22,.85), rgba(7,7,12,.98));
  padding: 40px 0 calc(32px + env(safe-area-inset-bottom));
}
.site-footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; gap: 28px; grid-template-columns: 1fr;
}
.site-footer__brand { display: flex; align-items: center; gap: 14px; }
.site-footer__brand img { width: 56px; height: 56px; object-fit: contain; }
.site-footer__word { font-family: var(--f-pixel); font-size: 14px; margin: 0 0 6px; }
.site-footer__tag { color: var(--muted); margin: 0; font-size: 14px; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 4px 4px; }
.site-footer__nav a { font-family: var(--f-pixel); font-size: 9px; color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; text-transform: uppercase; }
.site-footer__nav a:hover { color: var(--yellow); }
.site-footer__meta { display: flex; flex-direction: column; gap: 6px; }
.site-footer__meta p { margin: 0; color: var(--dim); font-size: 13px; }
.site-footer__contract { font-family: var(--f-num); font-size: 20px !important; color: var(--muted) !important; }
.x-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--text); }
.x-link:hover { color: var(--yellow); }
@media (min-width: 768px) {
  .site-footer__inner { grid-template-columns: 1.2fr 1.5fr 1fr; align-items: center; }
  .site-footer__meta { align-items: flex-end; text-align: right; }
}

/* ---------- Boot loader ---------- */
.boot {
  position: fixed; inset: 0; z-index: 2000;
  display: none; place-items: center;
  background: #050508;
  font-family: var(--f-pixel);
}
.boot.is-on, .booting .boot { display: grid; }
.boot.is-off { animation: bootOut .35s steps(5) forwards; }
@keyframes bootOut { to { opacity: 0; transform: scaleY(.02); } }
.boot__inner { width: min(88vw, 420px); text-align: center; display: grid; gap: 18px; justify-items: center; }
.boot__logo { width: 88px; height: 88px; object-fit: contain; animation: bob 2s ease-in-out infinite; filter: drop-shadow(0 0 16px rgba(240,185,11,.5)); }
.boot__line { font-size: 11px; color: var(--yellow); margin: 0; letter-spacing: .05em; }
.boot__dots::after { content: ""; animation: dots 1s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.boot__bar { width: 100%; height: 20px; background: #000; padding: 4px; box-shadow: 0 -4px 0 0 var(--line-2), 0 4px 0 0 var(--line-2), -4px 0 0 0 var(--line-2), 4px 0 0 0 var(--line-2); }
.boot__bar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--yellow) 0 12px, transparent 12px 16px); animation: bootBar 1.2s steps(14) forwards; }
@keyframes bootBar { to { width: 100%; } }
.boot__log { font-family: var(--f-num); font-size: 22px; color: var(--muted); margin: 0; min-height: 1.2em; }
.boot__skip { background: none; border: 0; color: var(--dim); font-family: var(--f-pixel); font-size: 9px; min-height: 44px; padding: 0 16px; }
.boot__skip:hover { color: var(--yellow); }

/* ---------- Route wipe ---------- */
.wipe { position: fixed; inset: 0; z-index: 950; pointer-events: none; display: grid; grid-template-rows: repeat(10, 1fr); }
.wipe i { display: block; background: #07070c; transform: scaleX(0); transform-origin: left; border-bottom: 2px solid rgba(240,185,11,.35); }
.wipe.is-in i { animation: wipeIn .17s steps(5) forwards; }
.wipe.is-out i { transform: scaleX(1); transform-origin: right; animation: wipeOut .17s steps(5) forwards; }
.wipe i:nth-child(odd) { transform-origin: right; }
.wipe.is-out i:nth-child(odd) { transform-origin: left; }
@keyframes wipeIn { to { transform: scaleX(1); } }
@keyframes wipeOut { to { transform: scaleX(0); } }

/* ---------- Shared keyframes ---------- */
@keyframes blink { 50% { opacity: .2; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .wipe { display: none; }
}

/* ---------- Custom scrollbar (Firefox + Chromium/Edge/Safari) ---------- */
html { scrollbar-width: thin; scrollbar-color: var(--yellow) var(--bg-2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); border-left: 2px solid var(--line); }
::-webkit-scrollbar-thumb {
  background: var(--yellow);
  border: 2px solid var(--bg-2);
  box-shadow: inset -2px -2px 0 var(--yellow-dark), inset 2px 2px 0 var(--yellow-2);
}
::-webkit-scrollbar-thumb:hover { background: var(--yellow-2); }
::-webkit-scrollbar-corner { background: var(--bg-2); }
@media (max-width: 768px) { ::-webkit-scrollbar { width: 6px; height: 6px; } }

/* ---------- No iOS rubber-band bounce / no pinch & double-tap zoom ---------- */
html, body { overscroll-behavior: none; }
html { touch-action: pan-x pan-y; }
body { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
img { -webkit-user-drag: none; user-select: none; }

/* BNB logo in chain badge */
.chain-badge { gap: 8px; align-items: center; }
.chain-badge__logo { width: 16px; height: 16px; flex: none; filter: drop-shadow(0 0 6px rgba(243,186,47,.55)); }
.chain-badge__dot { width: 6px; height: 6px; }
