/* ==========================================================================
   Base Styles — Reset, Typography, Global Defaults
   ========================================================================== */

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text-body);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-brand-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

ul,
ol {
  list-style: none;
}

/* Typography — Heading Scale */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-body);
  font-weight: 600;
  line-height: var(--line-height-tight);
}

h1 {
  font-size: 28px;
  font-weight: 700;
}

h2 {
  font-size: 22px;
}

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

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

/* Tablet+ heading scale */
@media (min-width: 481px) {
  h1 {
    font-size: var(--font-size-2xl);
  }

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

/* Desktop heading scale */
@media (min-width: 769px) {
  h1 {
    font-size: var(--font-size-3xl);
  }

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

/* Body text */
p {
  margin-bottom: var(--space-md);
}

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

strong {
  font-weight: 600;
}

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

/* Focus indicators — WCAG 2.4.7 */
:focus-visible {
  outline: 2px solid var(--color-brand-text);
  outline-offset: 2px;
}

/* Skip link — WCAG 2.4.1 */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 10000;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-text-body);
  color: var(--color-background);
  font-weight: 600;
  border-radius: var(--border-radius-sm);
}

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

/* Selection */
::selection {
  background: var(--color-brand-primary);
  color: var(--color-background);
}

/* Utility — Screen reader only */
.u-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;
}
