/* Docs website theme: the colors and type of the Surjection website (site/css)
   on top of mdBook. Light is the website's light theme; dark (mdBook's navy,
   shown as Dark) is the website's dark theme. rust and coal/ayu reuse them
   for anyone who picked those on another mdBook site on this origin.
   Every text color pair is checked by site/tools/contrast.mjs, which reads
   the two token blocks below: keep one declaration per line, hex colors. */

:root {
  --lo-sans: "Bricolage", system-ui, sans-serif;
  --mono-font: "Martian Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --code-font-size: .8em;
  --content-max-width: 820px;
  --sidebar-target-width: 290px;
}

/* tokens: light */
.light, .rust, html:not(.js) {
  --bg: #f7f4ff;
  --fg: #19133a;
  --lo-muted: #4d4572;
  --lo-rule: #d3cbf2;
  --lo-focus: #5a3fd0;
  --sidebar-bg: #efebff;
  --sidebar-fg: #19133a;
  --sidebar-non-existant: #4d4572;
  --sidebar-active: #a4460b;
  --sidebar-spacer: #d3cbf2;
  --sidebar-header-border-color: #a4460b;
  --scrollbar: #9d95c4;
  --icons: #4d4572;
  --icons-hover: #19133a;
  --links: #a4460b;
  --inline-code-color: #19133a;
  --lo-inline-code-bg: #e6e0fb;
  --theme-popup-bg: #ffffff;
  --theme-popup-border: #d3cbf2;
  --theme-hover: #efebff;
  --quote-bg: #ffffff;
  --quote-border: #d3cbf2;
  --warning-border: #f28b3c;
  --table-border-color: #d3cbf2;
  --table-header-bg: #efebff;
  --table-alternate-bg: #fbfaff;
  --searchbar-border-color: #9d95c4;
  --searchbar-bg: #ffffff;
  --searchbar-fg: #19133a;
  --searchbar-shadow-color: #f28b3c;
  --searchresults-header-fg: #4d4572;
  --searchresults-border-color: #d3cbf2;
  --searchresults-li-bg: #efebff;
  --search-mark-bg: #ffd8b0;
  --footnote-highlight: #6a52e6;
  --blockquote-note-color: #1d5c9e;
  --blockquote-tip-color: #0b6e47;
  --blockquote-important-color: #5a3fd0;
  --blockquote-warning-color: #7a4a00;
  --blockquote-caution-color: #b0222c;
  --lo-code-bg: #0b081c;
  --lo-code-fg: #f1edff;
  --lo-code-muted: #b9b0de;
  --lo-code-str: #ffd8b0;
  --lo-code-key: #f5a061;
  --lo-code-num: #ffc21a;
  --lo-code-add: #5fe0a5;
  --lo-code-del: #ff9b9b;
  --overlay-bg: rgba(25, 19, 58, .25);
  --copy-button-filter: invert(78%);
  --copy-button-filter-hover: invert(100%);
  --color-scheme: light;
}

/* tokens: dark */
.navy, .coal, .ayu {
  --bg: #120d2b;
  --fg: #f1edff;
  --lo-muted: #b9b0de;
  --lo-rule: #3b307a;
  --lo-focus: #ffd8b0;
  --sidebar-bg: #1c1540;
  --sidebar-fg: #f1edff;
  --sidebar-non-existant: #b9b0de;
  --sidebar-active: #f5a061;
  --sidebar-spacer: #3b307a;
  --sidebar-header-border-color: #f28b3c;
  --scrollbar: #5d548c;
  --icons: #b9b0de;
  --icons-hover: #f1edff;
  --links: #f5a061;
  --inline-code-color: #ffd8b0;
  --lo-inline-code-bg: #251c52;
  --theme-popup-bg: #1c1540;
  --theme-popup-border: #3b307a;
  --theme-hover: #251c52;
  --quote-bg: #1c1540;
  --quote-border: #3b307a;
  --warning-border: #f28b3c;
  --table-border-color: #3b307a;
  --table-header-bg: #251c52;
  --table-alternate-bg: #170f36;
  --searchbar-border-color: #5d548c;
  --searchbar-bg: #1c1540;
  --searchbar-fg: #f1edff;
  --searchbar-shadow-color: #f28b3c;
  --searchresults-header-fg: #b9b0de;
  --searchresults-border-color: #3b307a;
  --searchresults-li-bg: #251c52;
  --search-mark-bg: #5c3110;
  --footnote-highlight: #9c8bff;
  --blockquote-note-color: #7cc7ff;
  --blockquote-tip-color: #5fe0a5;
  --blockquote-important-color: #b9a9ff;
  --blockquote-warning-color: #ffc867;
  --blockquote-caution-color: #ff9b9b;
  --lo-code-bg: #0b081c;
  --lo-code-fg: #f1edff;
  --lo-code-muted: #b9b0de;
  --lo-code-str: #ffd8b0;
  --lo-code-key: #f5a061;
  --lo-code-num: #ffc21a;
  --lo-code-add: #5fe0a5;
  --lo-code-del: #ff9b9b;
  --overlay-bg: rgba(11, 8, 28, .6);
  --copy-button-filter: invert(78%);
  --copy-button-filter-hover: invert(100%);
  --color-scheme: dark;
}

/* Type */
html { font-family: var(--lo-sans); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
body { font-size: 1.7rem; }
.content main { line-height: 1.65; }
.content h1, .content h2, .content h3, .content h4, .content h5 { font-weight: 750; font-stretch: 85%; letter-spacing: -.01em; line-height: 1.2; }
.content h1 { font-size: 3.4rem; font-weight: 800; font-stretch: 78%; letter-spacing: -.015em; }
.content h2 { font-size: 2.5rem; }
.content h3 { font-size: 2rem; }
.menu-title { font-weight: 750; font-stretch: 85%; }
.chapter li.part-title { font-weight: 750; font-stretch: 85%; letter-spacing: .02em; text-transform: uppercase; font-size: .85em; color: var(--lo-muted); }
.on-this-page, .chapter li.header-item { font-size: .95em; }

/* Links are underlined in text so color is not the only cue. */
.content a:link, .content a:visited { color: var(--links); text-decoration: underline; text-underline-offset: .18em; }
.content a:hover { text-decoration-thickness: 2px; }
.content .header:link, .content .header:visited { color: var(--fg); text-decoration: none; }
:focus-visible { outline: 3px solid var(--lo-focus); outline-offset: 2px; border-radius: 4px; }

/* Code: blocks stay dark in both themes, like the website's code screens. */
.content :not(pre) > code { background: var(--lo-inline-code-bg); color: var(--inline-code-color); padding: .1em .35em; border-radius: 4px; }
.content a > code, .content a:link > code, .content a:visited > code { color: var(--links); }
.content .header > code, .content .header:link > code, .content .header:visited > code { color: var(--fg); }
pre { border: 1px solid var(--lo-rule); border-radius: 10px; }
pre > code, pre > code.hljs { background: var(--lo-code-bg); color: var(--lo-code-fg); border-radius: 10px; }
pre > .buttons button { color: var(--lo-code-muted); }
.hljs-comment, .hljs-quote, .hljs-meta { color: var(--lo-code-muted); }
.hljs-string, .hljs-symbol, .hljs-bullet, .hljs-regexp, .hljs-link { color: var(--lo-code-str); }
.hljs-keyword, .hljs-selector-tag, .hljs-attr, .hljs-attribute, .hljs-name, .hljs-tag, .hljs-title, .hljs-section, .hljs-built_in, .hljs-type { color: var(--lo-code-key); }
.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable, .hljs-params { color: var(--lo-code-num); }
.hljs-addition { color: var(--lo-code-add); background: none; }
.hljs-deletion { color: var(--lo-code-del); background: none; }

/* Tables */
.content table { display: block; overflow-x: auto; max-width: 100%; }
.content table th { text-align: left; }

/* Screenshots and clips (docs/media) */
.content img, .content video { max-width: 100%; height: auto; }
.content picture img, .content video.lo-clip { border: 1px solid var(--lo-rule); border-radius: 10px; }
.content video.lo-clip { display: block; width: 100%; background: var(--lo-code-bg); }

/* Theme menu: the website has a light and a dark theme, plus Auto. */
#mdbook-theme-list li:has(#mdbook-theme-rust),
#mdbook-theme-list li:has(#mdbook-theme-coal),
#mdbook-theme-list li:has(#mdbook-theme-ayu) { display: none; }

/* Link back to the website, added by surjection.js */
.lo-home { display: inline-flex; align-items: center; gap: 6px; height: var(--menu-bar-height); padding: 0 8px; color: var(--icons); font-weight: 650; font-stretch: 88%; text-decoration: none; }
.lo-home:hover { color: var(--icons-hover); }
.lo-home img { width: 20px; height: 20px; }

@media print {
  pre > code, pre > code.hljs { background: none; color: inherit; }
  .hljs-comment, .hljs-quote, .hljs-meta, .hljs-string, .hljs-symbol, .hljs-bullet, .hljs-regexp, .hljs-link,
  .hljs-keyword, .hljs-selector-tag, .hljs-attr, .hljs-attribute, .hljs-name, .hljs-tag, .hljs-title, .hljs-section,
  .hljs-built_in, .hljs-type, .hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable, .hljs-params,
  .hljs-addition, .hljs-deletion { color: inherit; }
}
