/* Element defaults and shared type utilities. */

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

html {
  scroll-behavior: smooth;
  /* Keep in-page anchor targets clear of the 76px sticky header. */
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

:target {
  scroll-margin-top: calc(var(--header-h) + var(--space-4));
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  color: var(--text-strong);
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

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

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

a:hover {
  color: var(--navy-900);
}

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* Visible only to assistive tech until focused. */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--navy-900);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-button);
  text-transform: uppercase;
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  top: 12px;
  color: var(--white);
}

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

/* ---------- Type utilities ---------- */

.eyebrow {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-accent);
}

.eyebrow--on-navy {
  color: var(--pink-400);
}

.display {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  color: var(--text-strong);
}

.display--navy {
  color: var(--navy-900);
}

.display--hero {
  font-size: var(--display-hero);
}

.display--page {
  font-size: var(--display-page);
}

.display--section {
  font-size: var(--display-section);
}

.heading-lg {
  font-size: var(--fs-h1);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
}

.heading-md {
  font-size: var(--fs-h2);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
}

.lede {
  font-size: var(--fs-body-l);
  color: var(--text-strong);
}

.muted {
  color: var(--text-muted);
}

/* ---------- Motion ---------- */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fade-up {
  animation: fade-up var(--dur-base) var(--ease-out) both;
}

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