/* Reset, typography and layout primitives shared by every page. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

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

img { height: auto; }

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

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

button { cursor: pointer; }

h1, h2, h3, h4, p, ul, ol, dl, figure, blockquote { margin: 0; }

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

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

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Typography */
.display,
h1,
h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.02;
  text-wrap: balance;
}

.display { font-size: clamp(46px, 8.2vw, 104px); letter-spacing: -0.035em; line-height: 0.96; }
h1 { font-size: clamp(40px, 6vw, 72px); }
h2 { font-size: clamp(34px, 4.6vw, 60px); }
h3 {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.9vw, 24px);
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

.lead {
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.6;
  color: var(--ink-600);
  text-wrap: pretty;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.eyebrow__num {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.muted { color: var(--ink-500); }
.small { font-size: 14px; line-height: 1.55; }

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

.container--narrow { max-width: calc(820px + var(--gutter) * 2); }

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

.section--dark {
  background: var(--ink-900);
  color: var(--on-dark);
}

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

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

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

.section--muted { background: var(--muted); }

.stack > * + * { margin-top: var(--stack, 20px); }

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--r-btn);
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  transition: top 160ms var(--ease-press);
}

.skip-link:focus { top: 12px; }

/* Scroll reveal: elements start slightly low and fade up once. JS adds .is-visible. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms var(--ease-out),
    transform 900ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

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

  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ?motion=reduce: a deterministic still frame for testing and screenshots. */
.motion-reduce *,
.motion-reduce *::before,
.motion-reduce *::after {
  animation: none !important;
  transition: none !important;
}

.motion-reduce [data-reveal] { opacity: 1 !important; transform: none !important; }
