/* ============================================================================
   tokens.css — design tokens (LOCKED design spec §2,3,4,7)
   Single source of truth: color, type, spacing, radius, motion, containers.
   Dark "intelligence terminal". No values off these scales.
   ========================================================================== */

/* ---- Fonts: self-hosted Geist Sans + Geist Mono (variable WOFF2) ---------- */
@font-face{
  font-family:'Geist';
  src:url('../fonts/Geist-Variable.woff2') format('woff2');
  font-weight:100 900; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'Geist Mono';
  src:url('../fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight:100 900; font-style:normal; font-display:swap;
}
/* Display grotesk — big numbers / KPI only (distinct from the dev-default mono).
   Descends from Space Mono → mechanical, instrument-like at large sizes. */
@font-face{
  font-family:'Space Grotesk';
  src:url('../fonts/SpaceGrotesk-Variable.woff2') format('woff2');
  font-weight:300 700; font-style:normal; font-display:swap;
}
/* Nav / brand sans — Onest Variable (self-hosted, Cyrillic-first). A modern
   geometric-humanist sans that reads more "designed" than the neutral body
   grotesque; used ONLY in the top nav (logo + links + CTA). Split by subset so
   the browser fetches just the glyphs it needs. */
@font-face{
  font-family:'Onest';
  src:url('../fonts/Onest-Cyrillic.woff2') format('woff2');
  font-weight:100 900; font-style:normal; font-display:swap;
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face{
  font-family:'Onest';
  src:url('../fonts/Onest-Latin.woff2') format('woff2');
  font-weight:100 900; 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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root{
  /* ---- Canvas & elevation surfaces (lightness-stepped) ---- */
  --bg:        #0B0D10;
  --surface-1: #121519;
  --surface-2: #181C22;
  --surface-3: #20242B;
  --surface-4: #272C34;

  /* ---- Hairline borders (translucent, elevation-agnostic) ---- */
  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.10);
  --border-hover:  rgba(255,255,255,0.15);

  /* ---- Text tiers — COOL-SLATE ladder (R≤G≤B), not neutral gray ----
     Pure-neutral gray text is the #1 "cheap on dark" tell (research 2026-06-03,
     Radix Slate dark / Linear / Vercel). Body lifted brighter + cooled; all AA+. */
  --text-1: #ECEEF1;   /* primary   — ~14.6:1 */
  --text-2: #C2C7CE;   /* body/secondary — ~10.6:1 (was flat #B4B4B4) */
  --text-3: #8B919C;   /* muted/meta — ~5.4:1 (cooled) */
  --text-disabled: #656B75; /* decorative / placeholder only — cooled, ~3.6:1 */

  /* ---- Accent: signal cyan-teal (interactive ONLY) ---- */
  --accent:        #2DD4BF;
  --accent-hover:  #5EEAD4;
  --accent-active: #14B8A6;
  --accent-tint:   rgba(45,212,191,0.10);
  --accent-tint:   color-mix(in srgb, var(--accent) 10%, transparent); /* derived from the one accent */
  --accent-tint-2: color-mix(in srgb, var(--accent) 16%, transparent); /* active-control fill */
  --accent-ring:   color-mix(in srgb, var(--accent) 26%, transparent); /* active-control inset ring */
  --accent-ink:    #06201C;  /* dark text on accent fill */

  /* ---- Semantic: gain / loss (CVD-aware; always paired with glyph) ---- */
  --up:        #3DD68C;
  --up-fill:   #30A46C;
  --up-tint:   #132D21;
  --down:      #FF9592;
  --down-fill: #E5484D;
  --down-tint: #3B1219;

  /* ---- Semantic: success / warn / danger ---- */
  --success:    #3DD68C;
  --warn:       #FFCA16;
  --warn-fill:  #FFC53D;
  --warn-tint:  #302008;
  --danger:     #FF9592;
  --danger-fill:#E5484D;

  /* ---- Interaction fills (translucent, layer on any surface) ---- */
  --fill-hover:    rgba(255,255,255,0.04);
  --fill-active:   rgba(255,255,255,0.06);
  --fill-selected: var(--accent-tint);

  /* ---- Categorical palette (Paul Tol muted, CVD-safe) — source mix ---- */
  --cat-team:   #117733;  /* team_whale  */
  --cat-safe:   #44AA99;  /* safe_inflow */
  --cat-fresh:  #88CCEE;  /* fresh_cluster */
  --cat-cex:    #DDCC77;  /* cex_coord   */
  --cat-dist:   #CC6677;  /* dist_followup */
  --cat-claim:  #AA4499;  /* claim / airdrop (Tol-muted rose-purple) */
  --cat-withdrawal:#882255; /* cex_withdrawal (Tol-muted wine) — mirror of deposit */
  --cat-balpha: #999933;  /* binance_alpha (Tol-muted olive-gold, named venue) */
  --cat-deposit:#CC8844;  /* cex_deposit — amber-ochre «приток в стакан»; clearly oranger than the olive balpha (was --cat-cex sand, too close to Alpha) */
  --cat-teamsale:#EE7733; /* team_sale — команд-dump on DEX (Tol-muted orange) */
  --cat-stablefund:#5FB87A; /* stable_funding — stablecoin top-up «под откуп» (emerald — capital inflow, bullish counterpart to the amber deposit) */
  --cat-depeg:  #E5484D;  /* depeg — stablecoin peg BREAK; vivid alarm-red (a discount below the peg, distinct from the muted wine/rose flows). Mirrored in spa.js SM.depeg.color. */
  --cat-other:  #4455BB;
  --cat-safewd: #6E8CA0;  /* safe_withdrawal — вывод С Safe: стальной сине-серый, «уходит из-под мультиподписи» (родственник teal --cat-safe, но холоднее = отток) */
  --cat-coord:  #9C8AC4;  /* coordinated — скоординированные переводы (несколько отправителей, один токен): приглушённая лаванда, OFF the rose-purple --cat-claim */
  /* ---- Holder-class palette (cluster / holders) — one canon, was hardcoded hex in cluster-force ---- */
  --cat-contract:#6688CC; /* contract (non-Safe) — steel-blue, OFF the teal --cat-safe (was the collision) */
  --cat-bot:    #8A8D93;  /* bot / HFT — neutral steel (was olive --cat-balpha, collided with Alpha) */
  --cat-bridge: #5B8DEF;  /* bridge (was hardcoded #5B8DEF in cluster-force.js) */
  --cat-fund:   #6F7BC4;  /* fund / institutional (was bright violet #C084FC — off-palette) */
  --cat-unknown:#9AA1AC;  /* regular / прочие — neutral grey (was #DDDDDD, near-white = invisible dot) */
  --cat-hl:     #4477AA;  /* HyperLiquid кит (PRIME) — Tol-muted blue, clearly OFF the teal --accent */
  --cat-hlsm:   #C9A24B;  /* HyperLiquid small-cap кластер (WATCH) — muted gold (tentative/watch) */

  /* ---- Concentration thresholds (gauge / treemap / sectors) — ordered, no red↔green pair ---- */
  --thr-low:  #88CCEE;  /* <33% */
  --thr-mid:  #DDCC77;  /* 33–66% */
  --thr-high: #CC6677;  /* >66% */

  /* ---- Focus ring (WCAG 1.4.11: >=3:1 on element AND canvas) ---- */
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px rgba(45,212,191,0.75);

  /* ---- Elevation shadows — cool-tinted (not pure black), layered for soft realism.
     Reserved for TRUE overlays (popover/drawer/tooltip/lock-card); static panels rely on
     surface-ladder + hairline + inset top-light, never an ambient drop shadow. ---- */
  --shadow-color: 220 30% 2%;
  --elev-1: 0 1px 0 rgba(255,255,255,.045) inset, 0 1px 2px hsl(var(--shadow-color)/.5),
            0 3px 6px hsl(var(--shadow-color)/.45), 0 8px 16px hsl(var(--shadow-color)/.4);
  --elev-2: 0 1px 0 rgba(255,255,255,.05) inset, 0 2px 4px hsl(var(--shadow-color)/.5),
            0 6px 12px hsl(var(--shadow-color)/.45), 0 14px 28px hsl(var(--shadow-color)/.4),
            0 28px 56px hsl(var(--shadow-color)/.35);

  /* ---- Typography ---- */
  --font-sans:'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:'Geist Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-display:'Space Grotesk', var(--font-mono); /* hero / KPI magnitude only */
  --font-nav:'Onest', var(--font-sans);             /* top-nav brand + links only */

  /* ---- Caption tracking — rises as size falls so small caps stay legible (not a flat 0.04em) ---- */
  --track-caps-lg:0.06em;   /* 12px structural caps (eyebrow / column header / KPI label) */
  --track-caps-sm:0.08em;   /* 11px micro caps (KPI cap, flow from/to, tooltip key) */
  --track-caps-xs:0.10em;   /* 10px mono hints only (kbd) */

  /* ---- Spacing (8px base, 4px sub-step) ---- */
  --space-1:.25rem; --space-2:.5rem; --space-3:.75rem; --space-4:1rem;
  --space-5:1.25rem; --space-6:1.5rem; --space-8:2rem; --space-10:2.5rem;
  --space-12:3rem; --space-16:4rem; --space-20:5rem; --space-24:6rem;
  --space-32:8rem; --space-40:10rem;

  /* ---- Radius (varied scale — not uniform) ---- */
  --radius-xs:2px;   /* terminal panels / table container */
  --radius-sm:4px;   /* inputs, cells, badges */
  --radius-md:8px;   /* cards */
  --radius-pill:999px;

  /* ---- Layout ---- */
  --container-marketing:1280px;
  --container-prose:680px;
  --container-dashboard:1600px;
  --nav-h:64px;
  --gutter:clamp(1rem, 5vw, 2rem);

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.3, 0, 0.8, 0.15);
  --ease-std: cubic-bezier(0.2, 0, 0, 1);
  --ease-strong: cubic-bezier(0.23, 1, 0.32, 1); /* asymmetric settle (hover-out / reveal) */
  --dur-1:120ms; --dur-2:150ms; --dur-3:200ms; --dur-4:300ms; --dur-5:400ms; --dur-6:500ms;
}
