/* ============================================================
   基础层：重置、氛围、排版、可达性
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background: var(--ink);
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- 氛围层：双径向渐变 + 极淡的观测网格 ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(52rem 38rem at 8% -8%, rgba(216, 255, 62, 0.09), transparent 62%),
    radial-gradient(46rem 34rem at 102% 4%, rgba(125, 211, 252, 0.1), transparent 58%),
    radial-gradient(40rem 40rem at 50% 108%, rgba(120, 96, 255, 0.08), transparent 62%);
}

/* 极细网格，像仪器的坐标底片 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 30%, #000 35%, transparent 78%);
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--acid);
  text-decoration: none;
}

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

/* ---- 焦点：键盘可见，鼠标不打扰 ---- */
:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 关键：组件自己声明了 display，[hidden] 会被覆盖，这里强制生效 */
[hidden] {
  display: none !important;
}

/* ---- 屏幕阅读器专用 ---- */
.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;
}

/* ---- 等宽小标签，全站统一的「仪器语气」 ---- */
.mono {
  font-family: var(--f-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- 入场序列：3–6 组，60–120ms 错峰 ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
}
.reveal.in {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
}
.reveal[data-delay="1"].in { transition-delay: 80ms; }
.reveal[data-delay="2"].in { transition-delay: 160ms; }
.reveal[data-delay="3"].in { transition-delay: 240ms; }
.reveal[data-delay="4"].in { transition-delay: 320ms; }
.reveal[data-delay="5"].in { transition-delay: 400ms; }

/* ---- 降级：尊重系统的减少动效设置 ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  /* 星盘与跑马灯直接停住，而不是瞬间跳到终点 */
  .disc__ring,
  .ticker__track,
  .wave i {
    animation: none !important;
    transform: none !important;
  }
}
