/* ==========================================================================
   BASE — Reset, typography defaults, global styles
   ========================================================================== */

/* ---- RESET ---- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

/* ---- TYPOGRAPHY ---- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
}

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

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

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

h5 {
  font-size: var(--text-lg);
  font-family: var(--font-body);
  font-weight: 500;
}

h6 {
  font-size: var(--text-base);
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin-bottom: var(--space-6);
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-smooth);
}

a:hover {
  color: var(--color-primary-dark);
}

strong, b {
  font-weight: 600;
}

/* ---- IMAGES ---- */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- LISTS ---- */

ul, ol {
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-2);
}

/* ---- FOCUS STATES ---- */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ---- SKIP LINK ---- */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 10000;
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: 0 0 8px 8px;
  transition: top var(--duration-fast) var(--ease-smooth);
}

.skip-link:focus {
  top: 0;
  color: var(--color-surface);
}

/* ---- SELECTION ---- */

::selection {
  background: var(--color-primary);
  color: var(--color-dark);
}

/* ---- SCREEN READER ONLY ---- */

.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;
}

/* ---- REDUCED MOTION ---- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- RESPONSIVE TYPOGRAPHY ---- */

@media (max-width: 767px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }
}
