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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
}

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

h1,
h2,
h3,
h4 {
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-4);
}

/* Deliberate weight step-down so H1 is unmistakably the strongest heading
   on the page, not just the biggest — h2/h3 share the same tight
   line-height but back off in both size and weight. */
h1 {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  letter-spacing: -0.01em;
}

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

h3 {
  font-size: var(--font-size-md);
  font-weight: 600;
}

h4 {
  font-size: var(--font-size-base);
  font-weight: 600;
}

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

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

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

button {
  font: inherit;
}

/* Consistent, visible keyboard focus everywhere, including links inside
   dark surfaces (header/footer) where a default outline would be invisible. */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 1000;
  background: var(--color-dark);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

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

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