/* Site fonts, self-hosted from ../fonts/ (licences next to them): Manrope for text, Rubik for headings. */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/manrope-1.woff2) format('woff2');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/manrope-2.woff2) format('woff2');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/manrope-3.woff2) format('woff2');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/manrope-4.woff2) format('woff2');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/manrope-5.woff2) format('woff2');
}

/* Rubik — display face. Variable font; a weight range lets the browser
   interpolate instead of shipping one file per weight. */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(../fonts/rubik-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(../fonts/rubik-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* CJK fallbacks of every font stack (Rubik/Manrope carry no CJK). One face per language,
   subset by tools/build-cjkfonts.py — re-run it when ja/zh/ko texts change (a glyph the
   subset lacks falls back to the system font). Each @font-face carries a unicode-range, so
   the files load only on pages of their language — without it one arrow glyph (↗, which
   Rubik/Manrope also lack) made every page fetch them. Symbols outside the ranges (↗, –, «»)
   fall to the system font, as they always did. The --cjk variable picks the page's language
   face: shared codepoints (国, 人) must render in the right language's glyph variants. */
:root { --cjk: 'Noto Sans JP'; }
html[lang^="zh"] { --cjk: 'Noto Sans SC'; }
html[lang="ko"] { --cjk: 'Noto Sans KR'; }

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/notojp-var.woff2) format('woff2');
  unicode-range: U+3000-303F, U+3041-309F, U+30A0-30FF, U+4E00-9FFF, U+FF01-FF60;
}

@font-face {
  font-family: 'Noto Sans SC';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/notosc-var.woff2) format('woff2');
  unicode-range: U+3000-303F, U+4E00-9FFF, U+FF01-FF60;
}

@font-face {
  font-family: 'Noto Sans KR';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/notokr-var.woff2) format('woff2');
  unicode-range: U+3000-303F, U+3130-318F, U+AC00-D7A3, U+FF01-FF60;
}
