.scroll-story,
.story-finale {
  background: #f4efe9;
}

.scroll-story figure,
.story-finale {
  margin: 0;
}

.scroll-story img,
.story-finale img {
  display: block;
  width: 100%;
  object-fit: cover;
}

.story-feature {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 78svh;
  isolation: isolate;
  overflow: hidden;
  background: #211a17;
  color: #fff;
}

.story-feature img,
.story-feature::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.story-feature img {
  --crop-default-x: center; --crop-default-y: 35%;
  z-index: -2;
}

.story-feature .story-next-photo {
  display: none;
}

.story-feature::after {
  content: "";
  z-index: -1;
  background: linear-gradient(0deg, rgb(22 14 12 / 82%), transparent 68%);
}

.story-title {
  padding: clamp(2rem, 7vw, 8rem);
}

.scroll-story figcaption p {
  margin: 0 0 .65rem;
  font-size: .875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.scroll-story figcaption h2 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(2.4rem, 6vw, 6.75rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.story-pair figcaption {
  padding-top: 1.25rem;
}

.story-pair figcaption h2 {
  font-size: clamp(1.85rem, 3.6vw, 4.3rem);
}

.story-pair {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  align-items: start;
  gap: clamp(1.5rem, 5vw, 6rem);
  max-width: 100rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 8rem) clamp(1.25rem, 5vw, 6rem);
}

.story-pair figure:nth-child(2) {
  margin-top: clamp(2rem, 9vw, 10rem);
}

.story-pair img {
  aspect-ratio: 4 / 5;
  --crop-default-x: center; --crop-default-y: 38%;
}

.story-pair figure:nth-child(2) img {
  aspect-ratio: 4 / 3;
}

.story-finale img {
  width: min(100%, 58rem);
  height: auto;
  aspect-ratio: 4 / 5;
  margin-inline: auto;
  --crop-default-x: center; --crop-default-y: top;
}

@media (max-width: 700px) {
  .story-pair {
    grid-template-columns: 1fr;
  }

  .story-pair figure:nth-child(2) {
    margin-top: 0;
  }

  .story-feature {
    min-height: 70svh;
  }

}

@media (prefers-reduced-motion: no-preference) {
  [data-reveal].is-pending {
    opacity: 0;
    translate: 0 1.5rem;
  }

  [data-reveal] {
    transition: opacity .65s ease, translate .75s ease;
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .story-chapter {
      height: 245svh;
      view-timeline-name: --portrait-chapter;
    }

    .story-feature {
      position: sticky;
      top: 0;
      min-height: 100svh;
    }

    .story-feature img:first-child {
      animation: story-portrait-zoom linear both;
      animation-timeline: --portrait-chapter;
      animation-range: entry 35% exit 15%;
    }

    .story-feature .story-next-photo {
      display: block;
      --crop-default-x: center; --crop-default-y: 32%;
      animation: story-photo-blend linear both;
      animation-timeline: --portrait-chapter;
      animation-range: contain 28% contain 80%;
    }

    .story-title {
      animation: story-title-rise linear both;
      animation-timeline: --portrait-chapter;
      animation-range: entry 55% contain 80%;
    }

  }

  @media (min-width: 701px) and (prefers-reduced-motion: no-preference) {
    .hero .hero-image > img {
      animation: story-hero-drift linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 100%;
    }

    .hero-copy {
      animation: story-hero-fade linear both;
      animation-timeline: view();
      animation-range: exit 15% exit 100%;
    }
  }
}

@keyframes story-hero-drift {
  from { translate: 0 0; }
  to { translate: 0 12%; }
}

@keyframes story-hero-fade {
  from { opacity: 1; }
  to { opacity: .25; }
}

@keyframes story-portrait-zoom {
  from { scale: 1.12; }
  to { scale: 1; }
}

@keyframes story-title-rise {
  from { opacity: 0; translate: 0 2rem; }
  35%, 70% { opacity: 1; translate: 0 0; }
  to { opacity: 0; translate: 0 -1rem; }
}

@keyframes story-photo-blend {
  from { opacity: 0; scale: 1.045; }
  to { opacity: 1; scale: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .story-pair [data-reveal],
  .story-finale[data-reveal] {
    opacity: 1;
    translate: none;
  }

  .story-pair [data-reveal] img,
  .story-finale img {
    clip-path: inset(0);
    transition: clip-path 1s cubic-bezier(.22, 1, .36, 1), scale 1.2s cubic-bezier(.22, 1, .36, 1);
  }

  .story-pair .is-pending:first-child img {
    clip-path: inset(0 100% 0 0);
    scale: 1.035;
  }

  .story-pair .is-pending:nth-child(2) img {
    clip-path: inset(0 0 0 100%);
    scale: 1.035;
  }

  .story-finale.is-pending img {
    clip-path: inset(12% 12% 12% 12%);
    scale: .94;
    opacity: 0;
  }

  .story-finale img {
    transition: clip-path 1s cubic-bezier(.22, 1, .36, 1), scale 1s cubic-bezier(.22, 1, .36, 1), opacity .65s ease;
  }

  .story-pair figcaption {
    transition: opacity .65s ease .16s, translate .75s ease .16s;
  }

  .story-pair .is-pending figcaption {
    opacity: 0;
    translate: 0 .85rem;
  }

  @media (max-width: 700px) {
    .story-pair .is-pending:first-child img,
    .story-pair .is-pending:nth-child(2) img {
      clip-path: inset(0 0 14% 0);
      scale: 1;
      opacity: 0;
    }

    .story-pair [data-reveal] img {
      transition: clip-path .7s ease, opacity .65s ease;
    }
  }
}

@media (max-width: 700px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .story-chapter {
      height: 215svh;
    }
  }

  .story-chapter.story-scroll-fallback {
    height: 215svh;
  }

  .story-feature img:first-child {
    --crop-default-x: center; --crop-default-y: 28%;
  }

  .story-chapter.story-scroll-fallback .story-feature {
    min-height: 100svh;
    position: sticky;
    top: 0;
  }

  .story-chapter.story-scroll-fallback .story-next-photo {
    display: block;
    --crop-default-x: center; --crop-default-y: 32%;
    opacity: var(--story-blend, 0);
  }

  .story-chapter.story-scroll-fallback .story-title {
    opacity: calc(1 - var(--story-blend, 0));
  }
}

.scroll-story img,
.story-finale img {
  object-position: var(--crop-desktop-x, var(--crop-default-x, center)) var(--crop-desktop-y, var(--crop-default-y, center));
}
.hero .hero-image img[data-desktop-crop] {
  object-position: var(--crop-desktop-x, 55%) var(--crop-desktop-y, 50%);
}
@media (max-width: 700px) {
  .scroll-story img,
  .story-finale img {
    object-position: var(--crop-mobile-x, var(--crop-default-x, center)) var(--crop-mobile-y, var(--crop-default-y, center));
  }
  .hero .hero-image img[data-desktop-crop] { object-position: center; }
  .hero .hero-image img[data-mobile-crop] {
    object-fit: cover;
    object-position: var(--crop-mobile-x, center) var(--crop-mobile-y, center);
  }
}
.scroll-story[hidden], .story-finale[hidden], .pricing-details[hidden], #price-estimator[hidden] { display: none; }
