/* Tiansight 侍天 — foundation tokens.
   Source: the published guide (brand/guide.md), provenance in brand/source.json.
   Section 1 values are the published palette and are checked by scripts/check.py.
   Everything below "derived" is derived from the guide's stated rules; nothing here
   comes from the supplied export's proposal scales. */
:root {
  color-scheme: light;

  /* ── 1. Color / 色彩 — published palette ─────────────────── */
  --surface: #F4F0E7;       /* 淡墨纸 Pale Manuscript — base canvas */
  --paper: #FFFDF8;         /* 宣纸 Paper — raised content */
  --ink-primary: #EFE6D2;   /* 素墨 Ink — primary brand color: fields, key actions */
  --charcoal: #17130D;      /* 玄墨 Charcoal — titles, primary text */
  --gold: #76551F;          /* 土金 Earth Gold — rules, strokes, navigation */
  --gold-hi: #D4A862;       /* 明金 Bright Gold — active state, key numbers */
  --gold-deep: #76551F;     /* 深金 Deep Gold — captions, EN labels (same hex as --gold; kept as its own token, ruling Q3 v0.7) */
  --ink-muted: #706758;     /* 素墨灰 Ink Muted — secondary text */
  --seal: #8C3228;          /* 朱红 Vermillion — seal, negation, warnings, ≤ 5% */

  /* surfaces (derived, on pale manuscript) */
  --line: rgba(23, 19, 13, 0.18);          /* hairline */
  --line-strong: rgba(23, 19, 13, 0.34);   /* hairline-strong */
  --card-border: rgba(118, 85, 31, 0.34);
  --rule: var(--gold);                     /* structural rule, 1px */
  --watermark: rgba(118, 85, 31, 0.10);    /* compass ring behind heroes */
  --scrim: rgba(23, 19, 13, 0.55);
  --focus: rgba(118, 85, 31, 0.5);

  /* text roles */
  --text: var(--charcoal);
  --text-muted: var(--ink-muted);
  --text-caption: var(--gold-deep);
  --text-key: var(--gold-hi);              /* key numbers 28px+, active states — never body-size on pale */
  --text-tagline: var(--gold-deep);        /* 智慧领航者 at every size (ruling Q2 v0.7) */
  --text-on-charcoal: var(--surface);
  --text-on-charcoal-key: var(--gold-hi);

  /* inverse surface — one card per view (百年共创 tier); never a page ground (v0.7) */
  --surface-inverse: var(--charcoal);
  --text-on-inverse: var(--surface);
  --muted-on-inverse: rgba(244, 240, 231, 0.72);
  --line-inverse: rgba(244, 240, 231, 0.22);

  /* gold ramp — hover one step darker, press two (v0.7) */
  --gold-100: #F3E7CF;
  --gold-300: #D4A862;
  --gold-400: #A8842F;
  --gold-500: #76551F;
  --gold-600: #5C4218;
  --gold-700: #3F2D0F;
  --gold-hover: var(--gold-600);
  --gold-press: var(--gold-700);

  /* shadow — dialogs and overlays only; cards stay bordered (v0.7) */
  --shadow-1: 0 1px 2px rgba(23, 19, 13, 0.08);
  --shadow-2: 0 2px 6px rgba(23, 19, 13, 0.10);
  --shadow-3: 0 6px 18px rgba(23, 19, 13, 0.12);
  --shadow-4: 0 14px 40px rgba(23, 19, 13, 0.16);

  /* state */
  --positive: var(--gold-hi);              /* ✓ */
  --negative: var(--seal);                 /* ✕, warnings */

  /* charts (guide §5): 1 series = gold-hi; 2 = + charcoal; 3 = + seal */
  --chart-1: var(--gold-hi);
  --chart-2: var(--charcoal);
  --chart-3: var(--seal);
  --chart-axis: var(--ink-muted);
  --chart-grid: var(--line);
  --chart-benchmark: rgba(112, 103, 88, 0.45);
  /* semantic set — report/ only, when 增长 must be told from 关注 (v0.7) */
  --chart-growth: #4E6B3F;
  --chart-caution: #B98B2A;
  --chart-benchmark-solid: #6E6355;
  --chart-loss: var(--seal);

  /* ── 2. Typography / 字体 ─────────────────────────────────── */
  --font-cn: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --font-en: "Noto Serif", "Source Han Serif", "Songti SC", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --weight-aux: 300;
  --weight-body: 400;
  --weight-medium: 500;
  --weight-title: 600;
  --weight-strong: 700;

  --text-display: clamp(3rem, 8vw, 6rem);  /* 48–96px, 侍天 lockup */
  --text-h1: clamp(2.25rem, 5vw, 3.5rem);  /* 36–56px */
  --text-h2: clamp(1.75rem, 3.5vw, 2.5rem);/* 28–40px */
  --text-h3: 1.75rem;                      /* 28px */
  --text-body: 1.125rem;                   /* 18px */
  --text-small: 0.875rem;                  /* 14px */
  --text-caption: 0.8125rem;               /* 13px */
  --text-mono: 0.8125rem;                  /* 13px */
  --type-ui: 1rem;                         /* 16px forms, buttons (v0.7) */
  --type-table: 0.875rem;                  /* 14px table body */
  --type-badge: 0.75rem;                   /* 12px badges */
  --type-tick: 0.6875rem;                  /* 11px chart ticks */

  --leading-display: 1;
  --leading-h1: 1.1;
  --leading-h2: 1.15;
  --leading-h3: 1.3;
  --leading-body: 1.7;
  --leading-small: 1.8;
  --leading-caption: 1.4;
  --leading-mono: 1.5;

  --tracking-display: 0.14em;
  --tracking-caps: 0.34em;
  --tracking-caps-tight: 0.3em;
  --tracking-tagline: 0.5em;

  --measure-cn: 36em;   /* 28–38 CN chars per line */
  --measure-en: 66ch;   /* 60–72 EN chars per line */

  /* ── 7. Layout / 版式 ─────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 96px;

  --container: 1280px;
  --columns: 12;
  --gutter: 48px;
  --section-gap: 96px;
  --card-pad: 24px;             /* 20–28px card, 24–32px inner */
  --card-pad-lg: 32px;

  --radius: 2px;                /* never round */
  --radius-pill: 999px;         /* outline status badge only */

  --swatch: 32px;               /* token row swatch 30–34px */

  /* mark */
  --mark-min-inline: 24px;
  --mark-min-hero: 64px;

  /* motion — quiet, short, no bounce */
  --dur-fast: 120ms;
  --dur-base: 220ms;
  --dur-reveal: 700ms;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --z-sticky: 100;
  --z-overlay: 400;
  --z-modal: 500;
}
@media (max-width: 640px) {
  :root {
    --gutter: 24px;
    --section-gap: 64px;
    --card-pad: 20px;
    --card-pad-lg: 24px;
  }
}
