/* =========================================================================
   HOMY — BASE
   Reset, element defaults, type scale, layout primitives, a11y.
   Every value resolves through tokens.css. No literals here.
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  /* Native scroll, no interpolation — the browser owns the scroll position. */
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

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

ul[class], ol[class] {
  list-style: none;
  padding: 0;
}

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

img { height: auto; }

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

button { background: none; border: 0; }

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

svg { flex: none; }

/* -------------------------------------------------------------------------
   TYPE SCALE  (BRIEF §2)
   ------------------------------------------------------------------------- */

h1, h2, h3, .h1, .h2, .h3 {
  font-family: var(--font-display);
  text-wrap: balance;
}

.h1, h1 {
  font-size: var(--fs-hero);
  line-height: var(--lh-hero);
  letter-spacing: var(--ls-hero);
  font-weight: var(--fw-black);
}

.h2, h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: var(--ls-h2);
  font-weight: var(--fw-extra);
}

.h3, h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  letter-spacing: var(--ls-h3);
  font-weight: var(--fw-bold);
}

.lede {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--muted);
  text-wrap: pretty;
}

.small { font-size: var(--fs-small); }

.on-dark { color: var(--on-dark); }
.on-dark .lede,
.lede--dark { color: var(--on-dark-60); }

/* Eyebrow — uppercase label preceded by a ◉ target glyph (BRIEF §2) */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  font-weight: var(--fw-semi);
  text-transform: uppercase;
  color: var(--ink);
}

.eyebrow__glyph {
  width: var(--icon-sm);
  height: var(--icon-sm);
  flex: none;
}

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

/* -------------------------------------------------------------------------
   LAYOUT PRIMITIVES
   ------------------------------------------------------------------------- */

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

/* One rhythm sitewide. Padding only — never margin — so adjacent section
   backgrounds meet cleanly with no white gap showing between them. */
.section {
  padding-block: var(--sec-pad);
  margin-block: 0;
}

@media (max-width: 1024px) {
  .section { padding-block: var(--sec-pad-md); }
}

@media (max-width: 768px) {
  .section { padding-block: var(--sec-pad-sm); }
}

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

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

/* Signature pattern A — split section header (BRIEF §3) */
.split-head {
  display: grid;
  grid-template-columns: minmax(0, 55fr) minmax(0, 40fr);
  gap: var(--space-6) var(--space-7);
  align-items: end;
  margin-block-end: var(--space-8);
}

.split-head__left { display: grid; gap: var(--space-5); justify-items: start; }
.split-head__right { display: grid; gap: var(--space-5); justify-items: start; }
.split-head__right .lede { max-width: 42ch; }

@media (max-width: 900px) {
  .split-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--space-5);
  }
}

/* Signature pattern C — ghost numerals (BRIEF §3) */
.numeral {
  font-family: var(--font-display);
  font-size: var(--fs-numeral);
  font-weight: var(--fw-black);
  letter-spacing: var(--ls-hero);
  line-height: 1;
  color: var(--surface);
  user-select: none;
  pointer-events: none;
}

.numeral--dark { color: var(--on-dark-08); }

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

a, button, input, select, textarea, summary, [tabindex] {
  outline-offset: var(--outline-off);
}

:focus-visible {
  outline: var(--bw-thick) solid var(--focus-ring);
  border-radius: var(--radius-sm);
}

.section--dark :focus-visible,
.on-dark :focus-visible { outline-color: var(--on-dark); }

a[href], button:not([disabled]), label, summary,
input[type="checkbox"], input[type="radio"], select {
  cursor: pointer;
}

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

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  inset-block-start: calc(var(--space-4) * -1 - var(--nav-h));
  z-index: var(--z-overlay);
  padding: var(--space-3) var(--space-5);
  background: var(--ink);
  color: var(--on-dark);
  border-radius: var(--radius-pill);
  font-size: var(--fs-nav);
  font-weight: var(--fw-medium);
  transition: inset-block-start var(--dur-fast) var(--ease);
}

.skip-link:focus { inset-block-start: var(--space-4); }

/* -------------------------------------------------------------------------
   SCROLL REVEAL — pre-animation state.
   .js-reveal is only hidden once JS confirms it can animate, so a failed
   script or a no-JS visitor still sees every word (BRIEF §7).
   ------------------------------------------------------------------------- */

/* No will-change here on purpose: this matches 35 elements, and promoting
   them all would hold a GPU layer per element for the whole session. GSAP
   sets will-change itself for the duration of each tween. */
.js-motion [data-reveal],
.js-motion [data-hero-in],
.js-motion [data-split] {
  opacity: 0;
}

/* Word-mask reveal for the hero headline */
.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.word__in { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  .js-motion [data-reveal],
  .js-motion [data-hero-in],
  .js-motion [data-split] { opacity: 1; transform: none; }
}
