/* Cinematic scroll story: pinned scenes that change as you scroll.
   Progressive enhancement: without JS (or with reduced motion) the scenes
   simply stack as normal sections. story.js adds .story--pin to enable pinning. */

.story { position: relative; background: #10160F; color: #EDE6D3; overflow: hidden; }
.story-head { text-align: center; padding: 4rem 1.5rem 1rem; max-width: 40rem; margin: 0 auto; }
.story-head .story-kicker { color: #C9A464; font-size: .75rem; letter-spacing: .22em; text-transform: uppercase; margin: 0 0 1rem; }
.story-head h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 500; font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.15; margin: 0; }
.story-head p { margin: 1rem 0 0; color: rgba(237,230,211,.65); font-size: .95rem; }

/* ---- base (stacked) layout ---- */
.story-sticky { position: relative; }
.story-scene { position: relative; display: grid; gap: 1.5rem; padding: 2.5rem 1.5rem; max-width: 64rem; margin: 0 auto; align-items: center; }
@media (min-width: 768px) { .story-scene { grid-template-columns: 1fr 1fr; gap: 4rem; padding: 4rem 2rem; } .story-scene:nth-child(even) .story-media { order: -1; } }
.story-media { position: relative; overflow: hidden; border-radius: 999px 999px 1.5rem 1.5rem; border: 1px solid rgba(201,164,100,.25); aspect-ratio: 9 / 14; max-height: 78vh; width: 100%; max-width: 26rem; margin: 0 auto; background: #1b241a; }
.story-media img, .story-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.story-copy .story-num { color: #C9A464; font-size: .75rem; letter-spacing: .22em; text-transform: uppercase; margin: 0 0 .9rem; }
.story-copy h3 { font-family: 'Playfair Display', Georgia, serif; font-weight: 500; font-size: clamp(1.6rem, 3.6vw, 2.6rem); line-height: 1.12; margin: 0 0 1rem; }
.story-copy p.story-text { color: rgba(237,230,211,.78); font-size: 1rem; line-height: 1.7; margin: 0; max-width: 28rem; }
.story-link { display: inline-block; margin-top: 1.25rem; color: #C9A464; font-size: .875rem; text-decoration: underline; text-decoration-color: rgba(201,164,100,.5); text-underline-offset: 4px; }
.story-link:hover { text-decoration-color: #C9A464; }
.story-cta { display: inline-block; margin-top: 1.5rem; background: #C9A464; color: #10160F; padding: .8rem 1.6rem; border-radius: 999px; font-size: .875rem; font-weight: 500; text-decoration: none; }
.story-cta:hover { background: #EDE6D3; }
.story-cta + .story-link { margin-left: 1rem; }
.story-dots, .story-hint { display: none; }

.story-sound { position: absolute; right: .75rem; bottom: .75rem; z-index: 3; display: inline-flex; align-items: center; gap: .4rem; background: rgba(16,22,15,.72); color: #EDE6D3; border: 1px solid rgba(201,164,100,.45); border-radius: 999px; padding: .45rem .8rem; font: 500 .75rem/1 'Inter', system-ui, sans-serif; cursor: pointer; backdrop-filter: blur(6px); }
.story-sound:hover { border-color: #C9A464; color: #C9A464; }

/* ---- pinned (enhanced) layout ---- */
.story--pin { height: calc(var(--n, 5) * 80vh + 100vh); height: calc(var(--n, 5) * 80svh + 100svh); overflow: visible; }
.story--pin .story-head { position: absolute; top: 0; left: 0; right: 0; display: none; }
.story--pin .story-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.story--pin .story-scene { position: absolute; inset: 0; max-width: none; margin: 0; padding: 0; display: block; opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s linear .9s; }
.story--pin .story-scene.is-active { opacity: 1; visibility: visible; transition: opacity .9s ease, visibility 0s; }

/* mobile: full-bleed media, copy over a gradient at the bottom */
.story--pin .story-media { position: absolute; inset: 0; max-width: none; max-height: none; width: 100%; aspect-ratio: auto; border-radius: 0; border: 0; margin: 0; }
.story--pin .story-media img, .story--pin .story-media video { transform: scale(1.12) translate3d(0, calc((.5 - var(--p, .5)) * 3%), 0); transition: transform .25s linear; will-change: transform; }
.story--pin .story-scene::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(16,22,15,.92) 0%, rgba(16,22,15,.55) 38%, rgba(16,22,15,0) 70%); pointer-events: none; z-index: 1; }
.story--pin .story-copy { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 4.75rem 4.5rem 1.5rem; transform: translate3d(0, 24px, 0); opacity: 0; transition: transform .9s ease .15s, opacity .9s ease .15s; }
.story--pin .story-scene.is-active .story-copy { transform: none; opacity: 1; }
.story--pin .story-sound { top: 4.75rem; bottom: auto; left: 1rem; right: auto; z-index: 4; }

.story--pin .story-dots { display: flex; flex-direction: column; gap: .6rem; position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); z-index: 5; margin: 0; padding: 0; list-style: none; }
.story--pin .story-dots li { width: 6px; height: 6px; border-radius: 50%; background: rgba(237,230,211,.35); transition: background .4s, transform .4s; }
.story--pin .story-dots li.on { background: #C9A464; transform: scale(1.5); }
.story--pin .story-hint { display: block; position: absolute; left: 0; right: 0; bottom: 1.2rem; z-index: 5; text-align: center; font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: rgba(237,230,211,.55); transition: opacity .5s; pointer-events: none; }
.story--pin .story-hint.hide { opacity: 0; }

/* desktop: copy on the left, media in a tall arch on the right */
@media (min-width: 768px) {
  .story--pin .story-scene::after { display: none; }
  .story--pin .story-media { position: absolute; top: 50%; right: max(3rem, calc((100vw - 68rem) / 2)); left: auto; bottom: auto; width: min(34vw, 25rem); height: min(80vh, 40rem); height: min(80svh, 40rem); transform: translateY(-50%); border-radius: 999px 999px 1.5rem 1.5rem; border: 1px solid rgba(201,164,100,.3); inset-inline-start: auto; }
  .story--pin .story-scene:nth-child(even) .story-media { order: 0; }
  .story--pin .story-copy { top: 50%; bottom: auto; left: max(3rem, calc((100vw - 68rem) / 2)); right: auto; width: min(34rem, 44vw); padding: 0; transform: translate3d(0, calc(-50% + 28px), 0); }
  .story--pin .story-scene.is-active .story-copy { transform: translate3d(0, -50%, 0); }
  .story--pin .story-sound { top: auto; left: auto; bottom: 1rem; right: 1rem; }
  .story--pin .story-dots { right: 1.4rem; }
}

/* mobile hero video (homepage) */
#hero-video { opacity: 0; transition: opacity .8s ease; }
#hero-video.is-on { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .story--pin { height: auto; }
  .story--pin .story-scene, .story--pin .story-copy, .story--pin .story-media img, .story--pin .story-media video { transition: none; }
}
