/* Computer Modern Unicode (CMU) webfont setup
   Files expected in the SAME folder as this CSS:
   cmunrm.ttf  cmunti.ttf  cmunbx.ttf  cmunbi.ttf
   cmunss.ttf  cmunsi.ttf  cmunsx.ttf  cmunso.ttf  cmunsl.ttf
   cmunttb.ttf cmuntti.ttf cmunttx.ttf
   (plus many others you have; we only wire the common ones)
*/

/* ===== CMU Serif (Roman) ===== */
@font-face {
  font-family: "CMU Serif";
  font-style: normal;
  font-weight: 400;
  src: url("cmunrm.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  font-style: italic;
  font-weight: 400;
  src: url("cmunti.ttf") format("truetype"); /* CMU Serif Italic (true italic) */
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  font-style: normal;
  font-weight: 700;
  src: url("cmunbx.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  font-style: italic;
  font-weight: 700;
  src: url("cmunbi.ttf") format("truetype"); /* CMU Serif Bold Italic */
  font-display: swap;
}
/* Optional: map 'oblique' requests to the slanted cuts you have */
@font-face {
  font-family: "CMU Serif";
  font-style: oblique;
  font-weight: 400;
  src: url("cmunoti.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  font-style: oblique;
  font-weight: 700;
  src: url("cmunoti.ttf") format("truetype");
  font-display: swap;
}

/* Optional: if mdBook asks for 300/600/800, alias to nearest real weight */
@font-face {
  font-family: "CMU Serif";
  font-style: normal;
  font-weight: 300;
  src: url("cmunrm.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  font-style: italic;
  font-weight: 300;
  src: url("cmunti.ttf") format("truetype"); /* CMU Serif Italic (true italic) */
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  font-style: normal;
  font-weight: 600;
  src: url("cmunbx.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  font-style: italic;
  font-weight: 600;
  src: url("cmunbi.ttf") format("truetype"); /* CMU Serif Bold Italic */
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  font-style: normal;
  font-weight: 800;
  src: url("cmunbx.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  font-style: italic;
  font-weight: 800;
  src: url("cmunbi.ttf") format("truetype"); /* CMU Serif Bold Italic */
  font-display: swap;
}

/* ===== CMU Sans Serif (optional, for UI bits) ===== */
@font-face {
  font-family: "CMU Sans";
  font-style: normal;
  font-weight: 300; /* Light */
  src: url("cmunsl.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "CMU Sans";
  font-style: normal;
  font-weight: 400;
  src: url("cmunss.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "CMU Sans";
  font-style: italic;
  font-weight: 400;
  src: url("cmunsi.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "CMU Sans";
  font-style: normal;
  font-weight: 700; /* Bold */
  src: url("cmunsx.ttf") format("truetype");
  font-display: swap;
}
/* Some themes ask for oblique instead of italic */
@font-face {
  font-family: "CMU Sans";
  font-style: oblique;
  font-weight: 400;
  src: url("cmunso.ttf") format("truetype");
  font-display: swap;
}

/* ===== CMU Typewriter (monospace) =====
   File→face mappings verified from each TTF's name table. Previously the regular
   cut pointed at cmuntx.ttf (actually Bold Italic) and italic at cmuntti.ttf
   (nonexistent), so everything rendered heavy/faux. Correct cuts: */
@font-face {
  font-family: "CMU Typewriter";
  font-style: normal;
  font-weight: 400;
  src: url("cmuntt.ttf") format("truetype"); /* CMU Typewriter Text Regular */
  font-display: swap;
}
@font-face {
  font-family: "CMU Typewriter";
  font-style: italic;
  font-weight: 400;
  src: url("cmunit.ttf") format("truetype"); /* CMU Typewriter Text Italic */
  font-display: swap;
}
@font-face {
  font-family: "CMU Typewriter";
  font-style: normal;
  font-weight: 700;
  src: url("cmuntb.ttf") format("truetype"); /* CMU Typewriter Text Bold */
  font-display: swap;
}
@font-face {
  font-family: "CMU Typewriter";
  font-style: italic;
  font-weight: 700;
  src: url("cmuntx.ttf") format("truetype"); /* CMU Typewriter Text Bold Italic */
  font-display: swap;
}

/* ===== Yinit drop-cap initials (gwern-style) =====
   26 single-glyph files, one per capital. unicode-range makes the browser
   fetch ONLY the letter a page actually starts with. Used by the opt-in
   `.dropcap` wrapper class (see custom.css). */
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-A.ttf") format("truetype");
  unicode-range: U+0041;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-B.ttf") format("truetype");
  unicode-range: U+0042;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-C.ttf") format("truetype");
  unicode-range: U+0043;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-D.ttf") format("truetype");
  unicode-range: U+0044;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-E.ttf") format("truetype");
  unicode-range: U+0045;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-F.ttf") format("truetype");
  unicode-range: U+0046;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-G.ttf") format("truetype");
  unicode-range: U+0047;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-H.ttf") format("truetype");
  unicode-range: U+0048;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-I.ttf") format("truetype");
  unicode-range: U+0049;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-J.ttf") format("truetype");
  unicode-range: U+004A;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-K.ttf") format("truetype");
  unicode-range: U+004B;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-L.ttf") format("truetype");
  unicode-range: U+004C;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-M.ttf") format("truetype");
  unicode-range: U+004D;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-N.ttf") format("truetype");
  unicode-range: U+004E;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-O.ttf") format("truetype");
  unicode-range: U+004F;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-P.ttf") format("truetype");
  unicode-range: U+0050;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-Q.ttf") format("truetype");
  unicode-range: U+0051;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-R.ttf") format("truetype");
  unicode-range: U+0052;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-S.ttf") format("truetype");
  unicode-range: U+0053;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-T.ttf") format("truetype");
  unicode-range: U+0054;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-U.ttf") format("truetype");
  unicode-range: U+0055;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-V.ttf") format("truetype");
  unicode-range: U+0056;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-W.ttf") format("truetype");
  unicode-range: U+0057;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-X.ttf") format("truetype");
  unicode-range: U+0058;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-Y.ttf") format("truetype");
  unicode-range: U+0059;
  font-display: swap;
}
@font-face {
  font-family: "Yinit";
  font-style: normal;
  font-weight: 400;
  src: url("Yinit-Z.ttf") format("truetype");
  unicode-range: U+005A;
  font-display: swap;
}
