:root {
  /* Colour */
  --paper: #FBF7F0;
  --paper-dim: #F3ECDF;
  --ink: #2B2320;
  --ink-soft: #5B4F47;
  --brick: #8B4A3C;
  --brick-dark: #6E3A2F;
  --sage: #4A6B4D;
  --sage-dark: #3A5540;
  --kraft: #D4C5A9;
  --kraft-line: #C4B294;
  --gold: #B8923F;
  --card-bg: #FFFDF9;
  --error: #A6402E;
  --shadow-card: 0 1px 0 rgba(43, 35, 32, 0.06);

  /* Type */
  --font-display: 'Fraunces', 'Noto Serif SC', Georgia, serif;
  --font-body: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Scale */
  --step-h1: clamp(1.9rem, 1.5rem + 1.6vw, 2.75rem);
  --step-h2: clamp(1.4rem, 1.2rem + 0.8vw, 1.85rem);
  --step-h3: 1.15rem;
  --step-body: 1rem;
  --step-small: 0.875rem;
  --step-tiny: 0.75rem;

  /* Layout */
  --content-max: 1180px;
  --radius-card: 3px;
  --radius-pill: 999px;
  --border-hair: 1px solid var(--kraft-line);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}

h1 { font-size: var(--step-h1); }
h2 { font-size: var(--step-h2); }
h3 { font-size: var(--step-h3); font-weight: 600; }

p { margin: 0; }

a {
  color: var(--brick);
}

button {
  font-family: inherit;
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--brick);
  outline-offset: 2px;
}

/* Language attribute switches font emphasis subtly */
[lang="zh"] {
  font-family: var(--font-body);
}
