/* WasmBox restyle for the mdBook theme — NATIVE overlay only:
 * connected through `additional-css` in book.toml, loaded after the stock
 * theme, overriding its CSS custom properties and nothing structural.
 * Sidebar, search, print and the toolbar stay stock mdBook.
 *
 * Palette (sanctioned hexes from landing/styles/tokens/palette.css):
 * light = warm paper + ink; coal = the graphite developer dark; links and
 * accents = the burgundy ACTION pair, lightened on the dark field for the
 * 4.5:1 text gate (#861f2b 9.4:1 on paper, #d4727d 5.9:1 on graphite).
 * Science Gothic arrives from ../../fonts/: book.toml links this sheet from
 * its book-root path (`/docs/src/styles/`), while mdBook copies `src/fonts/`
 * to `/docs/fonts/` — `../fonts/` would 404 and fall back silently. */

@font-face {
  font-family: "Science Gothic";
  font-style: oblique 0deg 10deg;
  font-weight: 100 900;
  font-stretch: 50% 200%;
  font-display: swap;
  src: url("../../fonts/science-gothic-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Science Gothic";
  font-style: oblique 0deg 10deg;
  font-weight: 100 900;
  font-stretch: 50% 200%;
  font-display: swap;
  src: url("../../fonts/science-gothic-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Science Gothic";
  font-style: oblique 0deg 10deg;
  font-weight: 100 900;
  font-stretch: 50% 200%;
  font-display: swap;
  src: url("../../fonts/science-gothic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Science Gothic";
  font-style: oblique 0deg 10deg;
  font-weight: 100 900;
  font-stretch: 50% 200%;
  font-display: swap;
  src: url("../../fonts/science-gothic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Science Gothic is the face of the WHOLE book (user directive 2026-09-23):
 * body, sidebar, toolbar, search and code alike. The stock theme names its
 * own faces in two places — `html` (Open Sans) and `--mono-font`, which its
 * `code` rule applies with `!important` — so both are re-pointed here; form
 * controls do not inherit a font by default, so they are told to. */
:root {
  --mono-font: "Science Gothic", ui-monospace, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}
html {
  font-family: "Science Gothic", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  /* Science Gothic's Regular (400) reads semi-bold; the book reads in its
     Light cut, emphasis and headings one and two steps up (user
     2026-09-23: «весь шрифт слишком жирный»). */
  font-weight: 300;
}
strong,
b,
.chapter li strong {
  font-weight: 450;
}
.chapter li a.active {
  font-weight: 400;
}
button,
input,
select,
textarea,
kbd,
samp,
pre {
  font-family: inherit;
}
pre > code,
code {
  font-variant-numeric: tabular-nums;
}

/* ── Light: the paper half of the site palette ──────────────────────────── */
.light {
  --bg: #fcfcfa;
  --fg: #2b2924;

  --headings: #1f1c18;
  --links: #861f2b;

  --sidebar-bg: #f2f2ef;
  --sidebar-fg: #5c574a;
  --sidebar-non-existant: #d6d5ce;
  --sidebar-active: #1f1c18;
  --sidebar-spacer: #e6e5e0;

  --scrollbar: #d6d5ce;
  --scrollbar-thumb: #c2c1b8;

  --primary: #1f1c18;
  --secondary: #5c574a;
  --tertiary: #6f6959;

  --page-break: #e6e5e0;
  --quote-bg: #f2f2ef;
  --table-border: #e6e5e0;
  --table-header-bg: #f2f2ef;
  --table-alternate-bg: #f7f7f4;
  --code-bg: #f2f2ef;
  --search-mark-bg: #f0d9dc;
}

/* ── Coal: the graphite half ─────────────────────────────────────────────── */
.coal {
  --bg: #0a0a0a;
  --fg: #ececec;

  --headings: #ffffff;
  --links: #d4727d;

  --sidebar-bg: #151515;
  --sidebar-fg: #a6a6a6;
  --sidebar-non-existant: #4a4a4a;
  --sidebar-active: #ffffff;
  --sidebar-spacer: #242424;

  --scrollbar: #242424;
  --scrollbar-thumb: #3a3a3a;

  --primary: #ffffff;
  --secondary: #a6a6a6;
  --tertiary: #8a8a8a;

  --page-break: #242424;
  --quote-bg: #151515;
  --table-border: #242424;
  --table-header-bg: #151515;
  --table-alternate-bg: #111111;
  --code-bg: #151515;
  --search-mark-bg: #4a2429;
}

/* The buttons and the search field read the same variables; only the two
 * accents below leave the stock ramp: the theme-toggle pills and the
 * active sidebar edge carry the burgundy action field. */
.button,
.chroma { border-radius: 4px; }

#theme-toggle button,
.sidebar .active {
  color: #861f2b;
}
.coal #theme-toggle button,
.coal .sidebar .active {
  color: #d4727d;
}

/* Chapter body rhythm, one step toward the site's reading cut. */
.content main {
  max-width: 62ch;
}
.content h1,
.content h2,
.content h3,
.content h4 {
  font-weight: 400;
  letter-spacing: -0.02em;
}
