/* ==========================================================================
   base.css
   基础排版、容器、区块标题与通用工具类。
   控制区域：全站字体、行高、容器宽度、.reveal 渐显初始状态。
   修改注意：这里不放具体模块布局；容器宽度变量在 variables.css。
   ========================================================================== */

html {
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--warm);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: clip;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

img,
svg {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
}

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

button {
  font: inherit;
}

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

::selection {
  background: var(--brand-400);
  color: var(--brand-950);
}

.container {
  width: min(calc(100% - 48px), var(--container));
  margin-inline: auto;
}

.section {
  padding: var(--section-y) 0;
}

.section--compact {
  padding: var(--section-y-sm) 0;
}

.section-head {
  max-width: 760px;
}

.section-head h2 {
  margin-top: 10px;
  font-size: clamp(30px, 3vw, 42px);
}

.section-head p {
  margin-top: 16px;
  max-width: 640px;
  color: var(--muted);
  font-size: 16px;
}

.section-head--light h2,
.section-head--light h3 {
  color: #fff;
}

.section-head--light p {
  color: rgba(255, 255, 255, 0.66);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-700);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 22px;
  height: 1px;
  background: currentColor;
  content: "";
}

.section-head--light .eyebrow {
  color: var(--brand-400);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 3px;
  color: var(--brand-800);
  font-size: 14px;
  font-weight: 700;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.text-link span {
  transition: transform 0.25s var(--ease);
}

.text-link:hover {
  border-color: var(--brand-700);
  color: var(--brand-700);
}

.text-link:hover span {
  transform: translateX(3px);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: var(--brand-900);
  color: #fff;
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  white-space: nowrap;
}

/* 轻量渐显：无 JS 时保持可见，避免内容被隐藏 */
.reveal {
  opacity: 1;
  transform: none;
}

.motion .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.motion .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .motion .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
