/* ==========================================================================
   Base — reset, typography, primitives
   ========================================================================== */

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--on-paper);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body.is-locked { overflow: hidden; }

img, picture, video, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.02;
  text-wrap: balance;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

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

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Layout primitives ---------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.surface-paper { background: var(--paper); color: var(--on-paper); }
.surface-ink   { background: var(--ink);   color: var(--on-dark); }
.surface-field { background: var(--field-deeper); color: var(--on-dark); }

/* ---- Shared type ----------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 1px;
  flex: none;
}
.eyebrow--rule::after {
  content: "";
  width: clamp(28px, 5vw, 72px);
  height: 1px;
  background: currentColor;
  opacity: 0.28;
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  max-width: var(--measure-text);
  letter-spacing: -0.006em;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-8);
  margin-bottom: clamp(40px, 5vw, 72px);
}
.section-head h2 { font-size: var(--t-h2); max-width: 18ch; }

.index-mark {
  font-family: var(--font-display);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  opacity: 0.4;
  font-variant-numeric: tabular-nums;
}

/* ---- Accessibility --------------------------------------------------- */
.wide-only { display: none; }
@media (min-width: 560px) { .wide-only { display: inline; } }

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

.skip-link {
  position: fixed;
  top: var(--s-4); left: var(--s-4);
  z-index: 200;
  padding: var(--s-3) var(--s-5);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-pill);
  transform: translateY(-200%);
  transition: transform var(--d-2) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

/* ---- Scroll reveal ---------------------------------------------------
   Gated behind .js so that if the script never runs — file://, a blocked
   bundle, an old browser — the content is simply visible rather than
   invisible forever. Progressive enhancement, not a dependency.          */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity var(--d-4) var(--ease-quiet),
    transform var(--d-4) var(--ease-quiet);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::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; }
}
