/* QUANTUM LABS — Design System */

/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Tokens */
:root {
  /* Colors */
  --obsidian: #0A0A0A;
  --carbon: #141414;
  --graphite: #1E1E1E;
  --steel: #252525;
  --ember: #C44B2B;
  --flame: #E05A35;
  --molten: #FF6B42;
  --bone: #F5F0EB;
  --chalk: #D4CFC9;
  --ash: #8A8A8A;
  --smoke: #5A5A5A;
  --wire: #2A2A2A;
  --wire-light: #383838;
  --success: #2ECC71;
  --warning: #F39C12;
  --danger: #E74C3C;
  --info: #3498DB;

  --glow-ember: 0 0 0 transparent;
  --glow-ember-strong: 0 0 0 transparent;
  --glow-molten: 0 0 0 transparent;

  /* Ember alpha variants — use these instead of hardcoded rgba() */
  --ember-05: rgba(196, 75, 43, 0.05);
  --ember-06: rgba(196, 75, 43, 0.06);
  --ember-08: rgba(196, 75, 43, 0.08);
  --ember-10: rgba(196, 75, 43, 0.10);
  --ember-12: rgba(196, 75, 43, 0.12);
  --ember-15: rgba(196, 75, 43, 0.15);
  --ember-20: rgba(196, 75, 43, 0.20);
  --ember-25: rgba(196, 75, 43, 0.25);
  --ember-30: rgba(196, 75, 43, 0.30);
  --ember-40: rgba(196, 75, 43, 0.40);
  --ember-50: rgba(196, 75, 43, 0.50);

  /* On-accent — text color used on top of ember/flame backgrounds */
  --on-accent: #fff;

  /* White alpha tints — subtle hover/focus overlays */
  --white-02: rgba(255, 255, 255, 0.02);
  --white-03: rgba(255, 255, 255, 0.03);
  --white-06: rgba(255, 255, 255, 0.06);

  /* Success alpha variants */
  --success-15: rgba(46, 204, 113, 0.15);
  --success-25: rgba(46, 204, 113, 0.25);
  --success-30: rgba(46, 204, 113, 0.30);

  /* Danger alpha variants */
  --danger-15: rgba(231, 76, 60, 0.15);
  --danger-30: rgba(231, 76, 60, 0.30);

  /* Info alpha variants */
  --info-10: rgba(52, 152, 219, 0.10);
  --info-40: rgba(52, 152, 219, 0.40);

  /* Shadow presets */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-bottom-sheet: 0 -4px 30px rgba(0, 0, 0, 0.3);

  /* Typography */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs: 0.6875rem;
  /* 11px */
  --text-sm: 0.75rem;
  /* 12px */
  --text-base: 0.8125rem;
  /* 13px */
  --text-md: 0.875rem;
  /* 14px */
  --text-lg: 1rem;
  /* 16px */
  --text-xl: 1.25rem;
  /* 20px */
  --text-2xl: 1.5rem;
  /* 24px */

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Radii */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 350ms;

  /* Z-Index */
  --z-behind: -1;
  --z-base: 0;
  --z-elevated: 1;
  --z-top: 2;
  --z-sticky: 100;
  --z-dropdown: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-popover: 500;
  --z-toast: 600;
  --z-tooltip: 700;
  --z-max: 9999;

  /* Layout */
  --sidebar-width: 320px;
  --toolbar-height: 48px;
  --results-width: 320px;
}

/* Light Theme */
[data-theme="light"] {
  --obsidian: #FAFAFA;
  --carbon: #FFFFFF;
  --graphite: #F3F3F3;
  --steel: #EAEAEA;
  --bone: #1A1A1A;
  --chalk: #333333;
  --ash: #6B6B6B;
  --smoke: #999999;
  --wire: #E0E0E0;
  --wire-light: #D0D0D0;

  --glow-ember: 0 0 0 transparent;
  --glow-ember-strong: 0 0 0 transparent;
  --glow-molten: 0 0 0 transparent;

  /* Light-mode white tints become black tints */
  --white-02: rgba(0, 0, 0, 0.02);
  --white-03: rgba(0, 0, 0, 0.03);
  --white-06: rgba(0, 0, 0, 0.06);

  /* Lighter shadows for light theme */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
  --shadow-bottom-sheet: 0 -4px 30px rgba(0, 0, 0, 0.1);

  /* Scrollbar */
  --scrollbar-thumb: #C0C0C0;
  --scrollbar-thumb-hover: #A0A0A0;
}

[data-theme="light"] ::selection {
  color: var(--bone);
  background: var(--ember-15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Base */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-gutter: stable;
}

body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--bone);
  background: var(--obsidian);
  overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--bone);
}

code,
pre,
.mono {
  font-family: var(--font-mono);
}

a {
  color: var(--ember);
  text-decoration: none;
}

a:hover {
  color: var(--flame);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--wire-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--smoke);
}

/* Selection */
::selection {
  color: var(--bone);
  background: var(--ember-30);
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Hidden */
.hidden {
  display: none !important;
}