/*
 * Beegit Solarized theme
 *
 * Based on Ethan Schoonover's original Solarized palette:
 * https://ethanschoonover.com/solarized/
 *
 */

:root {
  color-scheme: light;

  --base03: #002b36;
  --base02: #073642;
  --base01: #586e75;
  --base00: #657b83;
  --base0: #839496;
  --base1: #93a1a1;
  --base2: #eee8d5;
  --base3: #fdf6e3;

  --yellow: #b58900;
  --orange: #cb4b16;
  --red: #dc322f;
  --magenta: #d33682;
  --violet: #6c71c4;
  --blue: #268bd2;
  --cyan: #2aa198;
  --green: #859900;

  /* Backgrounds */

  --background: var(--base3);
  --surface: var(--base2);
  --surface-hover: #efe9d7;

  /* Foreground */

  --foreground: var(--base00);
  --foreground-muted: var(--base1);
  --foreground-strong: var(--base01);
  --foreground-inverse: var(--base3);

  /* Borders */

  --border: var(--base1);
  --border-muted: var(--base2);
  --border-strong: var(--base01);

  /* Accents */

  --accent: var(--blue);
  --accent-hover: var(--cyan);
  --accent-foreground: var(--base3);

  /* Links */

  --link: var(--blue);
  --link-hover: var(--violet);
  --link-visited: var(--violet);

  /* Selection */

  --selection-background: var(--magenta);
  --selection-foreground: var(--base3);

  /* Status */

  --success: var(--green);
  --warning: var(--yellow);
  --error: var(--red);
  --info: var(--cyan);
}

/* Solarized Dark: system preference */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;

    --background: var(--base03);
    --surface: var(--base02);
    --surface-hover: #13404b;

    --foreground: var(--base0);
    --foreground-muted: var(--base01);
    --foreground-strong: var(--base1);
    --foreground-inverse: var(--base03);

    --border: var(--base01);
    --border-muted: var(--base02);
    --border-strong: var(--base1);

    --accent-foreground: var(--base03);
    --link-hover: var(--cyan);
  }
}

/* Explicit Solarized Dark */

:root[data-theme="dark"] {
  color-scheme: dark;

  --background: var(--base03);
  --surface: var(--base02);
  --surface-hover: #13404b;

  --foreground: var(--base0);
  --foreground-muted: var(--base01);
  --foreground-strong: var(--base1);
  --foreground-inverse: var(--base03);

  --border: var(--base01);
  --border-muted: var(--base02);
  --border-strong: var(--base1);

  --accent-foreground: var(--base03);
  --link-hover: var(--cyan);
}

/*
 * Progressive enhancement:
 * Mix the surface with 5% white for a subtle hover highlight.
 *
 * The values above are fallbacks for browsers without color-mix().
 */

@supports (background-color: color-mix(in srgb, white, black)) {
  :root {
    --surface-hover: color-mix(in srgb, var(--surface), white 5%);
  }
}

/* Selection */

::selection {
  color: var(--selection-foreground);
  background: var(--selection-background);
}
