/* ========================================
   Base Typography & Global Styles
   Source: DESIGN.md Typography section
   ======================================== */

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-bark);
  background: var(--color-warm-white);
  letter-spacing: 0.01em;
}

/* Display headings — Cormorant Garamond */
h1, h2 {
  font-family: var(--font-display);
  line-height: 1.15;
  color: var(--color-bark);
}

h1 {
  font-size: clamp(2.25rem, 4vw + 1rem, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* UI headings — DM Sans */
h3 {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--color-bark);
}

h4 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-bark);
}

p {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

small, .text-small {
  font-size: 0.875rem;
  letter-spacing: 0.015em;
}

.text-caption {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.text-secondary {
  color: var(--color-text-secondary);
}

/* Links */
a:hover {
  color: var(--color-amber);
}

/* Selection */
::selection {
  background: var(--color-amber-glow);
  color: var(--color-bark);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-frost);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Grain overlay on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

/* Utility: visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
