/* ==========================================================================
   base.css  -  reset, typography, layout primitives, utilities
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

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

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  margin: 0 0 .55em;
  color: var(--navy-900);
  font-variation-settings: "SOFT" 0, "WONK" 0;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); line-height: var(--leading-snug); }
h4 { font-size: var(--step-1); line-height: var(--leading-snug); }

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

a { color: var(--navy-700); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--blue-600); }

ul, ol { margin: 0 0 1.15em; padding-left: 1.15em; }
li { margin-bottom: .45em; }

/* Bold inherits its colour. Forcing navy here would make bold text disappear
   on the dark plates, badges and panels. */
strong, b { font-weight: 700; color: inherit; }

blockquote { margin: 0; }

hr { border: 0; height: 1px; background: var(--line); margin: 2.5rem 0; }

::selection { background: var(--sky-200); color: var(--navy-900); }

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

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); position: relative; }
.section--sm { padding-block: var(--section-y-sm); }
.section--tight-top { padding-top: clamp(2.2rem, 4vw, 3.4rem); }

.section--paper { background: var(--paper); }
.section--white { background: var(--white); }
.section--sky   { background: var(--grad-sky); }
.section--deep  { background: var(--grad-deep); color: var(--text-on-dark); }
.section--deep h1, .section--deep h2, .section--deep h3, .section--deep h4 { color: var(--white); }
.section--deep p { color: var(--text-on-dark-mut); }

.grid { display: grid; gap: clamp(1.1rem, 2.4vw, 2rem); }
.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)); }
.grid-2-3 { grid-template-columns: 2fr 3fr; }
.grid-3-2 { grid-template-columns: 3fr 2fr; }

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

.stack > * + * { margin-top: var(--stack-gap, 1.1rem); }
.flow-lg { --stack-gap: 1.8rem; }

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
}

/* ---------- Text helpers ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--font-sans);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: var(--grad-rule);
  flex: none;
}
.section--deep .eyebrow { color: var(--sky-300); }

.lead {
  font-size: var(--step-1);
  line-height: 1.62;
  color: var(--slate-600);
  font-weight: 400;
}
.section--deep .lead { color: var(--text-on-dark-mut); }

.display-serif { font-family: var(--font-display); }
.italic-accent { font-style: italic; color: var(--blue-600); font-weight: 400; }
.section--deep .italic-accent { color: var(--sky-300); }

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.measure { max-width: 62ch; }
.measure-sm { max-width: 48ch; }

.muted { color: var(--text-muted); }
.small { font-size: var(--step--1); }
.tiny { font-size: var(--step--2); }

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

.skip-link {
  position: absolute; left: 50%; top: -80px;
  transform: translateX(-50%);
  background: var(--navy-900); color: #fff;
  padding: .8rem 1.4rem; border-radius: 0 0 var(--r-sm) var(--r-sm);
  z-index: var(--z-top); font-weight: 600;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Section heading block ---------- */

.section-head { max-width: 760px; margin-bottom: clamp(2.2rem, 4vw, 3.6rem); }
.section-head.is-center { margin-inline: auto; text-align: center; }
.section-head.is-center .eyebrow { justify-content: center; }
.section-head h2 { margin-bottom: .5rem; }
.section-head .lead { margin-top: 1rem; }

.section-head--split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  max-width: none;
}
@media (max-width: 860px) {
  .section-head--split { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reveal on scroll ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .85s var(--ease-out), transform .85s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
