/* ==========================================================================
   SPRK — 02. RESET + BASE TYPOGRAPHY + UTILITIES
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
/* Lenis takes over smooth scrolling when JS is on */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

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

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--font-head);
  color: var(--navy-800);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 700; line-height: var(--lh-tight); letter-spacing: var(--ls-tight); }
h2 { font-size: var(--fs-h2); font-weight: 700; line-height: var(--lh-head); letter-spacing: -0.3px; }
h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.25; }
h4 { font-size: var(--fs-h4); font-weight: 600; line-height: 1.3; }

p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--navy-800);
  text-decoration: none;
  transition: color var(--t) var(--ease-out);
}
a:hover { color: var(--amber-600); }

img, svg, video { display: block; max-width: 100%; height: auto; }
/* <picture> must not create a box of its own — the <img> is what gets laid out */
picture { display: contents; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

::selection { background: var(--amber-500); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Layout utilities
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 860px; }

.section { padding-block: var(--section-y); position: relative; }
.section--tight  { padding-block: calc(var(--section-y) * .66); }
.section--light  { background: var(--bg); }
.section--white  { background: var(--surface); }
.section--navy   { background: var(--navy-800); color: var(--muted-dark); }
.section--navy h2, .section--navy h3, .section--navy h4 { color: #fff; }

/* Grain overlay for dark blocks */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: .05;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.stack   { display: grid; gap: var(--s-5); }
.stack-4 { display: grid; gap: var(--s-4); }
.row     { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }

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

/* --------------------------------------------------------------------------
   Type utilities
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--amber-600);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--amber-500);
  flex: none;
}
.section--navy .eyebrow { color: var(--amber-500); }

.eyebrow-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 600;
}

.lead   { font-size: var(--fs-lead); color: var(--steel); line-height: 1.6; }
.section--navy .lead { color: var(--muted-dark); }
.muted  { color: var(--muted); }
.small  { font-size: var(--fs-sm); }
.upper  { text-transform: uppercase; letter-spacing: var(--ls-label); }
.amber  { color: var(--amber-600); }
.center { text-align: center; }

/* Section header block used by every section */
.sec-head { display: grid; gap: var(--s-4); max-width: 720px; margin-bottom: var(--s-11); }
.sec-head--split {
  max-width: none;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--s-6);
}
.sec-head--center { margin-inline: auto; text-align: center; justify-items: center; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.section--navy .rule { background: var(--line-dark); }

/* --------------------------------------------------------------------------
   Accessibility helpers
   -------------------------------------------------------------------------- */
.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(--s-4); top: -100px;
  z-index: var(--z-loader);
  background: var(--amber-500); color: var(--ink);
  padding: var(--s-3) var(--s-5); border-radius: var(--r-btn);
  font-weight: 600;
  transition: top var(--t) var(--ease-out);
}
.skip-link:focus { top: var(--s-4); }

/* --------------------------------------------------------------------------
   Motion — everything opt-out safe
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  /* Park the marquee at its start instead of snapping it to the loop end */
  .marquee__track { animation: none !important; transform: none !important; }
  .hero__bg img   { animation: none !important; transform: scale(1.02) !important; }
}

/* Reveal-on-scroll base state (JS adds .is-in) */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity var(--t-slow) var(--ease-out),
    transform var(--t-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-36px); }
[data-reveal="right"] { transform: translateX(36px); }
[data-reveal="zoom"]  { transform: scale(.94); }
[data-reveal].is-in   { opacity: 1; transform: none; }

/* No-JS: never hide content */
.no-js [data-reveal] { opacity: 1; transform: none; }
