/* ==========================================================
   base.css — 设计变量、字体、重置、全局导航、通用组件
   字体方案：中文 思源宋体（Noto Serif SC）/ 局部手写体（Ma Shan Zheng）
            英文 Times New Roman（Tinos 作为同度量备选）
            代码 SF Mono
   配色：Apple 紫 + Claude 暖色（#f5f3ee / #1d1b16 / #da7756）
   ========================================================== */

:root {
  --surface: #f5f3ee;
  --surface-2: #ece8df;
  --paper: #fbfaf7;
  --ink: #1d1b16;
  --ink-2: #4a463d;
  --ink-3: #8a857a;
  --line: rgba(29, 27, 22, 0.12);

  --purple-1: #f1eaff;
  --purple-2: #c9b4ff;
  --purple-3: #9b7bf0;
  --purple-4: #6e4bd8;
  --purple-5: #4a2fa3;
  --purple-6: #241451;
  --accent: #da7756;
  --accent-2: #cc7d5e;
  --night: #0b0812;

  --grad-purple: linear-gradient(120deg, #b79cff 0%, #7e57e8 38%, #5b3cc4 62%, #da7756 100%);
  --grad-text: linear-gradient(90deg, #6e4bd8, #9b7bf0 40%, #da7756 80%, #6e4bd8);

  --font-serif: "Times New Roman", Tinos, "Noto Serif SC", "Source Han Serif SC", "Source Han Serif SC VF", "Songti SC", "STSong", "SimSun", serif;
  --font-hand: "Ma Shan Zheng", "Long Cang", "Kaiti SC", "STKaiti", "KaiTi", cursive;
  --font-mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;

  --ease-apple: cubic-bezier(0.28, 0.11, 0.32, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --gutter: clamp(24px, 6vw, 88px);
  --maxw: 1180px;
  --radius-l: 28px;
  --radius-m: 18px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
::selection { background: var(--purple-2); color: var(--ink); }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.hand { font-family: var(--font-hand); letter-spacing: 0.04em; }
.mono { font-family: var(--font-mono); }

/* ---------- 滚动进度条 ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200;
  transform-origin: 0 50%; transform: scaleX(0);
  background: var(--grad-purple);
}

/* ---------- 全局导航（Apple 式毛玻璃） ---------- */
.gnav {
  position: fixed; inset: 0 0 auto 0; height: 48px; z-index: 100;
  background: rgba(245, 243, 238, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease-apple), border-color 0.5s var(--ease-apple), color 0.5s;
}
.gnav.is-dark { background: rgba(11, 8, 18, 0.62); color: #f5f3ee; }
.gnav.is-scrolled { border-bottom-color: var(--line); }
.gnav.is-dark.is-scrolled { border-bottom-color: rgba(255, 255, 255, 0.08); }
.gnav__inner {
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.gnav__brand {
  font-size: 19px; font-weight: 600; letter-spacing: 0.01em;
  display: inline-flex; align-items: center; gap: 10px;
}
.gnav__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--grad-purple); box-shadow: 0 0 12px rgba(126, 87, 232, 0.8);
  animation: dotPulse 2.6s ease-in-out infinite;
}
@keyframes dotPulse { 50% { transform: scale(1.5); opacity: 0.6; } }
.gnav__links { display: flex; gap: clamp(14px, 2.4vw, 34px); font-size: 14px; }
.gnav__links a { opacity: 0.78; transition: opacity 0.3s; position: relative; }
.gnav__links a:hover, .gnav__links a.is-active { opacity: 1; }
.gnav__links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1.5px;
  background: var(--grad-purple); border-radius: 2px;
}

/* ---------- Apple 式本地导航（滚动后吸顶） ---------- */
.lnav {
  position: sticky; top: 48px; z-index: 90; height: 56px;
  background: rgba(251, 250, 247, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.lnav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.lnav__title { font-size: 21px; font-weight: 600; white-space: nowrap; }
.lnav__menu { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); font-size: 13px; overflow-x: auto; scrollbar-width: none; }
.lnav__menu::-webkit-scrollbar { display: none; }
.lnav__menu a { color: var(--ink-2); white-space: nowrap; transition: color 0.3s; }
.lnav__menu a:hover, .lnav__menu a.is-active { color: var(--purple-4); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 15px; border-radius: 999px; font-size: 13px; line-height: 1.4;
  background: var(--purple-4); color: #fff !important; white-space: nowrap;
  transition: background 0.3s, transform 0.3s var(--ease-spring);
}
.pill:hover { background: var(--purple-5); transform: scale(1.04); }

/* ---------- 通用：入场显现 ---------- */
.reveal {
  opacity: 0; transform: translateY(46px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal--scale { transform: scale(0.92) translateY(30px); }
.reveal--blur { filter: blur(14px); transition-property: opacity, transform, filter; }
.reveal--blur.is-in { filter: none; }

/* 按字拆分的标题 */
.split .ch {
  display: inline-block; opacity: 0; transform: translateY(0.6em) rotate(6deg);
  filter: blur(6px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out), filter 0.9s var(--ease-out);
  transition-delay: calc(var(--i) * 38ms + var(--d, 0s));
}
.split.is-in .ch { opacity: 1; transform: none; filter: none; }

/* 区块标题 */
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--purple-4); display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before {
  content: ""; width: 28px; height: 1px; background: currentColor;
  transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease-out) 0.2s;
}
.is-in .eyebrow::before, .eyebrow.is-in::before { transform: scaleX(1); }

.section-title {
  font-size: clamp(40px, 6.4vw, 88px); line-height: 1.12; font-weight: 600;
  letter-spacing: -0.01em; margin: 18px 0 0;
}

/* 渐变流动文字 */
.grad-text {
  background: var(--grad-text); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradFlow 8s linear infinite;
}
@keyframes gradFlow { to { background-position: 300% 0; } }

/* ---------- 页脚 ---------- */
.footer {
  padding: 56px 0 120px; font-size: 13px; color: var(--ink-3);
  border-top: 1px solid var(--line); text-align: center; letter-spacing: 0.06em;
}
.footer--dark { background: var(--night); color: rgba(245, 243, 238, 0.5); border-top-color: rgba(255,255,255,0.08); }

/* ---------- 自定义光标光晕 ---------- */
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 420px; height: 420px; margin: -210px 0 0 -210px;
  border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(circle, rgba(155, 123, 240, 0.16), rgba(155, 123, 240, 0) 65%);
  transition: opacity 0.4s; mix-blend-mode: multiply;
}
.is-dark-zone .cursor-glow { mix-blend-mode: screen; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .gnav__links { gap: 14px; font-size: 13px; }
  .lnav__menu { display: none; }
  .cursor-glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  .reveal, .split .ch { opacity: 1 !important; transform: none !important; filter: none !important; }
}
