/* Base reset + typografie + layout primitives
 * Depends on tokens.css
 */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--c-text);
  background: var(--c-bg);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--s-4);
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }

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

a {
  color: var(--c-brand-navy);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color var(--t-base);
}
a:hover { color: var(--c-brand-teal-dark); }
a:focus-visible {
  outline: none;
  box-shadow: var(--sh-focus);
  border-radius: var(--r-sm);
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.container-narrow {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.section {
  padding: var(--s-16) 0;
}

.section-lg {
  padding: var(--s-24) 0;
}

.stack > * + * {
  margin-top: var(--s-6);
}

.stack-sm > * + * {
  margin-top: var(--s-3);
}

.stack-lg > * + * {
  margin-top: var(--s-10);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
}

.grid {
  display: grid;
  gap: var(--s-6);
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* Text helpers */
.text-center { text-align: center; }
.text-muted { color: var(--c-text-muted); }
.text-faded { color: var(--c-text-faded); }
.text-display { font-family: var(--font-display); }
.text-hero {
  font-size: var(--fs-hero);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: var(--fw-black);
}

.lede {
  font-size: var(--fs-md);
  color: var(--c-text-muted);
  max-width: 60ch;
  line-height: var(--lh-relaxed);
}

/* Accessibility */
.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;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
