/* ==========================================================================
   Base: reset, typography defaults, utilities
   ========================================================================== */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  /* Inter's opsz 32 instance is the "Inter Display" cut used in Figma */
  font-variation-settings: "opsz" 32;
  font-weight: var(--font-weight-regular);
  font-size: var(--text-body-2);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body-2);
  color: var(--color-black);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img, svg { display: block; max-width: none; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
figure { margin: 0; }

/* balanced line breaks everywhere, as in the Framer build */
h1, h2, h3, h4, h5, h6, p, li, dd, figcaption, blockquote { text-wrap: balance; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Figma measures text from cap-height to baseline ("text-box-trim").
   Browsers that support text-box get pixel-matching spacing; others
   fall back gracefully to normal line boxes. */
.trim { text-box: trim-both cap alphabetic; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-16);
  top: -100px;
  z-index: 100;
  padding: var(--space-14);
  background: var(--color-white);
  color: var(--color-black);
}
.skip-link:focus { top: var(--space-16); }

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

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Page transitions ------------------------------------------
   Cross-document view transitions (js/transition.js): pages sweep in, and
   the header is captured on its own so it stays put and only its theme
   (light ↔ dark) fades. Browsers without support just navigate normally. */

@view-transition { navigation: auto; }

.site-header { view-transition-name: site-header; }

/* the new page is swept in from the bottom up behind a soft gradient edge,
   over the old page, which holds still underneath */
::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) {
  mix-blend-mode: normal;
  /* 300% tall mask: transparent top, opaque bottom, a soft band in between.
     Sliding it from top to bottom lifts that edge up the screen. */
  mask-image: linear-gradient(to top, #000 35%, transparent 65%);
  mask-size: 100% 300%;
  mask-repeat: no-repeat;
  animation: page-sweep 900ms cubic-bezier(0.65, 0, 0.35, 1) both;
}
@keyframes page-sweep {
  from { mask-position: 0 0; }
  to   { mask-position: 0 100%; }
}
::view-transition-group(site-header),
::view-transition-old(site-header),
::view-transition-new(site-header) { animation-duration: 400ms; animation-timing-function: ease; }

/* arriving through a transition: the header is already on screen, skip its intro fade */
.is-page-transition .site-header { opacity: 1 !important; transition: none; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
