/* =============================================================
 * base.css — reset / 排版 / 可访问性基础
 * ============================================================= */

/* ---- modern reset ---- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
picture { display: block; max-width: 100%; height: auto; }

/* 所有 .figure 真实图片统一等比完整显示，禁止裁切 */
.figure__img,
.figure--hasimg img {
  object-fit: contain;
  object-position: center;
}

a { color: inherit; text-decoration: none; }

button,
input,
textarea,
select { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: none; }

ul,
ol { list-style: none; }

h1, h2, h3, h4 {
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

p { color: var(--ink-2); }

/* ---- 焦点可见（可访问性）---- */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- 跳转链接（屏幕阅读器/键盘用户）---- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-sm);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---- 选区 ---- */
::selection {
  background: rgba(0, 102, 204, 0.18);
  color: var(--ink);
}

/* ---- 滚动揭示初始态（无 JS / 降级时直接可见）---- */
.js .reveal { opacity: 0; transform: translateY(22px); }
.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
/* 预览/截图模式：强制 reveal 元素一次性完全可见，避免无头截图截到过渡中间态 */
.preview .js .reveal,
.preview .js .reveal.is-in {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* ---- 尊重减少动效偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---- 通用容器与区块 ---- */
.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}
.container--narrow { width: min(100% - 40px, var(--container-narrow)); }

.section { padding-block: var(--section-y); }
.section--soft { background: var(--bg-soft); }
.section--dark { background: var(--bg-dark); color: var(--on-dark); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--brand);
  opacity: 0.6;
}

.lead { font-size: var(--fs-lead); color: var(--ink-2); max-width: 60ch; }

.h-xl { font-size: var(--fs-display); }
.h-1 { font-size: var(--fs-h1); }
.h-2 { font-size: var(--fs-h2); }

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.grad-text {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 深色段内的文字覆盖 */
.section--dark .eyebrow { color: var(--brand-2); }
.section--dark .eyebrow::before { background: var(--brand-2); }
.section--dark h1,
.section--dark h2,
.section--dark h3 { color: #fff; }
.section--dark p { color: var(--on-dark-2); }
