/* ==========================================================================
   Base — reset, document defaults, typography and accessibility helpers.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--text);
  background-color: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* --- Headings --------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--navy-700);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}

h4 {
  font-size: var(--text-lg);
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 650;
  color: var(--navy-700);
}

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

a {
  color: var(--navy-600);
  text-decoration-color: color-mix(in srgb, var(--navy-600) 35%, transparent);
  text-underline-offset: 0.2em;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--rose-600);
}

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

ul,
ol {
  padding: 0;
}

ul[role="list"],
ol[role="list"],
.list-plain {
  list-style: none;
}

/* --- Focus ------------------------------------------------------------ */

:focus-visible {
  outline: 3px solid var(--rose-500);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* --- 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-skip);
  background: var(--navy-700);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--duration) var(--ease);
}

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

/* --- Shared text utilities -------------------------------------------- */

.lede {
  font-size: var(--text-lg);
  color: var(--text-muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--blue-100);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--navy-700);
}

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

.text-center {
  text-align: center;
}

/* Vertical rhythm for a small group of related elements. */
.stack {
  display: grid;
  gap: 0.6rem;
  align-content: start;
}

/* Body copy with breathing room between paragraphs and after headings. */
.prose p + p {
  margin-top: 1rem;
}

.prose h2,
.prose h3 {
  margin-bottom: 0.75rem;
}

/* Headings inside a narrow reading column are sub-headings of a document, not
   full-width section titles, so they step down one rung on the scale. */
.prose h2 {
  font-size: var(--text-2xl);
}

/* --- Spacing utilities -------------------------------------------------- */

.mt-2 {
  margin-top: var(--space-2);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-5 {
  margin-top: var(--space-5);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mt-7 {
  margin-top: var(--space-7);
}

.mb-5 {
  margin-bottom: var(--space-5);
}

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

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