/* ============================================================================
   base.css — reset, document defaults, layout primitives, accessibility.
   No decorative styling lives here; see components.css and pages.css.
   ========================================================================= */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- Headings: one family, medium weight, no italics anywhere -------------- */

h1, h2, h3, h4 {
  font-family: var(--font-ui);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
  font-style: normal;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-base); font-weight: 600; }

em, i { font-style: normal; }

p { text-wrap: pretty; }

/* --- Accessibility -------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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: var(--space-4);
  top: -60px;
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  transition: top var(--dur) var(--ease);
}

.skip-link:focus-visible { top: var(--space-3); }

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

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.container--narrow { width: min(100% - 2.5rem, var(--container-narrow)); }

.section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section--tight { padding-block: clamp(2rem, 3.5vw, 3rem); }

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

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

.split {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; }
}

.grid { display: grid; gap: var(--space-5); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Exactly two columns: an auto-fill track leaves a lone card stranded on desktop. */
.grid--2 { grid-template-columns: 1fr; }

@media (min-width: 760px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
}

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

.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.lede {
  font-size: var(--text-lg);
  color: var(--text-soft);
  line-height: var(--leading-snug);
  max-width: 60ch;
}

.muted { color: var(--text-muted); }
.small { font-size: var(--text-sm); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin-block: var(--space-5);
}
