.story-page {
  overflow-x: hidden;
  background: var(--paper);
}

.story-container {
  width: min(72rem, calc(100% - 5rem));
  margin-inline: auto;
}

.story-hero {
  min-height: clamp(30rem, 70svh, 36rem);
  color: var(--paper);
  background: #4f5b45;
}

.story-hero-inner {
  display: grid;
  width: min(76rem, calc(100% - 6rem));
  min-height: inherit;
  margin: 0 auto;
  padding: 2.25rem 1rem 0;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 0.82fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 8rem);
}

.story-hero-copy {
  padding-bottom: 2rem;
}

.story-hero h1 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(5.75rem, 9vw, 9rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.86;
}

.story-hero-copy p {
  margin: 2.15rem 0 0;
  color: rgba(250, 247, 241, 0.86);
  font: 400 clamp(0.8rem, 1vw, 0.95rem)/1.8 var(--ui);
}

.story-coral-rule {
  display: block;
  width: 3.2rem;
  height: 2px;
  margin-top: 1.65rem;
  background: var(--coral);
}

.story-hero-arch {
  width: min(30rem, 100%);
  max-height: 31rem;
  align-self: end;
  justify-self: center;
  object-fit: contain;
  object-position: center bottom;
}

.story-scroll-cue {
  margin: 0.9rem auto 0;
  border-color: rgba(250, 247, 241, 0.62);
  color: var(--paper);
}

.story-scroll-cue span {
  position: relative;
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.story-scroll-cue span::before,
.story-scroll-cue span::after {
  position: absolute;
  left: 50%;
  content: "";
}

.story-scroll-cue span::before {
  bottom: 0.05rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.story-scroll-cue span::after {
  top: 0.05rem;
  bottom: 0.15rem;
  width: 1px;
  background: currentColor;
  transform: translateX(-50%);
}

.story-scroll-cue:hover,
.story-scroll-cue:focus-visible {
  border-color: var(--coral);
  color: var(--coral);
}

.story-timeline {
  position: relative;
  background: var(--paper);
}

.story-timeline::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 1;
  width: 1px;
  content: "";
  background: rgba(230, 129, 109, 0.72);
}

.story-chapter,
.engagement-chapter {
  position: relative;
  z-index: 2;
  padding: clamp(5rem, 8vw, 8rem) 0;
  background: var(--paper);
}

.chapter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 0.75fr);
  align-items: center;
  gap: clamp(4rem, 9vw, 9rem);
}

.chapter-copy {
  position: relative;
  max-width: 28rem;
}

.chapter-copy-right::before {
  position: absolute;
  top: 1.7rem;
  left: calc(clamp(4rem, 9vw, 9rem) * -0.5 - 1rem);
  width: 0.72rem;
  height: 0.72rem;
  border: 2px solid var(--coral);
  border-radius: 50%;
  content: "";
  background: var(--paper);
  box-shadow: 0 0 0 0.28rem var(--paper);
}

.chapter-date {
  margin: 0 0 0.7rem;
  color: var(--coral);
  font: 500 0.67rem/1.2 var(--ui);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.chapter-copy h2,
.paths-heading h2,
.story-closing h2 {
  margin: 0;
  color: var(--moss);
  font-size: clamp(3.35rem, 5vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.92;
}

.chapter-copy > p:last-child,
.paths-copy p {
  margin: 1.5rem 0 0;
  color: #3d4744;
  font: 400 0.8rem/1.85 var(--ui);
}

.paper-photo {
  position: relative;
  margin: 0;
  padding: 0.72rem;
  background: #fffdf9;
  box-shadow: 0 0.8rem 2.2rem rgba(39, 51, 50, 0.12);
}

.paper-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.school-collage {
  position: relative;
  min-height: 31rem;
}

.school-photo-large {
  position: absolute;
  inset: 0 9% 8% 0;
  transform: rotate(-1.5deg);
}

.school-photo-large img {
  object-position: center 68%;
}

.school-photo-small {
  position: absolute;
  right: -2%;
  bottom: 0;
  z-index: 2;
  width: 48%;
  aspect-ratio: 4 / 3;
  transform: rotate(2.5deg);
}

.school-photo-large::before,
.school-photo-small::before,
.note-photo::before,
.tinder-photo::before {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  z-index: 3;
  width: 5.2rem;
  height: 1.35rem;
  content: "";
  background: rgba(218, 204, 166, 0.72);
  transform: translateX(-50%) rotate(-2deg);
}

.school-photo-small::before {
  width: 3.9rem;
  transform: translateX(-50%) rotate(3deg);
}

.note-chapter {
  background: var(--paper-deep);
}

.note-chapter .chapter-grid {
  grid-template-columns: minmax(17rem, 0.65fr) minmax(0, 1fr);
}

.note-photo {
  width: min(36rem, 100%);
  justify-self: center;
  transform: rotate(0.8deg);
}

.note-photo-rotated {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.note-photo-rotated img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
}

.note-photo figcaption {
  margin: 0.8rem 0 0.2rem;
  color: var(--moss);
  font: italic 400 1.15rem/1.3 var(--display);
  text-align: center;
}

.paths-chapter {
  position: relative;
  z-index: 2;
  padding: clamp(4.5rem, 7vw, 6.5rem) 0;
  background: var(--soft-sage);
}

.paths-inner {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  align-items: center;
  gap: clamp(4rem, 8vw, 8rem);
}

.paths-heading h2 {
  color: var(--ink);
}

.paths-copy {
  display: grid;
  grid-template-columns: 1fr 5.5rem 1fr;
  align-items: start;
  gap: 1.35rem;
}

.paths-copy article {
  padding-top: 0.9rem;
}

.paths-copy h3 {
  margin: 0;
  color: var(--moss);
  font-size: 2.1rem;
  font-weight: 400;
}

.paths-copy p {
  margin-top: 0.65rem;
  font-size: 0.72rem;
}

.paths-join {
  position: relative;
  display: block;
  height: 8rem;
  border-right: 1px dashed var(--moss);
  border-bottom: 1px dashed var(--moss);
  border-left: 1px dashed var(--moss);
  border-radius: 0 0 3rem 3rem;
}

.paths-join i {
  position: absolute;
  bottom: -0.4rem;
  left: 50%;
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--coral);
  border-radius: 50%;
  background: var(--soft-sage);
  transform: translateX(-50%);
}

.tinder-photo {
  aspect-ratio: 1.47 / 1;
  transform: rotate(-0.75deg);
}

.tinder-photo img {
  object-fit: contain;
  background: #080b10;
}

.carousel-chapter {
  position: relative;
  z-index: 2;
  padding: clamp(5rem, 8vw, 7rem) 0;
  background: var(--paper-deep);
}

.gallery-chapter {
  background: var(--soft-sage);
}

.carousel-intro {
  display: flex;
  margin-bottom: 2.6rem;
  align-items: end;
  justify-content: space-between;
  gap: 3rem;
}

.carousel-intro .chapter-copy {
  max-width: 36rem;
}

.carousel-controls {
  display: flex;
  min-width: 12rem;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.carousel-count {
  min-width: 4.25rem;
  margin: 0;
  color: var(--ink);
  font: 500 0.68rem/1 var(--ui);
  letter-spacing: 0.12em;
  text-align: center;
}

.carousel-button {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--moss);
  background: transparent;
  cursor: pointer;
}

.carousel-button::before,
.carousel-button::after {
  position: absolute;
  top: 50%;
  content: "";
  transform: translateY(-50%);
}

.carousel-button::before {
  right: 0.55rem;
  left: 0.55rem;
  height: 1px;
  background: currentColor;
}

.carousel-button::after {
  width: 0.52rem;
  height: 0.52rem;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.carousel-next::after {
  right: 0.55rem;
  transform: translateY(-50%) rotate(45deg);
}

.carousel-previous::after {
  left: 0.55rem;
  transform: translateY(-50%) rotate(-135deg);
}

.carousel-button:hover,
.carousel-button:focus-visible {
  color: var(--coral);
}

.carousel-button:disabled {
  opacity: 0.3;
  cursor: default;
}

.carousel-viewport {
  display: flex;
  width: 100%;
  padding: 1rem max(2.5rem, calc((100vw - 72rem) / 2)) 3.2rem;
  overflow-x: auto;
  gap: 2rem;
  scroll-behavior: smooth;
  scroll-padding-inline: max(2.5rem, calc((100vw - 72rem) / 2));
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel-viewport::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  height: clamp(19rem, 30vw, 27rem);
  flex: 0 0 min(43rem, 58vw);
  scroll-snap-align: start;
}

.memory-viewport .carousel-slide {
  height: clamp(17rem, 27vw, 24rem);
  flex-basis: min(28rem, 36vw);
}

.gallery-viewport .carousel-slide {
  height: clamp(17rem, 27vw, 24rem);
  flex-basis: min(28rem, 36vw);
}

.gallery-viewport .portrait-slide {
  flex-basis: min(18rem, 24vw);
}

.engagement-chapter {
  padding-bottom: 0;
}

.engagement-story-grid {
  display: grid;
  padding-bottom: clamp(5rem, 8vw, 8rem);
  grid-template-columns: 0.66fr 1fr 0.68fr;
  align-items: center;
  gap: 2rem;
}

.engagement-ring-photo {
  height: clamp(22rem, 35vw, 33rem);
}

.engagement-hands-photo {
  height: clamp(19rem, 30vw, 28rem);
  transform: translateY(2.5rem) rotate(1deg);
}

.engagement-hands-photo img {
  filter: grayscale(1);
}

.castle-photo {
  height: clamp(18rem, 33vw, 30rem);
  margin: 0;
  grid-column: 1 / -1;
  overflow: hidden;
}

.castle-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
}

.story-closing {
  position: relative;
  display: grid;
  min-height: clamp(29rem, 45vw, 42rem);
  overflow: hidden;
  color: var(--paper);
  background: var(--moss);
  place-items: center;
  text-align: center;
}

.story-closing > img {
  position: absolute;
  top: 2.5rem;
  left: 50%;
  width: auto;
  max-width: none;
  height: min(36rem, 82%);
  object-fit: contain;
  opacity: 0.42;
  transform: translateX(-50%);
}

.story-closing > div {
  position: relative;
  z-index: 2;
  padding: 4rem 1.5rem;
}

.story-closing h2 {
  color: var(--paper);
  font-size: clamp(3rem, 5.3vw, 5.3rem);
  line-height: 1;
}

.closing-flower {
  display: block;
  margin-top: 2rem;
  color: var(--coral);
  font-size: 2rem;
}

@media (max-width: 900px) {
  .story-container {
    width: min(100% - 3rem, 44rem);
  }

  .story-hero {
    min-height: 44rem;
  }

  .story-hero-inner {
    width: min(100% - 3rem, 44rem);
    min-height: 44rem;
    padding-top: 3rem;
    grid-template-columns: 1fr 0.78fr;
    gap: 2.5rem;
  }

  .story-hero h1 {
    font-size: clamp(4.6rem, 12vw, 6.6rem);
  }

  .story-timeline::before {
    display: none;
  }

  .chapter-grid,
  .note-chapter .chapter-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  .chapter-copy-right::before {
    display: none;
  }

  .red-table .chapter-copy,
  .tinder-chapter .chapter-copy {
    grid-row: 1;
  }

  .school-collage {
    min-height: 34rem;
  }

  .paths-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .engagement-story-grid {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .engagement-story-grid .chapter-copy,
  .castle-photo {
    grid-column: 1 / -1;
  }

  .carousel-slide {
    flex-basis: min(36rem, 76vw);
  }

  .memory-viewport .carousel-slide,
  .gallery-viewport .carousel-slide,
  .gallery-viewport .portrait-slide {
    flex-basis: min(27rem, 61vw);
  }
}

@media (max-width: 640px) {
  .story-container {
    width: calc(100% - 2.5rem);
  }

  .story-hero {
    min-height: calc(100svh - var(--site-header-height));
  }

  .story-hero-inner {
    display: flex;
    width: calc(100% - 2.5rem);
    min-height: calc(100svh - var(--site-header-height));
    padding: 2.75rem 0 4.5rem;
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    text-align: center;
  }

  .story-hero-arch {
    width: min(14rem, 62vw);
    max-height: 19rem;
    order: -1;
    align-self: center;
  }

  .story-hero-copy {
    padding-bottom: 0;
  }

  .story-hero h1 {
    font-size: clamp(4.4rem, 20vw, 6rem);
  }

  .story-hero-copy p {
    margin-top: 1.5rem;
    font-size: 0.76rem;
  }

  .story-hero .story-coral-rule {
    margin-inline: auto;
  }

  .story-chapter,
  .engagement-chapter {
    padding: 4.5rem 0;
  }

  .chapter-grid,
  .note-chapter .chapter-grid {
    gap: 2.75rem;
  }

  .chapter-copy h2,
  .paths-heading h2,
  .story-closing h2 {
    font-size: clamp(3.1rem, 15vw, 4rem);
  }

  .chapter-copy > p:last-child,
  .paths-copy p {
    font-size: 0.76rem;
    line-height: 1.8;
  }

  .school-collage {
    min-height: 25rem;
  }

  .school-photo-large {
    right: 4%;
    bottom: 12%;
  }

  .school-photo-small {
    right: -1%;
    width: 54%;
  }

  .paths-chapter {
    padding: 4rem 0;
  }

  .paths-copy {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .paths-join {
    display: none;
  }

  .tinder-photo {
    aspect-ratio: auto;
  }

  .tinder-photo img {
    height: auto;
  }

  .carousel-chapter {
    padding: 4.5rem 0 3rem;
  }

  .carousel-intro {
    margin-bottom: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .carousel-controls {
    min-width: 0;
    justify-content: flex-start;
  }

  .carousel-viewport {
    padding: 0.75rem 1.25rem 2.5rem;
    gap: 1rem;
    scroll-padding-inline: 1.25rem;
  }

  .carousel-slide,
  .gallery-viewport .carousel-slide,
  .gallery-viewport .portrait-slide {
    height: min(106vw, 25rem);
    flex-basis: calc(100vw - 3rem);
  }

  .engagement-story-grid {
    width: calc(100% - 2.5rem);
    padding-bottom: 0;
    grid-template-columns: 1fr 0.72fr;
    gap: 1rem;
  }

  .engagement-story-grid .chapter-copy {
    margin-bottom: 1rem;
  }

  .engagement-ring-photo {
    height: 22rem;
  }

  .engagement-hands-photo {
    height: 18rem;
    transform: translateY(1.5rem) rotate(1deg);
  }

  .castle-photo {
    height: 16rem;
    margin: 3.5rem -1.25rem -4.5rem;
  }

  .story-closing {
    min-height: 34rem;
  }

  .story-closing > img {
    top: 2rem;
    width: auto;
    height: min(30rem, 82%);
  }

  .story-closing h2 {
    font-size: clamp(2.75rem, 13vw, 3.7rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-viewport {
    scroll-behavior: auto;
  }
}
