/* ==========================================================================
   Base — body, typography, links, focus states
   ========================================================================== */

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Headings --- */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  color: var(--color-primary);
}

h1 {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-6);
}

h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

/* --- Body copy --- */

p {
  margin-bottom: var(--space-4);
  line-height: var(--line-height-normal);
}

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

strong {
  font-weight: var(--font-semibold);
}

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

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

.text-center { text-align: center; }
.text-white  { color: #fff; }

/* --- Links --- */

a {
  color: var(--color-secondary);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-secondary-dark);
  text-decoration: underline;
}

/* --- Focus states (WCAG 2.1 AA) --- */

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

/* --- Skip link --- */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: calc(var(--z-modal) + 1);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: #fff;
  font-weight: var(--font-semibold);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: var(--space-2);
}

/* --- Selection --- */

::selection {
  background: var(--color-secondary);
  color: #fff;
}

/* --- Responsive type scale --- */

@media (width <= 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}
