/* Typography System */

:root {
  /* Font stacks */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
               "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);
  --font-mono: "SF Mono", "Fira Code", Consolas, 
               "Liberation Mono", Menlo, monospace;

  /* Type scale (1.25 ratio - Major Third) */
  --text-xs: 0.8rem;      /* 12.8px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.563rem;   /* 25px */
  --text-3xl: 1.953rem;   /* 31px */
  --text-4xl: 2.441rem;   /* 39px */
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.3;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.4;
}

h5 {
  font-size: var(--text-lg);
  font-weight: 600;
}

h6 {
  font-size: var(--text-base);
  font-weight: 600;
}

/* Paragraphs */
p {
  max-width: 65ch;
  margin-bottom: 1.5rem;
  orphans: 3;
  widows: 3;
}

/* Lead text */
.lead {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* Small text */
small, .text-sm {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

/* Muted text */
.text-muted {
  color: var(--color-text-muted);
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Responsive typography */
@media (max-width: 640px) {
  :root {
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
  }
}

@media (min-width: 640px) and (max-width: 768px) {
  :root {
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
  }
}
