/* ==========================================================================
   AuraLux · 排版系统 v1.0
   英 / 中 / 俄 三语同栈：拉丁与西里尔走 Cormorant + Inter，
   中文按 unicode-range 自动落到思源宋体 / 思源黑体。
   需先引入同目录 fonts.css（由 scripts/build_fonts.py 生成）。
   ========================================================================== */

:root {
  /* ---- 字体栈：拉丁在前，中文在后，顺序不可颠倒 ---- */
  --font-display: "Cormorant Garamond", "Noto Serif SC", "Songti SC", "STSong",
    Georgia, serif;
  --font-text: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
  /* 可选点睛：未打包时自动回退到宋体 */
  --font-kai: "LXGW WenKai", "Kaiti SC", "STKaiti", "Noto Serif SC", serif;

  /* ---- 品牌色 ---- */
  --c-cream: #f7f3ee;
  --c-forest: #14342a;
  --c-forest-2: #1a3d2e;
  --c-gold: #c4a77d;
  --c-sage: #3d5a4c;
  --c-ink: #1a1a1a;

  /* ---- 拉丁/西里尔默认节奏 ---- */
  --lh-display: 1.05;
  --ls-display: -0.018em;
  --lh-h2: 1.15;
  --ls-h2: -0.012em;
  --lh-body: 1.68;
  --ls-body: 0.004em;
  --lh-quote: 1.62;
  /* 中文视觉更大，同层级小一档 */
  --zh-scale: 0.8;
}

/* 中文：行高、字距、字号整体切换 */
:lang(zh) {
  --lh-display: 1.4;
  --ls-display: 0.02em;
  --lh-h2: 1.45;
  --ls-h2: 0.02em;
  --lh-body: 1.9;
  --ls-body: 0.02em;
  --lh-quote: 1.7;
}

/* 俄语：西里尔字面略宽，收紧一点 */
:lang(ru) {
  --lh-display: 1.12;
  --ls-display: -0.008em;
  --lh-body: 1.62;
  --ls-body: 0;
}

html {
  font-family: var(--font-text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  color: var(--c-ink);
  background: var(--c-cream);
  font-size: 1rem;
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
}

:lang(zh) {
  text-autospace: normal;
  text-spacing-trim: trim-start;
}
:lang(en) {
  hyphens: auto;
}

/* 性能开关：中文正文改用系统字体，可省掉思源黑体的全部分片。
   <html lang="zh-CN" data-zh-body="system"> */
html[data-zh-body="system"]:lang(zh) {
  --font-text: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, sans-serif;
}

/* ==========================================================================
   标题
   ========================================================================== */

.display-1,
.display-2,
.display-3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  text-wrap: balance;
}

.display-1 {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}

.display-2 {
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  line-height: var(--lh-h2);
  letter-spacing: var(--ls-h2);
}

.display-3 {
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.006em;
}

:lang(zh) .display-1 {
  font-size: clamp(2.25rem, 4.8vw, 3.5rem);
}
:lang(zh) .display-2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}
:lang(zh) .display-3 {
  font-size: clamp(1.25rem, 1.7vw, 1.5rem);
  letter-spacing: 0.02em;
}
:lang(ru) .display-1 {
  font-size: clamp(2.5rem, 5.4vw, 4rem);
}

/* ==========================================================================
   文本
   ========================================================================== */

.lede {
  font-size: 1.125rem;
  line-height: calc(var(--lh-body) + 0.05);
  letter-spacing: var(--ls-body);
  max-width: 62ch;
}

.body {
  font-size: 1rem;
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  max-width: 62ch;
  text-wrap: pretty;
}

.body-sm {
  font-size: 0.875rem;
  line-height: calc(var(--lh-body) + 0.02);
  letter-spacing: var(--ls-body);
}

:lang(zh) .lede,
:lang(zh) .body {
  max-width: 34em;
}

/* 眉题 */
.eyebrow {
  font-family: var(--font-text);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-gold);
}

:lang(zh) .eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: none;
}

/* 引文 / 诗性短句 */
.quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: var(--lh-quote);
  letter-spacing: 0;
  text-wrap: balance;
}

:lang(zh) .quote {
  font-family: var(--font-kai);
  font-style: normal;
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  letter-spacing: 0.03em;
}

/* 数字、价格、参数 */
.stat {
  font-family: var(--font-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* ==========================================================================
   组件
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-text);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.875rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
}

:lang(zh) .btn {
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: none;
}

/* ==========================================================================
   表面
   ========================================================================== */

[data-surface="dark"] {
  background: var(--c-forest);
  color: var(--c-cream);
}

[data-surface="dark"] .body,
[data-surface="dark"] .lede,
[data-surface="dark"] .body-sm {
  color: color-mix(in srgb, var(--c-cream) 78%, transparent);
}

[data-surface="dark"] .eyebrow {
  color: var(--c-gold);
}

/* 深底上衬线细笔画会发虚，统一加半档到一档 */
[data-surface="dark"] .display-1,
[data-surface="dark"] .display-2,
[data-surface="dark"] .display-3 {
  font-weight: 500;
}

/* ==========================================================================
   中文特例
   ========================================================================== */

/* 中文没有真斜体，杜绝伪斜体 */
:lang(zh) i,
:lang(zh) em,
:lang(zh) .italic,
:lang(zh) cite {
  font-style: normal;
  font-weight: 500;
}

/* 中文强调用颜色与字重，而不是斜体 */
:lang(zh) strong {
  font-weight: 500;
  color: var(--c-forest-2);
}

/* 中文标题不吃负字距 */
:lang(zh) h1,
:lang(zh) h2,
:lang(zh) h3,
:lang(zh) h4 {
  letter-spacing: 0.02em;
}

/* 中英混排时，行内英文不要继承中文的宽字距 */
:lang(zh) [lang="en"],
:lang(zh) [lang="ru"] {
  letter-spacing: 0.004em;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
