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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

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

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

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4);
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  color: var(--color-text);
}

h1 { font-size: clamp(1.85rem, 4vw, var(--fs-5xl)); }
h2 { font-size: clamp(1.5rem, 3vw, var(--fs-3xl)); }
h3 { font-size: clamp(1.2rem, 2.2vw, var(--fs-xl)); }

p {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
}

ul, ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.25rem;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: var(--fs-base);
}

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 9999;
  background: var(--color-primary);
  color: var(--color-text-light);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
}

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

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