/* -----------------------------------------------------------------------
   CAN V7 — themes.

   style.css defines the default palette as CSS custom properties on
   :root, using the same names as the site's existing member theme
   presets. Each theme below overrides that same set, scoped to
   `[data-theme="…"]` — set that attribute (via main.js / the theme
   picker window, or already set from an existing member preference) to
   switch the whole site's palette live.
   ----------------------------------------------------------------------- */

/* -----------------------------------------------------------------------
   Existing member presets, wired up as-is.
   ----------------------------------------------------------------------- */

/* "light" is :root's own default in style.css (the default theme) — its
   block below repeats those values for the theme picker's swatch, whose
   chips each carry data-theme="<slug>" so their colors resolve per swatch
   via this same selector convention instead of leaking whatever theme is
   active on <html>. "silver" (previously the default, see style.css's own
   comment) is a full preset like any other now. */
[data-theme="light"] {
	color-scheme: light;
	--framecolor: #c9c9c9;
	--backgroundcolor: #F0F0F0;
	--backgroundcoloralt: #E8E8E8;
	--bodycolor: #24292E;
	--linecolor: #D8D8D8;
	--linkcolor: #005CC5;
	--darkcolor: #D03592;
	--codecolor: #24292E;
	--midcolor: #6F42C1;
	--shadecolor: #dfdfdf;
	--imagefilter: brightness(0.99) contrast(1.02) saturate(0.9);
	--tui-amber: #e5c07b;
	--tui-red: #e06c75;
}

[data-theme="silver"] {
	color-scheme: light;
	--framecolor: #c7c7c7;
	--backgroundcolor: #DBDBDB;
	--backgroundcoloralt: #D2D2D2;
	--bodycolor: #3e3e3e;
	--linecolor: #ADADAD;
	--linkcolor: #010101;
	--darkcolor: #0D0D0D;
	--codecolor: #3B3B3B;
	--shadecolor: #bababa;
	--midcolor: #8c8c8c;
	--imagefilter: brightness(91%);
}

[data-theme="signal"] {
	color-scheme: light;
	--framecolor: #c1c1c1;
	--backgroundcolor: #F2F2F2;
	--backgroundcoloralt: #EAEAEA;
	--bodycolor: #333333;
	--linecolor: #D0D0D0;
	--linkcolor: #008BE8;
	--darkcolor: #FF751A;
	--codecolor: #333333;
	--midcolor: #00ACE6;
	--shadecolor: #DDDDDD;
	--imagefilter: brightness(0.99) contrast(1.02) saturate(0.9);
}

[data-theme="carbon"] {
	color-scheme: dark;
	--framecolor: #373738;
	--backgroundcolor: #242526;
	--backgroundcoloralt: #1D1E1F;
	--bodycolor: #848586;
	--linecolor: #3a3a3b;
	--linkcolor: #A4A5A6;
	--darkcolor: #CCCCCC;
	--codecolor: #848586;
	--midcolor: #767778;
	--shadecolor: #3B3B3B;
	--imagefilter: invert(100%) brightness(100%) contrast(80%);
}

[data-theme="solarized"] {
	color-scheme: dark;
	--framecolor: #002B36;
	--backgroundcolor: #073642;
	--backgroundcoloralt: #002B36;
	--bodycolor: #839496;
	--linecolor: #00566b;
	--linkcolor: #268BD2;
	--darkcolor: #D14438;
	--codecolor: #586E75;
	--midcolor: #586E75;
	--shadecolor: #053540;
	--imagefilter: sepia(100%) invert(84%) brightness(140%) hue-rotate(311deg) contrast(116%);
}

[data-theme="pumice"] {
	color-scheme: light;
	--framecolor: #c5c6c0;
	--backgroundcolor: #CFD0C9;
	--backgroundcoloralt: #c5c6c0;
	--bodycolor: #343530;
	--linecolor: #8a9080;
	--linkcolor: #f23600;
	--darkcolor: #5E6348;
	--codecolor: #24292E;
	--shadecolor: #b7b7b3;
	--midcolor: #EF6582;
	--imagefilter: invert(0.165) sepia(0.1) hue-rotate(1819deg) saturate(0.65);
}

[data-theme="terminal"] {
	color-scheme: dark;
	--framecolor: #383838;
	--backgroundcolor: #171717;
	--backgroundcoloralt: #131313;
	--bodycolor: #878787;
	--linecolor: #2e2e2e;
	--linkcolor: #d5d5d5;
	--darkcolor: #2DF200;
	--codecolor: #7f7f7f;
	--midcolor: #545454;
	--shadecolor: #272727;
	--imagefilter: invert(100%) brightness(80%) contrast(90%);
}

[data-theme="dark"] {
	color-scheme: dark;
	--framecolor: #040404;
	--backgroundcolor: #0F0F0F;
	--backgroundcoloralt: #080808;
	--bodycolor: #C9C9C9;
	--linecolor: #363636;
	--linkcolor: #dadada;
	--darkcolor: #E5E5E5;
	--codecolor: #7D7D7D;
	--midcolor: #7D7D7D;
	--shadecolor: #242424;
	--imagefilter: invert(100%);
}

/* -----------------------------------------------------------------------
   CAN V7's own extra presets, on top of the above.
   ----------------------------------------------------------------------- */
 /* Monokai */
 [data-theme="everforest"] {
	 color-scheme: dark;
	 --framecolor: #262e34;
	 --backgroundcolor: #2D353B;
	 --backgroundcoloralt: #262e34;
	 --bodycolor: #9a9d90;
	 --linecolor: #353e46;
	 --linkcolor: #7FBBB3;
	 --darkcolor: #cf6466;
	 --codecolor: #84877c;
	 --shadecolor: #333E42;
	 --midcolor: #9DB478;
	 --imagefilter: sepia(40%) invert(80%) brightness(97%) saturate(70%) hue-rotate(320deg);
 	--tui-amber: #e6db74;
 	--tui-red: #f92672;
 }

 /* Horizon */
 [data-theme="horizon"] {
	 color-scheme: light;
	 --framecolor: #f0e4e0;
	 --backgroundcolor: #FDF0EC;
	 --backgroundcoloralt: #f0e4e0;
	 --bodycolor: #505054;
	 --linecolor: #FADAD1;
	 --linkcolor: #F43D5C;
	 --darkcolor: #1EAEAE;
	 --codecolor: #505054;
	 --shadecolor: #f3d5ce;
	 --midcolor: #03DA8C;
	 --imagefilter: invert(2%) sepia(8%) saturate(170%) hue-rotate(330deg);
	 --tui-amber: #e5c07b;
	 --tui-red: #e06c75;
 }

 /* Flint */
 [data-theme="flint"] {
	 color-scheme: dark;
	 --framecolor: #3c3b36;
	 --backgroundcolor: #2B2A27;
	 --backgroundcoloralt: #252522;
	 --bodycolor: #bab0a2;
	 --linecolor: #403C38;
	 --linkcolor: #27A6A6;
	 --darkcolor: #F55B38;
	 --codecolor: #9b9287;
	 --shadecolor: #3c3b36;
	 --midcolor: #BCD42A;
	 --imagefilter: brightness(97%) contrast(96%) saturate(0%) sepia(9%) invert(90%) hue-rotate(185deg);
	--tui-amber: #e5c07b;
	--tui-red: #e06c75;
 }

 /* Ember */
 [data-theme="ember"] {
	 color-scheme: dark;
	 --framecolor: #1A1A1A;
	 --backgroundcolor: #1A1A1A;
	 --backgroundcoloralt: #141414;
	 --bodycolor: #7b7b7b;
	 --linecolor: #2d2d2d;
	 --linkcolor: #33A450;
	 --darkcolor: #F03E3D;
	 --codecolor: #707070;
	 --shadecolor: #252525;
	 --midcolor: #D17416;
	 --imagefilter: invert(100%) brightness(80%) contrast(89%);
 }

/* -----------------------------------------------------------------------
   Typeface — default is the monospace stack defined in style.css :root;
   this switches the whole site over to Inter (sans-serif) instead.
   ----------------------------------------------------------------------- */

html[data-tui-font="inter"] {
	--tui-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Buena Mono (assets/fonts/buena-mono/, SIL OFL 1.1): a variable-weight monospace; the browser only fetches the file once it is chosen. */
@font-face {
	font-family: "Buena Mono";
	src: url("assets/fonts/buena-mono/BuenaMono-VF.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

html[data-tui-font="buena-mono"] {
	--tui-font: "Buena Mono", ui-monospace, "IBM Plex Mono", "SFMono-Regular", Consolas, Menlo, Monaco, "Liberation Mono", monospace;
}
