/* ==========================================================================
   Base — reset, elements, 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; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  text-wrap: balance;
}
/* Archivo carries weight well. 900 on the big headings, 700 lower down, and
   the tight tracking only where the type is large enough to need it. */
h1 { font-size: var(--step-5); font-weight: 900; letter-spacing: -0.025em; }
h2 { font-size: var(--step-3); font-weight: 900; letter-spacing: -0.022em; }
h3 { font-size: var(--step-2); font-weight: 700; letter-spacing: -0.012em; }
h4 { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.008em; }

p, ul, ol { margin: 0; }
p { max-width: var(--measure); }

a { color: var(--c-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--c-accent-hover); }

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

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

/* Belt and braces for Safari, which paints a ring for programmatic :focus on a
   link even when the interaction was a tap. A ring should only ever appear for
   real keyboard focus. */
:focus:not(:focus-visible) { outline: none; }
body:focus { outline: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--c-accent); color: var(--c-on-accent);
  padding: var(--s-3) var(--s-4); border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: var(--c-on-accent); }

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

/* --- Layout primitives ---------------------------------------------------- */
.wrap  { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--text { max-width: var(--wrap-text); }

.section { padding-block: clamp(3.5rem, 8vw, var(--s-9)); }
.section--tight { padding-block: clamp(2.5rem, 5vw, var(--s-7)); }
.section--alt   { background: var(--c-surface); }
.section--wash  { background: var(--c-accent-wash); }
.section--sand  { background: var(--c-surface-alt); }

.stack > * + * { margin-top: var(--flow, var(--s-4)); }
.stack--lg { --flow: var(--s-6); }
.stack--sm { --flow: var(--s-2); }

.grid { display: grid; gap: var(--s-6); }
@media (min-width: 720px)  { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.cluster { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

/* Wide content never scrolls the page sideways */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
