/* ==========================================================================
   Our Story — luxury wedding magazine editorial
   ========================================================================== */

.story-section {
  position: relative;
  padding-block: clamp(4.5rem, 10vw, 7.5rem);
  overflow-x: clip;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(201, 168, 76, 0.1), transparent 55%),
    linear-gradient(180deg, var(--color-ivory) 0%, #f3ebe0 50%, var(--color-ivory) 100%);
}

.story-section *,
.story-section *::before,
.story-section *::after {
  box-sizing: border-box;
}

.story-intro {
  width: var(--container);
  margin-inline: auto;
  margin-bottom: clamp(3rem, 7vw, 5rem);
  text-align: center;
}

.story-rail {
  position: relative;
  width: min(1120px, calc(100% - 1.5rem));
  margin-inline: auto;
  padding-inline: 0.25rem;
}

/* Gold timeline ---------------------------------------------------------- */
.story-timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(201, 168, 76, 0.18);
  pointer-events: none;
  z-index: 0;
}

.story-timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--color-gold-light), var(--color-gold), var(--color-gold-deep));
  transform-origin: top center;
  transform: scaleY(0);
  will-change: transform;
}

/* Chapters --------------------------------------------------------------- */
.story-chapter {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  margin-bottom: clamp(3.5rem, 8vw, 6.5rem);
  width: 100%;
  max-width: 100%;
}

.story-chapter:last-child {
  margin-bottom: 0;
}

.story-chapter--right .story-media {
  order: 2;
}

.story-chapter--right .story-copy {
  order: 1;
  text-align: right;
  margin-left: auto;
}

.story-chapter--right .story-copy .gold-rule {
  margin-left: auto;
  margin-right: 0;
}

.story-chapter--right .story-ornament {
  left: auto;
  right: -0.5rem;
}

/* Timeline node */
.story-node {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%) scale(0.4);
  border-radius: 50%;
  background: var(--color-ivory);
  border: 1.5px solid var(--color-gold);
  box-shadow: 0 0 0 4px rgba(250, 246, 239, 0.95);
  opacity: 0;
  pointer-events: none;
}

.story-node::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--color-gold);
  opacity: 0.85;
}

/* Media ------------------------------------------------------------------ */
.story-media {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.story-frame {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 4 / 3;
  background: #2a1218;
  box-shadow:
    0 24px 60px rgba(61, 6, 17, 0.14),
    inset 0 0 0 1px rgba(201, 168, 76, 0.35);
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
}

.story-chapter:nth-child(odd) .story-frame {
  aspect-ratio: 4 / 3;
}

.story-chapter:nth-child(even) .story-frame {
  aspect-ratio: 3 / 4;
  max-height: 560px;
  margin-inline: auto;
  width: min(100%, 420px);
}

.story-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(201, 168, 76, 0.4);
  pointer-events: none;
  z-index: 2;
  opacity: 0.85;
}

.story-parallax {
  position: absolute;
  inset: -12%;
  will-change: transform;
}

.story-parallax img,
.story-photo-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.92) contrast(1.04);
}

.story-photo-fallback {
  background:
    linear-gradient(145deg, #3d0611 0%, #5c0a1a 40%, #1a4a3a 100%);
}

.story-frame-caption {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 3;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 230, 200, 0.85);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  opacity: 0;
}

/* Copy ------------------------------------------------------------------- */
.story-copy {
  position: relative;
  width: 100%;
  max-width: 28rem;
  min-width: 0;
  padding-inline: 0.25rem;
}

.story-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-emerald);
  opacity: 0;
  transform: translateY(18px);
}

.story-heading {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-maroon-deep);
  opacity: 0;
  transform: translateY(22px);
}

.story-text {
  margin: 0 0 0.85rem;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-ink-soft);
  opacity: 0;
  transform: translateY(18px);
}

.story-text:last-child {
  margin-bottom: 0;
}

.story-copy .gold-rule {
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: left center;
  margin-block: 0.85rem 1.1rem;
}

.story-chapter--right .story-copy .gold-rule {
  transform-origin: right center;
}

/* Decorative florals ----------------------------------------------------- */
.story-ornament {
  position: absolute;
  top: -0.5rem;
  left: -0.5rem;
  width: clamp(56px, 10vw, 88px);
  height: clamp(56px, 10vw, 88px);
  opacity: 0;
  pointer-events: none;
  color: var(--color-gold);
}

.story-ornament svg {
  width: 100%;
  height: 100%;
  display: block;
}

.story-ornament .motif-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
}

.story-ornament .motif-leaf {
  fill: rgba(201, 168, 76, 0.28);
  stroke: currentColor;
  stroke-width: 0.7;
}

.story-ornament .motif-dot {
  fill: currentColor;
}

/* Intro animation targets */
.story-intro [data-story-intro] {
  opacity: 0;
  transform: translateY(24px);
}

/* Mobile ----------------------------------------------------------------- */
@media (max-width: 900px) {
  .story-timeline-line {
    left: 1rem;
    transform: none;
  }

  .story-node {
    left: 1rem;
  }

  .story-chapter,
  .story-chapter--right {
    grid-template-columns: 1fr;
    gap: 1.35rem;
    padding-left: 2rem;
  }

  .story-chapter--right .story-media,
  .story-chapter--right .story-copy,
  .story-chapter .story-media,
  .story-chapter .story-copy {
    order: initial;
  }

  .story-chapter--right .story-copy {
    text-align: left;
    margin-left: 0;
  }

  .story-chapter--right .story-copy .gold-rule {
    margin-left: 0;
    margin-right: auto;
    transform-origin: left center;
  }

  .story-chapter--right .story-ornament {
    left: -0.25rem;
    right: auto;
  }

  .story-chapter:nth-child(even) .story-frame {
    width: 100%;
    max-height: none;
    aspect-ratio: 4 / 3;
  }

  .story-copy {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .story-rail {
    width: calc(100% - 1rem);
  }

  .story-chapter,
  .story-chapter--right {
    padding-left: 1.6rem;
  }

  .story-frame::after {
    inset: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-frame {
    clip-path: none !important;
  }

  .story-kicker,
  .story-heading,
  .story-text,
  .story-copy .gold-rule,
  .story-ornament,
  .story-node,
  .story-intro [data-story-intro],
  .story-frame-caption {
    opacity: 1 !important;
    transform: none !important;
  }

  .story-timeline-progress {
    transform: scaleY(1) !important;
  }
}
