/* Guided tour on /demo/. Real platform screens (WebP, made-up content) with numbered points and a scripted assistant.
   Default (no JavaScript): every step stacked, image beside its notes and its questions with answers.
   demo.js adds .js: one step at a time on a large stage, the step bar, the controls and the tour assistant. */
main>.phero{padding-bottom:clamp(.5rem,2vw,1.5rem)}
.tour{padding:0 0 clamp(3rem,7vw,5rem)}
.tour .wide{max-width:94rem;padding-left:max(var(--gutter),env(safe-area-inset-left));padding-right:max(var(--gutter),env(safe-area-inset-right))}
.tour h3,.tour h4,.asst h2{text-wrap:balance}
.tour-note{font-size:.98rem;color:var(--ink-soft);margin:0 0 1.25rem;max-width:72ch}

/* step bar: links, so it works without JavaScript too */
.stepper{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(var(--n,11),minmax(0,1fr));gap:.25rem;border-bottom:1px solid var(--ink)}
.stepper a{display:flex;flex-direction:column;align-items:flex-start;gap:.3rem;min-height:48px;padding:.5rem .35rem .55rem;text-decoration:none;font:600 .9rem/1.2 var(--display);color:var(--ink-soft);border-radius:.35rem .35rem 0 0;position:relative;transition:background .18s ease-out,color .18s ease-out}
.stepper .n{display:inline-grid;place-items:center;width:1.75rem;height:1.75rem;border-radius:50%;border:2px solid currentColor;font-size:.9rem;font-variant-numeric:tabular-nums}
.stepper a:hover{background:var(--stone-deep);color:var(--ink)}
.stepper a:active{transform:scale(.97)}
.stepper a:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
.stepper a[aria-current=step]{color:var(--ink)}
.stepper a[aria-current=step] .n{background:var(--action);border-color:var(--action);color:var(--on-action)}
.stepper a[aria-current=step]::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;background:var(--action)}
.stepper .t{overflow-wrap:anywhere}
.tour:not(.js) .stepper{display:flex;flex-wrap:wrap;border:0;gap:.25rem .5rem;margin-bottom:2rem}
.tour:not(.js) .stepper a{flex-direction:row;align-items:center;border-radius:.35rem;padding:.35rem .6rem;color:var(--ink)}

/* controls and progress: only with JavaScript */
.tour-bar,.asst{display:none}
.tour.js .tour-bar{display:flex;align-items:center;gap:.5rem 1rem;flex-wrap:wrap;margin:1rem 0}
.tour-bar .count{font:600 1rem/1 var(--display);font-variant-numeric:tabular-nums;min-width:7.5rem}
.prog{flex:1 1 10rem;height:4px;background:var(--stone-deep);border-radius:2px;overflow:hidden;position:relative}
.prog i{position:absolute;left:0;top:0;bottom:0;width:0;background:var(--brass);transition:width .3s ease-in-out}
.ctl{display:flex;gap:.5rem}
.ctl button{font:600 1rem/1 var(--display);min-height:44px;min-width:44px;padding:0 1.05rem;border:2px solid var(--ink);border-radius:.35rem;background:transparent;color:var(--ink);cursor:pointer;transition:background .18s ease-out,color .18s ease-out,transform .12s ease-out}
.ctl button:hover{background:var(--ink);color:var(--ground)}
.ctl button:active{transform:scale(.97)}
.ctl button:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.ctl button:disabled{opacity:.4;cursor:default}
.ctl #t-prev:disabled{opacity:1;color:var(--ink-soft);border-color:var(--rule)}
.ctl button:disabled:hover{background:transparent;color:var(--ink)}
.ctl #t-next{background:var(--action);border-color:var(--action);color:var(--on-action)}
.ctl #t-next:hover{background:var(--action-hover)}
.ctl #t-next:disabled:hover{background:var(--action);color:var(--on-action)}
/* while the tour plays, the current step's underline fills over the time it stays */
.tour.js.running .stepper a[aria-current=step]::after{transform-origin:left;animation:tick 12s linear both}
@keyframes tick{from{transform:scaleX(0)}to{transform:scaleX(1)}}

/* layout */
.tour-body{display:grid;gap:clamp(1.25rem,3vw,2rem)}
.tour.js .tour-body{grid-template-columns:minmax(0,1fr) 22rem;align-items:start}
@media(max-width:1100px){.tour.js .tour-body{grid-template-columns:1fr}}

/* steps */
.tlist{list-style:none;margin:0;padding:0;display:grid;gap:clamp(2.5rem,6vw,4rem)}
.tstep{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:clamp(1rem,3vw,2.5rem);align-items:start;border-top:3px solid var(--brass);padding-top:1.25rem;scroll-margin-top:1rem}
@media(max-width:900px){.tstep{grid-template-columns:1fr}}
.tour.js .tlist{display:block}
.tour.js .tstep{display:none;border-top:0;padding-top:0;grid-template-columns:1fr}
.tour.js .tstep.on{display:grid}
/* the new screen comes in from the side the visitor is moving to (Next: from the right, Back: from the left).
   A new step restarts it, so pressing Next again mid-way is never blocked. */
.tour.js .tstep.on .shot-frame{animation:shot-in .26s ease-out both}
.tour.js[data-dir=back] .tstep.on .shot-frame{animation-name:shot-back}
@keyframes shot-in{from{opacity:.25;transform:translateX(14px)}to{opacity:1;transform:none}}
@keyframes shot-back{from{opacity:.25;transform:translateX(-14px)}to{opacity:1;transform:none}}

/* the screen */
#t-stage:focus{outline:none}
#t-stage:focus-visible{outline:2px solid var(--focus);outline-offset:4px;border-radius:var(--r-2)}
.shot{position:relative;margin:0;padding:clamp(.5rem,1.6vw,1.25rem);border-radius:var(--r-2);border:1px solid var(--rule);background-color:var(--ground-deep);background-image:linear-gradient(var(--grid) 1px,transparent 1px),linear-gradient(90deg,var(--grid) 1px,transparent 1px);background-size:24px 24px;display:flex;flex-direction:column;align-items:center}
.shot-frame{position:relative;display:inline-block;max-width:100%;line-height:0}
.shot-frame img{max-width:100%;height:auto;width:auto;max-height:min(80vh,820px);border-radius:var(--r-1);border:1px solid var(--rule);box-shadow:0 10px 30px rgba(10,43,41,.18);background:var(--surface)}
@media(max-width:640px){.shot-frame img{max-height:none}}

/* numbered points on the screen */
.hs{position:absolute;transform:translate(-50%,-50%);width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:var(--on-action);font:700 .9rem/1 var(--display);font-variant-numeric:tabular-nums;display:grid;place-items:center;cursor:pointer;padding:0;isolation:isolate;-webkit-tap-highlight-color:transparent;transition:transform .15s ease-out}
/* the visible dot is 28px; the button around it is the 44px touch target */
.hs::before{content:"";position:absolute;inset:8px;z-index:-1;border-radius:50%;border:2px solid var(--ground);background:var(--action);box-shadow:0 2px 8px rgba(10,43,41,.45);transition:background .15s ease-out}
.hs:hover::before{background:var(--action-hover)}
.hs:hover{transform:translate(-50%,-50%) scale(1.08)}
.hs:active{transform:translate(-50%,-50%) scale(.97)}
.hs:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
.hs.on::before{background:var(--brass)}
.hs.on{color:var(--blueprint);transform:translate(-50%,-50%) scale(1.12)}
.tour.js .tstep.on .hs{animation:hs-in .22s ease-out both;animation-delay:calc(.15s + var(--i,0) * 30ms)}
@keyframes hs-in{from{opacity:0;transform:translate(-50%,-50%) scale(.6)}to{opacity:1}}
.hs[hidden]{display:none}

/* text beside or under the screen */
.ttxt h3{font-size:clamp(1.35rem,2.2vw,1.75rem);margin-bottom:.6rem}
.ttxt .lead{color:var(--ink-soft);margin:0 0 1rem;max-width:62ch}
.tour.js .notes{grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:1.5rem}

@media(max-width:820px){.tour.js .notes{grid-template-columns:1fr}}
.notes{list-style:none;margin:0 0 1rem;padding:0;display:grid;gap:.35rem;counter-reset:pt}
.notes li{counter-increment:pt;position:relative;padding:.55rem .7rem .55rem 2.9rem;border-radius:.45rem;font-size:1rem;line-height:1.5;color:var(--ink-soft);transition:background .18s ease-out,color .18s ease-out}
.notes li::before{content:counter(pt);position:absolute;left:.6rem;top:.55rem;width:1.6rem;height:1.6rem;border-radius:50%;background:var(--action);color:var(--on-action);font:700 .8rem/1.6rem var(--display);text-align:center;font-variant-numeric:tabular-nums}
.notes li b{color:var(--ink);font-family:var(--display);font-weight:600;transition:color .18s ease-out}
.tour.js .notes li{cursor:pointer}
.tour.js .notes li:hover{background:var(--stone-deep)}
.notes li.on{background:var(--band);color:var(--on-band-soft)}
.notes li.on b{color:var(--on-band)}
.notes li.on::before{background:var(--brass-light);color:var(--blueprint)}
.tour.js .qa{display:none}
.qa h4{font:600 1rem/1.3 var(--display);margin:1rem 0 .25rem}
.qa details{border-top:1px solid var(--rule)}
.qa details:last-child{border-bottom:1px solid var(--rule)}
.qa summary{font:600 1.02rem/1.35 var(--display);cursor:pointer;padding:.6rem 0;min-height:44px;display:flex;align-items:center}
.qa details p{margin:0 0 .8rem;font-size:1rem;color:var(--ink-soft)}

/* tour assistant */
.tour.js .asst{display:flex}
.asst{flex-direction:column;border:1.5px solid var(--line);border-radius:var(--r-2);background:var(--ground-deep);overflow:hidden;min-width:0}
@media(min-width:1101px){.asst{position:sticky;top:1rem;max-height:calc(100vh - 2rem)}}
.asst-head{display:flex;gap:.7rem;align-items:flex-start;padding:.85rem 1rem;background:var(--band);color:var(--on-band)}
.asst-head svg{width:1.6rem;height:1.6rem;flex:none;margin-top:.15rem;background:var(--film);border-radius:var(--r-1);padding:.2rem}
.asst-head h2{font-size:1.2rem;letter-spacing:-.01em}
.asst-head p{margin:.2rem 0 0;font-size:.9rem;line-height:1.4;color:var(--on-band-soft)}
.a-pad{flex:none;margin-top:-.65rem}
.a-log{position:relative;flex:1 1 auto;min-height:12rem;max-height:30rem;overflow-y:auto;padding:1rem;display:flex;flex-direction:column;gap:.65rem}
@media(min-width:1101px){.a-log{max-height:none}}
.msg{max-width:94%;padding:.6rem .8rem;border-radius:.6rem;font-size:.98rem;line-height:1.55;text-wrap:pretty;overflow-wrap:anywhere;animation:msg-in .2s ease-out both}
.msg p{margin:0 0 .5rem}.msg p:last-child{margin:0}
.msg.bot{align-self:flex-start;background:var(--surface);border:1px solid var(--rule)}
.msg.bot b{font-family:var(--display);font-weight:600}
.msg.me{align-self:flex-end;background:var(--action);color:var(--on-action);border-radius:.6rem .6rem .15rem .6rem;font-family:var(--display);font-weight:500}
@keyframes msg-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.a-qs{display:flex;flex-wrap:wrap;gap:.45rem;padding:.75rem 1rem 1rem;border-top:1px solid var(--rule)}
.chip{min-height:44px;padding:.4rem .85rem;border:1.5px solid var(--action);border-radius:2rem;background:transparent;color:var(--ink);font:600 .92rem/1.25 var(--display);text-align:left;cursor:pointer;transition:background .15s ease-out,color .15s ease-out,transform .12s ease-out}
.chip:hover{background:var(--action);color:var(--on-action)}
.chip:active{transform:scale(.97)}
.chip:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.chip.go{border-style:dashed}
.chip.show{display:inline-flex;margin-top:.6rem;border-color:var(--brass);color:var(--ink);min-height:40px}
.chip.show:hover{background:var(--brass);color:var(--blueprint)}

/* the ending band */
.endcta{background:var(--band);color:var(--on-band)}
.endcta h2{margin-bottom:.75rem}
.endcta p{color:var(--on-band-soft);max-width:60ch}
.endcta .cta-row{margin-top:1.5rem}
.endcta .plain{color:var(--on-band);font:600 1.05rem/1 var(--display);display:inline-flex;align-items:center;min-height:48px;text-decoration-color:var(--brass-light);text-underline-offset:.3em;text-decoration-thickness:2px}

@media(max-width:700px){
  .stepper{grid-template-columns:repeat(6,minmax(0,1fr));border-bottom:0;row-gap:.35rem}
  .stepper a{align-items:center;padding:.3rem 0;border-radius:.35rem}
  .stepper .t{display:none}
  .stepper a[aria-current=step]::after{left:20%;right:20%;bottom:0}
  .tour-bar .count{min-width:0}
  .prog{order:3;flex-basis:100%}
  .ctl{margin-left:auto}
  .ctl button{padding:0 .8rem}
}

@media(prefers-reduced-motion:reduce){
  .tour *,.tour *::before,.tour *::after{animation:none!important;transition:none!important}
}

/* Optional clip of a step (site/demo/README.md): hidden without the script, which owns Play and Stop. */
.clip{display:none}
.tour.js .clip{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:center;gap:.5rem 1rem;margin-top:.9rem;max-width:62ch;text-align:center}
.shot-frame video{display:block;max-width:100%;height:auto;width:auto;max-height:min(80vh,820px);border-radius:var(--r-1);border:1px solid var(--rule);box-shadow:0 10px 30px rgba(10,43,41,.18);background:var(--surface)}
.shot-frame video[hidden]{display:none}
.shot-frame.playing .hs{display:none}
.clip-btn{min-height:44px;padding:0 1rem;font:600 .95rem/1 var(--display);color:var(--ink);background:var(--ground);border:1.5px solid var(--ink);border-radius:var(--r-1);cursor:pointer}
.clip-btn:hover{background:var(--surface)}
.clip-btn:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.clip-cap{margin:0;font-size:.9375rem;line-height:1.45;color:var(--ink-soft)}
.clip-len{font-weight:600;color:var(--ink)}
@media(max-width:640px){.shot-frame video{max-height:none}}
