/* ==========================================================================
   Base reset + typography defaults
   ========================================================================== */

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

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-zh);
  font-size: var(--fs-body-md);
  line-height: 1.7;
  color: var(--color-ink);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* === Typography utility classes === */
.t-display {
  font-family: var(--font-en);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.t-headline-lg {
  font-family: var(--font-zh);
  font-size: var(--fs-headline-lg);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.t-headline-md {
  font-family: var(--font-zh);
  font-size: var(--fs-headline-md);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}
.t-headline-sm {
  font-family: var(--font-zh);
  font-size: var(--fs-headline-sm);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.t-english-display {
  font-family: var(--font-en);
  font-size: var(--fs-english-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.t-english-label {
  font-family: var(--font-en);
  font-size: var(--fs-english-label);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.t-body-lg {
  font-family: var(--font-zh);
  font-size: var(--fs-body-lg);
  font-weight: 400;
  line-height: 1.7;
}
.t-body-md {
  font-family: var(--font-zh);
  font-size: var(--fs-body-md);
  font-weight: 400;
  line-height: 1.7;
}
.t-body-sm {
  font-family: var(--font-zh);
  font-size: var(--fs-body-sm);
  font-weight: 400;
  line-height: 1.6;
}
.t-label-md {
  font-family: var(--font-zh);
  font-size: var(--fs-label-md);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.t-label-sm {
  font-family: var(--font-zh);
  font-size: var(--fs-label-sm);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
}
.t-data-emphasis {
  font-family: var(--font-en);
  font-size: var(--fs-data-emphasis);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.t-caption {
  font-family: var(--font-zh);
  font-size: var(--fs-caption);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--color-ink-muted);
}

/* === Container === */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--gutter-mobile);
  padding-right: var(--gutter-mobile);
}

@media (min-width: 1025px) {
  .container {
    padding-left: var(--gutter-desktop);
    padding-right: var(--gutter-desktop);
  }
}

.content-narrow {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

/* === Section vertical rhythm === */
.section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}
@media (min-width: 1025px) {
  .section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
  }
}

.section-tight {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

/* === Backgrounds === */
.bg-alt { background: var(--color-surface-alt); }
.bg-brand-50 { background: var(--color-brand-50); }
.bg-brand-100 { background: var(--color-brand-100); }
.bg-brand-500 { background: var(--color-brand-500); color: var(--color-surface); }
.bg-brand-grad-light {
  background: linear-gradient(180deg, var(--color-brand-100) 0%, var(--color-surface) 100%);
}
.bg-brand-grad-soft {
  background: linear-gradient(180deg, var(--color-brand-50) 0%, var(--color-surface) 100%);
}

/* === Common utility === */
.text-center { text-align: center; }
.text-brand-300 { color: var(--color-brand-300); }
.text-brand-400 { color: var(--color-brand-400); }
.text-brand-500 { color: var(--color-brand-500); }
.text-ink-soft { color: var(--color-ink-soft); }
.text-ink-muted { color: var(--color-ink-muted); }
.text-white { color: var(--color-surface); }

.stack-xs > * + * { margin-top: var(--space-xs); }
.stack-sm > * + * { margin-top: var(--space-sm); }
.stack-md > * + * { margin-top: var(--space-md); }
.stack-lg > * + * { margin-top: var(--space-lg); }
.stack-xl > * + * { margin-top: var(--space-xl); }

/* === Selection === */
::selection {
  background: var(--color-brand-100);
  color: var(--color-brand-500);
}

/* === Focus ring === */
:focus-visible {
  outline: 2px solid var(--color-brand-300);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* === Reduce motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
