/* ==========================================================================
   base.css — Reset, document defaults, typography, accessibility primitives
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  background-color: var(--bg);
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

p,
li,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* ---- Headings -----------------------------------------------------------
   Source Serif carries h1–h3. h4 drops to the body sans so small headings
   inside cards stay crisp at UI sizes.
   ------------------------------------------------------------------------- */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.012em;
  color: var(--heading);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
}

h4 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  font-weight: 640;
  line-height: var(--lh-snug);
  letter-spacing: -0.004em;
  color: var(--heading);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 640;
  color: var(--text);
}

/* ---- Links --------------------------------------------------------------- */

a {
  color: var(--brand);
  text-decoration-color: rgb(var(--brand-rgb) / 0.4);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease),
    text-decoration-color var(--dur-fast) var(--ease);
}

a:hover {
  color: var(--brand-soft);
  text-decoration-color: var(--brand-soft);
}

/* ---- Lists --------------------------------------------------------------- */

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

li + li {
  margin-top: var(--sp-2);
}

/* ---- Selection & focus --------------------------------------------------- */

::selection {
  background: var(--blue-700);
  color: #fff;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-xs);
}

/* ---- Scrollbar ----------------------------------------------------------- */

* {
  scrollbar-color: var(--n-700) transparent;
  scrollbar-width: thin;
}

/* The header bar is sized for the full desktop lockup; phones get a
   shorter bar so the first screenful is not mostly chrome. */
@media (max-width: 900px) {
  :root {
    --header-h: 76px;
  }
}

/* ---- Accessibility helpers ----------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: var(--z-toast);
  padding: 0.75rem 1.25rem;
  background: var(--blue-700);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  text-decoration: none;
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
  color: #fff;
}

[hidden] {
  display: none !important;
}

/* ---- Reduced motion ------------------------------------------------------
   The audience for this site includes people for whom motion is a barrier.
   Honour the preference completely, not partially.
   ------------------------------------------------------------------------- */

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

/* ---- Print ---------------------------------------------------------------- */

@media print {
  .site-header,
  .site-footer,
  .to-top,
  .form__actions {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
