/* ═════════════ HERO v3 — 3D scroll story (pinned) ═════════════ */
.h3d { position: relative; height: 620vh; background: var(--paper); }
.h3d__pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.h3d__pin canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.h3d__fade { position: absolute; inset: 0; background: var(--paper); opacity: 0; pointer-events: none; }
.h3d__hud { position: absolute; inset: 0; pointer-events: none; color: var(--fg, var(--ink)); --fg: var(--paper); }
.h3d__hud > * { will-change: opacity, transform; }

.h3d__intro { position: absolute; left: 0; right: 0; top: calc(var(--nav-h) + 6vh); padding: 0 16px; text-align: center; opacity: 0; }
.h3d__intro h1 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 3.4vw, 50px); line-height: 1.2; max-width: 760px; margin: 0 auto; }
.h3d__intro p { font-size: clamp(15px, 1.15vw, 18px); line-height: 1.6; max-width: 560px; margin: 14px auto 0; opacity: .78; }
.h3d__cue { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 34px; font-family: var(--hand); font-size: 16px; }
.h3d__cue i { display: block; width: 1.5px; height: 30px; background: currentColor; transform-origin: top; animation: h3d-cue 2.4s var(--ease-out) infinite; }
@keyframes h3d-cue { 0% { transform: scaleY(0); opacity: .9; } 60% { transform: scaleY(1); opacity: .9; } 100% { transform: scaleY(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .h3d__cue i { animation: none; } }

.h3d__act { position: absolute; top: calc(var(--nav-h) + 6vh); left: max(32px, calc((100vw - 1100px) / 2)); max-width: 430px; opacity: 0; }
/* chapter label: bold number, centred against a colour pill */
.h3d__act > p:first-child { display: flex; align-items: center; gap: 10px; }
.h3d__num { font-family: var(--sans); font-weight: 800; font-size: 17px; line-height: 1; }
.h3d__pill { display: inline-flex; align-items: center; padding: 6px 13px; border: 2px solid var(--ink); border-radius: 999px; font-family: var(--sans); font-weight: 800; font-size: 14px; line-height: 1.1; color: #000; }
.h3d__act[data-k="0"] .h3d__pill { background: var(--mint); }
.h3d__act[data-k="1"] .h3d__pill { background: var(--sun); }
.h3d__act[data-k="2"] .h3d__pill { background: var(--sky); }
.h3d__act h2 { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 2.8vw, 40px); line-height: 1.3; margin: 16px 0 12px; }
.h3d__act h2 em { font-style: normal; background: linear-gradient(transparent 62%, var(--hl, rgba(45,227,167,.45)) 62%); }
.h3d__act[data-k="1"] h2 em { --hl: rgba(246,196,22,.5); }
.h3d__act[data-k="2"] h2 em { --hl: var(--sky); }   /* solid, no opacity */
.h3d__act p { font-size: clamp(15px, 1.2vw, 18px); line-height: 1.5; opacity: .82; }

.h3d__loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--hand); font-size: 20px; color: var(--paper); background: #1E1B2B; transition: opacity .6s; }
.h3d__loading.done { opacity: 0; pointer-events: none; }

@media (max-width: 900px) {   /* tablets + phones: roomier side gutters, copy clears the nav */
    .h3d__act { left: 28px; right: 28px; max-width: none; top: calc(var(--nav-h) + 44px); }
    .h3d__act h2 { margin: 12px 0 8px; }
    .h3d__intro { top: calc(var(--nav-h) + 22px); padding: 0 28px; }
    .h3d__intro h1 { font-size: 27px; }
    .h3d__intro p { font-size: 14.5px; }
}

/* static fallback: no JS / no WebGL / CDN or asset failure / slow boot → plain readable headline */
.h3d--static { height: auto; }
.h3d--static .h3d__pin { position: relative; height: auto; min-height: 60svh; display: grid; place-items: center; background: var(--paper); }
.h3d--static canvas, .h3d--static .h3d__loading, .h3d--static .h3d__act, .h3d--static .h3d__cue, .h3d--static .h3d__fade { display: none; }
.h3d--static .h3d__hud { position: relative; color: var(--ink); }
.h3d--static .h3d__intro { position: static; opacity: 1 !important; transform: none !important; padding: calc(var(--nav-h) + 6vh) 24px 8vh; }
