/* ==========================================================================
   Reset, document defaults, typography, layout primitives
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

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

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

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

p, li, dd { text-wrap: pretty; }

h1, h2, h3, h4 {
  line-height: 1.1;
  font-weight: 750;
  text-wrap: balance;
}

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

::selection { background: var(--butter); color: var(--ink); }

/* Focus — high-visibility ring that works on every surface */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--butter);
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--r-sm);
  font-weight: 650;
  text-decoration: none;
}
.skip-link:focus { top: var(--s-3); }

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

/* ---------- Type roles ---------- */

.display {
  font-stretch: var(--stretch-display);
  font-weight: 820;
  line-height: 0.9;
  letter-spacing: -0.012em;
}
.display-1 { font-size: var(--display-1); }
.display-2 { font-size: var(--display-2); }
.display-3 { font-size: var(--display-3); line-height: 0.95; }

.heading {
  font-stretch: var(--stretch-heading);
  font-weight: 760;
  font-size: var(--text-xl);
  line-height: 1.15;
  letter-spacing: -0.005em;
}

.lede {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 38ch;
}

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

/* ---------- Layout primitives ---------- */

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

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--white { background: var(--card); }
.section--sun { background: var(--sun); }

.section-head {
  display: grid;
  gap: var(--s-4);
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  max-width: 52rem;
}
.section-head p { color: var(--ink-2); max-width: 54ch; font-size: var(--text-lg); line-height: 1.5; }

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

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

@media (min-width: 48em) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64em) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 48em) and (max-width: 63.99em) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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