/* ═══════════════════════════════════════════════════
   Design System Tokens
   Source: https://seantippen.github.io/style-guide/

   Import in any project:
   <link rel="stylesheet" href="https://seantippen.github.io/style-guide/tokens.css">

   All tokens extracted from the canonical style guide.
   Do NOT edit per-project — update this file, push,
   and every linked project picks up the changes.
   ═══════════════════════════════════════════════════ */

/* ─── DARK MODE (default) ─── */
:root {
  color-scheme: dark;

  /* === Accents === */
  --color-accent: oklch(0.75 0.17 178);
  --color-accent-hover: oklch(0.80 0.17 178);
  --color-secondary: oklch(0.74 0.18 30);

  /* Backward-compat RGB for components using rgba(var(...), x) */
  --color-accent-rgb: 78, 196, 188;
  --color-secondary-rgb: 226, 136, 80;

  /* Derived accent scales */
  --accent-muted: oklch(0.87 0.17 178 / 0.15);
  --accent-subtle: oklch(0.87 0.17 178 / 0.08);

  /* === Surfaces — 5-level elevation === */
  --color-bg:              oklch(0.14 0.008 270);
  --color-surface:         oklch(0.18 0.008 270);
  --color-surface-hover:   oklch(0.22 0.008 270);
  --color-surface-raised:  oklch(0.26 0.008 270);
  --color-surface-overlay: oklch(0.30 0.008 270);

  /* === Text Hierarchy === */
  --color-text:           oklch(0.93 0.01 270);
  --color-text-secondary: oklch(0.75 0.01 270);
  --color-text-muted:     oklch(0.55 0.015 270);
  --color-text-disabled:  oklch(0.40 0.01 270);

  /* === Opacity-Based Text (fine-grained hierarchy) === */
  --text-alpha-90: oklch(0.93 0.01 270 / 0.9);
  --text-alpha-70: oklch(0.93 0.01 270 / 0.7);
  --text-alpha-50: oklch(0.93 0.01 270 / 0.5);
  --text-alpha-30: oklch(0.93 0.01 270 / 0.3);
  --text-alpha-15: oklch(0.93 0.01 270 / 0.15);

  /* === Borders === */
  --color-border: oklch(1 0 0 / 0.08);
  --color-border-emphasis: oklch(1 0 0 / 0.15);
  --color-border-strong: oklch(1 0 0 / 0.25);

  /* === Status Colors === */
  --color-success: oklch(0.72 0.17 145);
  --color-warning: oklch(0.80 0.16 85);
  --color-danger: oklch(0.70 0.19 25);
  --color-info: oklch(0.72 0.14 230);
  --color-success-subtle: oklch(0.22 0.05 145);
  --color-warning-subtle: oklch(0.24 0.06 85);
  --color-danger-subtle: oklch(0.22 0.05 25);
  --color-info-subtle: oklch(0.22 0.05 230);

  /* === Shadows === */
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
  --shadow-ring: 0 0 0 0.5px oklch(1 0 0 / 0.1);
  --shadow-float: 0 4px 20px oklch(0 0 0 / 0.3), var(--shadow-ring);
  --shadow-float-lg: 0 12px 40px oklch(0 0 0 / 0.4), var(--shadow-ring);

  /* === Focus === */
  --focus-ring: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent);

  /* === Data Series (hex — Canvas API can't resolve OKLCH) === */
  --green: #4CC97A;
  --blue: #6BA3FF;
  --red: #F28878;
  --amber: #D4AD42;
  --purple: #C688E0;
  --cyan: #4BC3CA;
  --yellow: #E8D44D;
  --orange: #E89B4D;

  /* === Type Badge Palette === */
  --color-type-dashboard: #60a5fa;
  --color-type-chatbot: #a78bfa;
  --color-type-gallery: #fbbf24;
  --color-type-xlsx: #4ade80;
  --color-type-seatmap: #2dd4bf;
  --color-type-report: #94a3b8;
  --color-type-app: #f97316;
  --color-type-research: #22d3ee;

  /* === Typography — fluid clamp() scale === */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --text-xs:   clamp(0.6875rem, 0.625rem + 0.25vw, 0.8125rem);
  --text-sm:   clamp(0.8125rem, 0.75rem + 0.25vw, 0.9375rem);
  --text-base: clamp(0.9375rem, 0.875rem + 0.25vw, 1.0625rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --text-xl:   clamp(1.375rem, 1.125rem + 1vw, 1.875rem);
  --text-2xl:  clamp(1.75rem, 1.375rem + 1.5vw, 2.625rem);
  --text-3xl:  clamp(2.25rem, 1.625rem + 2.5vw, 3.5rem);
  --text-4xl:  clamp(2.75rem, 1.875rem + 3.5vw, 4.5rem);

  /* === Leading === */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;
  --measure: 65ch;

  /* === Fluid Spacing === */
  --space-xs: clamp(0.25rem, 0.2rem + 0.2vw, 0.5rem);
  --space-sm: clamp(0.5rem, 0.4rem + 0.4vw, 0.875rem);
  --space-md: clamp(1rem, 0.875rem + 0.5vw, 1.5rem);
  --space-lg: clamp(1.5rem, 1.25rem + 1vw, 2.5rem);
  --space-xl: clamp(2rem, 1.5rem + 2vw, 4rem);

  /* === Fixed Spacing (4px base) === */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.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-section: clamp(3rem, 2rem + 5vw, 6rem);

  /* === Motion === */
  --duration-instant: 80ms;
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* === Border Radius — sharp by default === */
  --radius-xs: 0;
  --radius-sm: 0;
  --radius-md: 0;
  --radius: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --radius-full: 9999px;

  /* === Layout === */
  --max-width: 1100px;
  --sidebar-w: 260px;

  /* === Compatibility Aliases ===
     Legacy dashboards use short names. New code should
     use the --color-* names directly.                    */
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --surface2: var(--color-surface-hover);
  --surface3: var(--color-surface-raised);
  --surface-hover: var(--color-surface-hover);
  --text: var(--color-text);
  --text-dim: var(--color-text-secondary);
  --text-muted: var(--color-text-muted);
  --text-secondary: var(--color-text-secondary);
  --text-disabled: var(--color-text-disabled);
  --accent: var(--color-accent);
  --accent2: var(--color-secondary);
  --secondary: var(--color-secondary);
  --border: var(--color-border);
  --border-emphasis: var(--color-border-emphasis);
}

/* ─── LIGHT MODE ───
   Supports both class-based (.light) and attribute-based
   (data-theme="light") toggling for cross-project compat. */
:root.light,
html[data-theme="light"] {
  color-scheme: light;

  --color-accent: oklch(0.52 0.18 178);
  --color-accent-hover: oklch(0.48 0.18 178);
  --color-secondary: oklch(0.55 0.19 30);
  --color-accent-rgb: 13, 148, 136;
  --color-secondary-rgb: 180, 100, 50;
  --accent-muted: oklch(0.52 0.18 178 / 0.12);
  --accent-subtle: oklch(0.52 0.18 178 / 0.06);

  --color-bg:              oklch(0.935 0.006 270);
  --color-surface:         oklch(1 0 0);
  --color-surface-hover:   oklch(0.955 0.004 270);
  --color-surface-raised:  oklch(1 0 0);
  --color-surface-overlay: oklch(1 0 0);

  --color-text:           oklch(0.16 0.02 270);
  --color-text-secondary: oklch(0.35 0.015 270);
  --color-text-muted:     oklch(0.50 0.01 250);
  --color-text-disabled:  oklch(0.68 0.005 250);

  --color-border: oklch(0 0 0 / 0.08);
  --color-border-emphasis: oklch(0 0 0 / 0.15);
  --color-border-strong: oklch(0 0 0 / 0.25);

  --color-success: oklch(0.52 0.17 145);
  --color-warning: oklch(0.60 0.16 85);
  --color-danger: oklch(0.52 0.19 25);
  --color-info: oklch(0.52 0.14 230);
  --color-success-subtle: oklch(0.94 0.04 145);
  --color-warning-subtle: oklch(0.95 0.04 85);
  --color-danger-subtle: oklch(0.94 0.04 25);
  --color-info-subtle: oklch(0.94 0.04 230);

  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.06);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.12);

  --green: #2D8E52;
  --blue: #3B78D0;
  --red: #D04F3D;
  --amber: #A88520;
  --purple: #9B55B5;
  --cyan: #2A96A0;
  --yellow: #B8A620;
  --orange: #B87620;

  /* Type badge palette — light mode */
  --color-type-dashboard: #2563eb;
  --color-type-chatbot: #7c3aed;
  --color-type-gallery: #d97706;
  --color-type-xlsx: #16a34a;
  --color-type-seatmap: #0d9488;
  --color-type-report: #64748b;
  --color-type-app: #ea580c;
  --color-type-research: #0891b2;

  /* Compatibility aliases */
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --surface2: var(--color-surface-hover);
  --surface3: var(--color-surface-raised);
  --surface-hover: var(--color-surface-hover);
  --text: var(--color-text);
  --text-dim: var(--color-text-secondary);
  --text-muted: var(--color-text-muted);
  --text-secondary: var(--color-text-secondary);
  --text-disabled: var(--color-text-disabled);
  --accent: var(--color-accent);
  --accent2: var(--color-secondary);
  --secondary: var(--color-secondary);
  --border: var(--color-border);
  --border-emphasis: var(--color-border-emphasis);
}
