/* Base — reset, typography, layout rhythm */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Pre-reveal x-offset transforms (data-reveal="left|right") must never widen the
   page: body's clip propagates to the viewport, so descendant overflow still
   counts into document scrollWidth — clipping at <main> actually removes it.
   overflow:clip creates no scroll container, so position:sticky keeps working. */
main { overflow-x: clip; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: var(--indigo-16); }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--indigo), 0 0 0 4px var(--indigo-16);
  border-radius: var(--r-sm);
}

/* Two-tone headline emphasis */
.hl { font-style: normal; color: var(--hl); }

/* Single-use lime underline flick (max one per page) */
.hl-lime {
  font-style: normal;
  background-image: linear-gradient(to top, var(--lime) 0 .14em, transparent .14em);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* Layout */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-pad); }
.section--slim { padding-block: calc(var(--section-pad) * .5); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--hl);
  margin-bottom: var(--sp-4);
}

.lead {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  color: var(--text-60);
  max-width: 42em;
}

.grid { display: grid; gap: var(--sp-5); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Mobile scroll-snap card rail (CSS-only) */
@media (max-width: 719px) {
  .rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 85%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    padding-bottom: var(--sp-3);
    -webkit-overflow-scrolling: touch;
  }
  .rail > * { scroll-snap-align: start; }
  .rail::-webkit-scrollbar { display: none; }
}

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

.skip-link {
  position: absolute;
  left: var(--sp-4); top: var(--sp-4);
  z-index: 100;
  background: var(--surface);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-raised);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Reduced-motion blanket: kill decorative keyframes/transitions.
   JS applies the same gate (no Lenis, no pins/scrubs, instant reveals). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
html.force-reduced-motion *, html.force-reduced-motion *::before, html.force-reduced-motion *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}
