/* kern-newcm.css: Swaps to New Computer Modern Math for Typst visual parity. */
/* Include this after kern.css to override font stacks. */

/* NewCMMath-Book is served from fred-wang/MathFonts's gh-pages branch
   (the only branch that actually contains the .woff2 binaries). About 670KB
   uncompressed but ~200KB over the wire after brotli; the browser caches it
   on first load. We alias it as `NewCMMath-Regular` so existing class names
   keep working. */
@font-face {
  font-family: 'NewCMMath-Regular';
  src: url('https://cdn.jsdelivr.net/gh/fred-wang/MathFonts@gh-pages/NewComputerModern/NewCMMath-Book.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/gh/fred-wang/MathFonts@gh-pages/NewComputerModern/NewCMMath-Book.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.kern,
.kern-mi,
.kern-mn,
.kern-mo,
.kern-mtext {
  font-family: "NewCMMath-Regular", "New Computer Modern Math", "Times New Roman", serif;
}

/* MathML output. Only set font-family on the root <math>; descendants
   inherit it. Setting it explicitly on every child (msub, msup, mfrac, ...)
   confuses Chromium's OpenType MATH table consultation and breaks
   script-level scaling for some nested constructs (e.g. b^2 inside an
   msqrt inside an mfrac would lose its superscript scaling). */
math {
  font-family: "NewCMMath-Regular", "New Computer Modern Math",
    "Latin Modern Math", "STIX Two Math", "Times New Roman", serif;
}

.kern-cal {
  font-family: "NewCMMath-Regular", cursive;
}

.kern-bb {
  font-family: "NewCMMath-Regular", "Times New Roman", serif;
}

.kern-frak {
  font-family: "NewCMMath-Regular", fantasy;
}

.kern-upright {
  font-family: "NewCMMath-Regular", "Times New Roman", serif;
}
