/* base.css — 现代站点基线（Web Studio）
   用法：复制到 assets/css/base.css，先改 :root 的颜色/字体/圆角，再写 site.css。
   约定：只放重置、token、排版、容器、按钮、卡片、入场动效这些跨项目复用的东西。 */

:root {
  color-scheme: light;

  /* 片场编辑感：暖纸、墨黑、信号橙。 */
  --bg: #f2eee5;
  --surface: #faf7f0;
  --surface-2: #e7e1d4;
  --text: #15140f;
  --muted: #686255;
  --line: rgb(21 20 15 / 0.16);
  --line-strong: rgb(21 20 15 / 0.32);
  --brand: #ff4d1f;
  --brand-2: #c93b14;
  --brand-text: #b5330e;
  --brand-ink: #1b0a04;
  --brand-soft: color-mix(in oklab, var(--brand) 12%, var(--bg));
  --lime: #d8f25b;
  --teal: #144a45;
  --ink: #15140f;
  --paper: #f2eee5;
  --deep: #15140f;
  --deep-2: #201d16;
  --deep-text: #f4efe4;
  --deep-muted: #b8b0a0;
  --deep-line: rgb(244 239 228 / 0.16);

  /* 字体：系统栈优先，Latin 用本机 Bahnschrift 做技术感。 */
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bahnschrift", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* 流体字阶 */
  --step--1: clamp(0.76rem, 0.73rem + 0.15vw, 0.84rem);
  --step-0: clamp(1rem, 0.97rem + 0.18vw, 1.06rem);
  --step-1: clamp(1.12rem, 1.05rem + 0.35vw, 1.3rem);
  --step-2: clamp(1.35rem, 1.2rem + 0.7vw, 1.8rem);
  --step-3: clamp(1.65rem, 1.35rem + 1.3vw, 2.55rem);
  --step-4: clamp(2.1rem, 1.55rem + 2.4vw, 3.9rem);
  --step-5: clamp(2.7rem, 1.7rem + 4.5vw, 6.6rem);

  /* 空间与形状 */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --container: 76rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgb(20 15 10 / 0.06);
  --shadow: 0 1px 2px rgb(20 15 10 / 0.05), 0 18px 44px -18px rgb(20 15 10 / 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-enter: 560ms;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11100d;
  --surface: #191813;
  --surface-2: #242118;
  --text: #f4efe4;
  --muted: #aaa392;
  --line: rgb(244 239 228 / 0.17);
  --line-strong: rgb(244 239 228 / 0.34);
  --brand: #ff6438;
  --brand-2: #e8491e;
  --brand-text: #ff8a62;
  --brand-ink: #1b0a04;
  --brand-soft: color-mix(in oklab, var(--brand) 18%, var(--bg));
  --lime: #d8f25b;
  --teal: #63b8aa;
  --ink: #f4efe4;
  --paper: #11100d;
  --deep: #0b0b09;
  --deep-2: #16150f;
  --deep-text: #f4efe4;
  --deep-muted: #b8b0a0;
  --deep-line: rgb(244 239 228 / 0.16);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.5);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.45), 0 18px 44px -18px rgb(0 0 0 / 0.8);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h1 { font-size: var(--step-5); letter-spacing: -0.055em; }
h2 { font-size: var(--step-3); line-height: 1.14; }
h3 { font-size: var(--step-2); letter-spacing: -0.025em; }
h4 { font-size: var(--step-1); letter-spacing: -0.015em; }

p { margin: 0 0 1em; max-width: 68ch; text-wrap: pretty; }

a {
  color: var(--brand-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in oklab, var(--brand-text) 45%, transparent);
  transition: color 160ms var(--ease), text-decoration-color 160ms var(--ease);
}
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--brand); color: var(--brand-ink); }

.container {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}

.section { padding-block: clamp(var(--space-12), 8vw, var(--space-24)); }

.stack > * + * { margin-top: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

.eyebrow {
  margin: 0 0 var(--space-3);
  font-size: var(--step--1);
  font-weight: 550;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 46ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.875rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 550;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: color-mix(in oklab, var(--brand) 88%, black); }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn--ghost:hover { border-color: color-mix(in oklab, var(--text) 30%, transparent); background: var(--surface); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in oklab, var(--text) 22%, transparent);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 4rem;
}
.nav a { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand); }

.reveal {
  opacity: 1;
  transform: none;
}
.reveal.in { animation: none; }


@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
