/* teaware CJK type layer, 2026-11-08: the cha.fyi approach (cha.fyi index.html, "East Asian typography layer").
   Body, sidebar and UI in the region's Noto Sans; headings and Han display glyphs in the region's Noto Serif (Song/Mincho/Myeongjo).
   Each stack: web font first, then the face each OS ships for that region. Latin always Source Sans 3 / Cormorant Garamond first.
   Noto Sans SC/TC/JP/KR: @fontsource 5.3.1, SIL OFL 1.1 (fonts/noto-sans-*-LICENSE.txt), CJK subsets only, 400 and 600. */
:root{
--sans-ja:"Noto Sans JP","Hiragino Sans","Hiragino Kaku Gothic ProN","BIZ UDPGothic","Yu Gothic UI","Yu Gothic","Meiryo","Noto Sans CJK JP";
--sans-hans:"Noto Sans SC","PingFang SC","HarmonyOS Sans SC","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC";
--sans-hant:"Noto Sans TC","PingFang TC","PingFang HK","Microsoft JhengHei UI","Microsoft JhengHei","Source Han Sans TC","Noto Sans CJK TC";
--sans-ko:"Pretendard","Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic","Noto Sans CJK KR";
--serif-ja:"Noto Serif JP","Hiragino Mincho ProN","HiraMinProN-W3","Yu Mincho","YuMincho","MS PMincho","Noto Serif CJK JP";
--serif-hans:"Noto Serif SC","Songti SC","STSongti-SC-Regular","Source Han Serif SC","STSong","SimSun","Noto Serif CJK SC";
--serif-hant:"Noto Serif TC","Songti TC","STSongti-TC-Regular","LiSong Pro","Source Han Serif TC","STSong","PMingLiU","MingLiU","Noto Serif CJK TC";
--serif-ko:"Noto Serif KR","Nanum Myeongjo","AppleMyungjo","Batang","Noto Serif CJK KR";
/* en/de/ru: untagged Chinese inside running text falls to Noto Sans SC/TC, as on cha.fyi (was the system UI face) */
--body:"Source Sans 3","Noto Sans SC","Noto Sans TC","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
--display:"Cormorant Garamond","Noto Serif SC","Noto Serif TC",Georgia,serif;
}
/* page language roots: sans body (sidebar, menus, prose, tables), serif headings */
html:root:lang(zh-Hans){--cjk:var(--serif-hans),serif;--body:"Source Sans 3",var(--sans-hans),system-ui,sans-serif;--display:var(--serif-hans),serif;--hanfont:var(--serif-hans),serif;--mono:"IBM Plex Mono",var(--sans-hans),ui-monospace,Menlo,monospace}
html:root:lang(zh-Hant){--cjk:var(--serif-hant),serif;--body:"Source Sans 3",var(--sans-hant),system-ui,sans-serif;--display:var(--serif-hant),serif;--hanfont:var(--serif-hant),serif;--mono:"IBM Plex Mono",var(--sans-hant),ui-monospace,Menlo,monospace;quotes:"「" "」" "『" "』"}
html:root:lang(ja){--cjk:var(--serif-ja),serif;--body:"Source Sans 3",var(--sans-ja),system-ui,sans-serif;--display:"Cormorant Garamond",var(--serif-ja),serif;--hanfont:var(--serif-ja),serif;--mono:"IBM Plex Mono",var(--sans-ja),ui-monospace,Menlo,monospace}
html:root:lang(ko){--cjk:var(--serif-ko),serif;--body:"Source Sans 3",var(--sans-ko),system-ui,sans-serif;--display:"Cormorant Garamond",var(--serif-ko),serif;--hanfont:var(--serif-ko),serif;--mono:"IBM Plex Mono",var(--sans-ko),ui-monospace,Menlo,monospace}
/* Han display glyphs (.han) keep the serif of their own language */
.han:lang(zh-Hans){font-family:var(--serif-hans),serif}
.han:lang(zh-Hant){font-family:var(--serif-hant),serif}
.han:lang(ja){font-family:var(--serif-ja),serif}
.han:lang(ko){font-family:var(--serif-ko),serif}
/* shared CJK base: no faux bold/italic on Han, kana, Hangul; strict kinsoku; 1/8em Han-Latin gap where no space is typed */
html:root:is(:lang(ja),:lang(zh-Hans),:lang(zh-Hant),:lang(ko)){font-synthesis:none;line-break:strict;hyphens:manual}
html:root:is(:lang(zh-Hans),:lang(zh-Hant)){text-autospace:normal}
html:root:lang(ja){text-autospace:no-autospace;text-spacing-trim:trim-start}
html:root:lang(ja) :is(h1,h2,h3){font-feature-settings:"palt"}
html:root:is(:lang(ja),:lang(zh-Hans),:lang(zh-Hant),:lang(ko)) :is(i,em,cite,dfn,svg text){font-synthesis-style:auto}
/* no Latin caps tracking on Han/kana/Hangul labels */
html:root:is(:lang(ja),:lang(zh-Hans),:lang(zh-Hant),:lang(ko)) :is(h1,h2,h3,h4){letter-spacing:0}
html:root:is(:lang(ja),:lang(zh-Hans),:lang(zh-Hant),:lang(ko)) :is(.eyebrow,.pill,.tag,.glance h2,.toc h2,.facts dt,.ledger th,.rel-group h3,.keyfacts dt,.drawing-views label,.check span){text-transform:none;letter-spacing:0}
/* zh-Hans: pinyin upright in the body face (tone marks are hard to read in small italic) */
html:root:lang(zh-Hans) :is(.pinyin,.row-pinyin,.shape-pinyin,.lineup-pinyin,em[lang="zh-Latn"]){font-family:var(--body);font-style:normal;font-weight:400;letter-spacing:.01em}
/* nested foreign-language text: Chinese names in en/de/ru/ja/ko pages, Japanese titles in zh pages */
:where([lang="zh-Hans"],[lang="zh-CN"]):not(:root){--hanfont:var(--serif-hans),serif}
:where([lang="zh-Hant"],[lang="zh-TW"],[lang="zh-HK"]):not(:root){--hanfont:var(--serif-hant),serif}
:where([lang="ja"]):not(:root){--hanfont:var(--serif-ja),serif}
:where([lang="ko"]):not(:root){--hanfont:var(--serif-ko),serif}
:where(p,li,dd,td,th,figcaption,blockquote,.lede,.notes,.card-desc,.src,.facts):where(span,a,em,cite,q,b,strong):where([lang="zh-Hans"],[lang="zh-CN"]){font-family:"Source Sans 3",var(--sans-hans),system-ui,sans-serif}
:where(p,li,dd,td,th,figcaption,blockquote,.lede,.notes,.card-desc,.src,.facts):where(span,a,em,cite,q,b,strong):where([lang="zh-Hant"],[lang="zh-TW"],[lang="zh-HK"]){font-family:"Source Sans 3",var(--sans-hant),system-ui,sans-serif}
:where(p,li,dd,td,th,figcaption,blockquote,.lede,.notes,.card-desc,.src,.facts):where(span,a,em,cite,q,b,strong):where([lang="ja"]){font-family:"Source Sans 3",var(--sans-ja),system-ui,sans-serif}
:where(p,li,dd,td,th,figcaption,blockquote,.lede,.notes,.card-desc,.src,.facts):where(span,a,em,cite,q,b,strong):where([lang="ko"]){font-family:"Source Sans 3",var(--sans-ko),system-ui,sans-serif}
:where(h1,h2,h3,h4) :where([lang="zh-Hans"],[lang="zh-CN"],[lang="zh-Hant"],[lang="zh-TW"],[lang="zh-HK"],[lang="ja"],[lang="ko"]){font-family:var(--hanfont)}
:where([lang="zh-Hans"],[lang="zh-Hant"],[lang="ja"],[lang="ko"]):not(:root){font-synthesis-weight:none}
/* ja: romanisation upright, as on cha.fyi */
html:root:lang(ja) :is(.pinyin,.row-pinyin,.shape-pinyin,.lineup-pinyin,[lang="zh-Latn"]){font-style:normal}
