/**
 * GitHub Octoverse 2026 - Premium Glass Analytics Design Tokens
 * Harmonized GitHub Editorial × Octoverse Palette × Subtle Glassmorphism
 */

:root {
  /* System font stacks - zero external network latency */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-editorial: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;

  /* Typography scale - disciplined, editorial hierarchy */
  --text-2xs: 0.6875rem;    /* 11px */
  --text-xs: 0.75rem;       /* 12px */
  --text-sm: 0.8125rem;     /* 13px */
  --text-base: 0.9375rem;   /* 15px */
  --text-md: 1.0625rem;     /* 17px */
  --text-lg: 1.25rem;       /* 20px */
  --text-xl: 1.5rem;        /* 24px */
  --text-2xl: 1.875rem;     /* 30px */
  --text-3xl: 2.25rem;      /* 36px */
  --text-4xl: 2.75rem;      /* 44px */

  /* Line heights */
  --leading-none: 1;
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.55;
  --leading-relaxed: 1.65;

  /* Font weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Spacing scale - tight, intentional rhythm */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */

  /* Layout widths */
  --container-max: 1320px;
  --container-wide: 1480px;
  --container-narrow: 880px;
  --nav-height: 56px;

  /* Border Radii */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 7px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-2xl: 18px;
  --radius-full: 9999px;

  /* Octoverse Multi-Hue Palette */
  --color-emerald: #3fb950;
  --color-emerald-rgb: 63, 185, 80;
  --color-blue: #58a6ff;
  --color-blue-rgb: 88, 166, 255;
  --color-violet: #bc8cff;
  --color-violet-rgb: 188, 140, 255;
  --color-pink: #f778ba;
  --color-pink-rgb: 247, 120, 186;
  --color-orange: #f0883e;
  --color-orange-rgb: 240, 136, 62;
  --color-yellow: #d29922;
  --color-yellow-rgb: 210, 153, 34;
  --color-cyan: #39c5cf;
  --color-cyan-rgb: 57, 197, 207;

  /* Animation & Transitions */
  --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index Layering */
  --z-background: 0;
  --z-base: 10;
  --z-sticky: 100;
  --z-dropdown: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-tooltip: 500;
}

/* ==========================================================================
   DARK THEME (Default: github-dark)
   ========================================================================== */
:root,
[data-theme="github-dark"] {
  --theme-id: "github-dark";

  /* Backgrounds */
  --bg-canvas: #090d13;
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-surface: #161b22;
  --bg-surface-elevated: #21262d;
  --bg-surface-hover: #1f242c;
  --bg-surface-active: #282e37;

  /* Glassmorphism tokens */
  --glass-bg: rgba(22, 27, 34, 0.72);
  --glass-bg-hover: rgba(30, 36, 45, 0.82);
  --glass-card: rgba(22, 27, 34, 0.65);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-hover: rgba(255, 255, 255, 0.18);
  --glass-blur: 14px;
  --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.08);

  /* Borders */
  --border-default: #30363d;
  --border-muted: #21262d;
  --border-subtle: rgba(240, 246, 252, 0.08);
  --border-emphasis: #484f58;

  /* Typography Colors */
  --text-primary: #f0f6fc;
  --text-secondary: #9da7b3;
  --text-tertiary: #6e7681;
  --text-inverse: #0d1117;
  --text-accent: #58a6ff;

  /* Interactive States */
  --interactive-hover: rgba(255, 255, 255, 0.06);
  --interactive-active: rgba(255, 255, 255, 0.1);
  --focus-ring: #388bfd;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.65);
  --shadow-glow-blue: 0 0 24px rgba(88, 166, 255, 0.12);
  --shadow-glow-violet: 0 0 24px rgba(188, 140, 255, 0.12);

  /* Chart Canvas Specifics */
  --chart-grid-line: #1c222b;
  --chart-axis-line: #30363d;
  --chart-axis-label: #8b949e;
  --chart-tooltip-bg: rgba(22, 27, 34, 0.94);
  --chart-tooltip-border: rgba(255, 255, 255, 0.12);
  --chart-tooltip-text: #f0f6fc;
}

/* ==========================================================================
   LIGHT THEME (github-light) - Tailored, Not Inverted
   ========================================================================== */
[data-theme="github-light"] {
  --theme-id: "github-light";

  /* Backgrounds */
  --bg-canvas: #f6f8fa;
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-hover: #f3f4f6;
  --bg-surface-active: #eaeef2;

  /* Glassmorphism tokens */
  --glass-bg: rgba(255, 255, 255, 0.86);
  --glass-bg-hover: rgba(255, 255, 255, 0.95);
  --glass-card: rgba(255, 255, 255, 0.84);
  --glass-border: rgba(31, 35, 40, 0.14);
  --glass-border-hover: rgba(31, 35, 40, 0.26);
  --glass-blur: 16px;
  --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 1);

  /* Borders */
  --border-default: #d0d7de;
  --border-muted: #eaeef2;
  --border-subtle: rgba(31, 35, 40, 0.08);
  --border-emphasis: #8c959f;

  /* Typography Colors */
  --text-primary: #1f2328;
  --text-secondary: #59636e;
  --text-tertiary: #8c959f;
  --text-inverse: #ffffff;
  --text-accent: #0969da;

  /* Interactive States */
  --interactive-hover: rgba(31, 35, 40, 0.04);
  --interactive-active: rgba(31, 35, 40, 0.08);
  --focus-ring: #0969da;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(31, 35, 40, 0.08), 0 1px 2px rgba(31, 35, 40, 0.04);
  --shadow-md: 0 4px 16px rgba(31, 35, 40, 0.08), 0 1px 3px rgba(31, 35, 40, 0.05);
  --shadow-lg: 0 12px 30px rgba(31, 35, 40, 0.12), 0 4px 10px rgba(31, 35, 40, 0.06);
  --shadow-glow-blue: 0 0 24px rgba(9, 105, 218, 0.08);
  --shadow-glow-violet: 0 0 24px rgba(130, 80, 223, 0.08);

  /* Chart Canvas Specifics */
  --chart-grid-line: #f0f3f6;
  --chart-axis-line: #d0d7de;
  --chart-axis-label: #656d76;
  --chart-tooltip-bg: rgba(255, 255, 255, 0.96);
  --chart-tooltip-border: #d0d7de;
  --chart-tooltip-text: #1f2328;
}
