/* ============================================================================
   base.css — 重置 / 字体 / 全局排版 / 基础元素
   ========================================================================= */

@font-face {
  font-family: "Space Grotesk Variable";
  src: url("../assets/fonts/space-grotesk-latin-wght-normal.woff2")
    format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter Variable";
  src: url("../assets/fonts/inter-latin-wght-normal.woff2")
    format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* 中文：阿里巴巴普惠体 3.0（免费商用）
   —— 只覆盖中文；拉丁字母仍走 Space Grotesk / Inter（在字体栈里排前面） */
@font-face {
  font-family: "Alibaba PuHuiTi 3";
  src: url("../assets/fonts/alibaba-puhuiti-3-55-regular.woff2")
    format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Alibaba PuHuiTi 3";
  src: url("../assets/fonts/alibaba-puhuiti-3-65-medium.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

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

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--c-void);
  color: var(--t-1);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* 注意：这里必须用 clip 而不是 hidden。
     overflow-x:hidden 会让 body 变成滚动容器，导致 position:sticky 失效，
     首页 hero 的固定舞台会跟着文档一起滚走。 */
  overflow-x: clip;
  min-height: 100%;
}

/* Lenis 接管滚动时的容器约束 */
html.lenis,
html.lenis body {
  height: auto;
}

/* 锁滚动时把 overflow 加在根元素上。
   注意：不能加在 body —— body 一旦成为滚动容器，首页 hero 的
   position:sticky 舞台会改挂到 body 的滚动口上，打开详情浮层时
   整个舞台直接错位消失（背景看上去「全黑」）。 */
html.is-locked {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

::selection {
  background: rgba(0, 168, 216, 0.32);
  color: #fff;
}

:focus-visible {
  outline: 1px solid var(--c-brand-lift);
  outline-offset: 3px;
}

/* --------------------------------------------------------------- 滚动条 */
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ------------------------------------------------------- 排版工具类 */
.display {
  font-family: var(--f-display);
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  font-weight: 400;
}

.h1 {
  font-family: var(--f-display);
  font-size: var(--fs-h1);
  line-height: 1.06;
  letter-spacing: var(--ls-h);
  font-weight: 400;
}

.h2 {
  font-family: var(--f-display);
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-h);
  font-weight: 400;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.62;
  color: var(--t-2);
  max-width: var(--measure);
}

.body {
  color: var(--t-2);
  max-width: var(--measure);
}

.label {
  font-family: var(--f-mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--t-3);
  font-weight: 400;
}

.mono {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
}

.dim {
  color: var(--t-3);
}

.brand {
  color: var(--c-brand-lift);
}

.amber {
  color: var(--c-amber);
}

/* --------------------------------------------------------------- 布局壳 */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(96px, 14vh, 200px);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-4) var(--sp-7);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--line-2);
  margin-bottom: var(--sp-8);
}

.hairline {
  height: 1px;
  background: var(--line-2);
  border: 0;
}

/* -------------------------------------------------- 电影感颗粒 / 暗角 */
.grain,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-nav);
}

.grain {
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

.vignette {
  z-index: calc(var(--z-nav) - 1);
  background: radial-gradient(
    120% 90% at 50% 45%,
    transparent 42%,
    rgba(0, 0, 0, 0.42) 100%
  );
  opacity: 0.9;
}

/* --------------------------------------------------------- 无障碍隐藏 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------- 进入视口显现
   V2.0：不只是淡入 —— 从「更远、更虚」的空间位置进入，
   模糊 / 位移 / 缩放 / 透明度同时收敛，形成空间纵深。 */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 30px, 0) scale(0.985);
  filter: blur(12px);
  transition: opacity var(--d-3) var(--e-out), transform var(--d-4) var(--e-out),
    filter var(--d-3) var(--e-out);
  transition-delay: var(--reveal-delay, 0s);
}

/* will-change 只在动画期间保留，落位后释放，避免长期占用合成层 */
[data-reveal]:not(.is-settled) {
  will-change: opacity, transform, filter;
}

[data-reveal].is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

/* 动画结束后移除 filter：filter 会建立 backdrop root，
   会让内部玻璃的 backdrop-filter 采样错误的背景 */
[data-reveal].is-settled {
  filter: none;
}

/* 内含玻璃元素的容器不做模糊（否则玻璃的折射在过渡期间失效） */
[data-reveal].reveal--no-blur {
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
