/* =============================================================
   BASE — reset, typography primitives, layout scaffolding
   ============================================================= */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
/* Lenis drives scrolling; native smooth would fight it. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html:not(.motion-on) { scroll-behavior: auto; }
  html:not(.motion-on) *,
  html:not(.motion-on) *::before,
  html:not(.motion-on) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  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;
  text-rendering: optimizeLegibility;
}

/* clip, not hidden, and on the root rather than body.
   overflow-x:hidden on body computes overflow-y:auto, which turns body
   into a scroll container: scroll events then fire on body instead of
   reaching window, and position:sticky resolves against the wrong box.
   That is a bad foundation for a site whose reveals and pinned gallery
   both depend on scroll. `clip` guards against stray horizontal overflow
   without creating a scroll container at all.

   It is a guard, not a fix: every page measures 0 horizontal overflow at
   375, 414, 768, 1024 and 1440. Anything that appears here in future is
   a real bug and should be fixed at the source, not hidden. */
html { overflow-x: clip; }

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

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}
button { cursor: pointer; }

ul, ol { list-style: none; }

::selection { background: var(--accent); color: var(--tk-black); }

/* Focus — visible and on-brand. Never removed. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* -------------------------------------------------------------
   TYPOGRAPHY
   ------------------------------------------------------------- */

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

.t-mega {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-mega);
  line-height: var(--lh-mega);
  letter-spacing: var(--ls-mega);
  text-wrap: balance;
}

/* <em> marks the accented word in a display headline — colour, not italic. */
.t-mega em, .t-h1 em, .t-h2 em, .cta__title em {
  font-style: normal;
  color: var(--accent);
}

.t-h1 { font-size: var(--fs-h1); line-height: var(--lh-mega); letter-spacing: var(--ls-mega); }
.t-h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); }
.t-h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); }
.t-h4 { font-size: var(--fs-h4); line-height: var(--lh-snug); }

.t-lead {
  font-family: var(--font-body);
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--text-secondary);
  font-weight: 300;
  text-wrap: pretty;
}

.t-body   { color: var(--text-secondary); text-wrap: pretty; }
.t-muted  { color: var(--text-muted); }
.t-accent { color: var(--accent); }

/* Eyebrow / label — the small tracked-out caps used throughout
   the reference to number and name sections. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-body);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: var(--accent);
  flex: none;
}
.eyebrow--bare::before { display: none; }
.eyebrow--index { color: var(--accent); }

/* The ⊹ glyph used as a list motif in the reference. */
.glyph { color: var(--accent); font-size: 0.8em; line-height: 1; }

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

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

.section { position: relative; padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--flush-top { padding-top: 0; }

.section--raised   { background: var(--bg-raised); }
.section--surface  { background: var(--bg-surface); }
.section--light    { background: var(--bg-inverse); color: var(--text-on-light); }
.section--light .t-body,
.section--light .t-lead { color: #4A4A4A; }
.section--light .eyebrow { color: #6B6B6B; }

/* Hairline rules between sections — the reference separates by line,
   not by whitespace alone. */
.rule-top    { border-top: 1px solid var(--rule); }
.rule-bottom { border-bottom: 1px solid var(--rule); }

/* Section header: eyebrow + big head + optional lead, used ~12 times. */
.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  margin-bottom: var(--s-8);
}
.section-head__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  flex-wrap: wrap;
}
.section-head .t-lead { max-width: 34rem; }

/* Split layout — label column left, content right. Used by process,
   services, and stats in the reference. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--s-7) var(--s-8);
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.stack   { display: flex; flex-direction: column; }
.gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); } .gap-5 { gap: var(--s-5); }
.gap-6 { gap: var(--s-6); } .gap-7 { gap: var(--s-7); }

/* -------------------------------------------------------------
   GRID OVERLAY — the faint vertical rules over the hero.
   Decorative only, hidden from assistive tech.
   ------------------------------------------------------------- */
.grid-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--z-grid);
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.grid-overlay span { border-left: 1px solid var(--rule-faint); }
.grid-overlay span:first-child { border-left: none; }
@media (min-width: 1024px) {
  .grid-overlay { grid-template-columns: repeat(6, 1fr); }
}

/* -------------------------------------------------------------
   UTILITIES
   ------------------------------------------------------------- */
.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 — keyboard users land here first. */
.skip-link {
  position: absolute;
  top: var(--s-4); left: var(--s-4);
  z-index: 1000;
  padding: var(--s-3) var(--s-5);
  background: var(--accent);
  color: var(--tk-black);
  font-weight: 600;
  border-radius: var(--r-pill);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

.text-center { text-align: center; }
.relative { position: relative; }
.z-content { position: relative; z-index: var(--z-content); }

/* -------------------------------------------------------------
   MOTION SUPPORT
   Structural bits the GSAP layer needs. All of it degrades to a
   plain visible state when motion is off or JS never runs.
   ------------------------------------------------------------- */
.split-mask { display: block; overflow: hidden; }
.split-inner { display: block; }

/* Section rules draw in rather than appearing all at once. */
.rule-top { position: relative; border-top-color: transparent; }
.rule-top::before {
  content: '';
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: var(--rule);
  transform: scaleX(var(--rule-scale, 1));
  transform-origin: left;
}

@media (prefers-reduced-motion: reduce) {
  html:not(.motion-on) .rule-top { border-top-color: var(--rule); }
  html:not(.motion-on) .rule-top::before { display: none; }
  html:not(.motion-on) .split-mask { overflow: visible; }
}
.no-js .rule-top { border-top-color: var(--rule); }
.no-js .rule-top::before { display: none; }
