/* Design tokens, reset, typography, and accessibility helpers. */
:root {
  color-scheme: light;

  --color-ink: #10283f;
  --color-text: #33475b;
  --color-muted: #4d6073;
  --color-ocean: #14608f;
  --color-ocean-dark: #0e4a70;
  --color-sky: #9ccbfb;
  --color-sky-100: #d3e8fc;
  --color-sky-50: #eaf4fe;
  --color-sun: #f4a81d;
  --color-sun-dark: #8a4f00;
  --color-sand: #fbf7f0;
  --color-sand-200: #f1e9da;
  --color-white: #ffffff;
  --color-line: #d9e2ea;
  --color-field-border: #6b7f93;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;

  --radius: 12px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgb(16 40 63 / 0.06), 0 10px 28px rgb(16 40 63 / 0.1);

  --container: 72rem;
  --reading: 46rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --grid-gap: 30px;
  --space-section: clamp(3rem, 8vw, 6rem);
  --header-height: 4.5rem;
  --focus-color: var(--color-ocean);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--color-sand);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Keeps the footer at the bottom of the window on short pages. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

img,
video {
  height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.6em;
  color: var(--color-ink);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 4.5vw + 0.9rem, 3.6rem); }
h2 { font-size: clamp(1.65rem, 3vw + 0.8rem, 2.5rem); }
h3 { font-size: clamp(1.25rem, 1.2vw + 1rem, 1.6rem); }
h4 { font-size: 1.2rem; }

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-ocean-dark);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

ul,
ol {
  padding-left: 1.4em;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-line);
}

/* Visually hidden, still read by screen readers. */
.sr-only,
.screen-reader-text {
  position: absolute !important;
  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;
  top: 0;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--color-ink);
  color: #fff;
  font-weight: 700;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
  outline-color: var(--color-sun);
}

#main-content:focus {
  outline: none;
}

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