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

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--sage);
  color: var(--body);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  margin: 0 0 0.6em;
  color: var(--heading);
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); letter-spacing: 0.01em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p, ul, ol, dl { margin: 0 0 1.15em; }
p { max-width: var(--measure); text-wrap: pretty; }

a { color: var(--field-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

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

hr { border: 0; height: 1px; background: var(--rule); margin: var(--band) 0; }

strong { font-weight: 700; color: var(--heading); }

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

.skip-link {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--on-dark);
  padding: 0.8rem 1.2rem; z-index: 100;
  font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 0.08em;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

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

.wrap { width: min(var(--wrap), 100% - (var(--gutter) * 2)); margin-inline: auto; }
.wrap--narrow { width: min(var(--wrap-narrow), 100% - (var(--gutter) * 2)); }

.band { padding-block: var(--band); }
.band--tight { padding-block: calc(var(--band) * 0.62); }

/* The section-separation system. The brief called out that flat white reads
   unfinished, so every band declares a surface and consecutive bands must not
   repeat one. build.mjs enforces the alternation. */
.band--sage    { background: var(--grad-sage); }
.band--surface { background: var(--surface); }
.band--warm    { background: var(--surface-warm); }
.band--patrol  { background: var(--grad-patrol); color: var(--on-dark-soft); }
.band--field   { background: var(--grad-field); color: var(--on-dark-soft); }

.band--patrol h1, .band--patrol h2, .band--patrol h3, .band--patrol h4,
.band--field  h1, .band--field  h2, .band--field  h3, .band--field  h4 { color: var(--on-dark); }
.band--patrol a:not(.btn), .band--field a:not(.btn) { color: var(--patrol-green); }
.band--patrol strong, .band--field strong { color: var(--on-dark); }

/* A reticle hairline used where two dark bands meet */
.band--reticle-top { border-top: 2px solid transparent; border-image: var(--grad-reticle) 1; }

.grid { display: grid; gap: clamp(1rem, 0.6rem + 1.6vw, 2rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

.stack > * + * { margin-top: 1.15em; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--body); }
.band--patrol .lede, .band--field .lede { color: var(--on-dark-soft); }

.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--field-deep);
  margin-bottom: 0.75rem;
}
.band--patrol .eyebrow, .band--field .eyebrow { color: var(--patrol-green); }
