/* ════════════════════════════════════════════════════════════
   base.css — 重置 / 排版 / 通用工具类
   ════════════════════════════════════════════════════════════ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-feature-settings: "rlig" 1, "calt" 1;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }

::selection { background: hsl(40 30% 85%); color: var(--fg-strong); }

/* ── 排版 ────────────────────────────────────────────── */
h1, h2, h3, h4 {
  letter-spacing: -0.025em;
  font-weight: 600;
  line-height: 1.15;
  color: var(--fg);
}
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); line-height: 1.2; }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-md); }

p { line-height: 1.6; }

code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }

/* ── 工具类 ──────────────────────────────────────────── */
.wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
.muted { color: var(--fg-muted); }
.dim   { color: var(--fg-dim); }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }
.lead {
  font-size: var(--fs-lg);
  color: var(--fg-muted);
  max-width: 640px;
  line-height: 1.55;
}
.lead.center { margin-left: auto; margin-right: auto; }
.lead.hero-lead {
  font-size: var(--fs-2xl);
  font-weight: 300;
  color: var(--fg);
  line-height: 1.3;
  margin-top: 36px;
  margin-bottom: 36px;
  letter-spacing: -0.01em;
}

/* ── 内容层（z-index 在背景画布之上） ───────────────── */
.layer { position: relative; z-index: 1; }

/* ── 背景画布 ────────────────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

/* ── 进入动画 ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ── reduced-motion 适配 ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
