/* fonts.css — KeyAudit Terminal Editorial typography stack
 *
 * 三套字体协作：
 *   --font-sans     拉丁正文 + 中文（lang 切换 fallback 到 Noto Sans SC）
 *   --font-display  显示标题（Inter Tight 收敛、专业，不做营销 gradient）
 *   --font-mono     数据 / hex / 代码 / 数字 tabular（JetBrains Mono 含 ligature）
 *
 * 走 Google Fonts；preconnect 已在 layout.head 由 GTM 占了同域，
 * fonts.googleapis.com 单独再加一次。
 */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont,
               'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-display: 'Inter Tight', 'Inter', 'Noto Sans SC', -apple-system,
                  'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas,
               'Source Han Mono SC', 'Sarasa Mono SC', monospace;
}

/* 全站 sans，加 OpenType features 让数字 tabular（对齐 6,943,863 这种）。 */
html, body {
  font-family: var(--font-sans);
  font-feature-settings: 'tnum' 0, 'cv11' 1, 'ss01' 1; /* slashed zero + ss01 */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 标题用 display font + 字距收紧。 */
h1, h2, h3, h4, h5, h6,
.seo-page-title, .seo-section__title, .seo-hero h1 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

/* 数字、tag、源 ID、stat value 全部 tabular figures + mono。 */
.seo-stat__value,
.seo-tag, .intel-tag,
.intel-item__meta time,
[data-numeric],
.seo-pill, .seo-news__date,
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1, 'cv11' 1, 'calt' 0; /* tabular, slashed 0, no ligature in inline */
}

/* code ligature 仅在 pre 块内启用（calt = ligature）。 */
pre, pre code {
  font-feature-settings: 'tnum' 1, 'calt' 1;
}

/* 中文环境 lang="zh"：让 Noto Sans SC 优先，避免英文字体插入中文造成宽度跳动。 */
:root:lang(zh) {
  --font-sans: 'Noto Sans SC', 'Inter', -apple-system, 'PingFang SC',
               'Microsoft YaHei', sans-serif;
}
