/* Eureka immersive stage (assets/js/immersive/stage.js): the pinned 3D scene on the world home pages.
   It is always night, whatever theme the page uses, like a cinema screen. */
.imm {
  --imm-seg: 92vh; --imm-accent: #ffb547; --imm-ink: #f4f1ea; --imm-muted: rgba(226, 229, 242, .74); --imm-bg: #04060d;
  position: relative; height: calc(var(--imm-n, 6) * var(--imm-seg) + 100vh); margin-inline: -16px;
  background: var(--imm-bg); color: var(--imm-ink); isolation: isolate;
}
@media (max-width: 759px) { .imm { --imm-seg: 80vh; } }
.imm-pin { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; background: radial-gradient(110% 80% at 68% 46%, #141c38 0%, #080b18 52%, var(--imm-bg) 100%); }
.imm-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.4s cubic-bezier(.2, .7, .2, 1); }
.imm.imm-ready .imm-cv { opacity: 1; }
.imm-pin.imm-dip .imm-cv { opacity: 0; transition: opacity .18s; }
.imm-scrim { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 6, 13, .78) 0%, rgba(4, 6, 13, .42) 28%, rgba(4, 6, 13, 0) 52%), linear-gradient(0deg, rgba(4, 6, 13, .55), rgba(4, 6, 13, 0) 24%), linear-gradient(180deg, rgba(4, 6, 13, .5), rgba(4, 6, 13, 0) 18%); }
.imm-scrim-top { display: none; }
.imm-outro { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; pointer-events: none; opacity: 0; background: linear-gradient(0deg, var(--bg, #04060d), transparent); }
.imm-safe { position: absolute; left: 0; right: 0; top: 0; height: 100vh; height: 100svh; pointer-events: none; }
.imm-frame { position: relative; height: 100%; max-width: var(--wide, 62rem); margin: 0 auto; padding: 0 16px; }

/* the opening words, then one caption per stop */
.imm-intro, .imm-cap { text-shadow: 0 1px 22px rgba(4, 6, 13, .55); }
.imm-intro, .imm-cap { position: absolute; left: 16px; top: 50%; width: min(29rem, 44vw); translate: 0 -50%; will-change: transform, opacity; }
.imm-intro { width: min(33rem, 48vw); translate: 0 -44%; pointer-events: auto; }
.imm-intro.off, .imm-cap:not(.on) { pointer-events: none; }
.imm-cap.on { pointer-events: auto; }
.imm-u { text-transform: none; letter-spacing: .04em; }
.imm .eyebrow, .imm-eye { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--imm-accent); font-weight: 600; margin: 0 0 .9rem; }
.imm-intro h1 { font-size: clamp(2.5rem, 5.2vw, 4.3rem); line-height: 1.02; font-weight: 800; letter-spacing: -.035em; color: #fff; margin: 0; }
.imm-intro h1 em { font-style: normal; color: var(--imm-accent); }
.imm-intro .lede { font-size: clamp(1.02rem, 1.4vw, 1.18rem); line-height: 1.6; color: var(--imm-muted); margin: 1.2rem 0 1.7rem; max-width: 31rem; }
.imm-cap h2 { font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.03; font-weight: 750; letter-spacing: -.03em; color: #fff; margin: 0; }
.imm-txt { font-size: clamp(1rem, 1.3vw, 1.14rem); line-height: 1.6; color: var(--imm-muted); margin: 1rem 0 0; max-width: 27rem; }
.imm-chip { display: inline-flex; align-items: center; gap: .45rem; margin-top: 1.3rem; padding: .42rem .85rem; border-radius: 999px; font: 600 .78rem/1 var(--f-mono); letter-spacing: .04em; color: var(--imm-ink); text-decoration: none;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s, border-color .2s; }
.imm-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--imm-accent); box-shadow: 0 0 8px var(--imm-accent); }
.imm-chip:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); }
.imm .cta-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
.imm .btn-ghost { color: var(--imm-ink); border-color: rgba(255, 255, 255, .26); background: rgba(255, 255, 255, .05); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.imm .btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .4); }
.imm-skip { display: inline-block; margin-top: 1.1rem; font: 600 .72rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--imm-muted); background: none; border: 0; padding: .3rem 0; cursor: pointer; }
.imm-skip:hover { color: #fff; }

/* the stops, down the right edge */
.imm-rail { position: absolute; right: 14px; top: 50%; translate: 0 -50%; display: flex; flex-direction: column; gap: 4px; pointer-events: auto; }
.imm-rail::before { content: ""; position: absolute; right: 13px; top: 13px; bottom: 13px; width: 1px; background: rgba(255, 255, 255, .14); }
.imm-rail::after { content: ""; position: absolute; right: 13px; top: 13px; width: 1px; height: calc((100% - 26px) * var(--imm-p, 0)); background: var(--imm-accent); box-shadow: 0 0 8px var(--imm-accent); }
.imm-dot { position: relative; width: 27px; height: 27px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.imm-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .34); transition: transform .3s, background .3s, box-shadow .3s; position: relative; z-index: 1; }
.imm-dot:hover::before, .imm-dot:focus-visible::before { background: #fff; transform: scale(1.3); }
.imm-dot.on::before { background: var(--imm-accent); transform: scale(1.45); box-shadow: 0 0 0 4px rgba(255, 255, 255, .07), 0 0 12px var(--imm-accent); }
.imm-dot-l { position: absolute; right: 32px; top: 50%; translate: 0 -50%; white-space: nowrap; font: 600 .68rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--imm-muted); opacity: 0; transition: opacity .25s; pointer-events: none; }
.imm-dot.on .imm-dot-l, .imm-dot:hover .imm-dot-l, .imm-dot:focus-visible .imm-dot-l { opacity: 1; }
.imm-dot:hover .imm-dot-l, .imm-dot:focus-visible .imm-dot-l { color: #fff; }

/* the scale readout */
.imm-hud { position: absolute; left: 16px; bottom: 30px; min-width: 15rem; font: 600 .66rem/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: rgba(226, 229, 242, .6); }
.imm-hud { left: max(16px, calc(50% - var(--wide, 62rem) / 2 + 16px)); }
.imm-hud-v { display: block; margin: .45rem 0 .6rem; font: 600 1.06rem/1.15 var(--f-mono); letter-spacing: .01em; text-transform: none; color: #fff; font-variant-numeric: tabular-nums; }
.imm-ruler { position: relative; display: block; height: 7px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .34) 0 1px, transparent 1px calc(100% / 10)); border-bottom: 1px solid rgba(255, 255, 255, .2); }
.imm-ruler i { position: absolute; bottom: -3px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--imm-accent); box-shadow: 0 0 10px var(--imm-accent); }

/* scroll hint */
.imm-cue { position: absolute; left: 50%; bottom: 26px; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 10px; font: 600 .66rem/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: rgba(226, 229, 242, .66); }
.imm-cue i { position: relative; width: 1px; height: 40px; overflow: hidden; background: rgba(255, 255, 255, .16); }
.imm-cue i::after { content: ""; position: absolute; left: -1px; top: -12px; width: 3px; height: 12px; border-radius: 2px; background: var(--imm-accent); box-shadow: 0 0 8px var(--imm-accent); animation: imm-cue 1.9s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes imm-cue { to { transform: translateY(54px); } }

/* labels pinned to things in the scene */
.imm-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.imm-label { position: absolute; left: 0; top: 0; opacity: 0; visibility: hidden; will-change: transform, opacity; white-space: nowrap; }
.imm-label > i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .14), 0 0 10px rgba(255, 255, 255, .8); }
.imm-label > span { position: absolute; left: 12px; top: 0; translate: 0 -50%; padding: .32rem .62rem; border-radius: 999px; font: 600 .72rem/1 var(--f-mono); letter-spacing: .03em; color: #fff;
  background: rgba(6, 9, 20, .58); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.imm-label.up > span { left: 0; top: -14px; translate: -50% -100%; }
.imm-label.left > span { left: auto; right: 12px; }
.imm-label.up.upl > span { translate: -12px -100%; }
.imm-label.up.upr > span { translate: calc(-100% + 12px) -100%; }
.imm-label.plain > i { display: none; }
.imm-label.plain > span { left: 0; translate: -50% -50%; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }
.imm-label.hot > i { background: var(--imm-accent); box-shadow: 0 0 0 3px rgba(255, 181, 71, .18), 0 0 12px var(--imm-accent); }

@media (max-width: 759px) {
  .imm-scrim { background: linear-gradient(0deg, rgba(4, 6, 13, .92) 0%, rgba(4, 6, 13, .6) 26%, rgba(4, 6, 13, 0) 50%), linear-gradient(180deg, rgba(4, 6, 13, .72) 0%, rgba(4, 6, 13, 0) 24%); }
  .imm-scrim { opacity: calc(1 - var(--imm-ia, 0)); }
  .imm-scrim-top { display: block; opacity: var(--imm-ia, 0); background: linear-gradient(180deg, rgba(4, 6, 13, .9) 0%, rgba(4, 6, 13, .62) 46%, rgba(4, 6, 13, 0) 66%); } /* the opening words sit at the top on phones */
  .imm-intro, .imm-cap { left: 16px; right: 38px; width: auto; top: auto; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); translate: none; }
  .imm-intro { top: 112px; bottom: auto; right: 16px; }
  .imm-intro h1 { font-size: clamp(2.1rem, 9.6vw, 2.7rem); }
  .imm-intro .lede { font-size: .98rem; margin: .9rem 0 1.2rem; }
  .imm-intro .cta-row .btn-ghost { display: none; } /* the course map is one tap away in the top bar */
  .imm-cap h2 { font-size: clamp(1.7rem, 7.6vw, 2.1rem); }
  .imm-txt { font-size: .97rem; margin-top: .65rem; }
  .imm-chip { margin-top: .9rem; }
  .imm-u { text-transform: none; letter-spacing: .04em; }
.imm .eyebrow, .imm-eye { margin-bottom: .6rem; font-size: .68rem; }
  .imm-rail { right: 4px; gap: 0; }
  .imm-dot { width: 22px; height: 22px; }
  .imm-rail::before, .imm-rail::after { right: 10.5px; top: 11px; }
  .imm-rail::before { bottom: 11px; }
  .imm-rail::after { height: calc((100% - 22px) * var(--imm-p, 0)); }
  .imm-dot::before { width: 5px; height: 5px; }
  .imm-dot-l { display: none; }
  .imm-hud { top: 66px; bottom: auto; min-width: 11rem; }
  .imm-hud-v { font-size: .95rem; margin: .35rem 0 .45rem; }
  .imm-cue { display: none; }
  .imm-label > span { font-size: .66rem; }
  .imm-label:not(.plain) > span { white-space: normal; width: max-content; max-width: 44vw; line-height: 1.25; } /* long tags wrap rather than run off a phone */
}
@media (prefers-reduced-motion: reduce) { .imm-cue i::after { animation: none; } .imm-cv { transition: none; } }
