/*
 * base.css — Reset, font loading, body defaults, typography
 * --------------------------------------------------------
 * Everything in here uses tokens from tokens.css. Don't hardcode values.
 */

/* =====================================================================
   1. SELF-HOSTED FONT — Prompt (300, 400, 500)
   ===================================================================== */

@font-face {
  font-family: "Prompt";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/Prompt-300.woff2") format("woff2");
}
@font-face {
  font-family: "Prompt";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Prompt-400.woff2") format("woff2");
}
@font-face {
  font-family: "Prompt";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Prompt-500.woff2") format("woff2");
}


/* =====================================================================
   2. MODERN RESET
   ===================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

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

/* Respect prefers-reduced-motion across the entire site. Users with motion
   sensitivity enabled in their OS get an effectively-instant version of every
   transition + animation. WCAG 2.3.3 (Animation from Interactions). */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  min-height: 100vh;
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

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


/* =====================================================================
   3. BODY + TYPOGRAPHY DEFAULTS
   ===================================================================== */

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-light);    /* 300 — per design spec */
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-offwhite);         /* #F7F7F7 site background */

  /* Prevent the horizontal scrollbar that the archive hero's width:100vw
     trick can introduce on Windows (where 100vw includes the scrollbar
     width, but body width doesn't). overflow-x: clip stops the overflow
     WITHOUT creating a new scroll container — preserves position: sticky
     on the header + filter sidebar (which overflow-x: hidden would break). */
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--line-height-tight);
  color: var(--color-secondary);
  letter-spacing: var(--letter-spacing-tight);
}

/* h1 = medium (500). h2-h4 = regular (400). h5, h6 = light (300). */
h1 { font-size: var(--font-size-3xl); font-weight: var(--font-weight-medium); }   /* Mobile h1 */
h2 { font-size: var(--font-size-2xl); font-weight: var(--font-weight-regular); }
h3 { font-size: var(--font-size-xl);  font-weight: var(--font-weight-regular); }
h4 { font-size: var(--font-size-lg);  font-weight: var(--font-weight-regular); }
h5 { font-size: var(--font-size-base);font-weight: var(--font-weight-light); }
h6 { font-size: var(--font-size-sm);  font-weight: var(--font-weight-light); }

p {
  margin-bottom: var(--space-4);
}
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-primary);
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--color-accent);
}

/* Per brand rule: only h1 uses 500. strong/b stay at body weight. */
strong, b { font-weight: var(--font-weight-regular); }

small { font-size: var(--font-size-sm); color: var(--color-text-muted); }

ul, ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-4);
}

hr {
  border: none;
  border-top: var(--border-width) solid var(--color-border);
  margin: var(--space-6) 0;
}

code, pre {
  font-family: var(--font-family-mono);
  font-size: 0.92em;
}
code {
  background: var(--color-offwhite);
  padding: var(--space-0-5) var(--space-1-5);
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--color-primary);
  color: var(--color-white);
}


/* =====================================================================
   4. RESPONSIVE TYPOGRAPHY (mobile-first → tablet → desktop)
   ===================================================================== */

@media (min-width: 640px) {
  h1 { font-size: var(--font-size-4xl); }
  h2 { font-size: var(--font-size-3xl); }
  h3 { font-size: var(--font-size-2xl); }
}

@media (min-width: 1024px) {
  h1 { font-size: var(--font-size-5xl); }
  h2 { font-size: var(--font-size-4xl); }
}


/* =====================================================================
   5. UTILITIES — minimal, only the most-used
   ===================================================================== */

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

.text-muted    { color: var(--color-text-muted); }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
