/* ==========================================================================
   Base — reset, type, grid, texture
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--ivory);
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--f-sans);
  font-weight: 300;
  letter-spacing: .005em;
  font-size: var(--fs-body);
  line-height: 1.65;
  overflow-x: clip;
}

img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, figure, ul, ol, dl, dd, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
::selection { background: var(--maroon); color: var(--ivory); }
:focus-visible { outline: 1px solid var(--maroon); outline-offset: 4px; }

/* Film grain — very subtle, fixed */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typography ---------- */
.display {
  font-family: var(--f-display);
  font-weight: 300;
  line-height: .9;
  letter-spacing: -0.025em;
  font-feature-settings: "liga", "dlig", "kern";
}
.display--mega { font-size: var(--fs-mega); }
.display--xl { font-size: var(--fs-xl); }
.display--l { font-size: var(--fs-l); line-height: .96; letter-spacing: -0.02em; }
.display--m { font-size: var(--fs-m); line-height: 1.02; letter-spacing: -0.012em; }

em, .em {
  font-family: var(--f-accent);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--maroon);
}
.on-dark em, .on-dark .em, .on-maroon em { color: var(--grey-300); }

.lede {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: var(--fs-lede);
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.lede em { font-size: 1.04em; }

.label {
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: var(--fs-label);
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.label .n {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.35em;
  letter-spacing: 0;
  text-transform: none;
  margin-right: .5em;
}
.muted { color: var(--grey-600); }
.body { max-width: 44ch; color: var(--ink-soft); }
.body + .body { margin-top: 1.1em; }
.small { font-size: var(--fs-small); line-height: 1.6; }

/* ---------- Layout ---------- */
.wrap { padding-inline: var(--gutter); }
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
}
.grid > [style*="--c"] { grid-column: var(--c); }
.section { padding-block: var(--section); position: relative; }
.rule { height: 1px; background: var(--line); transform-origin: left center; }
.on-dark { background: var(--ink); color: var(--ivory); }
.on-dark .rule { background: var(--line-light); }
.on-dark .muted { color: var(--grey-400); }
.on-dark .body { color: rgba(243, 239, 232, .74); }
.on-paper { background: var(--paper); }

/* Visually hidden */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Media ---------- */
.media { position: relative; overflow: hidden; background: var(--bone); }
.media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.74) contrast(1.03) sepia(.07);
  transition: filter 1.2s var(--ease), transform 1.6s var(--ease);
  will-change: transform;
}
.hide-m {}
@media (max-width: 760px) { .hide-m { display: none !important; } }

@media (max-width: 760px) {
  .grid > [style*="--c"] { grid-column: var(--cm, 1 / -1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Static fallback when animation frames are paused: show everything */
html.z-static [data-fade], html.z-static [data-svc], html.z-static .split-line > *,
html.z-static .line-mask > span, html.z-static [data-hero-fade], html.z-static .help-row,
html.z-static .value, html.z-static .model, html.z-static [data-rule], html.z-static .footer__mark > * {
  opacity: 1 !important; visibility: visible !important; transform: none !important;
}
html.z-static [data-img-reveal], html.z-static [data-hero-img] { clip-path: none !important; }
html.z-static .curtain { transform: translateY(-100%) !important; }
