/* ============================================================
   HYPERTALE — Design Tokens
   The single source of truth for color, depth, motion and space.
   ============================================================ */

:root {
  /* ---- Core surfaces (layered, never flat) ----
     Cool near-black "midnight arcane" tones — a deep blue-violet void that
     makes the magical accents glow. */
  --bg-void: #060811;
  --bg-900: #0a0d1a;
  --bg-850: #0d1120;
  --bg-800: #111527;
  --bg-750: #151a30;
  --bg-700: #1a2039;
  --bg-650: #202844;

  /* ---- Brand ----
     Arcane spellbook palette: PRIMARY accent is a luminous arcane BLUE,
     SECONDARY is mystic VIOLET (rune magic). Admin-editable: header.ejs may
     override --accent / --accent-rgb from site settings, and everything below
     cascades from it. True green (--leaf) is kept for rare, intentional use only
     (success, "online", emerald rank). */
  --accent: #4aa3ff;
  --accent-2: #9a5cff;
  --accent-rgb: 74, 163, 255;
  --accent-2-rgb: 154, 92, 255;

  /* Legacy "green*" names now resolve to the accent so the whole UI recolors
     from one variable — no churn across the stylesheet. */
  --green: var(--accent);
  --green-bright: color-mix(in oklab, var(--accent), white 20%);
  --green-deep: color-mix(in oklab, var(--accent), #04102e 32%);
  --green-rgb: var(--accent-rgb);

  --purple: var(--accent-2);
  --purple-bright: color-mix(in oklab, var(--accent-2), white 18%);
  --purple-deep: #5b3fd6;
  --purple-rgb: var(--accent-2-rgb);

  --gold: #ffd75e;
  --danger: #ff5f6d;
  --danger-deep: #c0243a;
  --cyan: #38e1ff;

  /* True green, for the few places that should stay green */
  --leaf: #53ff4f;
  --leaf-rgb: 83, 255, 79;

  /* ---- RGB helpers ---- */
  --gold-rgb: 255, 215, 94;
  --danger-rgb: 255, 95, 109;
  --cyan-rgb: 56, 225, 255;

  /* ---- Text ---- */
  --text: #f4f5f7;
  --text-soft: #c4c8d0;
  --text-dim: #8b909b;
  --text-faint: #5c616c;

  /* ---- Glass / arcane crystal ---- */
  --glass-bg: rgba(22, 28, 50, 0.58);
  --glass-bg-strong: rgba(15, 20, 38, 0.82);
  --glass-brd: rgba(120, 170, 255, 0.14);
  --glass-brd-strong: rgba(140, 180, 255, 0.26);
  --hair: rgba(120, 170, 255, 0.09);
  /* Arcane rune edge used by spellbook panels */
  --gilt: rgba(74, 163, 255, 0.5);

  /* ---- Radii ---- */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  /* ---- Shadows / depth ---- */
  --sh-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --sh-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --sh-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --sh-glow-green: 0 0 0 1px rgba(var(--green-rgb), 0.4), 0 10px 40px rgba(var(--green-rgb), 0.28);
  --sh-glow-purple: 0 0 0 1px rgba(var(--purple-rgb), 0.4), 0 10px 40px rgba(var(--purple-rgb), 0.28);

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.16s;
  --t: 0.28s;
  --t-slow: 0.5s;

  /* ---- Layout ---- */
  --nav-h: 68px;
  --wrap: 1180px;
  --wrap-wide: 1440px;
  --gutter: clamp(16px, 4vw, 40px);

  /* ---- Z-index scale ---- */
  --z-fx: 0;
  --z-base: 1;
  --z-sticky: 100;
  --z-nav: 200;
  --z-dropdown: 300;
  --z-overlay: 400;
  --z-toast: 500;

  /* ---- Fonts ---- */
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-pixel: 'Pixelify Sans', 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

/* ---- Optional light mode (dark is the true product; light is a courtesy) ---- */
:root[data-theme='light'] {
  --bg-void: #eef0f4;
  --bg-900: #f5f6f9;
  --bg-850: #eef0f4;
  --bg-800: #e8eaf0;
  --bg-750: #e1e4ec;
  --bg-700: #d8dce6;
  --bg-650: #ccd2df;
  --text: #14161c;
  --text-soft: #333844;
  --text-dim: #5a6070;
  --text-faint: #8a90a0;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-bg-strong: rgba(255, 255, 255, 0.85);
  --glass-brd: rgba(10, 12, 20, 0.1);
  --glass-brd-strong: rgba(10, 12, 20, 0.16);
  --hair: rgba(10, 12, 20, 0.08);
}
