/* Reset, typography, shared components (wrap, section shell, title, buttons, icon, reveal). */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 60px; color-scheme: light; -webkit-text-size-adjust: 100%; }
/* anchor offset comes from html scroll-padding-top alone (adding scroll-margin-top here doubled it) */
body {
  margin: 0;
  font: 400 var(--fs-16)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
b { font-weight: 600; color: var(--text); }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; text-wrap: balance; font-weight: 400; letter-spacing: -0.03em; }
p { margin: 0; text-wrap: pretty; }
/* Forced heading breaks are for wide layouts; on phones the text reflows (and balances) instead */
@media (max-width: 600px) { h2 br { display: none; } }
ul, ol { list-style: none; margin: 0; padding: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.muted, .sub { color: var(--muted); }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

/* Section shell: three rhythm tiers via --sec-y / tight / alt background */
.sec { padding: var(--sec-y) 0; position: relative; }
.sec--tight { padding: var(--sec-y-tight) 0; }
.sec--alt { background: var(--bg-2); }
.sec--white { background: var(--white); }
.sec--ink { background: var(--bg); color: var(--text); }
.sec--flush { padding-bottom: 0; }

.sub { margin-top: var(--sp-16); max-width: 40em; }
.sec-head { margin-bottom: var(--sp-48); }

.ic {
  width: 28px; height: 28px; flex: none;
  fill: none; stroke: var(--accent); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Buttons: .btn/.btn-p = solid (ink on light, ice on dark), .btn-g/.btn-ghost = hairline outline. Flat, square, no glow. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px;
  border: 1px solid var(--btn-bg); border-radius: var(--r);
  font: 500 15px var(--sans); letter-spacing: -0.01em;
  color: var(--btn-fg); text-decoration: none; cursor: pointer;
  background: var(--btn-bg);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 14px; }
.btn-g, .btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-g:hover, .btn-ghost:hover { background: var(--surface); border-color: var(--text); color: var(--text); }

/* Mono uppercase label (Mistral-style section eyebrow) */
.eyebrow { font: 400 12px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }

/* Stepped gradient blocks: square cells ramping ice to deep blue; size with width/height on the element */
.blocks {
  pointer-events: none;
  background:
    linear-gradient(var(--block-1), var(--block-1)) 0 100% / 12.5% 25% no-repeat,
    linear-gradient(var(--block-2), var(--block-2)) 12.5% 100% / 12.5% 50% no-repeat,
    linear-gradient(var(--block-3), var(--block-3)) 25% 100% / 12.5% 75% no-repeat,
    linear-gradient(var(--block-4), var(--block-4)) 37.5% 100% / 12.5% 100% no-repeat;
}

/* Mistral style is flat: decorative grid backdrop is intentionally off */
.gridbg { display: none; }

/* Scroll reveal is progressive enhancement: html.reveal-on is set only when JS + IntersectionObserver
   exist and motion is allowed, so content is visible in every other case. */
.reveal-on [data-reveal], .reveal-on .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 40ms);
}
.reveal-on [data-reveal].in, .reveal-on .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
