/* Flow AI · bilingual layer. Loaded on every page by scripts/i18n.py.
   1. The EN | 中文 switch in the site header.
   2. Chinese typography: the same Google Sans Flex for Latin and numerals, with a CJK system
      face behind it, natural tracking and a little more line height for Hanzi. */

.site-header__nav .lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(250, 248, 243, 0.16);
  border-radius: 999px;
  line-height: 1;
}
.site-header__nav .lang-switch a {
  padding: 2px 0;
  color: rgba(250, 248, 243, 0.5);
  font-size: 12.5px;
  font-weight: 560;
  letter-spacing: 0.02em;
}
.site-header__nav .lang-switch a:hover,
.site-header__nav .lang-switch a[aria-current="true"] { color: #faf8f3; }
.site-header__nav .lang-switch a[aria-current="true"] { pointer-events: none; }
.lang-switch__sep { color: rgba(250, 248, 243, 0.24); font-size: 12px; }

@media (max-width: 640px) {
  .site-header__nav .lang-switch { margin-left: auto; padding: 2px 8px; }
  .site-header__nav .lang-switch a { padding-block: 8px; font-size: 12px; }
}

@media print { .lang-switch { display: none !important; } }

/* ---------- Chinese ---------- */
html[lang^="zh"] {
  --font: "Google Sans Flex", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
          "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: var(--font);
}
html[lang^="zh"] body {
  line-break: strict;
  word-break: normal;
  overflow-wrap: anywhere;
}
/* Negative display tracking suits Latin capitals and crushes Hanzi. */
html[lang^="zh"] body *:not(code):not(pre):not(kbd) { letter-spacing: 0 !important; }
html[lang^="zh"] :is(h1, h2, h3) { line-height: 1.28; text-wrap: balance; }
/* Measures across the site are set in ch, the width of a Latin "0", about half a Hanzi.
   Headlines get an em measure instead, so a Chinese headline runs up to 18 characters a line
   and still never outgrows its column. */
html[lang^="zh"] :is(h1, h2, h3), html[lang^="zh"] .cv-hero h1 span { max-width: 18em !important; }
html[lang^="zh"] :is(p, li, dd, blockquote, summary) { line-height: 1.8; }
html[lang^="zh"] .site-header__nav a,
html[lang^="zh"] .btn { line-height: 1.2; }
/* Hanzi have no italic; emphasis stays upright. */
html[lang^="zh"] :is(em, i, cite) { font-style: normal; }
