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

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

@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;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-foreground);
  background: var(--color-background);
  min-height: 100vh;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  font-weight: 600;
  color: var(--color-foreground);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { max-width: 65ch; }

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

ul, ol { padding-left: 0; list-style: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

a, button, [role="button"], input[type="submit"] {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}

.container {
  width: min(100% - 2.5rem, var(--container-width));
  margin-inline: auto;
}

.visually-hidden {
  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: 1rem;
  top: 1rem;
  /* transform (not a negative top offset) guarantees it's fully off-screen
     regardless of the element's actual rendered height - a fixed -3rem
     offset was shorter than the button's real height and let it peek in
     at the very top of every page even without keyboard focus. */
  transform: translateY(-150%);
  background: var(--color-primary);
  color: var(--color-on-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}
