/* Lenis */
html.lenis,
html.lenis body {
  scroll-behavior: auto;
}

html.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

:where([id]) {
  scroll-margin-top: 1.5rem;
}

/* Motion foundation */
[data-hero-motion],
[data-reveal-section],
[data-cta-reveal] {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  --motion-sheen-opacity: 0;
  --motion-sheen-x: -18%;
}

[data-reveal-section]::before,
[data-cta-reveal]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--motion-sheen-opacity);
  transform: translate3d(var(--motion-sheen-x), 0, 0);
  background:
    linear-gradient(
      110deg,
      transparent 0%,
      rgba(255, 255, 255, 0) 32%,
      rgba(255, 255, 255, 0.26) 50%,
      rgba(255, 255, 255, 0) 68%,
      transparent 100%
    );
  mix-blend-mode: soft-light;
}

[data-reveal-section] > *,
[data-cta-reveal] > * {
  position: relative;
  z-index: 1;
}

[data-reveal-item],
[data-reveal-group],
[data-hero-title],
[data-reveal-heading],
[data-image-reveal],
.line-reveal-inner,
.motion-marquee {
  will-change: transform, opacity;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  transition:
    background-color 0.24s ease,
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    backdrop-filter 0.24s ease;
}

.site-header .header-inner {
  transition: min-height 0.24s ease;
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--traditional) 88%, transparent);
  border-bottom-color: color-mix(in srgb, var(--white) 28%, transparent);
  box-shadow: 0 1rem 2.5rem color-mix(in srgb, var(--black) 16%, transparent);
  backdrop-filter: blur(18px);
}

.site-header.is-scrolled .header-inner {
  min-height: 4.35rem;
}

/* Hero */
[data-hero-motion] [data-image-reveal] {
  overflow: hidden;
}

[data-hero-motion] [data-image-reveal] img {
  display: block;
  will-change: transform;
}

/* Heading reveals */
.line-reveal-mask {
  display: block;
  overflow: hidden;
  padding-block: 0.04em 0.1em;
  margin-block: -0.04em -0.1em;
}

.line-reveal-inner {
  display: block;
}

/* Image reveals */
[data-image-reveal] {
  overflow: hidden;
}

[data-image-reveal] img {
  display: block;
  will-change: transform;
}

/* Pinned story */
.home-scroll-story__pin,
.home-scroll-story__track {
  position: relative;
}

.home-scroll-story__pin {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding-block: clamp(4rem, 7vw, 6.5rem);
}

.home-scroll-story__track {
  width: 100%;
  min-height: min(74svh, 48rem);
  display: grid;
  place-items: center;
}

.home-scroll-story__panel {
  position: absolute;
  inset: 0;
  grid-area: 1 / 1;
  width: min(100%, 58rem);
  margin-inline: auto;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  transform-origin: center center;
}

.home-scroll-story__panel--second {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.home-scroll-story .eyebrow {
  justify-self: center;
}

.home-scroll-story h2,
.home-scroll-story p {
  margin-inline: auto;
  text-align: center;
}

.home-scroll-story h2 {
  max-width: 11ch;
}

.home-scroll-story p {
  max-width: 38rem;
}

/* Cards and grids */
[data-card-grid],
.card-grid,
.value-grid,
.pricing-grid,
.event-grid,
.article-grid,
.photo-grid,
.accordion {
  position: relative;
}

/* Gallery */
.motion-marquee {
  width: max-content;
  max-width: none;
  margin: clamp(2.5rem, 7vw, 7rem) 0 clamp(1.5rem, 4vw, 4rem);
  white-space: nowrap;
  font-size: clamp(4.5rem, 14vw, 13rem);
  font-weight: 900;
  line-height: 0.78;
  letter-spacing: -0.07em;
  color: currentColor;
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
}

/* CTA */
.cta-band .motion-marquee {
  margin-block: 0 clamp(1.75rem, 4vw, 3rem);
  color: var(--traditional);
  opacity: 0.11;
}

/* Responsive */
@media (max-width: 63.99rem) {
  .home-scroll-story__pin {
    min-height: 94svh;
    padding-block: clamp(3.5rem, 8vw, 5.5rem);
  }

  .home-scroll-story__track {
    min-height: min(70svh, 42rem);
  }
}

@media (max-width: 47.99rem) {
  [data-hero-motion],
  [data-reveal-section],
  [data-cta-reveal] {
    overflow-x: hidden;
  }

  .site-header.is-scrolled .header-inner {
    min-height: 4.75rem;
  }

  .home-scroll-story__pin {
    min-height: 92svh;
    padding-block: 3.5rem;
  }

  .home-scroll-story__track {
    min-height: 68svh;
  }

  .home-scroll-story h2 {
    max-width: 10ch;
  }

  .motion-marquee {
    margin-block: 2.5rem 1.5rem;
    font-size: clamp(3.75rem, 20vw, 7rem);
  }

  .cta-band .motion-marquee {
    margin-block: 0 1.5rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  .motion-ready *,
  .motion-ready *::before,
  .motion-ready *::after {
    animation: none !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
    will-change: auto !important;
  }

  .motion-ready [data-reveal-section],
  .motion-ready [data-cta-reveal] {
    --motion-sheen-opacity: 0 !important;
    --motion-sheen-x: 0% !important;
  }

  .motion-ready [data-image-reveal],
  .motion-ready [data-image-reveal] img,
  .motion-ready [data-reveal-item],
  .motion-ready [data-reveal-group],
  .motion-ready [data-hero-title],
  .motion-ready [data-reveal-heading],
  .motion-ready .line-reveal-inner {
    transform: none !important;
    clip-path: none !important;
    opacity: 1 !important;
  }

  .motion-ready .motion-marquee {
    transform: none !important;
    clip-path: none !important;
  }

  .motion-ready .home-scroll-story__pin {
    min-height: auto;
  }

  .motion-ready .home-scroll-story__track {
    display: grid;
    gap: clamp(4rem, 10vw, 7rem);
    min-height: auto;
  }

  .motion-ready .home-scroll-story__panel,
  .motion-ready .home-scroll-story__panel--second {
    position: static;
    inset: auto;
    width: min(100%, 58rem);
    opacity: 1 !important;
    pointer-events: auto;
  }
}
