/**
 * Typography Styles
 * Data vs Narrative split - Inter for story, JetBrains Mono for specs
 */

/* Base typography */
body {
  font-family: var(--font-narrative);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
}

h4 {
  font-size: var(--text-lg);
}

h5, h6 {
  font-size: var(--text-base);
}

/* Paragraphs - WCAG compliant spacing */
p {
  margin-bottom: 1.5em;
}

p:last-child {
  margin-bottom: 0;
}

/* Data font class - for specs, numbers, code */
.font-data {
  font-family: var(--font-data);
  font-feature-settings: 'tnum' 1; /* Tabular numbers */
}

/* Strong emphasis */
strong, b {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

/* Italic emphasis */
em, i {
  font-style: italic;
}

/* Links */
a {
  color: var(--accent-blue);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-orange);
}

a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

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

/* Blockquotes */
blockquote {
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent-orange);
  padding-left: var(--space-5);
  margin: var(--space-6) 0;
}

/* Code */
code {
  font-family: var(--font-data);
  font-size: 0.9em;
  background-color: var(--bg-tertiary);
  padding: 0.1em 0.3em;
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-data);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  background-color: var(--bg-code);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

/* Selection */
::selection {
  background-color: var(--accent-orange);
  color: var(--bg-primary);
}

/* ==========================================
   RESPONSIVE TYPOGRAPHY
   ========================================== */

/* Mobile: Slightly larger base for readability */
@media (max-width: 767px) {
  body {
    font-size: 1.125rem; /* 18px on mobile */
  }
  
  h1 {
    font-size: var(--text-2xl);
  }
  
  h2 {
    font-size: var(--text-xl);
  }
  
  blockquote {
    font-size: var(--text-base);
  }
}

/* Large screens: Scale up for better legibility */
@media (min-width: 1440px) {
  h1 {
    font-size: var(--text-4xl);
  }
}
