/* ==========================================================================
   01-BASE.CSS — reset, typography, section shells, scroll reveal
   ========================================================================== */

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

html {
  font-size: 100%;                    /* never override — breaks a11y text sizing */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  color: var(--c-muted);
  background: var(--c-surface);
  font-optical-sizing: auto;
  font-feature-settings: 'cv11' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }


/* --- TYPE ---------------------------------------------------------------- */

.t-display {
  font-size: var(--fs-display); font-weight: var(--w-x);
  line-height: var(--lh-tight); letter-spacing: var(--ls-display);
  color: var(--c-ink); text-wrap: balance;
}
.t-h1 {
  font-size: var(--fs-h1); font-weight: var(--w-x);
  line-height: var(--lh-head); letter-spacing: var(--ls-h1);
  color: var(--c-ink); text-wrap: balance;
}
.t-h2 {
  font-size: var(--fs-h2); font-weight: var(--w-x);
  line-height: var(--lh-head); letter-spacing: var(--ls-h2);
  color: var(--c-ink); text-wrap: balance;
}
.t-h3 {
  font-size: var(--fs-h3); font-weight: var(--w-bold);
  line-height: var(--lh-snug); letter-spacing: var(--ls-h3);
  color: var(--c-ink);
}
.t-h4 {
  font-size: var(--fs-h4); font-weight: var(--w-bold);
  line-height: var(--lh-snug); color: var(--c-ink);
}
.t-lead {
  font-size: var(--fs-lead); line-height: 1.6;
  letter-spacing: var(--ls-lead); text-wrap: pretty;
}
.t-body    { font-size: var(--fs-body); line-height: var(--lh-body); max-width: var(--measure); text-wrap: pretty; }
.t-small   { font-size: var(--fs-small); line-height: 1.55; }
.t-caption { font-size: var(--fs-caption); line-height: 1.5; color: var(--c-muted); }

.t-eyebrow {
  display: inline-block;
  font-size: var(--fs-eyebrow); font-weight: var(--w-bold);
  line-height: 1.2; letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--c-accent);
  margin-bottom: var(--sp-4);
}
.t-stat {
  font-size: var(--fs-stat); font-weight: var(--w-bold);
  line-height: 1; letter-spacing: var(--ls-display);
  font-variant-numeric: tabular-nums; color: var(--c-ink);
}
.t-num { font-variant-numeric: tabular-nums; }

a { color: var(--c-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--c-accent); }


/* --- LAYOUT SHELLS -------------------------------------------------------- */

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

.section        { padding-block: var(--sp-section); position: relative; }
.section__head  { max-width: 640px; margin-bottom: var(--sp-12); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head p { margin-top: var(--sp-4); }

/* Dark sections — flip the text, keep the scale */
.section--dark { background: var(--c-base); color: var(--c-muted-d); }
.section--dark .t-display,
.section--dark .t-h1,
.section--dark .t-h2,
.section--dark .t-h3,
.section--dark .t-h4,
.section--dark .t-stat  { color: var(--c-surface); }
.section--dark .t-eyebrow { color: var(--c-energy); }
.section--dark .t-caption { color: rgba(247,245,240,0.55); }
.section--dark a { color: var(--c-energy); }


/* --- SCROLL REVEAL -------------------------------------------------------- */
/* JS adds .is-visible when the element scrolls into view (js/reveal.js) */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }


/* --- ACCESSIBILITY -------------------------------------------------------- */

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

.sr-only {
  position: absolute; 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: var(--sp-4); top: -60px; z-index: 200;
  background: var(--c-energy); color: var(--c-base);
  padding: var(--sp-3) var(--sp-5); border-radius: var(--radius);
  font-weight: var(--w-semi); font-size: var(--fs-small);
  transition: top 200ms var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

@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;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
