/* ============================================================
   base.css — 设计令牌 / 重置 / 排版基座
   ============================================================ */

:root {
  /* 纸墨 */
  --paper:   #F2F1EC;
  --paper-2: #EAE8E1;
  --ink:     #0E0E0C;
  --ink-70:  rgba(14, 14, 12, .70);
  --muted:   #77746B;
  --line:    #DCD9D0;
  --panel:   #FFFFFF;
  --shadow:  0 30px 70px -40px rgba(0, 0, 0, .45);

  /* 信号色 — 全站克制使用 */
  --signal:  #FF3B14;

  /* 尺度 */
  --gutter:  clamp(18px, 4.2vw, 74px);
  --gap:     clamp(10px, 1.1vw, 20px);
  --topbar-h: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --page-left: max(var(--gutter), var(--safe-left));
  --page-right: max(var(--gutter), var(--safe-right));
  --chrome-h: calc(var(--topbar-h) + var(--safe-top));

  /* 缓动 */
  --e-out:  cubic-bezier(.22, 1, .36, 1);
  --e-soft: cubic-bezier(.4, 0, .2, 1);

  color-scheme: light;
}

[data-theme="dark"] {
  --paper:   #0B0B0C;
  --paper-2: #121214;
  --ink:     #F2F1EC;
  --ink-70:  rgba(242, 241, 236, .70);
  --muted:   #8C8981;
  --line:    #252528;
  --panel:   #141416;
  --shadow:  0 30px 70px -40px rgba(0, 0, 0, .9);
  --signal:  #FF4E28;
  color-scheme: dark;
}

/* ---------------------------------------------- 重置 */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(84px + var(--safe-top));
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", "Segoe UI", Roboto, Arial,
               "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.62;
  font-feature-settings: "kern" 1, "liga" 1, "tnum" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .5s var(--e-soft), color .5s var(--e-soft);
}

body.is-locked { overflow: hidden; }

h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, canvas, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

::selection { background: var(--signal); color: #fff; }

/* ---------------------------------------------- 排版基座 */

.display {
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: .84;
  text-transform: none;
}

.mono {
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Mono", "Consolas", monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

em { font-style: normal; }

/* 数字/标签统一小字 */
.tagline {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ---------------------------------------------- 揭示动画基元 */

.reveal {
  display: block;
  overflow: hidden;
  clip-path: inset(0 0 -18% 0);
}

.reveal > span {
  display: block;
  transform: translate3d(0, 105%, 0);
  transition: transform 1s var(--e-out);
  will-change: transform;
}

.is-in .reveal > span,
.reveal.is-in > span { transform: translate3d(0, 0, 0); }

.reveal:nth-child(2) > span { transition-delay: .07s; }
.reveal:nth-child(3) > span { transition-delay: .14s; }
.reveal:nth-child(4) > span { transition-delay: .21s; }

/* 通用入场 */
[data-anim] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity .8s var(--e-out), transform .8s var(--e-out);
  will-change: transform, opacity;
}

[data-anim].is-in {
  opacity: 1;
  transform: none;
}

[data-anim].is-in { will-change: auto; }

/* ---------------------------------------------- 无障碍 / 降级 */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal > span { transform: none !important; }
  [data-anim] { opacity: 1 !important; transform: none !important; }
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}
