/* ============================================================
   容程序 IDE 官网 · 设计令牌与基础
   方向：暖墨纸感 × 终端编辑器
   展示字：霞鹜文楷 / 正文：思源黑体 / 代码：JetBrains Mono + 文楷
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=JetBrains+Mono:wght@400;700&display=swap");
@import url("https://cdn.jsdelivr.net/npm/lxgw-wenkai-webfont@1.7.0/style.css");

:root {
  /* 颜色 —— 暖墨 + 纸白 + 朱砂 */
  --color-bg: #17130e;
  --color-bg-deep: #100d09;
  --color-surface: #211b13;
  --color-surface-2: #2a2318;
  --color-text: #f3ecdc;
  --color-muted: #a3967e;
  --color-accent: #ff4d2e;        /* 朱砂 */
  --color-accent-dim: rgba(255, 77, 46, .14);
  --color-border: rgba(243, 236, 220, .13);
  --color-border-strong: rgba(243, 236, 220, .28);
  --color-gold: #d9a441;          /* 仅作点缀，用于徽记 */
  --color-ok: #7fb069;

  /* 代码高亮（容程序语法） */
  --code-keyword: #ff7a5c;
  --code-string: #d9a441;
  --code-number: #8fc7a2;
  --code-comment: #7d715c;
  --code-func: #e8c07a;
  --code-window: #c9a0ff;

  /* 字体 */
  --font-display: "LXGW WenKai", "Noto Sans SC", serif;
  --font-body: "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "LXGW WenKai", monospace;

  /* 字阶（1.25 比例） */
  --fs-xs: .78rem;
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.56rem;
  --fs-2xl: 1.95rem;
  --fs-3xl: 2.44rem;
  --fs-4xl: 3.05rem;
  --fs-hero: clamp(2.8rem, 6.4vw, 5.2rem);

  /* 间距 */
  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px;
  --space-5: 40px; --space-6: 64px; --space-7: 96px; --space-8: 128px;

  /* 圆角 / 阴影 / 动效 */
  --radius-sm: 6px; --radius-md: 12px; --radius-lg: 20px;
  --shadow-1: 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-2: 0 8px 28px rgba(0, 0, 0, .38);
  --shadow-3: 0 24px 64px rgba(0, 0, 0, .5);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur-fast: 160ms; --dur-base: 320ms; --dur-slow: 640ms;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.75;
  letter-spacing: .02em;
  overflow-x: hidden;
}
::selection { background: var(--color-accent); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 700; }
h2 {
  font-size: var(--fs-3xl);
  line-height: 1.15;
  letter-spacing: -.01em;
}
.muted { color: var(--color-muted); }
.wrap { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }

/* 氛围层：暖色渐变网格 + 颗粒 */
.atmosphere::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(58rem 40rem at 8% -12%, rgba(255, 77, 46, .16), transparent 60%),
    radial-gradient(46rem 34rem at 96% 4%, rgba(217, 164, 65, .10), transparent 55%),
    radial-gradient(40rem 30rem at 50% 110%, rgba(255, 77, 46, .07), transparent 60%);
}
.grain::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, header.site, footer.site { position: relative; z-index: 2; }

/* ---------- 入场编排 ---------- */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.reveal.d1.in { transition-delay: 80ms; }
.reveal.d2.in { transition-delay: 160ms; }
.reveal.d3.in { transition-delay: 240ms; }
.reveal.d4.in { transition-delay: 320ms; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
