/* Jungle theme, matching lab.sallyroth.dev (~/sre-lab/index.html :root).
   About eight ANSI-style roles per theme: fg (--text), muted (--dim),
   accent (leaf), highlight, flower, info, warn (--warm), error.
   --text and --dim must stay at 4.5:1 or better against --bg in every theme.

   `theme jungle` (default, no data-theme) follows the system light/dark
   setting. `theme jungle-day` and `theme jungle-night` pin one of them. */

/* Jungle by day: sunlit canopy */
:root {
  --bg: #eef5e6;            /* lab --bg */
  --text: #14261a;          /* lab --fg, 14.3:1 */
  --accent: #1f7a3a;        /* lab --accent (leaf), 4.8:1 */
  --prompt: #2d7a3c;        /* lab --leaf2, 4.8:1 */
  --dim: #4a6250;           /* lab --muted, 6.0:1 */
  --highlight: #24563a;     /* lab --vine, 7.6:1 */
  --cursor: #1f7a3a;
  --error: #b3261e;
  --info: #1d5f7a;
  --warm: #8a5a12;
  --flower: #d9481e;        /* lab --flower; decorative glyphs only (3.9:1) */
  --flower-text: #b5401a;   /* flower dark enough for text, e.g. ~/hire */
  --vine: #3f9a4f;          /* lab --leaf; decorative glyphs only */
  --frame: #9cbf8c;         /* frame borders */
  --glow: transparent;      /* fireflies: night only */
  --selection-bg: #1f7a3a2e;
  --widget-bg: #e6f1dc;     /* dashboard pane, a shade under the canopy */
  --widget-border: #c4d9b3; /* lab --rule */
  --bar-fill: #1f7a3a;
  --tag-bg: #1f7a3a14;
  color-scheme: light;
}

/* Jungle at night: used automatically when the visitor's system is in dark
   mode and they haven't picked a theme with the `theme` command */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #08130d;
    --text: #e3f0de;
    --accent: #8fdc7a;
    --prompt: #7fcf8f;
    --dim: #9fb8a2;
    --highlight: #e8ff8a;
    --cursor: #8fdc7a;
    --error: #ff8a7a;
    --info: #7cc4d8;
    --warm: #f0c060;
    --flower: #ff7a4d;
    --flower-text: #ff7a4d;
    --vine: #3f8a4f;
    --frame: #2e6b3d;
    --glow: #e8ff8a;
    --selection-bg: #8fdc7a33;
    --widget-bg: #0d2016;
    --widget-border: #21402c;
    --bar-fill: #8fdc7a;
    --tag-bg: #8fdc7a1f;
    color-scheme: dark;
  }
}

/* Jungle at night, picked explicitly (same values as above) */
:root[data-theme="jungle-night"] {
  --bg: #08130d;
  --text: #e3f0de;
  --accent: #8fdc7a;
  --prompt: #7fcf8f;
  --dim: #9fb8a2;
  --highlight: #e8ff8a;
  --cursor: #8fdc7a;
  --error: #ff8a7a;
  --info: #7cc4d8;
  --warm: #f0c060;
  --flower: #ff7a4d;
  --flower-text: #ff7a4d;
  --vine: #3f8a4f;
  --frame: #2e6b3d;
  --glow: #e8ff8a;
  --selection-bg: #8fdc7a33;
  --widget-bg: #0d2016;
  --widget-border: #21402c;
  --bar-fill: #8fdc7a;
  --tag-bg: #8fdc7a1f;
  color-scheme: dark;
}

/* Jungle by day, picked explicitly: the :root values apply, and the
   data-theme attribute keeps the night media query from kicking in. */

/* Amber theme */
[data-theme="amber"] {
  --bg: #1a1510;
  --text: #d4a857;
  --accent: #c8962e;
  --prompt: #a87d28;
  --dim: #a08850;
  --highlight: #e8b84a;
  --cursor: #c8962e;
  --error: #e07a6a;
  --info: #b09a6a;
  --warm: #d4a857;
  --flower: #e8743a;
  --flower-text: #e8743a;
  --vine: #8a6a28;
  --frame: #4a3c22;
  --glow: transparent;
  --selection-bg: #c8962e22;
  --widget-bg: #1f1a12;
  --widget-border: #3a3020;
  --bar-fill: #c8962e;
  --tag-bg: #c8962e18;
  color-scheme: dark;
}

/* Blue theme */
[data-theme="blue"] {
  --bg: #0a1628;
  --text: #a8c4e0;
  --accent: #4a90d9;
  --prompt: #5a9ae0;
  --dim: #7890b0;
  --highlight: #6ab0f0;
  --cursor: #4a90d9;
  --error: #e88080;
  --info: #6ab0f0;
  --warm: #d9a84a;
  --flower: #d9a84a;
  --flower-text: #d9a84a;
  --vine: #2f5f99;
  --frame: #24406a;
  --glow: transparent;
  --selection-bg: #4a90d922;
  --widget-bg: #0e1c32;
  --widget-border: #1a3050;
  --bar-fill: #4a90d9;
  --tag-bg: #4a90d918;
  color-scheme: dark;
}

/* Matrix theme */
[data-theme="matrix"] {
  --bg: #0a0a0a;
  --text: #33ff33;
  --accent: #00cc00;
  --prompt: #00b300;
  --dim: #2fa52f;
  --highlight: #66ff66;
  --cursor: #00cc00;
  --error: #ff4d4d;
  --info: #33cc33;
  --warm: #99cc33;
  --flower: #99cc33;
  --flower-text: #99cc33;
  --vine: #1a7a1a;
  --frame: #1f5a1f;
  --glow: transparent;
  --selection-bg: #00cc0022;
  --widget-bg: #0f0f0f;
  --widget-border: #1a3a1a;
  --bar-fill: #00cc00;
  --tag-bg: #00cc0018;
  color-scheme: dark;
}

/* Selection styling */
::selection {
  background: var(--selection-bg);
  color: var(--text);
}
