/* =========================================================
   ourlovestory.css — full redesign: full-width, bold, loving.
   ========================================================= */

/* ---- Scroll-reveal: subtle fade + gentle drift ---- */
.will-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.72s ease-out, transform 0.72s ease-out;
}

.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Chapter pairs: container stays visible, children slide in from their own side */
.chapter-pair.will-reveal {
  opacity: 1;
  transform: none;
}

/* Normal pair: text on left slides from left, image on right slides from right */
.chapter-pair.will-reveal .chapter-pair__text-inner {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.75s ease-out, transform 0.75s ease-out;
}

.chapter-pair.will-reveal .chapter-pair__image {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.75s ease-out 0.1s, transform 0.75s ease-out 0.1s;
}

/* Flipped pair: image on left slides from left, text on right slides from right */
.chapter-pair--flip.will-reveal .chapter-pair__text-inner {
  transform: translateX(40px);
}

.chapter-pair--flip.will-reveal .chapter-pair__image {
  transform: translateX(-60px);
}

.chapter-pair.is-visible .chapter-pair__text-inner,
.chapter-pair.is-visible .chapter-pair__image {
  opacity: 1;
  transform: translateX(0);
}

/* =========================================================
   STORY HERO — inset image with border radius, matches main page hero
   ========================================================= */
.story-hero {
  position: relative;
  z-index: 2;
  /* min-height, not height: a fixed height + overflow:hidden silently
     clips the badge/title/sub/span whenever their combined content is
     taller than the viewport (longer copy, narrow/short screens).
     min-height keeps the full-bleed look for normal content while
     letting the section grow instead of clipping when it doesn't fit. */
  min-height: 100vh;
  background: var(--cream);
  padding: 28px;
  transition: padding-left 0.12s linear, padding-right 0.12s linear;
}

/* Inner frame: sizing shell only, doesn't clip — see __visual below */
.story-hero__frame {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 56px);
  border-radius: 25px;
  isolation: isolate;
  /* Grid, not flex: stacks __visual and __content in the same cell so
     the frame's height is driven by whichever is taller (usually
     __visual's min-height floor, but __content wins and grows the
     frame if its text ever needs more room). Nothing here clips. */
  display: grid;
}

/* Image/darken/overlay layer — this is the ONLY part that clips to
   the rounded corners. Kept separate from __content so long text can
   never be hidden by the image frame's own overflow:hidden. */
.story-hero__visual {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  isolation: isolate;
}

.story-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  transform: scale(1.04);
  animation: storyHeroZoom 14s var(--ease) forwards;
}

@keyframes storyHeroZoom {
  to { transform: scale(1); }
}

.story-hero__darken {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.story-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0.28) 45%,
    rgba(0, 0, 0, 0.75) 100%
  );
}

.story-hero__content {
  grid-row: 1;
  grid-column: 1;
  align-self: end;
  position: relative;
  z-index: 2;
  padding: 0 8vw 10vh;
}

.story-hero__badge {
  display: block;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(243, 237, 225, 0.8);
  margin-bottom: 28px;
}

.story-hero__title {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(64px, 9vw, 140px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--cream);
  margin: 0 0 32px;
}

.story-hero__title em {
  font-style: italic;
}

.story-hero__sub {
  display: inline-block;
  font-family: var(--sans);
  font-size: clamp(12px, 1.1vw, 15px);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(243, 237, 225, 0.95);
  margin: 0;
  background: rgba(20, 21, 15, 0.72);
  padding: 10px 16px;
  border-radius: 12px;
}

.story-hero__span {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(13px, 1.2vw, 16px);
  letter-spacing: 0.08em;
  color: rgba(243, 237, 225, 0.9);
  margin-top: 14px;
  background: rgba(20, 21, 15, 0.72);
  padding: 8px 16px;
  border-radius: 12px;
}

.story-hero__scroll {
  position: absolute;
  bottom: 44px;
  right: 8vw;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(243, 237, 225, 0.4);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.story-hero__scroll svg {
  width: 18px;
  height: 18px;
  animation: scrollBounce 2.4s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}

/* =========================================================
   STORY INTRO — wide centred text strip
   ========================================================= */
.story-intro {
  position: relative;
  z-index: 2;
  background: var(--cream);
  padding: 96px 32px;
}

.story-intro__inner {
  max-width: 1280px;
  margin: 0 auto;
}

.story-intro__eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

.story-intro__lede {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
}

/* =========================================================
   STORY VIDEO — expandable YouTube player
   ========================================================= */
.story-video {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.story-video__toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s ease;
}

.story-video__toggle:hover {
  color: var(--ink);
}

.story-video__play {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease, transform 0.35s ease;
}

.story-video__toggle:hover .story-video__play {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
  transform: scale(1.08);
}

.story-video__toggle[aria-expanded="true"] .story-video__play {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.story-video__line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.story-video__dur {
  opacity: 0.5;
}

.story-video__frame {
  overflow: hidden;
  max-height: none;
  opacity: 1;
  margin-top: 20px;
}

.story-video__ratio {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

.story-video__ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* =========================================================
   STORY CHAPTERS — full-width section
   ========================================================= */
.story-chapters {
  position: relative;
  z-index: 2;
  background: var(--cream);
  overflow: clip;
}

/* ---- Timeline spine — one continuous line built from a matching
   full-height segment on every chapter, so it reads as unbroken down
   the page without any section-height math. ---- */
.story-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--line);
  z-index: 2;
  pointer-events: none;
}

/* ---- Chapter marker — a small ring sitting on the spine, one per
   chapter. Desktop only (see responsive section): its fixed vertical
   offset is tuned to each variant's own top padding, which shifts too
   unpredictably on mobile (image-first stacking, viewport-relative
   heights) to keep aligned reliably. ---- */
.chapter__marker {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--accent);
  z-index: 3;
}

.chapter-pair .chapter__marker { top: 96px; }
.chapter-full .chapter__marker { top: 132px; }

.chapter-full--dark .chapter__marker {
  background: var(--ink);
  border-color: rgba(243, 237, 225, 0.2);
}

/* ---- Giant watermark year — the primary new typographic device.
   Sits behind the real content, centred within its own chapter. ---- */
.chapter__year-giant {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(120px, 22vw, 340px);
  line-height: 1;
  color: var(--ink);
  opacity: 0.05;
  letter-spacing: -0.02em;
  z-index: 0;
  pointer-events: none;
  white-space: nowrap;
}

.chapter-full--dark .chapter__year-giant {
  color: var(--cream);
  opacity: 0.07;
}

/* ---- Shared chapter text styles ---- */
.chapter__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.chapter__num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.chapter__rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.chapter__year {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.chapter__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(32px, 3.6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 28px;
}

.chapter__body {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 3vw, 46px);
  line-height: 1.68;
  color: var(--ink-soft);
  margin: 0;
}

/* Multi-paragraph chapters (e.g. The Evolution) — space consecutive
   paragraphs apart; single-paragraph chapters are unaffected. */
.chapter__body + .chapter__body {
  margin-top: 22px;
}

/* ---- Chapter pair (alternating grid) ---- */
.chapter-pair {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 640px;
  background: var(--cream);
  border-top: 1px solid var(--line);
}

.chapter-pair--flip .chapter-pair__image {
  order: -1;
}

.chapter-pair__text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 80px 7vw;
}

.chapter-pair__text-inner {
  max-width: 640px;
}

.chapter-pair__image {
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: #e8e0d0;
  border-radius: 20px;
  margin: 32px 32px 32px 0;
}

.chapter-pair--flip .chapter-pair__image {
  margin: 32px 0 32px 32px;
}

.chapter-pair__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Chapter full (centred, full-width, all cream) ---- */
.chapter-full {
  position: relative;
  background: var(--cream);
  padding: 120px 32px;
  border-top: 1px solid var(--line);
}

/* The story's two hardship beats — the 2009 diagnosis and the 2020
   health decline — are the only dark panels on an otherwise light
   page, so the tonal shift itself carries meaning. */
.chapter-full--dark {
  background: var(--ink);
  border-top-color: rgba(243, 237, 225, 0.12);
}

.chapter-full--dark .chapter__num,
.chapter-full--dark .chapter__year {
  color: rgba(243, 237, 225, 0.55);
}

.chapter-full--dark .chapter__rule {
  background: rgba(243, 237, 225, 0.16);
}

.chapter-full--dark .chapter__title,
.chapter-full--dark .chapter-full__quote {
  color: var(--cream);
}

.chapter-full--dark .chapter__body {
  color: rgba(243, 237, 225, 0.75);
}

.chapter-full__inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
}

.chapter-full__quote {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(36px, 4.8vw, 72px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 48px;
}

/* =========================================================
   CLOSING QUOTE
   ========================================================= */
.story-quote {
  position: relative;
  z-index: 2;
  background: var(--cream);
  padding: 96px 32px 100px;
  text-align: center;
  border-radius: 0 0 40px 40px;
  box-shadow: 0 60px 80px -50px rgba(0, 0, 0, 0.5);
}

.story-quote__inner {
  max-width: 740px;
  margin: 0 auto;
}

.story-quote__text {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 50px);
  line-height: 1.3;
  color: var(--ink);
  margin: 0 auto 28px;
  max-width: 32ch;
}

.story-quote__attr {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 56px;
}

.story-quote__cta {
  display: flex;
  justify-content: center;
}

/* =========================================================
   INLINE CHAPTER SIGNATURE (Chapter 07)
   ========================================================= */
.chapter-sig {
  margin-top: 52px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.chapter-sig__name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(44px, 5vw, 68px);
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 10px;
}

.chapter-sig__role {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

.chapter-sig__location {
  font-family: var(--sans);
  font-size: 24px;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.55;
  margin: 0;
  max-width: 42ch;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .story-hero {
    padding: 14px;
  }

  .story-hero__frame {
    border-radius: 20px;
    min-height: calc(100vh - 28px);
  }

  .story-hero__content {
    padding: 0 6vw 8vh;
  }

  .story-intro {
    padding: 72px 28px;
  }

  /* Marker's desktop offset is tuned to a text-first layout; mobile's
     image-first stacking + viewport-relative image heights make a
     reliable fixed offset impractical, so it's hidden here and the
     spine + giant year carry the timeline motif instead. */
  .chapter__marker {
    display: none;
  }

  .chapter__year {
    font-size: 14px;
  }

  .chapter__body {
    font-size: 17px;
    line-height: 1.55;
  }

  /* Sits inside the existing 20-28px content padding/margin rather
     than matching it, so it reads as a rail clear of the text and
     images instead of running through their left edge. */
  .story-spine {
    left: 10px;
  }

  .chapter__year-giant {
    font-size: clamp(80px, 22vw, 140px);
    opacity: 0.04;
  }

  .chapter-full--dark .chapter__year-giant {
    opacity: 0.05;
  }

  .chapter-pair {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  /* Image always sits above text on mobile regardless of --flip */
  .chapter-pair--flip .chapter-pair__image {
    order: 0;
  }

  .chapter-pair__image {
    min-height: 55vw;
    border-radius: 14px;
    margin: 20px 20px 32px;
  }

  .chapter-pair--flip .chapter-pair__image {
    margin: 20px 20px 32px;
  }

  .chapter-pair__text {
    padding: 40px 28px 56px;
  }

  .chapter-pair__text-inner {
    max-width: 100%;
  }

  .chapter-full {
    padding: 80px 28px;
  }

  .story-quote {
    padding: 0 28px 72px;
    border-radius: 0 0 28px 28px;
  }
}

@media (max-width: 540px) {
  .story-hero {
    min-height: 0;
    aspect-ratio: 1 / 1;
  }

  .story-hero__frame {
    /* Floor matches the aspect-ratio square; grid lets it grow taller
       than this if __content's text needs more room than that. */
    min-height: calc(100vw - 28px);
  }

  .story-hero__content {
    padding: 0 24px 72px;
  }

  .story-hero__title {
    font-size: clamp(36px, 11vw, 52px);
  }

  .story-hero__scroll {
    display: none;
  }

  .story-intro {
    padding: 52px 20px;
  }

  .story-spine {
    left: 6px;
  }

  .chapter__year-giant {
    font-size: clamp(60px, 24vw, 100px);
  }

  .chapter-pair__image {
    min-height: 68vw;
    border-radius: 12px;
    margin: 16px 16px 0;
  }

  .chapter-pair__text {
    padding: 32px 20px 48px;
  }

  .chapter-full {
    padding: 64px 20px;
  }

  .story-quote {
    padding: 0 20px 56px;
    border-radius: 0 0 20px 20px;
  }
}
