/* =========================================================
   BASE — resets, design tokens, and typography
   ========================================================= */

/* Universal box-sizing: border-box means padding/border are
   INCLUDED in an element's declared width, not added on top.
   This makes layout math predictable everywhere else in the CSS. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Minimal reset */
html, body, h1, h2, h3, p, ul, blockquote, figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Design tokens. Using rem for spacing/type so everything scales
   if the user changes their browser's root font size (accessibility win). */
:root {
  /* Color */
  --color-bg: #faf8f5;
  --color-surface: #ffffff;
  --color-text: #24211d;
  --color-text-muted: #5c574f;

  /* Palette pulled directly from the four-band reference image */
  --color-maroon: #7c2a34;   /* top band */
  --color-red:    #d9504f;   /* second band */
  --color-gold:   #f0d375;   /* third band */
  --color-blue:   #4c7899;   /* fourth band */

  --color-primary: var(--color-maroon);
  --color-primary-dark: var(--color-red);
  --color-accent: var(--color-gold);
  --color-link: var(--color-blue);
  --color-border: #e3ddd2;
  /* Spacing scale (rem = relative to root font size, stays consistent
     no matter what element it's used on) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;

  /* Type */
  --font-heading: "Georgia", "Times New Roman", serif;
  --font-body: "Segoe UI", system-ui, sans-serif;

  /* Layout */
  --container-max: 72rem;
  --radius: 0.5rem;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;

  /* clamp(min, preferred, max) gives fluid type that scales with the
     viewport but never gets unreadably small or huge. Using a vw unit
     in the middle term is deliberate here — it's the one place fluid
     scaling actually matters more than a fixed rem value. */
  font-size: clamp(1rem, 0.5vw + 0.9rem, 1.125rem);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-text);
}

a {
  color: var(--color-link);
}

a:hover,
a:focus {
  color: var(--color-primary-dark);
}

/* Utility: visually hides content but keeps it for screen readers */
.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: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-2) var(--space-3);
  z-index: 100;
}

.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}