/* Visite 3D du lab: scroll-driven three.js tour. */
.tour-page { background: #0B1033; }
.tour-page .nav { background: linear-gradient(rgba(11, 16, 51, .72), rgba(11, 16, 51, 0)); box-shadow: none; }
.tour-page .nav .brand img { filter: none; }
.menu-open .tour-page .nav, .tour-page.menu-open .nav { background: var(--paper); color: var(--ink); }

.tour { position: relative; }
.tour__stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; background: radial-gradient(120% 90% at 50% 40%, #1b2463 0%, #0B1033 70%); }
.tour__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.1s var(--ease); }
.tour.is-ready .tour__stage canvas { opacity: 1; }
.tour__fallback { position: absolute; inset: 0; display: none; }
.tour__fallback img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.tour.no-webgl .tour__fallback { display: block; }
.tour.no-webgl .tour__loader, .tour.no-webgl .tour__hud { display: none; }
.tour__vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(130% 100% at 50% 45%, transparent 55%, rgba(5, 8, 30, .45) 100%); }

.tour__loader { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #fff; text-align: center; transition: opacity .6s, visibility .6s; z-index: 2; }
.tour__loader b { font: 700 20px/1.2 var(--fh); letter-spacing: -.01em; }
.tour__loader small { font: 500 12px/1 var(--m); letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.tour__spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--red); animation: v3dspin 0.9s linear infinite; }
@keyframes v3dspin { to { rotate: 360deg; } }
.tour.is-ready .tour__loader { opacity: 0; visibility: hidden; }

.tour__hud { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); translate: -50% 0; display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-radius: 999px; background: rgba(11, 16, 51, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; font: 500 12px/1 var(--m); letter-spacing: .04em; z-index: 3; white-space: nowrap; transition: opacity .4s; }
.tour__bar { width: 90px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.tour__bar i { display: block; height: 100%; width: 0; background: var(--red); border-radius: inherit; }
.tour__label { text-transform: uppercase; opacity: .85; }
.tour__label.is-transit { color: #ffc21a; opacity: 1; }
/* Maker passport: one stamp per station visited. */
.tour__stamps { display: flex; gap: 4px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .2); }
.tour__stamps i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .2); transition: background .3s, scale .35s var(--ease); }
.tour__stamps i.is-on { background: var(--red); box-shadow: 0 0 0 2px rgba(232, 32, 94, .25); scale: 1.15; }
.tour__stamps i.is-pop { animation: v3dpop .6s var(--ease); }
@keyframes v3dpop { 0% { scale: 1; } 40% { scale: 2.1; background: #ffc21a; } 100% { scale: 1.15; } }

/* Lina's speech bubble + mentor tip (desktop: follows her head; phone: band under the HUD). */
.tour__talk { position: absolute; left: 0; top: 0; z-index: 3; width: min(340px, 34vw); display: grid; gap: 8px; pointer-events: none; transition: opacity .35s, translate .45s var(--ease); will-change: transform; }
.tour__talk.is-hidden { opacity: 0; translate: 0 10px; }
.talk__bubble { position: relative; padding: 12px 16px 14px; border-radius: 22px 22px 22px 6px; background: #fff; color: var(--ink); box-shadow: 0 18px 40px -16px rgba(5, 8, 30, .55); }
.talk__bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 18px; height: 18px; margin-left: -9px; background: #fff; rotate: 45deg; border-radius: 0 0 4px 0; }
.talk__who { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 4px; font: 600 10.5px/1 var(--m); letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.talk__who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6cc8ee; box-shadow: 0 0 0 2px rgba(108, 200, 238, .3); }
.talk__say { margin: 0; font: 700 21px/1.18 Caveat, cursive; }
.talk__say span { opacity: .12; transition: opacity .25s; }
.talk__say span.is-on { opacity: 1; }
.talk__tip { order: -1; padding: 9px 13px; border-radius: 14px; background: #ffc21a; color: #0B1033; box-shadow: 0 12px 30px -14px rgba(5, 8, 30, .5); }
.talk__tip .talk__who { color: #0B1033; }
.talk__tip .talk__who::before { background: #0B1033; box-shadow: none; }
.talk__tip p { margin: 0; font: 600 13.5px/1.35 var(--f); }
.talk__tip[hidden] { display: none; }
/* Skill badges that rise out of the station and fly into the passport. */
.tour__chips { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.tour__chip { position: absolute; left: 0; top: 0; padding: 8px 13px; border-radius: 999px; background: #0B1033; color: #fff; font: 600 13px/1 var(--f); white-space: nowrap; box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .6), 0 0 0 2px rgba(255, 255, 255, .85); opacity: 0; }

.tour__pins { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.tour__pin { position: absolute; left: 0; top: 0; translate: -50% -50%; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink); font: 600 12px/1 var(--f); box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .45); cursor: pointer; transition: opacity .35s, scale .35s var(--ease); will-change: transform; }
.tour__pin span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; font: 700 11px/1 var(--m); }
.tour__pin.is-hidden { opacity: 0; scale: .7; pointer-events: none; }
.tour__pin.is-active { background: var(--red); color: #fff; }
.tour__pin.is-active span { background: #fff; color: var(--red); }
.tour__pin:hover { scale: 1.06; }

/* Steps scroll over the sticky stage. */
.tour__steps { position: relative; z-index: 4; margin-top: -100vh; margin-top: -100lvh; pointer-events: none; }
.stop { min-height: 135vh; display: flex; align-items: center; padding: 96px var(--gut); }
.stop--intro { min-height: 120vh; align-items: flex-start; padding-top: 22vh; }
.stop--outro { min-height: 140vh; }
.stop__card { pointer-events: auto; width: min(420px, 100%); background: rgba(255, 255, 255, .94); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); color: var(--ink); border-radius: var(--r); padding: 22px 24px 24px; box-shadow: 0 30px 70px -30px rgba(5, 8, 30, .7), 0 0 0 1px rgba(255, 255, 255, .5) inset; }
.stop:nth-child(odd):not(.stop--intro):not(.stop--outro) { justify-content: flex-end; }
.stop__card h1 { margin: 10px 0 14px; font: 800 clamp(40px, 5.2vw, 64px)/.95 var(--fh); letter-spacing: -.035em; }
.stop__card h2 { margin: 2px 0 4px; font: 800 30px/1.02 var(--fh); letter-spacing: -.03em; }
.stop__card h1 em, .stop__card h2 em { font-style: normal; color: var(--red); }
.stop__card p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.5; }
.stop__lead { font: 600 17px/1.35 var(--fh) !important; color: var(--red); }
.stop__eyebrow, .stop__num { display: flex; align-items: center; gap: 8px; margin: 0 0 6px !important; font: 500 11.5px/1 var(--m) !important; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stop__photo { margin: -8px -10px 14px; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--paper2); }
.stop__photo img { width: 100%; height: 100%; object-fit: cover; }
.stop__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.stop__tags li { padding: 6px 11px; border-radius: 999px; background: var(--paper); font: 600 12.5px/1 var(--f); }
.stop__safe { margin: 12px 0 0 !important; padding: 9px 12px; border-radius: 10px; background: rgba(255, 194, 26, .2); font-size: 13.5px !important; }
.stop__safe::before { content: "⚠ "; }
.stop__hint { display: flex; align-items: center; gap: 10px; margin-top: 18px !important; font: 500 12px/1 var(--m) !important; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mouse { width: 18px; height: 28px; border: 2px solid currentColor; border-radius: 10px; position: relative; }
.mouse::after { content: ""; position: absolute; left: 50%; top: 5px; width: 3px; height: 6px; margin-left: -1.5px; border-radius: 2px; background: var(--red); animation: v3dwheel 1.6s var(--ease) infinite; }
@keyframes v3dwheel { 0% { translate: 0 0; opacity: 1; } 80% { translate: 0 9px; opacity: 0; } 100% { opacity: 0; } }
.stop--intro .stop__card, .stop--outro .stop__card { width: min(520px, 100%); padding: 28px 30px 30px; }
.stop__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 14px; }
.stop__note { font-size: 12.5px !important; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(232, 32, 94, .2); }

/* Cards fade in as they reach the middle of the screen. */
.tour.is-ready .stop__card { opacity: .35; translate: 0 18px; transition: opacity .5s, translate .6s var(--ease); }
.tour.is-ready .stop.is-current .stop__card { opacity: 1; translate: 0 0; }

.tour-page .foot { position: relative; z-index: 5; }

@media (max-width: 759px) {
  .stop { min-height: 125vh; align-items: flex-end; padding: 80px 12px calc(64px + env(safe-area-inset-bottom)); }
  .stop:nth-child(odd):not(.stop--intro):not(.stop--outro) { justify-content: flex-start; }
  .stop--intro { align-items: flex-end; padding-top: 0; }
  .stop__card { padding: 16px 18px 18px; border-radius: 18px; }
  .stop__card h1 { font-size: 40px; }
  .stop__card h2 { font-size: 25px; }
  .stop__card p { font-size: 14.5px; }
  .stop__lead { font-size: 15.5px !important; }
  .stop__photo { display: none; }
  .tour__pin { padding: 3px; }
  .tour__pin b { display: none; }
  .tour__hud { top: 74px; bottom: auto; }
  .tour__bar { width: 60px; }
  .tour__stamps { gap: 3px; padding-left: 8px; }
  .tour__stamps i { width: 5px; height: 5px; }
  .tour__label { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  .tour__talk { left: 12px; right: 12px; top: 120px; width: auto; transform: none !important; }
  .talk__bubble { padding: 10px 13px 12px; border-radius: 18px 18px 18px 6px; }
  .talk__bubble::after { left: 28px; }
  .talk__say { font-size: 18.5px; }
  .talk__tip { order: 0; padding: 7px 11px; }
  .talk__tip p { font-size: 12.5px; }
  .tour__chip { padding: 6px 10px; font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .tour.is-ready .stop__card { opacity: 1; translate: none; }
}
