/* Rustiz docs: same paper/ink/signal look as the landing page.
   Fonts are served by the landing site from /assets/fonts. */
@font-face {
  font-family: "Bricolage";
  src: url("/assets/fonts/bricolage-grotesque-latin-var.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
}
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --mono-font: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --code-font-size: .86em;
}
html { font-family: "Bricolage", ui-sans-serif, system-ui, sans-serif; font-optical-sizing: auto; }
code, pre, .hljs { font-family: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace !important; }

.light {
  --bg: #f3f0e8;
  --fg: #23221e;
  --sidebar-bg: #ebe7dc;
  --sidebar-fg: #34322d;
  --sidebar-non-existant: #8d887b;
  --sidebar-active: #a33a06;
  --sidebar-spacer: #d3cdbe;
  --scrollbar: #bdb6a4;
  --icons: #6c685e;
  --icons-hover: #161513;
  --links: #c2410c;
  --inline-code-color: #161513;
  --theme-popup-bg: #f3f0e8;
  --theme-popup-border: #161513;
  --theme-hover: #e2ddcf;
  --quote-bg: #ebe7dc;
  --quote-border: #ff5a1f;
  --sidebar-header-border-color: #161513;
  --table-border-color: #d3cdbe;
  --table-header-bg: #e2ddcf;
  --table-alternate-bg: #efebe2;
  --searchbar-border-color: #161513;
  --searchbar-bg: #fbfaf6;
  --searchbar-fg: #161513;
  --searchresults-header-fg: #6c685e;
  --searchresults-border-color: #d3cdbe;
  --searchresults-li-bg: #ebe7dc;
  --search-mark-bg: #ffb08f;
}
.light #mdbook-menu-bar, .light .menu-bar { border-bottom: 1px solid #161513; }
.light .sidebar { border-right: 1px solid #161513; }
.light :not(pre) > code { background: #e7e2d6; border: 1px solid #d3cdbe; padding: .05em .35em; border-radius: 3px; }
.light pre > .hljs, .light pre { background: #1a1916 !important; color: #e8e4da; border-radius: 4px; }
.light .hljs-string, .light .hljs-attr { color: #b9dcb0; }
.light .hljs-keyword, .light .hljs-built_in, .light .hljs-name { color: #ffb08f; }
.light .hljs-comment { color: #8d887b; }

.menu-title { font-weight: 700; letter-spacing: -.02em; }
.content h1, .content h2, .content h3 { letter-spacing: -.025em; font-weight: 700; }
.content h1 { font-size: 2.6em; line-height: 1.05; }
.chapter li.part-title { color: #a33a06; font-family: "Plex Mono", monospace; font-size: .72em; text-transform: uppercase; letter-spacing: .08em; margin-top: 1.4em; }
.content main { max-width: 78ch; }
.content table { display: block; overflow-x: auto; }
blockquote { border-radius: 4px; border-left-width: 3px; }

/* Only the paper/ink light skin is styled: hide the stock dark-theme picker. */
#mdbook-theme-toggle { display: none !important; }
/* Link back to the landing page, injected by theme/rustiz.js. */
.rustiz-home {
  display: inline-flex; align-items: center; padding: 0 14px; margin-right: 4px;
  font: 600 12px/1 var(--mono-font); text-transform: uppercase; letter-spacing: .05em;
  color: #161513; text-decoration: none; white-space: nowrap;
}
.rustiz-home:hover { color: #c2410c; }
.chapter li.part-title { color: #a33a06; }

/* Mobile: fit tables to the viewport instead of clipping them. */
@media (max-width: 620px) {
  .content table { display: table; width: 100%; table-layout: fixed; overflow-x: visible; }
  .content table th, .content table td { overflow-wrap: anywhere; word-break: break-word; }
  .rustiz-home { padding: 0 6px; font-size: 10px; }
  .menu-title { font-size: .95em; }
}

/* ---------- DeepSeek round-5 fixes ---------- */
:focus-visible { outline: 2px solid #b8430a; outline-offset: 2px; }
.light .sidebar .chapter li a { padding-top: 8px; padding-bottom: 8px; min-height: 36px; display: flex; align-items: center; }
.light .sidebar .chapter li.part-title { padding-top: 10px; padding-bottom: 4px; }
