/* ============================================================
   松風 SONGFENG — Design Tokens
   奶油绿 + 蜜桃点缀 / Light · Dark · System
   单一事实来源：所有页面与动效模块的变量只读这里。
   ============================================================ */

:root {
  /* ---------- 字体 ----------
     英文界面：显示体用衬线（Georgia/SI 下品质感），正文用系统无衬线。
     中文族保留在栈尾，混排时不会掉字形。
     显示体用 Lora：它是仓库里唯一实际加载的衬线字体（assets/fonts/Lora-*.woff），
     首页 home.css 用的也是它。此前这里写的是 Cormorant Garamond / Playfair
     Display，两者都没有随站发布，内页标题因此一直回落到 Georgia，和首页不是
     同一套字体。栈序与 home.css 的 --serif 保持一致。 */
  --font-display: "Lora", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC",
    "STSong", "SimSun", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Courier New",
    monospace;

  /* ---------- 流式字号 ---------- */
  --step--2: clamp(0.7rem, 0.68rem + 0.08vw, 0.76rem);
  --step--1: clamp(0.8rem, 0.77rem + 0.12vw, 0.88rem);
  --step-0: clamp(0.96rem, 0.92rem + 0.16vw, 1.05rem);
  --step-1: clamp(1.14rem, 1.03rem + 0.44vw, 1.38rem);
  --step-2: clamp(1.42rem, 1.2rem + 0.86vw, 1.88rem);
  --step-3: clamp(1.8rem, 1.38rem + 1.7vw, 2.6rem);
  --step-4: clamp(2.2rem, 1.55rem + 2.7vw, 3.7rem);
  --step-5: clamp(2.7rem, 1.7rem + 4.4vw, 5.4rem);

  --tracking-wide: 0.16em;
  --tracking-mega: 0.3em;

  /* ---------- 品牌色板（固定，不随主题变） ---------- */
  /* 奶油绿主色阶 —— 由浅至深的抹茶叶脉 */
  --cream-50: #fdfaf3;
  --cream-100: #f9f3e6;
  --cream-200: #f2e9d6;
  --matcha-100: #e9f2dd;
  --matcha-200: #d3e5bc;
  --matcha-300: #b6d399;
  --matcha-400: #95be75;
  --matcha-500: #76a558;
  --matcha-600: #5c8540;
  --matcha-700: #43642f;
  --matcha-800: #2f4a22;
  --matcha-900: #1e3218;

  /* 蜜桃点缀 —— 只用于强调、徽章与交互高亮 */
  --peach-100: #fdeee4;
  --peach-200: #fbdcc9;
  --peach-300: #f7c3a5;
  --peach-400: #f2a67f;
  --peach-500: #e98a5c;
  --peach-600: #d9713f;

  --ink-900: #1c2b16;
  --jade-deep: #24401f;
  --gold: #d9b25c;
  --gold-soft: #ecd393;

  /* ---------- 浅色主题（默认） ---------- */
  --bg: #fdfaf3;
  --bg-alt: #f7f1e4;
  --bg-elev: #ffffff;
  --bg-tint: #f3f8ea;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-solid: #ffffff;
  --surface-mint: #f4f9ee;
  --surface-peach: #fdf1e8;
  --border: rgba(28, 43, 22, 0.1);
  --border-strong: rgba(28, 43, 22, 0.2);
  --border-mint: rgba(92, 133, 64, 0.24);
  --border-peach: rgba(233, 138, 92, 0.32);
  --text: #1b2a15;
  --text-muted: #5a6653;
  /* 4.84:1 on --bg（原 #7d8876 只有 3.56:1，正文尺寸达不到 WCAG AA 的 4.5）。 */
  --text-soft: #68725f;
  --text-invert: #fdfaf3;
  /* 5.25:1 on --bg：强调色同时用作正文文字和按钮底色，旧值 #5c8540 只有 4.12:1，
     白字压在它上面同样不足。 */
  --accent: #4f7336;
  --accent-hover: #3d5a28;
  --accent-soft: #76a558;
  --highlight: #e98a5c;
  /* 桃色只能当装饰：它在浅底上只有 2.44:1。需要作为文字时用这个深的。 */
  --highlight-ink: #9d4a26;
  --highlight-soft: #f7c3a5;
  --shadow-sm: 0 2px 10px rgba(40, 60, 30, 0.05);
  --shadow-md: 0 16px 42px -20px rgba(45, 70, 35, 0.24);
  --shadow-lg: 0 44px 84px -42px rgba(40, 65, 30, 0.34);
  --shadow-peach: 0 14px 34px -18px rgba(233, 138, 92, 0.5);
  --glass: rgba(253, 250, 243, 0.72);
  --hero-glow: radial-gradient(120% 92% at 72% 18%, rgba(182, 211, 153, 0.42), transparent 62%),
    radial-gradient(80% 60% at 18% 78%, rgba(247, 195, 165, 0.34), transparent 64%);
  --grain-opacity: 0.03;
  --ring: rgba(92, 133, 64, 0.34);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0f1510;
  --bg-alt: #151d16;
  --bg-elev: #18211a;
  --bg-tint: #16211a;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-solid: #17201a;
  --surface-mint: #1a2519;
  --surface-peach: #241a14;
  --border: rgba(233, 242, 221, 0.12);
  --border-strong: rgba(233, 242, 221, 0.24);
  --border-mint: rgba(182, 211, 153, 0.26);
  --border-peach: rgba(247, 195, 165, 0.3);
  --text: #edf2e6;
  --text-muted: #a2ae98;
  --text-soft: #85917d;
  --text-invert: #0f1510;
  --accent: #b6d399;
  --accent-hover: #cde5b4;
  --accent-soft: #95be75;
  --highlight: #f2a67f;
  /* 深色底上桃色本来就能读，这个变量只是让两条主题走同一套引用。 */
  --highlight-ink: #f2a67f;
  --highlight-soft: #d9713f;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 18px 44px -20px rgba(0, 0, 0, 0.78);
  --shadow-lg: 0 50px 92px -50px rgba(0, 0, 0, 0.9);
  --shadow-peach: 0 14px 34px -18px rgba(233, 138, 92, 0.36);
  --glass: rgba(21, 29, 22, 0.74);
  --hero-glow: radial-gradient(120% 92% at 72% 18%, rgba(118, 165, 88, 0.26), transparent 64%),
    radial-gradient(80% 60% at 18% 78%, rgba(217, 113, 63, 0.2), transparent 66%);
  --grain-opacity: 0.055;
  --ring: rgba(182, 211, 153, 0.4);
  color-scheme: dark;
}

/* ---------- 间距 / 布局 ---------- */
:root {
  --shell: 1240px;
  --shell-narrow: 880px;
  --gutter: clamp(1.15rem, 4vw, 3.75rem);
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 30px;
  --radius-xl: 44px;
  --radius-pill: 999px;
  --section-y: clamp(4rem, 8.5vw, 8.5rem);
  /* Inner-page nav. Same shape as the home page's floating pill: 44px of
     logo + 8px padding top and bottom + 1px border = 62px, sitting 16px
     down from the top edge. --nav-space is the room the pill occupies in
     total, which is what page padding and anchor offsets have to clear. */
  --nav-h: 62px;
  --nav-top: 16px;
  --nav-space: calc(var(--nav-h) + var(--nav-top));
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur: 0.45s;
}
