/* ============================================================
   Trixo Market — Design Tokens
   Re-color / re-scale the entire site from this single file.
   ============================================================ */

:root {
  /* ---- Brand & surfaces (black + red) ---- */
  --bg: #0a0a0c;            /* page background (near-black) */
  --bg-pure: #000000;       /* full-black bands */
  --surface: #141417;       /* cards, panels */
  --surface-2: #1c1c20;     /* raised / hover panels */
  --surface-3: #26262b;     /* inputs, chips */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --surface-light: #f5f7fb;  /* light contrast bands / light-theme pages */
  --grad-light: linear-gradient(180deg, #ffffff 0%, #f1f4fa 100%);

  /* ---- Accent (brand red) ---- */
  --accent: #ee3142;
  --accent-hover: #ff4555;
  --accent-press: #c8202f;
  --accent-soft: rgba(238, 49, 66, 0.14);
  --accent-glow: rgba(238, 49, 66, 0.35);

  /* ---- Text ---- */
  --text: #ffffff;
  --text-muted: #a2a2ad;
  --text-dim: #6e6e78;
  --text-on-accent: #ffffff;

  /* ---- Market semantics ---- */
  --up: #16c784;
  --up-soft: rgba(22, 199, 132, 0.14);
  --down: #ee3142;
  --down-soft: rgba(238, 49, 66, 0.14);

  /* ---- Gradients ---- */
  --grad-accent: linear-gradient(135deg, #ff4555 0%, #ee3142 45%, #c8202f 100%);
  --grad-hero: radial-gradient(1200px 600px at 70% -10%, rgba(238, 49, 66, 0.22), transparent 60%);
  --grad-fade-top: linear-gradient(180deg, rgba(0,0,0,0.6), transparent);

  /* ---- Typography ---- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-ar: "Cairo", "Tajawal", var(--font-sans);

  --fs-h1: clamp(2.4rem, 1.4rem + 4.2vw, 4rem);
  --fs-h2: clamp(1.9rem, 1.3rem + 2.6vw, 3rem);
  --fs-h3: clamp(1.4rem, 1.1rem + 1.4vw, 2rem);
  --fs-h4: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  --fs-lead: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;

  --lh-tight: 1.12;
  --lh-snug: 1.3;
  --lh-body: 1.65;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* ---- Spacing scale (8px base) ---- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 2.5rem;
  --sp-8: 3rem;
  --sp-9: 4rem;
  --sp-10: 5rem;
  --sp-12: 7rem;

  /* ---- Layout ---- */
  --container: 1240px;
  --container-wide: 1400px;
  --gutter: clamp(1rem, 0.5rem + 2vw, 2.5rem);
  --section-y: clamp(3.5rem, 2rem + 6vw, 7rem);

  /* ---- Radius ---- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* ---- Shadows ---- */
  --sh-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --sh-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --sh-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
  --sh-accent: 0 10px 30px rgba(238, 49, 66, 0.35);

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms;
  --t-med: 280ms;
  --t-slow: 600ms;

  /* ---- Z-index ---- */
  --z-header: 1000;
  --z-drawer: 1100;
  --z-modal: 1200;
  --z-toast: 1300;

  --header-h: 72px;
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }
}

/* ============================================================
   Light theme — re-map the surface/text tokens so every
   var()-driven component flips automatically.
   .theme-light   → whole page (markets/*.html)
   .section--light → a single light contrast band on a dark page
   ============================================================ */
.theme-light,
.section--light {
  --bg: #ffffff;
  --bg-pure: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --surface-3: #e6eaf2;
  --border: rgba(15, 18, 26, 0.10);
  --border-strong: rgba(15, 18, 26, 0.18);
  --text: #10121a;
  --text-muted: #4f5566;
  --text-dim: #80869a;
  --accent-soft: rgba(238, 49, 66, 0.10);
  --grad-hero: radial-gradient(1200px 600px at 70% -10%, rgba(238, 49, 66, 0.10), transparent 60%);
}
.theme-light { background: var(--bg); color: var(--text); }
