/*
 * HOODACHI design system (css/base.css). Shared by every page: landing, app, docs, legal, 404.
 * Tokens from SPEC 2.1 (all on :root: --bg --panel --line --green --red --text --muted --faint --up --down --watch
 * --info --font --font-label --font-mono --r-panel --r-ctl --r-pill --shadow-1/2 --blur --ease --gutter --header-h).
 *   layout   .wrap .wrap-wide .stack .row .row-nowrap .spacer .grid-2 .grid-3 .grid-4 .divider .hairline
 *            .hide-sm (<640) .hide-md (<1024) .only-sm
 *   text     .eyebrow .label .lede .muted .faint .mono .num .stat-num .small .tiny .nowrap .ellipsis .kbd .link
 *            .up .down .watch .info .sr-only .skip-link
 *   buttons  .btn + .btn-primary .btn-ghost .btn-quiet .btn-danger .btn-sm .btn-lg .btn-icon .btn-block
 *            [disabled] / [aria-disabled=true] / [aria-busy=true] (spinner) .icon-link .btn-buy
 *   status   .pill (+ .pill-up -down -watch -info -muted -label) .chip (.sep) .dot (+ .dot-up -down -watch -info -live)
 *            .chg[data-dir=up|down|flat|none]
 *   surfaces .glass .panel (.panel-solid) .panel-head .panel-title .panel-body .panel-foot .card (hover lift)
 *            .kpi .kpi-value .kpi-sub
 *   data     .table-wrap .table (th button for sorting, td.num, tr[data-href]) .tok .tok-text .tok-sym .tok-name
 *            .tok-logo .tok-img .monogram .spark .kv .meter (.meter-split) .avatar
 *   forms    .field .field-label .field-hint .input .input-search .select .textarea .seg (button[aria-pressed])
 *            .toggle (+ .toggle-track) .range
 *   overlays [data-tip] (+ data-tip-pos=bottom) .tip (.is-on) .toasts .toast dialog.modal .modal-card .modal-head
 *            .modal-title .modal-body .modal-close .modal-media .player-* .lightbox-*
 *   states   .skel .skel-line (--w) .skel-circle (--s) .state .state-title .state-error .state-inline
 *   motion   html.js .reveal (+ .is-in, --d delay); prefers-reduced-motion stops every animation
 *   shell    .site-header (.is-over .is-solid) .brand .site-nav .nav-link .header-actions .menu-btn .sheet
 *            .site-footer .footer-* (partials/*.html, stamped by tools/shell.mjs, behaviour in js/ui/shell.js)
 *   3D       .city-canvas .city-tip (js/city.js)
 */

/* ------------------------------------------------------------------ fonts */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: 'Chakra Petch'; src: url('/fonts/chakra-petch-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url('/fonts/chakra-petch-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url('/fonts/chakra-petch-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

/* ----------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;
  --bg: #0b0d0c;
  --bg-2: #0f1311;
  --bg-3: #141a17;
  --panel: rgba(18, 24, 21, .72);
  --panel-solid: #121815;
  --panel-hi: rgba(26, 35, 30, .82);
  --line: rgba(160, 255, 200, .09);
  --line-2: rgba(160, 255, 200, .16);
  --line-3: rgba(160, 255, 200, .26);

  --green: #57c980;
  --green-2: #7bdc9d;
  --green-deep: #006837;
  --green-ink: #06130c;
  --red: #d32120;
  --cream: #eee4cf;
  --ink: #0c0d0d;

  --text: #e9efe9;
  --muted: #93a39a;
  --faint: #5f6d65;

  --up: var(--green);
  --down: #ff5a52;
  --watch: #f2b84b;
  --info: #5aa9ff;
  --up-bg: rgba(87, 201, 128, .12);
  --down-bg: rgba(255, 90, 82, .12);
  --watch-bg: rgba(242, 184, 75, .12);
  --info-bg: rgba(90, 169, 255, .12);

  --font: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-label: 'Chakra Petch', 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --r-panel: 14px;
  --r-ctl: 10px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 60px -24px rgba(0, 0, 0, .8);
  --glow: 0 0 0 1px rgba(87, 201, 128, .35), 0 10px 40px -12px rgba(87, 201, 128, .45);
  --blur: blur(14px) saturate(1.2);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: .15s;
  --t: .28s;

  --gutter: 16px;
  --wrap: 1200px;
  --wrap-wide: 1400px;
  --header-h: 68px;
}
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; } }

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
svg { flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4, h5, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
ul[role='list'], ol[role='list'] { list-style: none; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
::selection { background: rgba(87, 201, 128, .32); color: #fff; }
html { scrollbar-color: #2a3530 transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #243029; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------- typography */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.02em; line-height: 1.1; color: var(--text); text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.2rem; letter-spacing: -.01em; line-height: 1.25; }
h4 { font-size: 1rem; letter-spacing: 0; line-height: 1.3; }
p { text-wrap: pretty; }
.lede { font-size: clamp(1rem, 1.4vw, 1.15rem); color: var(--muted); max-width: 56ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-label); font-weight: 600; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--green);
}
.label {
  font-family: var(--font-label); font-weight: 600; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); font-feature-settings: 'zero' 0; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.stat-num { font-family: var(--font-label); font-weight: 700; letter-spacing: .01em; line-height: 1; }
.up { color: var(--up); }
.down { color: var(--down); }
.watch { color: var(--watch); }
.info { color: var(--info); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kbd { font-family: var(--font-mono); font-size: .78em; padding: .1em .45em; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; color: var(--muted); }
.link { color: var(--green); text-decoration: underline; text-decoration-color: rgba(87, 201, 128, .35); text-underline-offset: 3px; transition: text-decoration-color var(--t-fast); }
.link:hover { text-decoration-color: currentColor; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 14px; border-radius: var(--r-ctl);
  background: var(--green); color: var(--green-ink); font-weight: 600; transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; }

/* ------------------------------------------------------------------ focus */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }
.btn:focus-visible, .input:focus-visible, .select:focus-visible { outline-offset: 2px; }

/* ----------------------------------------------------------------- layout */
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { width: 100%; max-width: calc(var(--wrap-wide) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--gap, 12px); }
.row-nowrap { flex-wrap: nowrap; }
.spacer { flex: 1 1 auto; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--gap, 16px); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.divider { height: 1px; border: 0; margin: 0; background: linear-gradient(90deg, transparent, var(--line-2) 20%, var(--line-2) 80%, transparent); }
.hairline { border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-h: 42px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  height: var(--btn-h); padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: rgba(255, 255, 255, .03);
  color: var(--text); font-weight: 600; font-size: .95rem; letter-spacing: -.005em; line-height: 1; white-space: nowrap;
  text-decoration: none; user-select: none;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: rgba(255, 255, 255, .06); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #66d48d, var(--green) 55%, #49b870);
  border-color: rgba(190, 255, 215, .35);
  color: var(--green-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 26px -10px rgba(87, 201, 128, .65);
}
.btn-primary:hover { background: linear-gradient(180deg, #74dc99, #62d08a 55%, #50c077); border-color: rgba(210, 255, 225, .55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 32px -8px rgba(87, 201, 128, .8); }
.btn-ghost { background: rgba(12, 16, 14, .38); border-color: rgba(233, 239, 233, .22); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.btn-ghost:hover { background: rgba(233, 239, 233, .08); border-color: rgba(233, 239, 233, .38); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { background: rgba(255, 255, 255, .05); border-color: transparent; color: var(--text); }
.btn-danger { background: rgba(211, 33, 32, .14); border-color: rgba(255, 90, 82, .35); color: #ffb3ae; }
.btn-danger:hover { background: rgba(211, 33, 32, .24); border-color: rgba(255, 90, 82, .55); }
.btn-sm { --btn-h: 34px; padding: 0 12px; font-size: .86rem; border-radius: 9px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { --btn-h: 50px; padding: 0 24px; font-size: 1.02rem; border-radius: 12px; }
.btn-lg svg { width: 20px; height: 20px; }
.btn-icon { width: var(--btn-h); padding: 0; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary[disabled], .btn-primary[aria-disabled='true'] { background: rgba(87, 201, 128, .22); color: rgba(233, 239, 233, .7); border-color: var(--line-2); }
.btn[aria-busy='true'] { color: transparent !important; pointer-events: none; }
.btn[aria-busy='true']::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--text) transparent var(--text) transparent; animation: spin .8s linear infinite;
}
.btn-primary[aria-busy='true']::after { border-color: var(--green-ink) transparent var(--green-ink) transparent; }
.icon-link {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--muted);
  transition: color var(--t-fast), background-color var(--t-fast);
}
.icon-link:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.icon-link svg { width: 19px; height: 19px; }

/* ---------------------------------------------------------- pills + dots */
.pill {
  display: inline-flex; align-items: center; gap: .4em; height: 24px; padding: 0 9px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  background: rgba(255, 255, 255, .06); color: var(--muted);
  font-family: var(--font-mono); font-size: .76rem; font-weight: 500; line-height: 1; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pill svg { width: 13px; height: 13px; }
.pill-up { background: var(--up-bg); color: var(--up); }
.pill-down { background: var(--down-bg); color: var(--down); }
.pill-watch { background: var(--watch-bg); color: var(--watch); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-muted { background: rgba(255, 255, 255, .04); color: var(--faint); }
.pill-label { font-family: var(--font-label); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .68rem; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 13px 5px 11px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: rgba(10, 14, 12, .55); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  font-size: .84rem; color: var(--muted); line-height: 1.2;
}
.chip strong { color: var(--text); font-weight: 600; }
.chip .sep { color: var(--faint); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot-up { background: var(--up); box-shadow: 0 0 10px rgba(87, 201, 128, .6); }
.dot-down { background: var(--down); box-shadow: 0 0 10px rgba(255, 90, 82, .55); }
.dot-watch { background: var(--watch); box-shadow: 0 0 10px rgba(242, 184, 75, .5); }
.dot-info { background: var(--info); box-shadow: 0 0 10px rgba(90, 169, 255, .5); }
.dot-live { position: relative; background: var(--up); }
.dot-live::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--up);
  animation: live-ring 2s var(--ease-out) infinite;
}
.dot-live.dot-down::after { border-color: var(--down); }
.dot-live.dot-watch::after { border-color: var(--watch); }
@keyframes live-ring { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.chg { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg[data-dir='up'] { color: var(--up); }
.chg[data-dir='down'] { color: var(--down); }
.chg[data-dir='flat'], .chg[data-dir='none'] { color: var(--muted); }

/* --------------------------------------------------------------- surfaces */
.glass { background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.panel {
  position: relative;
  background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--r-panel);
  box-shadow: var(--shadow-1);
}
.panel::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(190, 255, 215, .05), transparent 28%);
}
.panel-solid { background: var(--panel-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; min-height: 44px; }
.panel-title { font-size: .98rem; font-weight: 600; letter-spacing: -.005em; display: flex; align-items: center; gap: 9px; }
.panel-title svg { width: 18px; height: 18px; color: var(--green); }
.panel-body { padding: 14px 18px 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card { transition: transform var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi-value { font-family: var(--font-label); font-weight: 700; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .82rem; color: var(--muted); }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.table { width: 100%; font-size: .9rem; }
.table th {
  position: sticky; top: 0; z-index: 1;
  padding: 10px 12px; text-align: left; white-space: nowrap;
  font-family: var(--font-label); font-weight: 600; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  background: var(--panel-solid); border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .r, .table td.num, .table th.num { text-align: right; }
.table td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .86rem; }
.table tbody tr { transition: background-color var(--t-fast); }
.table tbody tr:hover { background: rgba(160, 255, 200, .035); }
.table tbody tr[data-href] { cursor: pointer; }
.table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.table th button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.table th[aria-sort] button { color: var(--text); }

/* ------------------------------------------------------- token identity */
.tok { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.tok-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.tok-sym { font-weight: 600; letter-spacing: -.005em; }
.tok-name { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tok-logo {
  --s: 24px;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden;
  background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}
.tok-logo .tok-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.monogram {
  --h: 150;
  display: inline-grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, hsl(var(--h) 45% 34%), hsl(var(--h) 40% 16%));
  color: hsl(var(--h) 70% 86%);
  font-family: var(--font-label); font-weight: 700; font-size: calc(var(--s, 24px) * .36); letter-spacing: .02em; line-height: 1;
}
.tok-logo:has(.monogram) { background: transparent; }

/* ------------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: .84rem; color: var(--muted); font-weight: 500; }
.field-hint { font-size: .78rem; color: var(--faint); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: rgba(6, 9, 8, .55); color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(87, 201, 128, .6); box-shadow: 0 0 0 3px rgba(87, 201, 128, .14); outline: none; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a39a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.input-search { padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6d65' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 11px center; background-size: 18px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.seg button {
  height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font-size: .84rem; font-weight: 600; transition: background-color var(--t-fast), color var(--t-fast);
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'], .seg button[aria-selected='true'] { background: rgba(87, 201, 128, .16); color: var(--green); }

/* toggle: <label class="toggle"><input type="checkbox"><span class="toggle-track"></span><span>Text</span></label> */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; min-width: 0; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.toggle-track {
  position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid var(--line-2);
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #c7d2cb; box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  transition: transform var(--t) var(--ease-out), background-color var(--t);
}
.toggle input:checked + .toggle-track { background: rgba(87, 201, 128, .85); border-color: rgba(190, 255, 215, .4); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); background: #fff; }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--green); outline-offset: 2px; }
.toggle input:disabled + .toggle-track { opacity: .5; }

.range { width: 100%; accent-color: var(--green); }

/* ---------------------------------------------------------------- tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 30;
  transform: translate(-50%, 4px); opacity: 0; pointer-events: none;
  width: max-content; max-width: 240px; padding: 7px 10px; border-radius: 8px;
  background: #1b231f; border: 1px solid var(--line-2); box-shadow: var(--shadow-2);
  color: var(--text); font: 500 .78rem/1.35 var(--font); letter-spacing: 0; text-transform: none; white-space: normal; text-align: left;
  transition: opacity var(--t-fast), transform var(--t-fast) var(--ease);
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
[data-tip-pos='bottom']::after { bottom: auto; top: calc(100% + 8px); transform: translate(-50%, -4px); }
.tip {
  position: absolute; z-index: 40; pointer-events: none;
  min-width: 180px; max-width: 280px; padding: 12px 14px; border-radius: 12px;
  background: rgba(14, 19, 16, .92); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-2);
  font-size: .84rem; opacity: 0; transform: translateY(4px);
  transition: opacity var(--t-fast), transform var(--t-fast) var(--ease);
}
.tip.is-on { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ toasts */
.toasts {
  position: fixed; z-index: 300; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 11px 16px 11px 12px; border-radius: 12px;
  background: rgba(20, 27, 23, .94); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-2);
  font-size: .9rem; font-weight: 500; pointer-events: auto;
  animation: toast-in .32s var(--ease-out) both;
}
.toast svg { width: 18px; height: 18px; color: var(--green); }
.toast-ok svg { color: var(--up); }
.toast-warn svg { color: var(--watch); }
.toast-error svg { color: var(--down); }
.toast-error { border-color: rgba(255, 90, 82, .3); }
.toast.is-out { animation: toast-out .24s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ------------------------------------------------------------------- modal */
html.modal-open { overflow: hidden; }
dialog.modal {
  position: fixed; inset: 0; margin: auto; padding: 0; border: 0; background: transparent; color: var(--text);
  width: min(var(--modal-w, 560px), calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); overflow: visible;
}
dialog.modal::backdrop { background: rgba(3, 5, 4, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-in .25s var(--ease) both; }
dialog.modal[open] .modal-card { animation: modal-in .34s var(--ease-out) both; }
dialog.modal.is-closing .modal-card { animation: modal-out .2s var(--ease) both; }
dialog.modal.is-closing::backdrop { animation: fade-out .2s var(--ease) both; }
.modal-card {
  position: relative; display: flex; flex-direction: column; max-height: calc(100dvh - 24px);
  background: rgba(16, 21, 18, .96); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-2); overflow: hidden;
}
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 1.05rem; font-weight: 600; }
.modal-body { padding: 18px; overflow: auto; }
.modal-close { margin-left: auto; }
.modal-media { --modal-w: 1100px; }
.modal-media .modal-card { background: #050706; }
.modal-media .modal-body { padding: 0; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* ---------------------------------------------------------------- skeleton */
.skel {
  display: block; border-radius: 8px; background: rgba(160, 255, 200, .06);
  background-image: linear-gradient(90deg, transparent, rgba(160, 255, 200, .08), transparent);
  background-size: 200% 100%; background-repeat: no-repeat; animation: shimmer 1.4s linear infinite;
}
.skel-line { height: .9em; width: var(--w, 100%); border-radius: 6px; }
.skel-circle { width: var(--s, 24px); height: var(--s, 24px); border-radius: 50%; flex: none; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* ------------------------------------------------------------------ states */
.state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 16px; color: var(--muted); }
.state svg { width: 26px; height: 26px; color: var(--faint); margin-bottom: 4px; }
.state-title { color: var(--text); font-weight: 600; }
.state-error svg { color: var(--down); }
.state-inline { flex-direction: row; justify-content: center; padding: 14px; font-size: .86rem; gap: 8px; }
.state-inline svg { width: 16px; height: 16px; margin: 0; }

/* ------------------------------------------------ key/value, meter, avatar */
/* <dl class="kv"><dt>Price</dt><dd>$224.26</dd>...</dl> */
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: .88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* <div class="meter" style="--v:.62"><span></span></div>; .meter-split shows up (green) vs down (red) */
.meter { position: relative; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; width: calc(var(--v, 0) * 100%); border-radius: inherit; background: var(--green); transition: width var(--t) var(--ease); }
.meter-split { background: rgba(255, 90, 82, .75); }
.meter-split > span { border-radius: 999px 0 0 999px; }
/* wallet avatar: set --a and --b from the address (deterministic gradient) */
.avatar { --a: #57c980; --b: #006837; flex: none; width: var(--s, 28px); height: var(--s, 28px); border-radius: 50%; background: conic-gradient(from 210deg, var(--a), var(--b), var(--a)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }

/* ------------------------------------------------------------------- spark */
.spark { display: block; width: 100%; height: auto; overflow: visible; }
.spark path { vector-effect: non-scaling-stroke; }

/* ---------------------------------------------------------------- reveal */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--d, 0s); }
html.js .reveal.is-in { opacity: 1; transform: none; }

/* ============================================================ site header */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), -webkit-backdrop-filter var(--t), backdrop-filter var(--t);
  border-bottom: 1px solid transparent;
}
.site-header.is-over { position: fixed; left: 0; right: 0; }
.site-header.is-solid {
  background: rgba(10, 13, 11, .72); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom-color: var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.brand-mark { width: 32px; height: 32px; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .45)); }
.brand-word { width: auto; height: 15px; }
.site-nav { display: none; align-items: center; gap: 2px; margin-left: 18px; }
.nav-link {
  position: relative; padding: 8px 13px; border-radius: 9px; color: rgba(233, 239, 233, .74); font-size: .93rem; font-weight: 500;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav-link[aria-current='page'] { color: var(--text); }
.nav-link[aria-current='page']::after { content: ''; position: absolute; left: 13px; right: 13px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--green); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.header-actions .icon-link { display: none; }
.menu-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--text); }
.menu-btn:hover { background: rgba(255, 255, 255, .06); }
.menu-btn svg { width: 22px; height: 22px; }
@media (max-width: 379px) {
  .brand-word { height: 12px; }
  .brand { gap: 8px; }
  .brand-mark { width: 28px; height: 28px; }
  .header-actions .btn { padding: 0 10px; }
  .header-actions .btn svg { display: none; }
}
@media (min-width: 900px) {
  .site-nav { display: flex; }
  .header-actions .icon-link { display: inline-grid; }
  .menu-btn { display: none; }
  .brand-word { height: 16px; }
}

/* mobile sheet */
.sheet {
  position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column;
  padding: 0 var(--gutter) max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 60% at 80% 0%, rgba(0, 104, 55, .28), transparent 60%), rgba(8, 11, 9, .97);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  animation: sheet-in .32s var(--ease-out) both;
}
.sheet.is-closing { animation: sheet-out .2s var(--ease) both; }
.sheet-top { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.sheet-nav { display: flex; flex-direction: column; margin-top: 18px; }
.sheet-nav a {
  display: flex; align-items: center; justify-content: space-between; padding: 17px 2px;
  border-bottom: 1px solid var(--line); font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em;
}
.sheet-nav a svg { width: 22px; height: 22px; color: var(--faint); }
.sheet-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.sheet-foot .row { justify-content: space-between; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(-8px); } }

/* ============================================================ site footer */
.site-footer { position: relative; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(15, 19, 17, .6), var(--bg)); }
.footer-inner { display: grid; gap: 22px; padding-block: 34px 22px; grid-template-columns: minmax(0, 1fr); align-items: center; }
.footer-brand { display: flex; flex-direction: column; gap: 10px; }
.footer-brand .brand-word { height: 14px; }
.footer-tag { color: var(--muted); font-size: .9rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .9rem; }
.footer-nav a { color: var(--muted); padding: 4px 0; transition: color var(--t-fast); }
.footer-nav a:hover { color: var(--text); }
.footer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.footer-base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-block: 16px 26px; border-top: 1px solid var(--line); color: var(--faint); font-size: .84rem; }
.footer-base .footer-note { color: var(--faint); }
.btn-buy[aria-disabled='true'] { opacity: 1; color: var(--muted); border-style: dashed; background: transparent; cursor: default; }
@media (min-width: 900px) {
  .footer-inner { grid-template-columns: auto 1fr auto; gap: 40px; }
  .footer-nav { justify-content: center; }
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 639px) { .hide-sm { display: none !important; } }
@media (max-width: 1023px) { .hide-md { display: none !important; } }
@media (min-width: 640px) { .only-sm { display: none !important; } }

/* ------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
  .skel { animation: none; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ------------------------------------------------ media player + lightbox */
.player-stage { position: relative; background: #000; aspect-ratio: 16 / 9; max-height: calc(100dvh - 140px); }
.player-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 16px; border-top: 1px solid var(--line); }
.player-now { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.player-code { color: var(--green); }
.player-title { font-weight: 600; font-size: 1.02rem; }
.player-list { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.player-ep {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: .84rem; font-weight: 500;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.player-ep:hover { color: var(--text); border-color: var(--line-3); }
.player-ep[aria-pressed='true'] { color: var(--text); border-color: rgba(87, 201, 128, .5); background: rgba(87, 201, 128, .1); }
.player-ep-code { font-family: var(--font-label); font-weight: 700; letter-spacing: .06em; color: var(--green); font-size: .74rem; }
.player-close {
  position: absolute; top: 10px; right: 10px; z-index: 5; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .55); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background-color var(--t-fast);
}
.player-close:hover { background: rgba(0, 0, 0, .8); }
@media (max-width: 639px) { .player-list { margin-left: 0; } .player-ep span:last-child { display: none; } }

.modal-lightbox { --modal-w: 1280px; }
.lightbox { position: relative; }
.lightbox-figure { display: flex; flex-direction: column; }
.lightbox-img { width: 100%; height: auto; max-height: calc(100dvh - 90px); object-fit: contain; background: #000; opacity: 0; transition: opacity .3s var(--ease); }
.lightbox-img.is-in { opacity: 1; }
.lightbox-cap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.lightbox-text { min-width: 0; }
.lightbox-pager { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.lightbox-count { min-width: 3.2em; text-align: center; }

/* ------------------------------------------------- 3D city (js/city.js) */
.city-tip { z-index: 5; }
.city-tip-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.city-tip-head .tok-sym { font-size: .98rem; }
.city-tip-grid { display: grid; grid-template-columns: auto auto; gap: 5px 16px; margin: 0; font-size: .8rem; }
.city-tip-grid dt { color: var(--muted); }
.city-tip-grid dd { margin: 0; text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.city-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.city-canvas.is-hover { cursor: pointer; }
