/* The pinned parts of the page: the 3D stage (Locate, then Find), the interlude, and the radar of the search scenario. */

/* ---------- the stage: the scroll plays Locate, then Find ---------- */
.stage { position: relative; height: 720vh; }
.stage-pin { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; isolation: isolate; }
.stage-pin canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-pin.no-3d { background: radial-gradient(60% 60% at 70% 50%, rgba(155, 139, 244, 0.25), transparent 70%); }
.stage-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(90deg, rgba(14, 15, 33, 0.94) 0%, rgba(14, 15, 33, 0.55) 34%, transparent 62%), linear-gradient(0deg, var(--bg) 0%, transparent 12%), linear-gradient(180deg, var(--bg) 0%, transparent 12%); }
.stage-copy { position: absolute; z-index: 3; left: calc((100% - min(1320px, 100% - clamp(32px, 7vw, 120px))) / 2); top: 50%; transform: translateY(-50%); width: min(41rem, 88vw); display: grid; }
.chapter { grid-area: 1 / 1; align-self: start; opacity: 0; transform: translateY(26px); filter: blur(8px); pointer-events: none; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), filter 0.5s var(--ease); }
.chapter.on { opacity: 1; transform: none; filter: none; pointer-events: auto; }
.chapter.intro h1 { font-size: clamp(3.1rem, 7.6vw, 7.2rem); line-height: 0.94; letter-spacing: -0.05em; }
.chapter.intro .lede { margin-top: clamp(20px, 3vh, 32px); }
.chapter h2 { font-size: clamp(3.6rem, 9vw, 8rem); line-height: 0.9; letter-spacing: -0.055em; }
.chapter-sub { margin-top: 18px; font-size: clamp(1.02rem, 1.4vw, 1.2rem); max-width: 30ch; color: #c4c1e2; }
.beats { display: grid; margin-top: clamp(22px, 4vh, 38px); min-height: 7.5em; }
.beat { grid-area: 1 / 1; align-self: start; opacity: 0; transform: translateY(18px); filter: blur(6px); transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), filter 0.45s var(--ease); font-size: clamp(1.02rem, 1.3vw, 1.18rem); line-height: 1.55; color: var(--ink); max-width: 33ch; }
.beat.on { opacity: 1; transform: none; filter: none; }

.rail { position: absolute; z-index: 3; top: clamp(20px, 3.4vw, 36px); right: clamp(20px, 3.6vw, 48px); display: flex; align-items: flex-start; gap: clamp(18px, 2.6vw, 36px); }
.rail-item { display: grid; gap: 9px; width: clamp(64px, 8vw, 104px); font-size: 0.8rem; font-weight: 600; line-height: 1; color: var(--faint); transition: color 0.4s var(--ease); }
.rail-item.on { color: var(--ink); }
.rail-item i { position: relative; width: 100%; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.rail-item i::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform: scaleX(var(--k, 0)); transform-origin: left; }

.sig { position: absolute; z-index: 3; right: clamp(16px, 5vw, 72px); bottom: clamp(20px, 8vh, 84px); width: min(270px, calc(100% - 32px)); padding: 18px 22px 20px; border-radius: 26px; background: rgba(20, 22, 42, 0.86); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
    opacity: 0; transform: translateY(24px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.in-find .sig { opacity: 1; transform: none; }
.sig-top { display: flex; justify-content: space-between; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.sig-top span + span { color: var(--mute); letter-spacing: 0.02em; text-transform: none; font-size: 0.86rem; }
.sig-num { display: flex; align-items: baseline; gap: 4px; margin: 6px 0 12px; font-family: var(--display); }
.sig-num b { font-size: 4.4rem; line-height: 1; font-weight: 600; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.sig-num small { font-size: 1.5rem; color: var(--faint); font-weight: 500; }
.sig-track { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.sig-track i { display: block; width: 100%; height: 100%; border-radius: 99px; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.sig-foot { margin-top: 12px; font-size: 0.86rem; color: var(--mute); font-variant-numeric: tabular-nums; }
.is-found .sig-track i { background: #4cc38a; }
.is-found [data-sig-state] { color: #4cc38a; }
.find-tag { position: absolute; left: 0; top: 0; z-index: 3; padding: 7px 14px; border-radius: 999px; background: rgba(14, 15, 33, 0.82); border: 1px solid rgba(76, 195, 138, 0.6); color: #7ee2a8; font-size: 0.82rem; font-weight: 600; white-space: nowrap; opacity: 0; transition: opacity 0.4s var(--ease); pointer-events: none; will-change: transform; }
.is-found .find-tag { opacity: 1; }

/* ---------- the interlude: the area answers where, the signal answers which ---------- */
.bridge { position: relative; height: 300vh; }
.bridge-pin { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; display: grid; align-items: center; background: radial-gradient(60% 50% at 50% 50%, rgba(155, 139, 244, 0.12), transparent 70%), var(--bg); }
.bridge-rings { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.bridge-rings i { grid-area: 1 / 1; width: 120vmax; height: 120vmax; border-radius: 50%; border: 1px solid rgba(184, 171, 247, 0.4); transform: scale(calc(0.02 + var(--p, 0) * var(--m, 1))); opacity: calc(0.95 - var(--p, 0) * 0.7); }
.bridge-body { position: relative; z-index: 2; }
.bridge-line { font-size: clamp(3.2rem, 10vw, 9.6rem); line-height: 0.94; letter-spacing: -0.055em; max-width: 9em; }
.bridge-line span { display: block; }
.b1 { opacity: clamp(0, calc(var(--p, 0) * 7), 1); transform: translateY(calc((1 - clamp(0, calc(var(--p, 0) * 7), 1)) * 44px)); }
.b2 { opacity: clamp(0, calc((var(--p, 0) - 0.3) * 7), 1); transform: translateY(calc((1 - clamp(0, calc((var(--p, 0) - 0.3) * 7), 1)) * 44px)); }
.bridge-sub { margin-top: clamp(20px, 3vh, 32px); font-size: clamp(1.05rem, 1.6vw, 1.35rem); color: #c4c1e2; opacity: clamp(0, calc((var(--p, 0) - 0.5) * 6), 1); }
.bridge-flow { display: flex; align-items: center; gap: 18px; margin-top: clamp(28px, 5vh, 52px); opacity: clamp(0, calc((var(--p, 0) - 0.55) * 6), 1); }
.node { padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.node.a { color: var(--mute); }
.node.b { color: var(--ink); border-color: rgba(184, 171, 247, 0.55); background: rgba(184, 171, 247, 0.1); opacity: clamp(0.35, calc(0.35 + (var(--p, 0) - 0.75) * 4), 1); }
.track { position: relative; flex: 1; max-width: 340px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); container-type: inline-size; }
.track .dot { position: absolute; left: 0; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 18px var(--accent); transform: translateX(calc(clamp(0, calc((var(--p, 0) - 0.58) * 3.2), 1) * (100cqw - 12px))); }

/* ---------- the radar of the search scenario ---------- */
.sr-glow, .sr-heat, .sr-pulse { pointer-events: none; }
.sr-ring { transition: stroke 0.2s ease; }
.sr-line { stroke-width: 2.5; stroke-dasharray: 6 9; fill: none; pointer-events: none; }

@media (max-width: 900px) {
    .stage-shade { background: linear-gradient(180deg, rgba(14, 15, 33, 0.94) 0%, rgba(14, 15, 33, 0.7) 34%, transparent 58%), linear-gradient(0deg, var(--bg) 0%, transparent 10%); }
    .stage-copy { top: clamp(72px, 12vh, 110px); transform: none; }
    .chapter h2 { font-size: clamp(3rem, 15vw, 4.6rem); }
    .sig { left: 16px; right: 16px; width: auto; bottom: 18px; }
    .sig-num b { font-size: 3.4rem; }
    .bridge-flow { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    .chapter, .beat, .sig, .find-tag { transition: none; }
}
