/* =============================================================
   Base — reset, document rhythm, typography primitives
   ============================================================= */

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

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

body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

:lang(zh) { font-family: var(--text), var(--cjk); line-height: 1.78; }

img,
video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 400;
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }

a:hover { text-decoration-color: var(--indigo); }

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

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

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection { background: var(--indigo); color: #fff; }

/* ---- Type primitives ------------------------------------ */

.display {
  font-family: var(--display);
  font-optical-sizing: auto;
  line-height: var(--lh-title);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0;
  font-size: var(--fs-kicker);
  font-weight: 600;
  letter-spacing: var(--track-kicker);
  text-transform: uppercase;
  color: var(--ink-3);
}

.kicker::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  flex: 0 0 auto;
}

.kicker--bare::before { display: none; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

.rule { height: 1px; border: 0; margin: 0; background: var(--rule); }

/* Accessibility helpers */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-small);
  font-weight: 600;
  border-radius: 0 0 var(--r-md) var(--r-md);
  transition: top var(--dur-fast) var(--ease);
}

.skip-link:focus { top: 0; }

/* ---- Scroll reveal (progressive; no JS = fully visible) --- */

[data-reveal] {
  opacity: 1;
  transform: none;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
