/* ============================================================
   BASE / RESET / TYPOGRAPHY
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
  overflow-x: hidden;
  max-width: 100%;
}

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

/* ---- Lenis smooth scroll (required companion CSS) ---- */
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  text-wrap: balance;
}

p { text-wrap: pretty; }

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

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

/* ---- Layout helpers ---- */
.wrap {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.stack > * + * { margin-top: var(--space-5); }

section { position: relative; }

/* ---- Type utility classes ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-accent);
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: currentColor;
}

.eyebrow--inverse { color: var(--color-gold); }

.display-1 { font-size: var(--fs-5xl); font-weight: 400; letter-spacing: -0.03em; }
.display-2 { font-size: var(--fs-4xl); font-weight: 400; letter-spacing: -0.03em; }
.display-3 { font-size: var(--fs-3xl); font-weight: 500; }
.heading-1 { font-size: var(--fs-2xl); font-weight: 500; }
.heading-2 { font-size: var(--fs-xl); font-weight: 500; }
.heading-3 { font-size: var(--fs-lg); font-weight: 600; }

.italic-accent { font-style: italic; font-weight: 400; color: var(--color-accent); }

.lede {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--color-ink-soft);
  font-weight: 400;
  max-width: 46ch;
}

.body-copy {
  color: var(--color-ink-soft);
  line-height: var(--lh-relaxed);
}
.body-copy p + p { margin-top: 1.1em; }

.text-muted { color: var(--color-ink-muted); }
.text-center { text-align: center; }
.mono-tag {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

/* ---- Section rhythm ---- */
.section { padding-block: var(--space-12); }
.section--tight { padding-block: var(--space-9); }
.section--bleed { padding-block: var(--space-13); }
.section--alt { background: var(--color-bg-alt); }
.section--ink { background: var(--color-inverse-bg); color: var(--color-inverse-ink); }
.section--ink .body-copy,
.section--ink .lede { color: rgba(251, 248, 242, 0.72); }
.section--ink h1, .section--ink h2, .section--ink h3, .section--ink h4 { color: var(--color-inverse-ink); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}
.section-head__title { max-width: 640px; }
.section-head__title h2 { margin-top: var(--space-3); }

@media (max-width: 780px) {
  .section-head { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
  .section { padding-block: var(--space-9); }
  .section--bleed { padding-block: var(--space-10); }
}

/* ---- Divider / registration-mark motif ---- */
.reg-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-ink-muted);
  margin-block: var(--space-6);
}
.reg-divider::before, .reg-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.crop-mark {
  width: 14px;
  height: 14px;
  position: relative;
  flex-shrink: 0;
}
.crop-mark::before, .crop-mark::after {
  content: '';
  position: absolute;
  background: currentColor;
}
.crop-mark::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }
.crop-mark::after { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }

/* ---- Scroll reveal ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-premium), transform var(--dur-slow) var(--ease-premium);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
[data-reveal-group] > * { transition-delay: calc(var(--i, 0) * 90ms); }

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-bg);
  padding: var(--space-3) var(--space-5);
  z-index: 1000;
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }
