/* ==========================================================================
   Base — reset, element defaults, typography primitives
   ========================================================================== */

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

* {
  margin: 0;
}

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

@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;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

img {
  font-style: italic;
  color: var(--color-text-muted);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); margin-bottom: var(--space-4); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); margin-bottom: var(--space-3); }
h4 { font-size: var(--fs-h4); line-height: var(--lh-snug); margin-bottom: var(--space-2); }

/* Baseline spacing so any heading immediately followed by text reads
   comfortably by default -- components with their own rhythm (cards,
   zone tiles, etc.) override this with more specific selectors. */
h2:last-child, h3:last-child, h4:last-child {
  margin-bottom: 0;
}

p {
  color: var(--color-text-muted);
  text-wrap: pretty;
}

p + p {
  margin-top: var(--space-4);
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

table {
  border-collapse: collapse;
}

/* ---- Focus visibility (accessibility) ---- */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-modal);
  padding: var(--space-3) var(--space-5);
  background: var(--color-forest-900);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast) var(--ease-out);
}

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

/* ---- Selection ---- */
::selection {
  background: var(--color-gold-400);
  color: var(--color-forest-900);
}

/* ---- Typography utility primitives ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-gold-600);
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1.5px;
  background: currentColor;
}

.section--dark .eyebrow {
  color: var(--color-gold-400);
}

.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-snug);
  color: var(--color-text-muted);
  max-width: 58ch;
}

.section--dark .lead {
  color: var(--color-text-on-dark-muted);
}

.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;
}
