/* =========================================================
   Base: typography, layout primitives, accessibility
   ========================================================= */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--ms-header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ms-font-body);
  font-size: var(--ms-fs-base);
  line-height: var(--ms-lh-body);
  color: var(--ms-text);
  background: var(--ms-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--ms-font-heading);
  color: var(--ms-navy);
  font-weight: 700;
  line-height: var(--ms-lh-heading);
  letter-spacing: -.02em;
  margin-bottom: .6em;
}
h1, .h1 { font-size: var(--ms-fs-h1); font-weight: 800; letter-spacing: -.03em; line-height: var(--ms-lh-tight); }
h2, .h2 { font-size: var(--ms-fs-h2); font-weight: 800; letter-spacing: -.025em; }
h3, .h3 { font-size: var(--ms-fs-h3); }
h4, .h4 { font-size: var(--ms-fs-h4); }
h5, .h5 { font-size: var(--ms-fs-h5); }
h6, .h6 { font-size: var(--ms-fs-h6); }

p { margin-bottom: 1.1em; }
.lead { font-size: var(--ms-fs-lg); color: var(--ms-text-2); line-height: 1.6; font-weight: 400; }
small, .small { font-size: var(--ms-fs-xs); }
strong, b { font-weight: 600; }

a { color: var(--ms-navy-2); text-underline-offset: .2em; text-decoration-thickness: 1px; transition: color var(--ms-dur) var(--ms-ease); }
a:hover { color: var(--ms-orange-hover); }

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

::selection { background: rgba(255, 107, 0, .18); color: var(--ms-navy); }

hr { border-color: var(--ms-border); opacity: 1; }

/* Focus — always visible for keyboard users */
:focus-visible { outline: none; box-shadow: var(--ms-focus-ring); border-radius: 4px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--ms-focus-ring); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--ms-orange-hover); box-shadow: 0 0 0 3px rgba(255, 107, 0, .22); }

/* Skip link */
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 2000;
  background: var(--ms-navy); color: #fff; padding: .75rem 1.25rem; border-radius: var(--ms-radius-sm);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; }

/* Layout */
.container, .container-xl { max-width: var(--ms-container); padding-left: var(--ms-gutter); padding-right: var(--ms-gutter); }
.container-narrow { max-width: 820px; margin: 0 auto; padding-left: var(--ms-gutter); padding-right: var(--ms-gutter); }

.section { padding: var(--ms-section-y) 0; position: relative; }
.section-sm { padding: calc(var(--ms-section-y) * .6) 0; }
.section-alt { background: var(--ms-bg-alt); }
.section-navy { background: var(--ms-navy); color: var(--ms-on-navy-2); }
.section-navy h1, .section-navy h2, .section-navy h3, .section-navy h4, .section-navy h5 { color: #fff; }
.section-navy a:not(.btn) { color: #fff; }
.section-border-top { border-top: 1px solid var(--ms-border); }

/* Section header — editorial */
.eyebrow {
  display: inline-flex; align-items: center; gap: .75rem;
  font-family: var(--ms-font-heading); font-size: var(--ms-fs-xs); font-weight: 700;
  letter-spacing: var(--ms-tracking-eyebrow); text-transform: uppercase;
  color: var(--ms-orange-text); margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--ms-orange); flex: none; }
.eyebrow.no-rule::before { display: none; }
.section-navy .eyebrow { color: var(--ms-orange); }

.section-head { max-width: 760px; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head h2 { margin-bottom: .5em; }
.section-head p { color: var(--ms-text-2); font-size: var(--ms-fs-lg); margin-bottom: 0; }
.section-navy .section-head p { color: var(--ms-on-navy-2); }
.section-head-split { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
.section-head-split .section-head { margin-bottom: 0; }

.text-navy { color: var(--ms-navy) !important; }
.text-orange { color: var(--ms-orange-text) !important; }
.text-secondary-ms { color: var(--ms-text-2) !important; }
.bg-alt { background: var(--ms-bg-alt) !important; }
.highlight { color: var(--ms-orange); }
.fw-800 { font-weight: 800 !important; }
.measure { max-width: 68ch; }

/* Rich text (CMS content) */
.prose { font-size: 1.0625rem; line-height: 1.75; color: var(--ms-text); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--ms-fs-h3); margin-top: 2em; }
.prose h3 { font-size: var(--ms-fs-h4); margin-top: 1.75em; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--ms-orange); }
.prose blockquote { border-left: 3px solid var(--ms-orange); padding: .25rem 0 .25rem 1.25rem; color: var(--ms-text-2); font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--ms-border); padding: .6rem .8rem; text-align: left; }
.prose a { color: var(--ms-orange-text); }

/* Reveal-on-scroll (progressive enhancement; disabled for reduced motion) */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ms-ease), transform .6s var(--ms-ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
