/* v26 design tokens — single source for color/type/space/radius/motion/z-index.
   Themes (styles/themes.css) override the semantic color tokens per
   [data-ui-theme]; this file's :root values are the "graphite" fallback so
   the app never renders unstyled before the boot script sets the attribute. */
:root {
  /* Layout */
  --topbar-h: 48px;
  --dock-h: 72px;
  --hud-h: 36px;

  /* Typography */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --leading-tight: 1.2;
  --leading: 1.45;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;

  /* Radius (corrected scale: sm < md < lg < xl < full) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-fast: 120ms var(--ease);
  --transition-base: 200ms var(--ease);
  --transition-slow: 320ms var(--ease);

  /* Z-index layers (replaces 25+ scattered literals) */
  --z-canvas: 1;
  --z-hud: 50;
  --z-toggle: 60;
  --z-panel: 100;
  --z-joe: 120;
  --z-dock: 200;
  --z-restore: 450;
  --z-gallery: 460;
  --z-topbar: 500;
  --z-modal: 1000;
  --z-toast: 1100;
  --z-tour: 9000;

  /* Touch targets */
  --touch-min: 44px;

  /* Menu size (base = "medium"; [data-menu-size="klein|gross"] overrides
     live in index.html next to the DOM they size, per project convention) */
  --menu-size: medium;
  --button-size: 60px;
  --button-icon-size: 24px;
  --button-label-size: 12px;
  --button-padding: 10px;
  --panel-padding: 20px;
  --panel-width: 300px;
  --grid-gap: 6px;

  /* Semantic color tokens — graphite (default) fallback values.
     styles/themes.css redefines these per [data-ui-theme]. */
  --surface-0: #151618;
  --surface-1: #1c1d20;
  --surface-2: #232529;
  --surface-3: #2c2f34;
  --text-1: #ecedee;
  --text-2: #a4a8ae;
  --text-3: #6b7078;
  --border-1: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.16);
  --accent: #4f8cff;
  --accent-rgb: 79, 140, 255;
  --accent-hover: #6ea0ff;
  --accent-fg: #0b1220;
  --accent-soft: rgba(var(--accent-rgb), 0.16);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 12px 32px rgba(0, 0, 0, 0.45);
  --glass-bg: rgba(28, 29, 32, 0.72);
  --glass-blur: 0px;
  --glow: none;
  --stage-bg: var(--surface-0);

  /* Legacy aliases — keep existing consumers (271x --accent-primary, 89x
     --ui-border, 60x --ui-bg, joe/joe.css, etc.) themed for free. */
  --bg-primary: var(--surface-0);
  --bg-secondary: var(--surface-1);
  --text-primary: var(--text-1);
  --text-secondary: var(--text-2);
  --accent-primary: var(--accent);
  --accent-primary-rgb: var(--accent-rgb);
  --ui-bg: var(--surface-1);
  --ui-border: var(--border-1);
  --shadow-sm: var(--shadow-1);
  --shadow-md: var(--shadow-2);
  --shadow-lg: var(--shadow-3);
  --shadow-xl: var(--shadow-3);
  --transition: var(--transition-base);
  --neon-glow: var(--glow);
  --canvas-border: 1px solid var(--border-2);
  --canvas-shadow: var(--shadow-3);
  --glass-light: var(--glass-bg);
  --glass-medium: var(--glass-bg);
  --glass-heavy: var(--surface-1);
  --blur-sm: var(--glass-blur);
  --blur-md: var(--glass-blur);
  --blur-lg: var(--glass-blur);
  --radius-full-legacy: var(--radius-full);
}
