/* ==========================================================================
   "Walk in love": pinned stage that scrolls sideways.
   js/scripture.js sets:
     --cl  0..1  how "closed" the stage is (rounded card -> full screen on entry, and back on exit)
     --hp  0..1  sideways progress through the track      --hx  track offset in px
     --vp  0..1  verse reading progress (words light up)
     --lp  -1..1 per panel: position relative to the screen centre;  --la is its absolute value
   Without html.fx (no JS / reduced motion) the panels stack vertically as a normal section.
   ========================================================================== */
.scripture {
    --wine: #3b0f16;
    --wine-deep: #170709;
    --gold: #e8bd72;
    --gold-soft: rgba(232,189,114,.7);
    position: relative; background: #fff; color: #fff;
}
.scripture-scene { position: relative; }
.scripture-stage { position: relative; overflow: hidden; isolation: isolate;
    background:
        radial-gradient(70% 90% at 20% 10%, #5a1620 0%, rgba(90,22,32,0) 60%),
        radial-gradient(60% 80% at 90% 100%, #2a0a10 0%, rgba(42,10,16,0) 70%),
        linear-gradient(160deg, var(--wine) 0%, var(--wine-deep) 100%); }
/* Fine grain so the colour field feels like paper, not a flat fill */
.scripture-stage::after { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Depth layers ---------- */
.stage-word { position: absolute; left: 4vw; top: 50%; translate: 0 -50%; z-index: -1; pointer-events: none; white-space: nowrap;
    font: italic 400 min(46vh, 34vw)/1 'Fraunces', Georgia, serif; letter-spacing: -.04em;
    color: transparent; -webkit-text-stroke: 1.5px rgba(232,189,114,.13); }
.stage-glow { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; filter: blur(50px); }
.stage-glow--a { width: 34vw; height: 34vw; left: 55%; top: -12%; background: rgba(232,189,114,.16); }
.stage-glow--b { width: 26vw; height: 26vw; left: 10%; bottom: -14%; background: rgba(200,60,70,.22); }
.stage-glow--c { width: 18vw; height: 18vw; left: 85%; top: 55%; background: rgba(232,189,114,.12); }

/* ---------- Track & panels (stacked fallback first) ---------- */
.h-track { display: flex; flex-direction: column; }
.h-panel { position: relative; padding: 96px clamp(20px, 6vw, 96px); }

.stage-chip { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 24px; padding: 7px 14px 7px 10px; border-radius: 999px;
    background: rgba(255,255,255,.07); border: 1px solid rgba(232,189,114,.3);
    font: 600 12px/1 'Manrope', sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.stage-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(232,189,114,.2); }

/* Intro: the verse */
.h-panel--intro { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.intro-verse { margin: 0; }
.intro-verse p { margin: 0; max-width: 12ch; font: 500 clamp(54px, 9vw, 150px)/.95 'Fraunces', Georgia, serif; letter-spacing: -.035em; }
.vw { display: inline-block; }
.vw--accent { font-style: italic; font-weight: 400; color: var(--gold); }
.intro-verse cite { display: inline-flex; align-items: center; gap: 14px; margin-top: 28px; font: 700 13px/1 'Manrope', sans-serif;
    font-style: normal; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-soft); }
.intro-verse cite::before { content: ""; width: 48px; height: 1.5px; background: currentColor; }
.intro-hint { display: none; }

/* Purposes */
.h-panel--purpose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.p-media { margin: 0; }
.p-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: 999px 999px 24px 24px;
    box-shadow: 0 50px 90px -40px rgba(0,0,0,.8); }
.p-frame img { position: absolute; top: 0; left: -10%; width: 120%; height: 100%; object-fit: cover; }
.p-frame::after { content: ""; position: absolute; inset: 14px; border-radius: inherit; border: 1.5px solid rgba(232,189,114,.5); pointer-events: none; }
.p-text { position: relative; }
.p-num { position: absolute; right: 100%; top: -.55em; margin-right: -.4em; z-index: -1; pointer-events: none;
    font: italic 400 clamp(160px, 18vw, 300px)/1 'Fraunces', Georgia, serif; color: transparent; -webkit-text-stroke: 1.5px rgba(232,189,114,.35); }
.p-kicker { margin: 0 0 14px; font: 700 12px/1 'Manrope', sans-serif; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-soft); }
.p-title { margin: 0 0 20px; font: 500 clamp(44px, 5.4vw, 88px)/.98 'Fraunces', Georgia, serif; letter-spacing: -.03em; }
.p-title em { font-style: italic; font-weight: 400; color: var(--gold); }
.p-body { margin: 0; max-width: 420px; font: 400 clamp(16px, 1.3vw, 19px)/1.7 'Manrope', sans-serif; color: rgba(255,255,255,.72); }

/* Mission */
.h-panel--mission { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.mission-arch { position: relative; width: clamp(180px, 20vw, 300px); aspect-ratio: 1 / 2; max-height: 70vh; overflow: hidden; border-radius: 999px 999px 0 0;
    box-shadow: 0 50px 90px -40px rgba(0,0,0,.8); }
.mission-arch img { width: 100%; height: 100%; object-fit: cover; object-position: 42% 0%; }
.mission-arch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(59,15,22,0) 50%, rgba(23,7,9,.75) 100%); }
.mission-lead { margin: 0 0 32px; max-width: 760px; font: 500 clamp(26px, 3vw, 46px)/1.22 'Fraunces', Georgia, serif; letter-spacing: -.015em; }
.mission-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.stage-btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 26px; border-radius: 999px; text-decoration: none;
    font: 600 15px/1 'Manrope', sans-serif; transition: transform .25s ease, background .25s ease, box-shadow .25s ease; }
.stage-btn:hover { transform: translateY(-2px); }
.stage-btn--gold { background: var(--gold); color: #2a0b10; box-shadow: 0 16px 34px -14px rgba(232,189,114,.7); }
.stage-btn--gold svg { transition: transform .25s ease; }
.stage-btn--gold:hover svg { transform: translateX(4px); }
.stage-btn--ghost { color: #fff; border: 1px solid rgba(255,255,255,.3); }
.stage-btn--ghost:hover { background: rgba(255,255,255,.08); }

.journey { display: none; }

/* ==========================================================================
   Pinned sideways mode (JS + motion allowed)
   ========================================================================== */
html.fx .scripture-scene { position: sticky; top: 0; height: 100vh; height: 100svh; }
html.fx .scripture-stage { position: absolute; inset: 0;
    clip-path: inset(calc(var(--cl, 1) * 7%) calc(var(--cl, 1) * 5%) round calc(var(--cl, 1) * 56px)); }

html.fx .h-track { position: absolute; top: 0; left: 0; height: 100%; flex-direction: row; width: max-content; will-change: transform;
    transform: translate3d(calc(var(--hx, 0) * -1px), 0, 0); }
html.fx .h-panel { flex: 0 0 auto; height: 100%; padding: 0 6vw 90px; }
html.fx .h-panel--intro { width: 100vw; padding-left: 9vw; }
html.fx .h-panel--purpose { width: max(88vw, 900px); }
html.fx .h-panel--mission { width: 100vw; padding-right: 10vw; }

/* Depth layers drift at their own speeds */
html.fx .stage-word { translate: calc(var(--hp, 0) * -55vw) -50%; }
html.fx .stage-glow--a { translate: calc(var(--hp, 0) * -60vw) 0; }
html.fx .stage-glow--b { translate: calc(var(--hp, 0) * -25vw) calc(var(--hp, 0) * -20vh); }
html.fx .stage-glow--c { translate: calc(var(--hp, 0) * -90vw) 0; }

/* Verse: words rise and light up as the stage opens */
html.fx .vw { opacity: calc(.12 + .88 * clamp(0, var(--vp, 0) * 9 - var(--i), 1));
    translate: 0 calc((1 - clamp(0, var(--vp, 0) * 9 - var(--i), 1)) * 30px); }
html.fx .intro-verse cite, html.fx .h-panel--intro .stage-chip { opacity: calc(var(--vp, 0) * 1.4); }
html.fx .intro-hint { display: inline-flex; align-items: center; gap: 14px; position: absolute; right: 7vw; bottom: 120px; margin: 0;
    font: 600 13px/1 'Manrope', sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-soft);
    opacity: calc(var(--vp, 0) - var(--hp, 0) * 12); }
html.fx .intro-hint svg { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { translate: 8px 0; } }

/* Purposes: image, number and text move at different speeds inside each panel */
html.fx .p-frame { max-height: 72vh; margin: 0 auto; rotate: calc(var(--lp, 0) * -4deg); scale: calc(1 - var(--la, 0) * .12); }
html.fx .p-frame img { translate: calc(var(--lp, 0) * 9%) 0; }
html.fx .h-panel--purpose .p-media { translate: 0 calc(var(--lp, 0) * 40px); }
html.fx .h-panel--purpose.is-flipped .p-media { order: 2; translate: 0 calc(var(--lp, 0) * -40px); }
html.fx .p-num { translate: calc(var(--lp, 0) * 160px) 0; opacity: calc(1 - var(--la, 0) * 2.2); }
html.fx .p-text > :not(.p-num) { translate: calc(var(--lp, 0) * 90px) 0; opacity: calc(1 - var(--la, 0) * 1.3); }

/* Mission arch rises in */
html.fx .mission-arch { translate: 0 calc(var(--la, 0) * 80px); }
html.fx .mission-text { translate: calc(var(--lp, 0) * 120px) 0; opacity: calc(1 - var(--la, 0) * 1.2); }

/* Journey line */
html.fx .journey { display: block; position: absolute; left: 9vw; right: max(9vw, 120px); bottom: 42px; z-index: 6;
    opacity: calc(1 - var(--cl, 1) * 3); }
.journey-line { position: relative; height: 2px; border-radius: 2px;
    background: repeating-linear-gradient(90deg, rgba(232,189,114,.35) 0 4px, transparent 4px 10px); }
.journey-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--gold); transform-origin: left; transform: scaleX(var(--hp, 0)); }
.journey-walker { position: absolute; top: 50%; left: calc(var(--hp, 0) * 100%); width: 14px; height: 14px; margin: -7px 0 0 -7px;
    border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(232,189,114,.25), 0 0 24px 4px rgba(232,189,114,.55); }
.journey-stops { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.journey-stops li { position: absolute; left: calc(var(--at) * 100%); top: 50%; }
.journey-stops li::before { content: ""; position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
    background: var(--wine-deep); border: 1.5px solid var(--gold-soft); }
.journey-stops span { position: absolute; top: 14px; left: 0; translate: -50% 0; white-space: nowrap;
    font: 600 11px/1 'Manrope', sans-serif; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.45); transition: color .3s ease; }
.journey-stops li.is-on span { color: var(--gold); }
.journey-stops li.is-on::before { background: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    .h-panel--purpose, .h-panel--mission { grid-template-columns: 1fr; }
    .p-num { right: auto; left: -.05em; top: -.85em; }
    .mission-arch { width: 150px; }
    html.fx .h-panel { padding: 70px 7vw 100px; }
    html.fx .h-panel--purpose { width: 100vw; align-content: center; gap: 22px; }
    html.fx .h-panel--purpose.is-flipped .p-media { order: 0; }
    html.fx .p-frame { max-height: 44vh; aspect-ratio: 4 / 4.2; width: 100%; }
    html.fx .h-panel--mission { align-content: center; gap: 24px; }
    html.fx .intro-hint { right: auto; left: 7vw; bottom: 110px; }
    html.fx .journey { left: 7vw; right: 92px; }
    .journey-stops li:last-child span { translate: -100% 0; }
    .journey-stops span { display: none; }
    .journey-stops li.is-current span { display: block; }
}
