/*
 * Two themes: dark (default) and light. Picked automatically from the browser setting (prefers-color-scheme);
 * the visitor can switch by hand. To change colours and settings use admin → Themes
 * (they are written as an extra <style> in <head> and override the values below).
 * Every colour used by the site is a CSS variable defined here: --bg, --fg, --acc (accent) and the named colours.
 */

/* derived colours (recalculated for every element with data-theme, so they also work in the preview tiles) */
:root,[data-theme]{
  --line:color-mix(in srgb,var(--fg) 15%,transparent);
  --tint:color-mix(in srgb,var(--fg) 6%,transparent);
  --fg2:color-mix(in srgb,var(--fg) 78%,var(--bg));
  --shade:color-mix(in srgb,var(--bg) 84%,transparent);
}

/* ===== Dark ===== */
:root,[data-theme="dark"]{
  color-scheme:dark;
  --bg:#010402;--win:#010703;--fg:#d6deeb;--dim:#637083;--hi:#ffffff;
  --green:#4ade80;--cyan:#22d3ee;--yellow:#facc15;--red:#fb7185;--purple:#a78bfa;--blue:#60a5fa;--orange:#fb923c;--pink:#f472b6;
  --rain:#0b5a22;--rain-hi:#1f9a45;--bar-a:#232623;--bar-b:#131513;--barfg:#cfd6cf;--vig:#000000;
  --acc:var(--green);
}

/* ===== Light ===== */
[data-theme="light"]{
  color-scheme:light;
  --bg:#ecece6;--win:#fbfbf8;--fg:#2b2b2b;--dim:#8a8a85;--hi:#000000;
  --green:#1a7f37;--cyan:#0a7d8c;--yellow:#8a5a00;--red:#cf222e;--purple:#8250df;--blue:#0969da;--orange:#bc4c00;--pink:#bf3989;
  --rain:#dedfd6;--rain-hi:#c4c5ba;--bar-a:#ececE6;--bar-b:#dcdcd4;--barfg:#444444;--vig:#6b6b60;
  --acc:var(--blue);
}

/* without JavaScript: follow the browser setting */
@media (prefers-color-scheme:light){
  :root:not([data-theme]){
    color-scheme:light;
    --bg:#ecece6;--win:#fbfbf8;--fg:#2b2b2b;--dim:#8a8a85;--hi:#000000;
    --green:#1a7f37;--cyan:#0a7d8c;--yellow:#8a5a00;--red:#cf222e;--purple:#8250df;--blue:#0969da;--orange:#bc4c00;--pink:#bf3989;
    --rain:#dedfd6;--rain-hi:#c4c5ba;--bar-a:#ececE6;--bar-b:#dcdcd4;--barfg:#444444;--vig:#6b6b60;
    --acc:var(--blue);
  }
}
