/* base.css — reset + typography + 全小写规则 */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  color: var(--color-ink);
  background: var(--color-cream);
  text-transform: lowercase;
  font-feature-settings: "ss01", "kern";
}

.preserve-case,
blockquote .preserve-case,
code,
pre,
.code-block,
[data-preserve-case] {
  text-transform: none !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-hero); font-weight: 900; }
h2 { font-size: var(--fs-section); }
h3 { font-size: var(--fs-subsection); font-weight: 600; }

p { color: var(--color-ink-70); }

a {
  color: var(--color-maroon);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--color-maroon-deep); }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

section {
  padding: var(--space-24) 0;
  border-top: 1px solid rgba(26, 26, 26, 0.06);
}

section:first-of-type { border-top: none; }

.section-kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--color-ink-50);
  letter-spacing: 0.08em;
  margin: 0 auto var(--space-3);
  text-align: center;
}

.section-title {
  margin: 0 auto var(--space-4);
  text-align: center;
}

.section-intro {
  max-width: 60ch;
  margin: 0 auto var(--space-12);
  color: var(--color-ink-70);
  text-align: center;
}

/* Chinese reading aid — sits tight under English titles/intros */
.lang-aid {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  color: var(--color-ink-50);
  text-align: center;
  line-height: var(--lh-normal);
  letter-spacing: 0.04em;
  margin: calc(-1 * var(--space-3)) auto var(--space-6);
  max-width: 60ch;
}
.lang-aid + .section-intro { margin-top: var(--space-3); }

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

/* ===== Mobile nav responsive ===== */
@media (max-width: 767px) {
  /* Stack brand + links vertically so links don't fight for horizontal space.
     Previously the flex-row layout caused brand to wrap + links to spill into
     3 rows consuming ~162px before any page content appeared. */
  .nav-inner {
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }
  /* Center links and tighten gaps to keep wrapping to 2 rows max */
  .nav-links {
    justify-content: center;
    gap: var(--space-2) var(--space-4);
    font-size: 0.8125rem; /* 13px — slightly below --fs-small (14px) */
  }
}
