/* The Journey, scroll-driven 3D story */
.journey { position: relative; background: var(--midnight); }
.journey-stage { position: sticky; top: 0; height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh; overflow: hidden; z-index: 0; }
.journey-stage::after { content: ""; position: absolute; inset: 0; background: var(--vault); opacity: var(--veil, 0); pointer-events: none; }
.journey-stage::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(10,18,13,.72) 0%, rgba(10,18,13,.15) 45%, transparent 60%), linear-gradient(0deg, rgba(10,18,13,.6), transparent 30%); }
.journey-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s var(--ease-lux); }
.journey-canvas.is-ready { opacity: 1; }
.journey-poster { position: absolute; inset: 0; background: radial-gradient(60% 50% at 70% 40%, rgba(201,168,76,.12), transparent 60%), linear-gradient(180deg, #13241c, #0a120d); }

.journey-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .8s var(--ease-lux); }
.journey-labels.is-on { opacity: 1; }
.jl { position: absolute; left: 0; top: 0; display: grid; gap: 2px; padding-left: 14px; transition: opacity .4s; white-space: nowrap; }
.jl::before { content: ""; position: absolute; left: -4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(201,168,76,.18); }
.jl b { font-family: var(--f-display); font-weight: 400; font-size: .8rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ivory); }
.jl small { font-family: var(--f-editorial); font-style: italic; font-size: .95rem; color: var(--gold-lt); }
.jl-origin::before { width: 11px; height: 11px; left: -6px; top: 4px; animation: pulse 2.4s ease-out infinite; }
.jl-region b { font-size: .65rem; letter-spacing: .5em; color: rgba(250,247,240,.55); }
.jl-region::before { display: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(201,168,76,.55); } 100% { box-shadow: 0 0 0 18px rgba(201,168,76,0); } }

.chapter { position: relative; z-index: 2; min-height: 150vh; pointer-events: none; }
.chapter-copy { position: sticky; top: 0; min-height: 100vh; display: grid; align-content: center; padding: calc(var(--header-h) + 24px) var(--gutter) 64px; max-width: min(640px, 92vw); pointer-events: auto; }
.chapter-copy .numeral { font-family: var(--f-display); font-size: clamp(3.5rem, 9vw, 7rem); line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(201,168,76,.55); letter-spacing: .05em; margin-bottom: 12px; }
.chapter-copy h2 { font-size: var(--fs-h2); margin: 14px 0 22px; }
.chapter-copy .lead { max-width: 30ch; color: var(--text); }
.chapter-copy p.body { margin-top: 18px; color: var(--text-soft); max-width: 46ch; }
.chapter-art { display: none; }

.cert-card { margin-top: 28px; max-width: 420px; padding: 26px 28px; background: rgba(250,247,240,.96); color: var(--ink); border: 1px solid rgba(201,168,76,.6); box-shadow: var(--shadow-lux); transform: translateY(18px) rotate(-1.2deg); opacity: 0; transition: transform 1.2s var(--ease-lux), opacity 1.2s var(--ease-lux); }
.is-in .cert-card, .cert-card.is-in { opacity: 1; transform: rotate(-1.2deg); }
.cert-card h3 { font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; color: var(--vault); display: flex; justify-content: space-between; gap: 12px; }
.cert-card dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin-top: 18px; font-size: .85rem; }
.cert-card dt { font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: #6f5714; padding-top: 3px; }
.cert-card dd { color: var(--ink); }
.cert-card .seal { width: 54px; height: 54px; border-radius: 50%; border: 1px solid #c9a84c; display: grid; place-items: center; font-family: var(--f-display); font-size: .6rem; letter-spacing: .14em; color: #6f5714; text-align: center; line-height: 1.2; }

.journey-rail { position: fixed; right: clamp(14px, 2.4vw, 36px); top: 50%; transform: translateY(-50%); z-index: 60; display: grid; gap: 4px; opacity: 0; visibility: hidden; transition: opacity .6s var(--ease-lux); }
.journey-rail.is-on { opacity: 1; visibility: visible; }
.journey-rail button { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 40px; padding: 0 4px; font-family: var(--f-display); font-size: .78rem; letter-spacing: .14em; color: rgba(250,247,240,.62); }
.journey-rail button span { font-family: var(--f-body); font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; opacity: 0; transform: translateX(8px); transition: all .5s var(--ease-lux); }
.journey-rail button::after { content: ""; width: 18px; height: 1px; background: currentColor; transition: width .5s var(--ease-lux); }
.journey-rail button:hover span, .journey-rail button[aria-current="step"] span { opacity: 1; transform: none; }
.journey-rail button[aria-current="step"] { color: var(--gold-lt); }
.journey-rail button[aria-current="step"]::after { width: 36px; background: var(--gold); }

.journey-tools { position: fixed; right: var(--gutter); top: calc(var(--header-h) + 16px); z-index: 60; display: flex; gap: 10px; align-items: center; opacity: 0; visibility: hidden; transition: opacity .6s; }
.journey-tools.is-on { opacity: 1; visibility: visible; }
.sound-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); background: rgba(10,18,13,.6); backdrop-filter: blur(8px); font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--text-soft); }
.sound-btn svg { width: 16px; height: 16px; }
.sound-btn[aria-pressed="true"] { color: var(--gold-lt); border-color: var(--line-strong); }

.prelude { min-height: 100vh; display: grid; align-content: center; padding-top: var(--header-h); text-align: center; }
.stone-picker { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 36px; }
.stone-picker button { display: grid; justify-items: center; gap: 10px; width: 132px; padding: 18px 10px 16px; border: 1px solid var(--line); background: rgba(255,255,255,.02); transition: border-color .4s, background .4s; }
.stone-picker button svg { width: 46px; height: 46px; }
.stone-picker button span { font-size: .6rem; letter-spacing: .24em; text-transform: uppercase; color: var(--text-soft); }
.stone-picker button[aria-pressed="true"] { border-color: var(--gold); background: rgba(201,168,76,.08); }
.stone-picker button[aria-pressed="true"] span { color: var(--gold-lt); }
.scroll-cue { display: grid; justify-items: center; gap: 12px; margin-top: 56px; font-size: .6rem; letter-spacing: .4em; text-transform: uppercase; color: var(--text-dim); }
.scroll-cue i { width: 1px; height: 56px; background: linear-gradient(var(--gold), transparent); animation: cue 2.4s var(--ease-in-out) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* Static sequence: reduced motion, no WebGL */
.journey.is-static .journey-stage, .journey.is-static ~ .journey-rail { display: none; }
.journey.is-static .chapter { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.journey.is-static .chapter-copy { position: relative; min-height: 0; }
.journey.is-static .chapter-art { display: grid; place-items: center; height: 100%; min-height: 60vh; position: relative; overflow: hidden; }
.journey.is-static .chapter-art svg { width: min(44%, 260px); height: auto; aspect-ratio: 1; color: var(--gold); filter: drop-shadow(0 0 40px rgba(201,168,76,.25)); }
.journey.is-static .chapter:nth-child(odd) .chapter-art { background: radial-gradient(60% 60% at 50% 50%, rgba(58,125,90,.25), transparent 70%); }
@media (max-width: 860px) {
  .journey.is-static .chapter { grid-template-columns: 1fr; }
  .journey.is-static .chapter-art { min-height: 38vh; order: -1; }
  .journey-stage::before { background: linear-gradient(0deg, rgba(10,18,13,.85) 0%, rgba(10,18,13,.3) 50%, transparent 70%); }
  .chapter-copy { align-content: end; }
  .journey-rail { right: 6px; }
  .journey-rail button span { display: none; }
  .cert-card { padding: 18px 20px; }
}

/* Decide the static layout in CSS (not JS) so the page never re-flows after load */
@media (prefers-reduced-motion: reduce) {
.journey .journey-stage, .journey ~ .journey-rail { display: none; }
.journey .chapter { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.journey .chapter-copy { position: relative; min-height: 0; }
.journey .chapter-art { display: grid; place-items: center; height: 100%; min-height: 60vh; position: relative; overflow: hidden; }
.journey .chapter-art svg { width: min(44%, 260px); height: auto; aspect-ratio: 1; color: var(--gold); filter: drop-shadow(0 0 40px rgba(201,168,76,.25)); }
.journey .chapter:nth-child(odd) .chapter-art { background: radial-gradient(60% 60% at 50% 50%, rgba(58,125,90,.25), transparent 70%); }
}
@media (max-width: 860px) {
.journey.journey-teaser .journey-stage, .journey.journey-teaser ~ .journey-rail { display: none; }
.journey.journey-teaser .chapter { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.journey.journey-teaser .chapter-copy { position: relative; min-height: 0; }
.journey.journey-teaser .chapter-art { display: grid; place-items: center; height: 100%; min-height: 60vh; position: relative; overflow: hidden; }
.journey.journey-teaser .chapter-art svg { width: min(44%, 260px); height: auto; aspect-ratio: 1; color: var(--gold); filter: drop-shadow(0 0 40px rgba(201,168,76,.25)); }
.journey.journey-teaser .chapter:nth-child(odd) .chapter-art { background: radial-gradient(60% 60% at 50% 50%, rgba(58,125,90,.25), transparent 70%); }
}

/* Compact static chapters on phones */
@media (max-width: 860px) {
  .journey.is-static .chapter, .journey.journey-teaser .chapter { min-height: 0; padding: 56px 0; grid-template-columns: 1fr; }
  .journey.is-static .chapter-art, .journey.journey-teaser .chapter-art { order: -1; }
  .journey.is-static .chapter-copy, .journey.journey-teaser .chapter-copy { min-height: 0; padding-top: 0; padding-bottom: 0; }
  .journey.is-static .chapter-art, .journey.journey-teaser .chapter-art { min-height: 0; height: 160px; }
  .journey.is-static .chapter-art svg, .journey.journey-teaser .chapter-art svg { width: 110px; }
}
