/* base.css: reset, fonts, base typography, focus, motion preferences */

@font-face {
  font-family: "Saira SemiCondensed";
  src: url("../assets/fonts/saira-semicondensed-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Saira SemiCondensed";
  src: url("../assets/fonts/saira-semicondensed-500-italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Saira SemiCondensed";
  src: url("../assets/fonts/saira-semicondensed-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Quantico";
  src: url("../assets/fonts/quantico-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Quantico";
  src: url("../assets/fonts/quantico-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Share Tech Mono";
  src: url("../assets/fonts/share-tech-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* Column layout with a growing main keeps the footer at the bottom of the
     viewport on short pages (404, thanks), where it otherwise floated with
     an empty screen below it. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-weight: 700; font-size: var(--step-4); }
h2 { font-weight: 400; font-size: var(--step-3); }
h3 { font-weight: 400; font-size: var(--step-1); }

p { margin: 0 0 1em; max-width: var(--measure); }

strong, b { font-weight: 600; }

a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color var(--transition);
}
a:hover { color: var(--text); }

/* Visible focus for keyboard users */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  z-index: 100;
  transform: translateY(-110%);
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-button);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
  transition: transform var(--transition);
}
.skip-link:focus-visible { transform: translateY(0); outline-color: var(--text); }

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

/* Section eyebrow / kicker. Kept tight against its heading: the pair reads
   as one unit, and the space saved goes to the gaps between sections. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.5rem;
}
.eyebrow--teal { color: var(--teal); }
.eyebrow--purple { color: var(--purple); }

/* External-link indication: every external link carries an aria-hidden
   arrow glyph plus visually-hidden text. Never icon-only links. */
.ext-glyph { font-size: 0.85em; }

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