/* Reset + element baselines */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Editorial paper-grain overlay — sits above content, below the nav.
   Very low opacity + multiply blend, so it warms the page without noise. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

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

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

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

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

/* Typography scale */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: clamp(48px, 7.2vw, 104px);
}

h2 {
  font-size: clamp(36px, 5.4vw, 72px);
}

h3 {
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.18;
}

h4 {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.25;
}

p {
  margin: 0;
}

.lede {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 60ch;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--taupe);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.italic {
  font-style: italic;
}

/* Layout helpers */

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

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

@media (max-width: 880px) {
  .section[id] {
    scroll-margin-top: 32px;
  }
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* Focus */

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

/* Screen-reader only — used in nav for aria-anchored brand text. */
.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;
}

/* Reveal on scroll */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 900ms var(--ease-out),
    transform 900ms var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
