/* Chinese (zh-CN) typography layer. Loaded after the page's own CSS on every zh/ page.
   Montserrat / Raleway / JetBrains Mono carry no CJK glyphs, so Noto Sans SC is appended
   to every stack: Latin numerals and product names keep the brand faces, Chinese text
   falls through to Noto Sans SC. */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&display=swap');

:root { --zh-sans: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; }

html, body { font-family: 'Raleway', var(--zh-sans); }
h1, h2, h3, h4, h5 { font-family: 'Montserrat', var(--zh-sans); }
.mono, [class*="mono"] { font-family: 'JetBrains Mono', var(--zh-sans); }

/* CJK headlines need less negative tracking and more leading than the Latin originals.
   Inline styles in the JSX set 800/900 + -0.02em, hence !important. */
h1 { font-weight: 700 !important; letter-spacing: 0 !important; line-height: 1.22 !important; }
h2 { font-weight: 700 !important; letter-spacing: 0 !important; line-height: 1.28 !important; }
h3, h4, h5 { font-weight: 700 !important; letter-spacing: 0 !important; line-height: 1.4 !important; }

/* Numbers, stats and code keep their Latin metrics. */
h1 .num, h2 .num, .stat-num { letter-spacing: -0.02em !important; }

/* Mono eyebrows: uppercase tracking is a Latin device — soften it for mixed CJK runs. */
.mono { letter-spacing: 0.05em; }
.mono.eyebrow-text { letter-spacing: 0.08em; }

/* Chinese body copy reads better slightly looser and never below 14px. */
p, li { line-height: 1.75; }
body { text-spacing-trim: space-all; }

/* Buttons: CJK labels are shorter — keep them from looking cramped. */
.btn-primary, .btn-outline { letter-spacing: 0.04em; white-space: nowrap; }

/* Language switch pill in the nav. */
.lang-switch { display: inline-flex; align-items: center; gap: 6px; }
