/* =========================================================================
   DUAL · base — reset, typography, utilities, accessibility
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: auto; /* Lenis owns scrolling */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-900);
  font-family: var(--ff-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  font-weight: 400;
  overflow-x: clip;
  min-height: 100vh;
  min-height: 100svh;
}

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

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

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

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

p { margin: 0; }

/* ---- Typography utilities ---- */

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink-900);
  margin: 0;
}

h1 { font-size: var(--fs-4xl); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-3xl); letter-spacing: -0.025em; }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

.mono {
  font-family: var(--ff-mono);
  font-feature-settings: "ss01", "ss02";
  letter-spacing: 0.02em;
  font-weight: 500;
  text-transform: none;
}

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

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

.container--narrow {
  max-width: var(--container-narrow);
}

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

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s-4);
  z-index: 1000;
  background: var(--ink-900);
  color: #fff;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-2);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  transition: top var(--t-fast) var(--ease-out);
}
.skip-link:focus {
  top: var(--s-4);
  outline: 2px solid var(--red-500);
  outline-offset: 2px;
}

:where(a, button, [tabindex], summary, input):focus-visible {
  outline: 2px solid var(--red-500);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

/* ---- Section heads ---- */

.section-head {
  max-width: 720px;
  margin-bottom: var(--s-9);
}

.section-head--row {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
}

.section-head__eyebrow {
  color: var(--blue-700);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: var(--s-3);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.section-head__eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--blue-400);
}

.section-head__title {
  font-size: var(--fs-3xl);
}

.section-head__lead {
  margin-top: var(--s-4);
  color: var(--ink-600);
  font-size: var(--fs-lg);
  max-width: 56ch;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink-900);
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: var(--fs-base);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--ink-900);
  transition: gap var(--t-fast) var(--ease-out);
}
.link-arrow:hover { gap: var(--s-3); }

/* ---- Preload state — fades in once main.js boots ---- */
.is-preload * {
  animation-play-state: paused !important;
}

/* ---- Reduced motion: kill non-essential motion ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
