/* Fibre to fold story (home page): one drawing that changes stage as the visitor scrolls. */
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(30px, 6vw, 90px); }
.story-art { position: sticky; top: calc(var(--header-h) + 40px); align-self: start; height: min(70vh, 540px); display: grid; place-items: center; }
.story-svg { width: min(100%, 420px); height: auto; overflow: visible; }
.story-svg g { fill: none; stroke: var(--gold-light); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity 0.5s var(--ease); }
.story-svg path, .story-svg circle { stroke-dasharray: 1; }
.story-svg .fill { fill: rgba(201, 167, 108, 0.18); }
.story-svg .thick { stroke-width: 7; }
.story-art g[data-stage="1"] { opacity: 1; } /* without script or scroll timelines, the first stage stays drawn */
.story-count { position: absolute; left: 0; bottom: 0; margin: 0; font: 700 0.72rem/1 var(--body); letter-spacing: 0.2em; color: rgba(255, 255, 255, 0.45); }
.story-count span { color: var(--gold-light); }

.story-steps { list-style: none; margin: 0; padding: 0; }
.story-step { min-height: 72vh; padding: 10vh 0; border-top: 1px solid var(--line-dark); display: flex; flex-direction: column; justify-content: center; }
.story-step:first-child { border-top: 0; padding-top: 0; }
.story-step .n { font: 700 0.72rem/1.4 var(--body); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-light); }
.story-step h3 { margin: 10px 0 12px; color: #fff; font: 400 clamp(1.5rem, 2.6vw, 2rem)/1.2 var(--title); text-transform: none; letter-spacing: 0; }
.story-step p { margin: 0; max-width: 46ch; color: rgba(255, 255, 255, 0.72); }
.story-photo { margin: 22px 0 14px; max-width: 520px; aspect-ratio: 3 / 2; overflow: hidden; background: var(--navy-2); }
.story-photo img { width: 100%; height: 100%; object-fit: cover; }
.story-photo img.pos-low { object-position: center 78%; }

/* Scroll timelines (Chrome and Edge 115+, Safari 26+): each step draws its own stage */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .story-grid { timeline-scope: --st1, --st2, --st3, --st4, --st5, --st6; }
    .story-step:nth-child(1) { view-timeline-name: --st1; }
    .story-step:nth-child(2) { view-timeline-name: --st2; }
    .story-step:nth-child(3) { view-timeline-name: --st3; }
    .story-step:nth-child(4) { view-timeline-name: --st4; }
    .story-step:nth-child(5) { view-timeline-name: --st5; }
    .story-step:nth-child(6) { view-timeline-name: --st6; }
    .story-svg g { transition: none; animation: story-stage linear both; animation-range: entry 40% exit 60%; }
    .story-svg g[data-stage="1"] { animation-timeline: --st1; }
    .story-svg g[data-stage="2"] { animation-timeline: --st2; }
    .story-svg g[data-stage="3"] { animation-timeline: --st3; }
    .story-svg g[data-stage="4"] { animation-timeline: --st4; }
    .story-svg g[data-stage="5"] { animation-timeline: --st5; }
    .story-svg g[data-stage="6"] { animation-timeline: --st6; }
  }
}
@keyframes story-stage {
  0% { opacity: 0; stroke-dashoffset: 1; }
  20% { opacity: 1; }
  45% { stroke-dashoffset: 0; }
  80% { opacity: 1; stroke-dashoffset: 0; }
  100% { opacity: 0; stroke-dashoffset: 0; }
}

/* Fallback driven by fibre-story.js: the step in the middle of the screen is drawn */
.story-art.js-driven g { opacity: 0; }
.story-art.js-driven g.on { opacity: 1; animation: story-draw 0.9s ease-out both; }
@keyframes story-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .story-art.js-driven g.on { animation: none; }
  .story-svg g { transition: none; }
}

@media (max-width: 900px) {
  .story-grid { grid-template-columns: 1fr; gap: 0; }
  .story-art { top: var(--header-h); z-index: 2; height: 34vh; background: var(--navy); border-bottom: 1px solid var(--line-dark); }
  .story-svg { width: auto; height: 28vh; }
  .story-count { left: 4px; bottom: 10px; }
  .story-step { min-height: 66vh; padding: 8vh 0; }
}
