/* ==========================================================================
   1 Poultry — reset, typography, layout primitives, reveal system
   ========================================================================== */

/* Brand face: Poultry Sans, licensed webfonts in assets/fonts/. */
/* swap, not optional.

   `optional` gives a face about 100ms to arrive and, if it misses, drops it
   for the whole of that page view — the brand face then only appears on a
   later navigation, once it is in cache. On a local file that window is never
   missed and the rule looked free. Over a wire it is the opposite: the first
   visit to the site, which is the one that matters, is the visit that does not
   get the typeface. `swap` renders the fallback and swaps the moment the face
   lands.

   The reason that is safe here, when it was not before: the preload in each
   <head> was pointing at a different URL from the one this rule asks for — the
   HTML link carried a ?v= cache-buster and the @font-face did not — so the
   browser fetched each face twice, the preload bought nothing, and the real
   copy arrived late enough for `optional` to give up on it. Both now carry the
   same stamp, and the faces are subset to a third of their weight, so the face
   is in hand before the first paint and there is nothing to swap. */
@font-face {
  font-family: "Poultry Sans";
  src: url("../fonts/PoultrySans-Medium.woff2?v=5691fa98") format("woff2"),
       url("../fonts/PoultrySans-Medium.woff?v=d5278eae")  format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poultry Sans";
  src: url("../fonts/PoultrySans-MediumItalic.woff2?v=8cc63aac") format("woff2"),
       url("../fonts/PoultrySans-MediumItalic.woff?v=70ca9f0e")  format("woff");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Poultry Sans";
  src: url("../fonts/PoultrySans-Semibold.woff2?v=595cac4b") format("woff2"),
       url("../fonts/PoultrySans-Semibold.woff?v=e08d981b")  format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poultry Sans";
  src: url("../fonts/PoultrySans-SemiboldItalic.woff2?v=6cc6818f") format("woff2"),
       url("../fonts/PoultrySans-SemiboldItalic.woff?v=31b615a8")  format("woff");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Everything on the site is sized in rem, so this one number scales the
     whole design. 16px is the 1:1 case — the Figma's own 1440 x 1024 frame —
     and site.js narrows or widens it to fit the window before the first
     paint. A window that cannot run the script simply gets the design at
     1:1, which is a legitimate page rather than a broken one. */
  font-size: 16px;
  /* auto, deliberately. This was "smooth" as a fallback for when Lenis is
     not running — but a smooth scroll-behavior makes EVERY programmatic
     scrollTo an animation, including the instant ones a deep link uses to
     place itself. The landing then reads a position still in flight,
     computes a large error, corrects, and restarts the animation, so it
     never arrives: in Safari it sat at 407 while aiming for 7128. The one
     place a glide is wanted asks for it explicitly, in site.js. */
  scroll-behavior: auto;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--c-cream);
  color: var(--c-black);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* clip, NOT hidden. overflow-x: hidden makes the other axis compute to
     auto, which turns <body> into a scroll container — and a scroll
     container between a position: sticky element and the viewport is what
     sticky then sticks to. Blink papers over that for the body; WebKit
     follows the spec, so every sticky on the site (the home strip's rail
     above 1025px, and the pinned rails elsewhere) silently stopped
     sticking in Safari and you scrolled through screens of empty rail.
     overflow-x: clip creates no scroll container and leaves the y axis
     visible, so it suppresses sideways overflow without that cost.
     .page below has always used clip for the same reason. */
  overflow-x: clip;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
ul, ol { list-style: none; }
/* Poultry Sans ships a Semibold, so the UA's bold default would silently
   promote every heading. The brand sets headings in Medium. */
h1, h2, h3, h4, h5, h6 { font-weight: 500; }
::selection { background: var(--c-rose); color: var(--c-cream); }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 0.25rem;
  border-radius: 2px;
}

.skip-link {
  position: absolute; top: -6.25rem; left: var(--pad-x); z-index: var(--z-loader);
  padding: 0.625rem 1.25rem; background: var(--c-black); color: var(--c-cream);
  border-radius: 6.25rem; transition: top var(--dur-sm) var(--ease-out-expo);
}
.skip-link:focus { top: 1rem; }

/* ---------- Type ---------------------------------------------------- */
.t-display { font-size: var(--fs-display); line-height: var(--lh-tight); }
.t-lead    { font-size: var(--fs-lead);    line-height: var(--lh-snug); }
.t-body    { font-size: var(--fs-body);    line-height: var(--lh-body); }
.t-small   { font-size: var(--fs-small);   line-height: var(--lh-snug); }
.t-xs      { font-size: var(--fs-xs);      line-height: var(--lh-snug); }
.t-micro   { font-size: var(--fs-micro);   line-height: var(--lh-ui); }
.t-caps    { text-transform: uppercase; letter-spacing: 0.06em; }
.t-center  { text-align: center; }
.t-italic  { font-style: italic; }

.u-cream { color: var(--c-cream); }
.u-white { color: var(--c-white); }
.u-black { color: var(--c-black); }

.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;
}

/* ---------- Layout -------------------------------------------------- */
.page { position: relative; width: 100%; overflow-x: clip; }

.shell {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.shell--wide { max-width: none; }
.shell--flush { padding-inline: 0; }

.section { position: relative; width: 100%; }
.section--dark  { background: var(--c-black); color: var(--c-cream); }
.section--black { background: var(--c-black-true); color: var(--c-white); }
.section--cream { background: var(--c-cream); color: var(--c-black); }
.section--pad   { padding-block: clamp(3.75rem, calc(8.3333vw * var(--s)), 7.5rem); }
.section--screen { min-height: var(--vh-hero); display: grid; align-items: center; }

.stack     { display: flex; flex-direction: column; }
.stack--8  { gap: 0.625rem; }  .stack--12 { gap: 0.625rem; }
.stack--24 { gap: 1.25rem; } .stack--32 { gap: 1.875rem; }
.stack--48 { gap: 2.8125rem; }

/* ---------- Full-bleed media beds ----------------------------------- */
/* Every hero and interstitial in the Figma file is the same object:
   a full-bleed image, a scrim top and bottom, and centred type.         */
.bleed {
  position: relative;
  width: 100%;
  min-height: var(--vh-hero);
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--c-black);
}
.bleed__media { position: absolute; inset: 0; z-index: -2; }
.bleed__media img,
.bleed__media video { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.bleed::before,
.bleed::after { content: ""; position: absolute; left: 0; right: 0; height: 42%; z-index: -1; pointer-events: none; }
.bleed::before { top: 0;    background: var(--grad-scrim-top); }
.bleed::after  { bottom: 0; background: var(--grad-scrim-bottom); }
.bleed--wash > .bleed__media::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(0, 0, 0, var(--bleed-wash, 0.38));
  pointer-events: none;
}
/* .bleed__inner is a centred grid item, so an `auto` width would be
   fit-content — sized by its own text. That is what made headlines jump on
   load: the box was measured from the text, the text was measured against
   the box, and any transient (the web font arriving, a heading being split
   into word spans for its reveal) tipped a one-line headline into two lines
   and back again. A stated width takes the text out of the measurement, so
   the box is the same before and after the font lands. */
.bleed__inner {
  position: relative;
  text-align: center;
  color: var(--c-cream);
  padding-inline: var(--pad-x);
  width: 56.25rem;
  max-width: 100%;
}
/* ...and every grid that holds one caps its column. An implicit `auto` column
   is sized by the item's max-content, and the item states 900px, so the column
   became 900 and the `max-width: 100%` above resolved against 900 rather than
   against the phone — every hero on the site was 900 wide inside a 390 screen,
   with the headline hanging off the right.

   Named, not :has(). The selector version was one line, but it is the only
   thing standing between a phone and a broken hero, and :has() is a 2022
   feature — on anything older the rule does not parse and the bug comes
   straight back with nothing to show for it. These are the three parents in
   the markup; a fourth would need adding here. */
.bleed,
.exp-hero__stage,
.exp-cta__stage { grid-template-columns: minmax(0, 1fr); }

/* ---------- Reveal system ------------------------------------------
   Elements carry data-reveal; site.js adds .is-in when they cross into
   view. Everything is transform+opacity only, so it stays on the GPU.  */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, var(--reveal-shift), 0);
  transition:
    opacity   var(--dur-md) var(--ease-out-expo) var(--reveal-delay, 0ms),
    transform var(--dur-md) var(--ease-out-expo) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="fade"]  { transform: none; }
/* The directional and scale variants are fades too, for the same reason:
   nothing carrying words may arrive by moving. */
[data-reveal="left"],
[data-reveal="right"],
[data-reveal="scale"] { transform: none; }
[data-reveal].is-in   { opacity: 1; transform: none; }

/* Headline reveal.

   This used to split the heading into one inline-block <span> per word and
   fade them in sequence. Replacing a heading's text node with spans makes
   the browser re-run line breaking on different boxes — and with
   text-wrap: balance on top, the statement headline broke into four ragged
   lines for a moment before settling back to two. That was the headline
   visibly re-laying itself out on load.

   The heading is left as plain text and fades as one. Nothing is
   re-parented, so there is nothing to re-break. */
[data-split] {
  opacity: 0;
  transition: opacity var(--dur-lg) var(--ease-out-quart);
  will-change: opacity;
}
[data-split].is-in,
.is-in [data-split] { opacity: 1; }

/* Masked image reveal — the image scales back as its cover slides away */
.mask-reveal { position: relative; overflow: hidden; }
.mask-reveal > img,
.mask-reveal > picture { transform: scale(1.14); transition: transform var(--dur-xl) var(--ease-out-expo); }
.mask-reveal.is-in > img,
.mask-reveal.is-in > picture { transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  [data-split]  { opacity: 1 !important; }
  .mask-reveal > img { transform: none !important; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
