/* Theme layer - color definitions using oklch for perceptual uniformity */
@layer base {
  :root {
    /* Dark theme (default) - Terminal inspired */
    --color-bg: oklch(15% 0.01 260);
    --color-surface: oklch(20% 0.015 260);
    --color-surface-elevated: oklch(25% 0.02 260);
    --color-border: oklch(35% 0.02 260);

    --color-text: oklch(90% 0.01 260);
    --color-text-muted: oklch(65% 0.01 260);
    --color-text-faint: oklch(50% 0.01 260);

    /* Terminal green accent */
    --color-accent: oklch(75% 0.18 145);
    --color-accent-hover: oklch(85% 0.2 145);
    --color-accent-muted: oklch(65% 0.12 145);

    /* Secondary accent - amber/orange for highlights */
    --color-secondary: oklch(75% 0.15 70);
    --color-secondary-hover: oklch(85% 0.17 70);

    /* Tertiary - cyan for special elements */
    --color-tertiary: oklch(75% 0.12 200);

    /* Semantic colors */
    --color-success: oklch(70% 0.15 145);
    --color-warning: oklch(75% 0.15 85);
    --color-error: oklch(65% 0.2 25);

    /* Syntax highlighting - terminal palette */
    --syntax-keyword: oklch(75% 0.15 320);
    --syntax-string: oklch(75% 0.18 145);
    --syntax-number: oklch(75% 0.12 200);
    --syntax-comment: oklch(55% 0.02 260);
    --syntax-function: oklch(80% 0.15 70);
    --syntax-variable: var(--color-text);
  }

  /* Light theme */
  [data-theme="light"] {
    --color-bg: oklch(98% 0.005 260);
    --color-surface: oklch(94% 0.008 260);
    --color-surface-elevated: oklch(100% 0 0);
    --color-border: oklch(85% 0.01 260);

    --color-text: oklch(20% 0.01 260);
    --color-text-muted: oklch(40% 0.01 260);
    --color-text-faint: oklch(55% 0.01 260);

    /* Darker green for light mode contrast */
    --color-accent: oklch(45% 0.15 145);
    --color-accent-hover: oklch(35% 0.18 145);
    --color-accent-muted: oklch(55% 0.1 145);

    --color-secondary: oklch(55% 0.15 70);
    --color-secondary-hover: oklch(45% 0.17 70);

    --color-tertiary: oklch(45% 0.12 200);

    --color-success: oklch(45% 0.15 145);
    --color-warning: oklch(55% 0.15 85);
    --color-error: oklch(50% 0.2 25);

    /* Light mode syntax highlighting */
    --syntax-keyword: oklch(50% 0.2 320);
    --syntax-string: oklch(40% 0.18 145);
    --syntax-number: oklch(45% 0.15 200);
    --syntax-comment: oklch(55% 0.02 260);
    --syntax-function: oklch(50% 0.18 70);
  }

  /* System preference detection when no explicit theme is set */
  @media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
      --color-bg: oklch(98% 0.005 260);
      --color-surface: oklch(94% 0.008 260);
      --color-surface-elevated: oklch(100% 0 0);
      --color-border: oklch(85% 0.01 260);

      --color-text: oklch(20% 0.01 260);
      --color-text-muted: oklch(40% 0.01 260);
      --color-text-faint: oklch(55% 0.01 260);

      --color-accent: oklch(45% 0.15 145);
      --color-accent-hover: oklch(35% 0.18 145);
      --color-accent-muted: oklch(55% 0.1 145);

      --color-secondary: oklch(55% 0.15 70);
      --color-secondary-hover: oklch(45% 0.17 70);

      --color-tertiary: oklch(45% 0.12 200);

      --color-success: oklch(45% 0.15 145);
      --color-warning: oklch(55% 0.15 85);
      --color-error: oklch(50% 0.2 25);

      --syntax-keyword: oklch(50% 0.2 320);
      --syntax-string: oklch(40% 0.18 145);
      --syntax-number: oklch(45% 0.15 200);
      --syntax-comment: oklch(55% 0.02 260);
      --syntax-function: oklch(50% 0.18 70);
    }
  }
}
