/*
  Each theme sets the same set of CSS variables. app.js reads these at runtime
  (getComputedStyle) to build the xterm.js `theme` object, so the terminal and
  the surrounding UI chrome always stay visually unified — one set of colors,
  two consumers.
*/

/* Naver D2Coding — Regular/Bold only (no italics shipped); SIL OFL 1.1,
   license text kept alongside the font files in assets/fonts/. 1:2 Latin:Hangul
   width ratio keeps monospace alignment intact when Korean text is mixed in. */
@font-face {
  font-family: 'D2Coding';
  src: url('../../assets/fonts/D2Coding-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'D2Coding';
  src: url('../../assets/fonts/D2Coding-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* The other font-picker entries (settings.js) previously named fonts that
   were never actually embedded — they only rendered correctly on a device
   that happened to already have that exact font installed, which on most
   devices (this iPad included) is none of them, so every choice silently
   fell through to D2Coding above and looked identical. Embedding them here
   is what actually makes the picker do anything visible everywhere. */

/* Ubuntu Mono — Ubuntu Font Licence 1.0 (explicitly permits embedding). */
@font-face {
  font-family: 'Ubuntu Mono';
  src: url('../../assets/fonts/UbuntuMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Ubuntu Mono';
  src: url('../../assets/fonts/UbuntuMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* JetBrains Mono — Apache 2.0. */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../../assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../../assets/fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Fira Code — SIL OFL 1.1. */
@font-face {
  font-family: 'Fira Code';
  src: url('../../assets/fonts/FiraCode-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fira Code';
  src: url('../../assets/fonts/FiraCode-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Cascadia Code — MIT (Microsoft open-sourced it specifically for this kind
   of embedding, unlike Consolas below, which is still proprietary). */
@font-face {
  font-family: 'Cascadia Code';
  src: url('../../assets/fonts/CascadiaCode-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cascadia Code';
  src: url('../../assets/fonts/CascadiaCode-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Source Code Pro — SIL OFL 1.1. Only the Medium (500) weight is shipped, by
   request; both normal and bold slots point at the same file so terminal
   "bold" text keeps this weight's stroke instead of the browser faking an
   even heavier synthetic bold on top of it. */
@font-face {
  font-family: 'Source Code Pro Medium';
  src: url('../../assets/fonts/SourceCodePro-Medium.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Code Pro Medium';
  src: url('../../assets/fonts/SourceCodePro-Medium.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Consolas is not included: it's a proprietary Microsoft font with no
   redistributable license, so it stays a "system font" option — it only
   renders as Consolas on a device that already has it installed (mostly
   Windows), and otherwise falls through to D2Coding like before. */

:root {
  --font-ui: 'Ubuntu Mono', 'D2Coding', monospace;
  --font-terminal: 'Ubuntu Mono', 'D2Coding', monospace;
}

[data-theme='ubuntu-classic'] {
  --bg: #300a24;
  --fg: #ffffff;
  --bg-elevated: #3d1030;
  --border: #52173f;
  --accent: #c9a0dc;
  --accent-fg: #300a24;
  --muted: #c9b3c2;
  --danger: #e05561;
  --cursor: #ffffff;
  --selection: rgba(255, 255, 255, 0.25);
  --ansi-black: #300a24;
  --ansi-red: #cc0000;
  --ansi-green: #4e9a06;
  --ansi-yellow: #c4a000;
  --ansi-blue: #3465a4;
  --ansi-magenta: #75507b;
  --ansi-cyan: #06989a;
  --ansi-white: #d3d7cf;
  --ansi-bright-black: #555753;
  --ansi-bright-red: #ef2929;
  --ansi-bright-green: #8ae234;
  --ansi-bright-yellow: #fce94f;
  --ansi-bright-blue: #729fcf;
  --ansi-bright-magenta: #ad7fa8;
  --ansi-bright-cyan: #34e2e2;
  --ansi-bright-white: #eeeeec;
}

[data-theme='solarized-dark'] {
  --bg: #002b36;
  --fg: #839496;
  --bg-elevated: #073642;
  --border: #0a4a5a;
  --accent: #268bd2;
  --accent-fg: #002b36;
  --muted: #586e75;
  --danger: #dc322f;
  --cursor: #839496;
  --selection: rgba(131, 148, 150, 0.25);
  --ansi-black: #073642;
  --ansi-red: #dc322f;
  --ansi-green: #859900;
  --ansi-yellow: #b58900;
  --ansi-blue: #268bd2;
  --ansi-magenta: #d33682;
  --ansi-cyan: #2aa198;
  --ansi-white: #eee8d5;
  --ansi-bright-black: #002b36;
  --ansi-bright-red: #cb4b16;
  --ansi-bright-green: #586e75;
  --ansi-bright-yellow: #657b83;
  --ansi-bright-blue: #839496;
  --ansi-bright-magenta: #6c71c4;
  --ansi-bright-cyan: #93a1a1;
  --ansi-bright-white: #fdf6e3;
}

[data-theme='solarized-light'] {
  --bg: #fdf6e3;
  --fg: #657b83;
  --bg-elevated: #eee8d5;
  --border: #d7cfb4;
  --accent: #268bd2;
  --accent-fg: #fdf6e3;
  --muted: #93a1a1;
  --danger: #dc322f;
  --cursor: #657b83;
  --selection: rgba(101, 123, 131, 0.2);
  --ansi-black: #073642;
  --ansi-red: #dc322f;
  --ansi-green: #859900;
  --ansi-yellow: #b58900;
  --ansi-blue: #268bd2;
  --ansi-magenta: #d33682;
  --ansi-cyan: #2aa198;
  --ansi-white: #eee8d5;
  --ansi-bright-black: #002b36;
  --ansi-bright-red: #cb4b16;
  --ansi-bright-green: #586e75;
  --ansi-bright-yellow: #657b83;
  --ansi-bright-blue: #839496;
  --ansi-bright-magenta: #6c71c4;
  --ansi-bright-cyan: #93a1a1;
  --ansi-bright-white: #fdf6e3;
}

[data-theme='one-dark'] {
  --bg: #282c34;
  --fg: #abb2bf;
  --bg-elevated: #2c313c;
  --border: #3e4451;
  --accent: #61afef;
  --accent-fg: #282c34;
  --muted: #5c6370;
  --danger: #e06c75;
  --cursor: #abb2bf;
  --selection: rgba(171, 178, 191, 0.2);
  --ansi-black: #282c34;
  --ansi-red: #e06c75;
  --ansi-green: #98c379;
  --ansi-yellow: #e5c07b;
  --ansi-blue: #61afef;
  --ansi-magenta: #c678dd;
  --ansi-cyan: #56b6c2;
  --ansi-white: #abb2bf;
  --ansi-bright-black: #545862;
  --ansi-bright-red: #e06c75;
  --ansi-bright-green: #98c379;
  --ansi-bright-yellow: #e5c07b;
  --ansi-bright-blue: #61afef;
  --ansi-bright-magenta: #c678dd;
  --ansi-bright-cyan: #56b6c2;
  --ansi-bright-white: #c8ccd4;
}

[data-theme='one-light'] {
  --bg: #fafafa;
  --fg: #383a42;
  --bg-elevated: #f0f0f1;
  --border: #dcdfe4;
  --accent: #4078f2;
  --accent-fg: #fafafa;
  --muted: #a0a1a7;
  --danger: #e45649;
  --cursor: #383a42;
  --selection: rgba(56, 58, 66, 0.15);
  --ansi-black: #383a42;
  --ansi-red: #e45649;
  --ansi-green: #50a14f;
  --ansi-yellow: #c18401;
  --ansi-blue: #4078f2;
  --ansi-magenta: #a626a4;
  --ansi-cyan: #0184bc;
  --ansi-white: #a0a1a7;
  --ansi-bright-black: #a0a1a7;
  --ansi-bright-red: #e45649;
  --ansi-bright-green: #50a14f;
  --ansi-bright-yellow: #c18401;
  --ansi-bright-blue: #4078f2;
  --ansi-bright-magenta: #a626a4;
  --ansi-bright-cyan: #0184bc;
  --ansi-bright-white: #ffffff;
}

/* Flexoki by Steph Ango (kepano/flexoki), MIT licensed. ANSI-16 mapping
   taken directly from the project's own kitty terminal theme rather than
   invented here — those files already curate which shade of each hue reads
   correctly as a terminal foreground/background pair. */
[data-theme='flexoki-dark'] {
  --bg: #100f0f;
  --fg: #cecdc3;
  --bg-elevated: #1c1b1a;
  --border: #403e3c;
  --accent: #4385be;
  --accent-fg: #100f0f;
  --muted: #878580;
  --danger: #af3029;
  --cursor: #cecdc3;
  --selection: #403e3c;
  --ansi-black: #100f0f;
  --ansi-red: #af3029;
  --ansi-green: #66800b;
  --ansi-yellow: #ad8301;
  --ansi-blue: #205ea6;
  --ansi-magenta: #a02f6f;
  --ansi-cyan: #24837b;
  --ansi-white: #878580;
  --ansi-bright-black: #6f6e69;
  --ansi-bright-red: #d14d41;
  --ansi-bright-green: #879a39;
  --ansi-bright-yellow: #d0a215;
  --ansi-bright-blue: #4385be;
  --ansi-bright-magenta: #ce5d97;
  --ansi-bright-cyan: #3aa99f;
  --ansi-bright-white: #cecdc3;
}

[data-theme='flexoki-light'] {
  --bg: #fffcf0;
  --fg: #100f0f;
  --bg-elevated: #f2f0e5;
  --border: #cecdc3;
  --accent: #205ea6;
  --accent-fg: #fffcf0;
  --muted: #6f6e69;
  --danger: #d14d41;
  --cursor: #100f0f;
  --selection: #cecdc3;
  --ansi-black: #100f0f;
  --ansi-red: #d14d41;
  --ansi-green: #879a39;
  --ansi-yellow: #d0a215;
  --ansi-blue: #4385be;
  --ansi-magenta: #ce5d97;
  --ansi-cyan: #3aa99f;
  --ansi-white: #fffcf0;
  --ansi-bright-black: #6f6e69;
  --ansi-bright-red: #af3029;
  --ansi-bright-green: #66800b;
  --ansi-bright-yellow: #ad8301;
  --ansi-bright-blue: #205ea6;
  --ansi-bright-magenta: #a02f6f;
  --ansi-bright-cyan: #24837b;
  --ansi-bright-white: #f2f0e5;
}
