/* App Purchase Vault — CJK typography (Japanese, Korean, Simplified and
   Traditional Chinese). NOT PUBLISHED YET: copy to assets/cjk.css and link it
   (after every other stylesheet) from ja / ko / zh-cn / zh-tw pages only, in
   the step that makes the first CJK locale public.

   Fonts: native system fonts only, no webfont download (no CLS, no extra
   bytes). Inter stays first so Latin product names (Google Play, App Store,
   purchase-history.json) keep the site's Latin face; Inter's @font-face covers
   Latin only, so every CJK glyph falls through to the platform font named
   next. Order per stack: Apple (macOS/iOS), Android/Linux (Noto CJK),
   Windows. The html:lang() prefix matches the page's lang attribute and
   out-ranks the homepage's inline `.hero h1`-style rules.

   Line breaking:
   - ja / zh: break between ideographs (word-break:normal, the default for
     CJK) with strict kinsoku rules (line-break:strict), never inside Latin
     words; break-word only as a last resort for an over-long token.
   - ko: Korean separates words with spaces, so keep-all keeps each word
     whole (no break mid-eojeol), again with break-word as the last resort.
   - ja headings: word-break:auto-phrase (Chrome 119+) breaks at phrase
     boundaries; other browsers ignore it and keep normal breaking. */

html:lang(ja){font-family:'Inter',"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","Noto Sans CJK JP",Meiryo,"Yu Gothic UI","Yu Gothic",-apple-system,system-ui,sans-serif}
html:lang(ko){font-family:'Inter',"Apple SD Gothic Neo","Noto Sans KR","Noto Sans CJK KR","Malgun Gothic",-apple-system,system-ui,sans-serif}
html:lang(zh-CN){font-family:'Inter',"PingFang SC","Hiragino Sans GB","Noto Sans SC","Noto Sans CJK SC","Microsoft YaHei",-apple-system,system-ui,sans-serif}
html:lang(zh-TW){font-family:'Inter',"PingFang TC","Noto Sans TC","Noto Sans CJK TC","Microsoft JhengHei",-apple-system,system-ui,sans-serif}
/* body carries its own font-family in both stylesheets: inherit the stack above */
html:is(:lang(ja),:lang(ko),:lang(zh-CN),:lang(zh-TW)) body{font-family:inherit}

/* rhythm: CJK glyphs fill the em box, so tight Latin display settings crowd them */
html:is(:lang(ja),:lang(ko),:lang(zh-CN),:lang(zh-TW)) :is(h1,h2,h3){letter-spacing:0;line-height:1.35}
html:is(:lang(ja),:lang(ko),:lang(zh-CN),:lang(zh-TW)) :is(.lede,p,li){letter-spacing:0}
/* italics do not exist in CJK type: emphasise with weight instead */
html:is(:lang(ja),:lang(ko),:lang(zh-CN),:lang(zh-TW)) :is(em,i){font-style:normal;font-weight:700}

/* line breaking */
html:is(:lang(ja),:lang(zh-CN),:lang(zh-TW)) body{line-break:strict;word-break:normal;overflow-wrap:break-word}
html:lang(ko) body{word-break:keep-all;overflow-wrap:break-word}
@supports (word-break:auto-phrase){
  html:lang(ja) :is(h1,h2,h3,.lede){word-break:auto-phrase}
}
