/* ── Base layer: reset, typography, layout primitives ─────────────────────
   Loaded after tokens.css and before site.css. Nothing here is component
   specific; if a rule needs a class to make sense, it belongs in site.css.

   Note what is NOT in this file. The sibling sites carry a long
   `:is(.section-ink, .hero, .page-header, .cta-band) …` override list, because
   a light site with dark bands has to restate every colour inside them, and
   forgetting one selector is how a hero eyebrow ends up at 1.63:1 on navy.
   This site is dark everywhere, so there is one text ramp, one link colour and
   no inverse mode. That is the single biggest accessibility advantage of
   committing to a dark field, and it is worth not giving back.
   ───────────────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The masthead is sticky, so an anchor target must clear it or the heading
     you jumped to sits underneath the nav bar. */
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-soft);
  font: 400 16.5px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

/* ── Headings ───────────────────────────────────────────────────────────
   Inter across the board, tracked in tight at display sizes. No serif: this
   is a systems company, not a law firm. */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-family: var(--font-sans);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -.021em;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 1.3rem + 2.9vw, 3.35rem); line-height: 1.06; letter-spacing: -.032em; }
h2 { font-size: clamp(1.6rem, 1.22rem + 1.35vw, 2.25rem); letter-spacing: -.026em; }
h3 { font-size: 1.26rem; letter-spacing: -.018em; }
h4 { font-size: 1.06rem; letter-spacing: -.012em; }
h5, h6 { font-size: 1rem; }

p { margin: 0 0 1.1em; color: var(--text-soft); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; color: var(--text-soft); }
li { margin-bottom: .38em; }
li:last-child { margin-bottom: 0; }

/* Prose links only. Any rule that colours links inside a container must
   exclude .btn — on a sibling site a footer link rule beat .btn-primary on
   specificity (0,1,1 against 0,1,0) and washed the CTA text out to a genuine
   contrast violation. Every link rule below carries the exclusion. */
a:not(.btn) {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:not(.btn):hover { color: var(--focus); }

strong, b { font-weight: 620; color: var(--text); }

em { font-style: italic; }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: .92em;
}
code {
  padding: .1em .38em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

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

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

blockquote { margin: 0; }

abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; }

/* A component rule like `.tablist { display: flex }` overrides the plain
   attribute selector, so this needs the !important to be reliable. */
[hidden] { display: none !important; }

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

/* ── Focus ─────────────────────────────────────────────────────────────── */

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 200;
  background: var(--accent);
  color: var(--on-signal);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 650;
  text-decoration: none;
  transition: top .12s ease-out;
}
.skip-link:focus { top: 12px; color: var(--on-signal); }

/* Visually hidden but available to assistive technology. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Layout primitives ─────────────────────────────────────────────────── */

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

/* Explicit column counts per breakpoint, never auto-fit: a six-card set has
   to land as 3 + 3, and `repeat(auto-fit, minmax(260px, 1fr))` will happily
   give you 4 + 2 at a width you did not test. */
.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 660px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Sections. Three flat field steps, no inverse mode — see the note at the
   top of this file. */
.section { padding: clamp(52px, 6.5vw, 88px) 0; }
.section-soft  { background: var(--bg-soft); }
.section-panel { background: var(--surface); }
.section-hair  { border-top: 1px solid var(--border); }

/* Spacing utility, for the handful of places where a component follows
   another component directly rather than following prose. */
.mt-lg { margin-top: clamp(26px, 3.5vw, 40px); }

.lead { font-size: 1.13rem; line-height: 1.6; color: var(--text-soft); }

/* ── Motion ────────────────────────────────────────────────────────────── */

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