
/* ==========================================================================
   BASE: reset, typography, layout, accessibility
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }

h1 em, h2 em, h3 em {
  font-style: italic;
  font-weight: 300;
}

p {
  margin: 0 0 var(--space-5);
  max-width: 62ch;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

/* ---------- Layout helpers ---------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-pad);
}

.section--dark {
  background: var(--color-charcoal);
  color: var(--color-ivory);
}

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

.muted { color: var(--color-muted); }

/* Small uppercase label that sits above headings */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent-ink);
}

.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
}

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

/* ---------- Accessibility ---------- */

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -4rem;
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background: var(--color-charcoal);
  color: var(--color-ivory);
  transition: top var(--dur-fast) var(--ease);
}

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

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

/* Respect visitors who prefer less motion */
@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;
  }
}
