/* ==========================================================================
   Base — reset, typography, accessibility, layout primitives
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

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

body.is-locked {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-tight);
  color: var(--navy-900);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-4xl);
  line-height: var(--lh-tight);
}
h2 {
  font-size: var(--fs-3xl);
}
h3 {
  font-size: var(--fs-xl);
  font-weight: 700;
}
h4 {
  font-size: var(--fs-lg);
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

img {
  height: auto;
}

strong,
b {
  font-weight: 600;
}

small {
  font-size: var(--fs-sm);
}

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

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

textarea {
  resize: vertical;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--blue-200);
  color: var(--navy-950);
}

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

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

/* Skip link */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  background: var(--navy-900);
  color: #fff;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--speed) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + 48px);
  margin-inline: auto;
  padding-inline: 24px;
}

.container--wide {
  max-width: calc(var(--container-wide) + 48px);
}

.container--narrow {
  max-width: calc(var(--container-narrow) + 48px);
}

.section {
  padding-block: var(--sp-11);
}

.section--tight {
  padding-block: var(--sp-9);
}

.section--bottom-tight {
  padding-bottom: var(--sp-9);
}

.section--surface {
  background: var(--surface-2);
}

.section--navy {
  position: relative;
  background: var(--navy-950);
  color: #d6e2f0;
  overflow: hidden;
}

.section--navy h2,
.section--navy h3,
.section--navy h4 {
  color: #fff;
}

.section--navy .eyebrow {
  color: var(--cyan-400);
}

.section-head {
  max-width: 720px;
  margin-bottom: var(--sp-8);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--wide {
  max-width: 860px;
}

.section-head p {
  margin-top: var(--sp-3);
  color: var(--slate-600);
  font-size: var(--fs-md);
}

.section--navy .section-head p {
  color: #aebfd4;
}

.section-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.section-head__actions--center {
  justify-content: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--sp-3);
  color: var(--blue-600);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.eyebrow--plain::before {
  display: none;
}

.lead {
  font-size: var(--fs-lg);
  line-height: 1.6;
  color: var(--slate-600);
}

.section--navy .lead {
  color: #b7c7db;
}

.muted {
  color: var(--slate-600);
}

.small {
  font-size: var(--fs-sm);
}

.fineprint {
  font-size: var(--fs-xs);
  line-height: 1.55;
  color: var(--slate-500);
}

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

.nowrap {
  white-space: nowrap;
}

/* Grid helpers */
.grid {
  display: grid;
  gap: var(--sp-5);
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1023px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
  .section {
    padding-block: var(--sp-9);
  }
  .section--tight {
    padding-block: var(--sp-8);
  }
  .container {
    padding-inline: 20px;
  }
}

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

.sr-only-focusable:focus-visible {
  position: fixed !important;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: auto;
  height: auto;
  padding: 12px 18px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
  background: var(--navy-900);
  color: #fff;
  border-radius: var(--r-sm);
}

/* Inline prose links */
.link {
  color: var(--blue-700);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--speed) var(--ease);
}

.link:hover {
  color: var(--blue-600);
  text-decoration-thickness: 2px;
}

.section--navy .link {
  color: var(--cyan-400);
}

/* Headings with accent */
.accent {
  color: var(--blue-600);
}

.accent-underline {
  position: relative;
  white-space: nowrap;
}

.accent-underline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 8px;
  border-radius: 4px;
  background: var(--cyan-100);
  z-index: -1;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@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;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
