/* ============================================================
   base.css — reset, typography, layout primitives, fonts
   ============================================================ */

/* --- Self-hosted webfonts (woff2, swap). Drop files in assets/fonts/. --- */
@font-face {
  font-family: "Bebas Neue";
  src: url("../fonts/bebas-neue-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* clear the sticky nav on anchor jumps */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--near-black);
  color: var(--bone);
  font-family: var(--font-ui);
  font-size: var(--step-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

a { color: var(--alarm-red); text-decoration: none; }
a:hover { color: var(--alarm-red-hover); text-decoration: underline; }

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
h1 { font-size: var(--step-hero); }
h2 { font-size: var(--step-h2); }
h3 { font-size: var(--step-h3); }

p { max-width: var(--measure); }

.mono { font-family: var(--font-mono); }
.kicker {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: var(--step-small);
  color: var(--alarm-red);
  font-weight: 600;
}
.muted { color: var(--bone-dim); }

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

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 5rem); }

.stack > * + * { margin-top: var(--space); }

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: var(--step-small);
  color: var(--bone-dim);
  margin-bottom: 1rem;
}

/* --- Accessibility helpers --- */
.visually-hidden {
  position: absolute !important;
  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: 0.5rem; top: -3rem;
  background: var(--alarm-red);
  color: var(--near-black);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-weight: 600;
  z-index: 1000;
  transition: top 0.15s var(--ease);
}
.skip-link:focus { top: 0.5rem; text-decoration: none; }

/* Visible focus states, in alarm red */
:focus-visible {
  outline: 2px solid var(--alarm-red);
  outline-offset: 2px;
}

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