/* ================================================================
   Typography — Matches Stitch scale exactly
   ================================================================ */

:root {
  --font-display:   'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:      'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;
  --font-editorial: 'Merriweather', Georgia, serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;      /* body-md — 15px */
  line-height: 1.5;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--on-surface);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

/* ── HEADINGS — Plus Jakarta Sans ─────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--on-surface);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-weight: 600;
}

/* Display — 3.5rem, 700, tightest */
h1 {
  font-size: 3.5rem;
  line-height: 4rem;
  letter-spacing: -0.03em;
  font-weight: 700;
}

/* Headline LG — 2.5rem, 600 */
h2 {
  font-size: 2.5rem;
  line-height: 3rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}

/* Headline MD — 1.75rem, 600 */
h3 {
  font-size: 1.75rem;
  line-height: 2.25rem;
  letter-spacing: -0.015em;
  font-weight: 600;
}

/* Headline SM — 1.25rem, 600 */
h4 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  letter-spacing: -0.01em;
  font-weight: 600;
}

h5 {
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-weight: 600;
}

h6 {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  h1 { font-size: 2.25rem; line-height: 2.75rem; letter-spacing: -0.025em; }
  h2 { font-size: 1.75rem; line-height: 2.25rem; letter-spacing: -0.015em; }
}

/* ── BODY ──────────────────────────────────────────────────── */
p {
  margin: 0 0 1rem;
  color: var(--on-surface-variant);
  line-height: 1.75;
  font-weight: 400;
}

/* Body LG — 1.125rem */
.body-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
  letter-spacing: -0.005em;
  color: var(--on-surface-variant);
}

/* Body MD — 0.9375rem (default) */
.body-md {
  font-size: 0.9375rem;
  line-height: 1.5rem;
  letter-spacing: 0;
}

/* Body SM — 0.8125rem */
.body-sm {
  font-size: 0.8125rem;
  line-height: 1.25rem;
  letter-spacing: 0.005em;
  color: var(--on-surface-variant);
}

/* ── MONO LABELS ───────────────────────────────────────────── */
.mono-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.04em;
  font-weight: 500;
  text-transform: uppercase;
}

.mono-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 0.875rem;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ── EDITORIAL (Merriweather) ──────────────────────────────── */
.editorial {
  font-family: var(--font-editorial);
  font-size: 1.125rem;
  line-height: 1.875rem;
  font-weight: 300;
  letter-spacing: 0;
  font-style: italic;
  color: var(--outline);
}

/* ── LINKS ─────────────────────────────────────────────────── */
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary);
}

/* ── CONTENT BODY (wiki pages) ─────────────────────────────── */
.content-card p,
.wiki-render p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--on-surface-variant);
}

.wiki-render h1 { font-size: 2.5rem; margin: 1.5rem 0 1rem; }
.wiki-render h2 { font-size: 1.75rem; margin: 1.5rem 0 0.75rem; }
.wiki-render h3 { font-size: 1.25rem; margin: 1.25rem 0 0.5rem; }

/* ── CODE ──────────────────────────────────────────────────── */
code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ── REDUCED MOTION ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.wiki-render blockquote {
  font-family: var(--font-editorial);
  font-size: 1.125rem;
  line-height: 1.875rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0;
  color: var(--on-surface);
  padding: 16px 20px;
  margin: 20px 0;
  border-left: 3px solid var(--primary-container);
  background: var(--surface-container-low);
  border-radius: var(--radius-lg);
}

.wiki-render blockquote p {
  margin: 0;
  color: inherit;
}

/* ── Editorial blockquotes (wiki pull-quotes) ──────────── */
.wiki-render blockquote {
  font-family: var(--font-editorial);
  font-size: 1.125rem;
  line-height: 1.875rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0;
  color: var(--on-surface);
  padding: 16px 20px;
  margin: 20px 0;
  border-left: 3px solid var(--primary-container);
  background: var(--surface-container-low);
  border-radius: var(--radius-lg);
}

.wiki-render blockquote p {
  margin: 0;
  color: inherit;
}

.wiki-render blockquote cite {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--outline);
  font-style: normal;
}