/* Ion's tour (js/tour.js). Everything is scoped to .tour-* so it can't touch the rest of the site. */
.tour-root{position:fixed;inset:0;z-index:2000;font-family:Inter,'Segoe UI',system-ui,sans-serif;color:#f1f5f9;--ion-h:min(300px,38svh);--dock:250px}
.tour-tipwrap{inset:auto;pointer-events:none}
.tour-tipwrap .tour-panel{pointer-events:auto}

/* ---- Ion + speech bubble ---- */
.tour-panel{position:fixed;display:flex;align-items:flex-end;gap:0;max-width:min(760px,calc(100vw - 16px))}
.tour-ion{position:relative;flex:none;width:calc(var(--ion-h) * .72);height:var(--ion-h);filter:drop-shadow(0 10px 22px #000b)}
.tour-ion img{position:absolute;left:50%;bottom:0;height:calc(var(--ion-h) * var(--s,1));width:auto;max-width:none;transform:translateX(-50%);transform-origin:50% 100%}
.tour-root.is-typing .tour-ion img{animation:tour-bob .5s ease-in-out infinite alternate}
.tour-bubble{position:relative;flex:0 1 430px;min-width:250px;margin:0 0 16px 6px;padding:15px 18px 14px;border:1px solid #3b6ea5;border-radius:18px;
  background:linear-gradient(160deg,#10263f,#091526);box-shadow:0 18px 50px #000a,0 0 0 1px #38bdf822 inset}
.tour-bubble::before{content:"";position:absolute;left:-9px;bottom:34px;width:16px;height:16px;transform:rotate(45deg);background:#10263f;border-left:1px solid #3b6ea5;border-bottom:1px solid #3b6ea5}
.tb-who{display:block;font:800 11px Inter,sans-serif;letter-spacing:.16em;text-transform:uppercase;color:#7dd3fc;margin-bottom:6px}
.tb-text{margin:0;font-size:17px;line-height:1.5;color:#f1f5f9;min-height:3em}
.tb-hint{margin:10px 0 0;font-weight:700;font-size:14px;color:#fde68a}
.tb-hint::before{content:"👉 "}
.tb-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;flex-wrap:wrap}
.tb-count{font:600 12px Inter,sans-serif;color:#94a3b8;letter-spacing:.04em}
.tb-btns{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}
.tb-skip,.tour-replay{background:none;border:0;padding:6px 4px;color:#94a3b8;font:600 13px Inter,sans-serif;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.tb-skip:hover,.tour-replay:hover{color:#f1f5f9}
.tour-replay{font-size:inherit;color:inherit;opacity:.85}
.tour-root button:focus-visible,.tour-replay:focus-visible{outline:3px solid #fbbf24;outline-offset:3px;border-radius:8px}

/* corners (desktop). Right-hand corners put Ion on the right with the bubble on her left. */
.tp-bl{left:clamp(8px,2vw,28px);bottom:0}
.tp-br{right:clamp(8px,2vw,28px);bottom:0;flex-direction:row-reverse}
.tp-tl{left:clamp(8px,2vw,28px);top:72px}
.tp-tr{right:clamp(8px,2vw,28px);top:72px;flex-direction:row-reverse}
.tp-br .tour-bubble,.tp-tr .tour-bubble{margin:0 6px 16px 0}
.tp-br .tour-bubble::before,.tp-tr .tour-bubble::before{left:auto;right:-9px;transform:rotate(-135deg)}
.tp-tl .tour-ion img,.tp-tr .tour-ion img{-webkit-mask-image:linear-gradient(#000 78%,transparent);mask-image:linear-gradient(#000 78%,transparent)}
.tp-tl,.tp-tr{align-items:flex-start}
.tp-tl .tour-bubble,.tp-tr .tour-bubble{margin-top:34px;margin-bottom:0}
.tp-tl .tour-bubble::before,.tp-tr .tour-bubble::before{bottom:auto;top:30px}

/* ---- guide: dimmer + spotlight ---- */
.tour-block{position:fixed;inset:0;background:transparent;cursor:default}
.tour-guide.no-target .tour-block{background:rgba(2,8,18,.74)}
.tour-spot{position:fixed;border-radius:14px;pointer-events:none;box-shadow:0 0 0 9999px rgba(2,8,18,.74);outline:2px solid #fbbf24;outline-offset:0;transition:left .28s,top .28s,width .28s,height .28s}
.tour-guide.no-target .tour-spot{display:none}
.tour-guide.is-do .tour-spot{animation:tour-pulse 1.4s ease-in-out infinite}

/* ---- opening story ---- */
.tour-story{background:#030712;animation:tour-fade .4s ease both}
.ts-art{position:absolute;left:0;right:0;top:0;bottom:calc(var(--dock) - 50px);overflow:hidden;background:#050d1c}
.ts-art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .7s}
.ts-art img.on{opacity:1;animation:tour-drift 20s ease-out forwards}
.ts-art::after{content:"";position:absolute;inset:auto 0 0 0;height:45%;background:linear-gradient(transparent,#030712)}
.tour-story .tour-panel.tp-dock{left:0;right:0;bottom:0;max-width:none;margin:0 auto;width:min(980px,100%);padding:0 clamp(8px,2vw,28px)}
.tour-story .tour-ion{--ion-h:min(330px,40svh);margin-bottom:0}
.tour-story .tour-bubble{flex:1 1 auto;max-width:640px;margin-bottom:22px}
.tour-story .tb-text{font-size:19px}

/* ---- tips ---- */
.tour-tip{left:clamp(8px,2vw,24px);bottom:0;--ion-h:200px;filter:none}
.tour-tip .tour-bubble{flex-basis:330px;margin-bottom:12px}
.tour-tip .tb-text{font-size:15px;min-height:0}

@keyframes tour-bob{from{transform:translateX(-50%) translateY(0)}to{transform:translateX(-50%) translateY(-3px)}}
@keyframes tour-pulse{0%,100%{outline-color:#fbbf24;outline-offset:0}50%{outline-color:#fde68a;outline-offset:5px}}
@keyframes tour-fade{from{opacity:0}to{opacity:1}}
@keyframes tour-drift{from{transform:scale(1.02)}to{transform:scale(1.09)}}

/* ---- phones: Ion becomes a round portrait and the bubble is a bottom sheet ---- */
@media (max-width:699px){
  .tour-panel,.tour-tip{left:8px!important;right:8px!important;top:auto!important;bottom:8px!important;max-width:none;flex-direction:row!important;align-items:flex-end}
  .tour-ion{--ion-h:76px;width:76px;height:76px;margin:0 0 10px;border:2px solid #fbbf24;border-radius:50%;background:#0f2a44;overflow:hidden;filter:none;flex:none}
  .tour-ion img{position:static;transform:none!important;width:100%;height:100%;object-fit:cover;object-position:50% 0;-webkit-mask-image:none!important;mask-image:none!important;animation:none!important}
  .tour-bubble,.tp-br .tour-bubble,.tp-tr .tour-bubble,.tp-tl .tour-bubble{flex:1 1 auto;min-width:0;margin:0 0 0 10px;padding:12px 14px}
  .tour-bubble::before{display:none}
  .tb-text{font-size:15px;min-height:0}
  .tb-bar{margin-top:8px}
  .tour-story .tour-panel.tp-dock{padding:0;width:auto}
  .tour-story .tour-ion{--ion-h:76px}
  .tour-story .tb-text{font-size:15px}
  .ts-art{bottom:210px}
}
@media (max-height:520px) and (min-width:700px){ .tour-root{--ion-h:min(210px,38svh)} .tb-text{font-size:15px;min-height:0} .tour-story .tb-text{font-size:16px} }
@media (prefers-reduced-motion:reduce){
  .tour-root *,.tour-root{animation:none!important;transition:none!important}
}

/* In guided "do" steps the page underneath must stay clickable: only the bubble (and, for plain steps, the blocker) take clicks. */
.tour-guide{pointer-events:none}
.tour-guide .tour-block,.tour-guide .tour-panel{pointer-events:auto}
