/* ==========================================================================
   base.css — reset, element defaults and Client-First-style utility classes
   ========================================================================== */

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

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

body {
  margin: 0;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-regular);
  line-height: var(--line-height-body);
  font-weight: var(--font-weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-heading);
  color: inherit;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
dl, dd { margin: 0; }
figure { margin: 0; }
blockquote { margin: 0; }
button { font: inherit; color: inherit; }

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--color-accent-hover); }

/* Focus: visible, consistent, never removed */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.background-color-navy :focus-visible,
.section-cta :focus-visible,
.footer_component :focus-visible {
  outline-color: var(--color-accent-on-dark);
}

::selection { background: var(--color-accent); color: var(--color-white); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background: var(--color-navy);
  color: var(--color-white);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-small);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-4); color: var(--color-white); }

/* ---------- Structure (Client-First) ---------- */
.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.main-wrapper { flex: 1 0 auto; }
.main-wrapper:focus { outline: none; }

.padding-global { padding-left: var(--padding-global); padding-right: var(--padding-global); }

.container-large { width: 100%; max-width: var(--container-large); margin-left: auto; margin-right: auto; }
.container-medium { width: 100%; max-width: var(--container-medium); margin-left: auto; margin-right: auto; }
.container-small { width: 100%; max-width: var(--container-small); margin-left: auto; margin-right: auto; }

.padding-section-small { padding-top: var(--padding-section-small); padding-bottom: var(--padding-section-small); }
.padding-section-medium { padding-top: var(--padding-section-medium); padding-bottom: var(--padding-section-medium); }
.padding-section-large { padding-top: var(--padding-section-large); padding-bottom: var(--padding-section-large); }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gap);
  row-gap: var(--space-12);
}

/* ---------- Backgrounds ---------- */
.background-color-white { background-color: var(--color-white); }
.background-color-navy { background-color: var(--color-navy); color: var(--color-on-dark); }
.background-color-navy .text-color-secondary { color: var(--color-on-dark-muted); }

/* ---------- Typography utilities ---------- */
.heading-style-display {
  font-size: var(--font-size-display);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-display);
  font-weight: var(--font-weight-extrabold);
}
.heading-style-h1 {
  font-size: var(--font-size-h1);
  line-height: 1.08;
  letter-spacing: var(--letter-spacing-display);
  font-weight: var(--font-weight-extrabold);
}
.heading-style-h2 { font-size: var(--font-size-h2); line-height: 1.1; letter-spacing: -0.028em; font-weight: var(--font-weight-bold); }
.heading-style-h3 { font-size: var(--font-size-h3); font-weight: var(--font-weight-bold); }
.heading-style-h4 { font-size: var(--font-size-h4); font-weight: var(--font-weight-bold); letter-spacing: -0.01em; }
.heading-style-h5 { font-size: var(--font-size-h5); font-weight: var(--font-weight-bold); letter-spacing: -0.005em; }

.text-size-large { font-size: var(--font-size-large); line-height: 1.6; }
.text-size-regular { font-size: var(--font-size-regular); }
.text-size-small { font-size: var(--font-size-small); line-height: 1.55; }
.text-size-tiny { font-size: var(--font-size-tiny); line-height: 1.5; }

.text-color-secondary { color: var(--color-text-secondary); }
.text-weight-medium { font-weight: var(--font-weight-medium); }
.text-weight-semibold { font-weight: var(--font-weight-semibold); }
.text-style-tabular { font-variant-numeric: tabular-nums lining-nums; }

.text-style-eyebrow {
  font-family: var(--font-body);
  font-size: var(--font-size-tiny);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-eyebrow);
  text-transform: uppercase;
}
.text-style-label {
  font-size: var(--font-size-tiny);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
}

.max-width-medium { max-width: 40rem; }
.max-width-large { max-width: 48rem; }

/* ---------- Spacing utilities ---------- */
.margin-bottom-xsmall { margin-bottom: var(--space-2); }
.margin-bottom-small { margin-bottom: var(--space-4); }
.margin-bottom-medium { margin-bottom: var(--space-8); }
.margin-bottom-large { margin-bottom: var(--space-12); }
.margin-bottom-xlarge { margin-bottom: var(--space-16); }
.margin-top-medium { margin-top: var(--space-8); }
.margin-top-large { margin-top: var(--space-12); }

/* ---------- Accessibility utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Elements that only make sense once JS has run */
html:not(.js) .hide-no-js { display: none !important; }

/* ---------- Reduced motion ---------- */
@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;
  }
}

/* Short pages (404, thank-you): keep the footer off the last section */
.main-wrapper > section:last-child { padding-bottom: var(--padding-section-medium); }
