/* courtscout.uk/instructions: the app's three tours, each step a still or two of the
   real app in the site's own drawn phone, with the tour drawn over them as the app draws
   it: a dim with a lit hole, a pulsing ring, an arrow from the card, a tap, and the step's
   card floating over the screen (words from shared/.../domain/Tour.kt). Everything is
   scoped to .tour-stage so the site's own rules (img, h2, .hero, .skip, .foot) stay out.
   The frame and what's in its screen are a picture of the phone, so they keep the app's
   light colours in dark mode; the switch and the steps beside it follow the site's theme. */
.tour-stage{
  --ink:#0B1030; --ink2:#4A5070; --ink3:#8A90AE; --dim:rgba(8,12,40,.62); --ask-dim:rgba(8,12,40,.72);
  --ease:cubic-bezier(.2,.8,.2,1);
  --sf:-apple-system,BlinkMacSystemFont,"SF Pro Text","Inter","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  container-type:inline-size;
}

.tour-stage button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
.tour-stage button:focus-visible{outline:3px solid var(--link);outline-offset:2px}

/* On a wide screen: the phone under its tour switch, and beside it the tour's name and its steps. */
.tour-stage{display:flex;align-items:center;justify-content:center;gap:56px;padding-block:8px}
.tour-stage .side{flex:0 0 340px;display:flex;flex-direction:column;gap:20px}
.tour-stage .side h2{margin:0;font:750 26px/1.15 var(--display);letter-spacing:-.02em;text-wrap:balance}
.tour-stage .side>p{margin:0 0 -4px;color:var(--text-2);font-size:16px;line-height:1.5}
.tour-stage .steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px;counter-reset:s}
.tour-stage .steps button{width:100%;display:flex;gap:12px;align-items:baseline;text-align:left;padding:10px 12px;border-radius:14px;color:var(--text-2);font-size:15.5px;line-height:1.35}
.tour-stage .steps button::before{counter-increment:s;content:counter(s);font-variant-numeric:tabular-nums;opacity:.7;width:16px;flex:none}
.tour-stage .steps button:hover{background:color-mix(in srgb,var(--card) 60%,transparent)}
.tour-stage .steps button[aria-current="step"]{background:var(--card);color:var(--text);font-weight:650;box-shadow:0 0 0 1px var(--line)}
.tour-stage .steps button[aria-current="step"]::before{color:var(--link);opacity:1}
.tour-stage .steps.many button{padding:7px 12px;font-size:14.5px}
.tour-stage .steps .pill{margin-left:auto;align-self:center}
.tour-stage .replay{align-self:flex-start;display:inline-flex;gap:8px;align-items:center;height:38px;padding:0 16px;border-radius:19px;background:var(--card);box-shadow:0 0 0 1px var(--line);font-weight:650;font-size:14px}

.tour-stage .phone-col{flex:none;display:flex;flex-direction:column;align-items:center;gap:16px;min-width:0}
/* Which tour: a segmented switch in the site's own colours. */
.tour-stage .tour-switch{display:inline-flex;gap:2px;padding:4px;border-radius:24px;background:var(--card);box-shadow:0 0 0 1px var(--line)}
.tour-stage .tour-switch button{min-width:84px;height:40px;padding:0 16px;border-radius:20px;font-weight:650;font-size:15px;color:var(--text-2);transition:background .2s,color .2s}
.tour-stage .tour-switch button:hover{color:var(--text)}
.tour-stage .tour-switch button[aria-pressed="true"]{background:var(--royal);color:#fff}
.tour-section{overflow-x:clip}
.tour-stage .rm-hint{margin:-4px 0 0;color:var(--text-2);font-size:14px;line-height:1.4;text-align:center}
.tour-stage .rm-hint[hidden]{display:none}

/* ---------- The phone ----------
   As tall as the window lets it be, about 86% of it, with the switch above in view.
   Everything in it is measured in --u, a point of a 390pt screen, so the frame, the
   island, the card and the light keep their shape at any size. The stills are an
   iPhone's (1320 x 2868), near enough this screen's shape to fill it. */
.tour-stage .phone-wrap{
  --pw:max(240px,min(calc(100cqw - 420px),calc(min(86vh,100vh - 104px) * 390 / 844)));
  --pw:max(240px,min(calc(100cqw - 420px),calc(min(86svh,100svh - 104px) * 390 / 844)));
  flex:none;width:var(--pw);margin:12px 14px 14px;container-type:inline-size;
}
.tour-stage .phone{
  --u:calc(100cqw / 390);
  position:relative;width:100%;aspect-ratio:390/844;border-radius:calc(54 * var(--u));
  box-shadow:0 0 0 calc(11 * var(--u)) #0B1030,0 0 0 calc(12 * var(--u)) #2A3050,0 30px 60px rgba(11,16,48,.28);
  color:var(--ink);font:15px/1.4 var(--sf);color-scheme:light;
}
.tour-stage .screen{position:absolute;inset:0;border-radius:inherit;overflow:hidden;background:#F4F5FB;isolation:isolate}
/* Until a still is in, or when it can't be had: a plain screen with the app's icon, as the app shows. */
.tour-stage .stand-in{position:absolute;left:50%;top:50%;width:calc(56 * var(--u));height:auto;max-width:none;margin:calc(-28 * var(--u)) 0 0 calc(-28 * var(--u));border-radius:22.5%;opacity:.5}
/* Two stills, one over the other, so one can fade into the next. They fill the screen
   exactly, so a spot's 0–1 place on the still is its place on the screen. */
.tour-stage .frame{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:fill;opacity:0;transition:opacity .45s ease}
.tour-stage .frame.on{opacity:1}
.tour-stage .island{z-index:20;position:absolute;top:calc(11 * var(--u));left:50%;width:calc(124 * var(--u));height:calc(36 * var(--u));margin-left:calc(-62 * var(--u));border-radius:calc(20 * var(--u));background:#000;pointer-events:none}

/* ---------- The light: a dim with a rounded hole, its ring, the arrow and the tap ---------- */
/* Placed by tour.js in % of the screen; with no spot it opens to the whole screen and goes out. */
.tour-stage .hole{z-index:3;position:absolute;left:0;top:0;width:100%;height:100%;border-radius:calc(54 * var(--u));box-shadow:0 0 0 300vmax var(--dim);pointer-events:none;opacity:1;transition:opacity .3s}
/* The accent light: a lime ring round the hole, and its glow on the dim, outside only so what's lit keeps its own colours. */
.tour-stage .hole::before{content:"";position:absolute;inset:calc(-5 * var(--u));border-radius:inherit;box-shadow:0 0 calc(60 * var(--u)) calc(20 * var(--u)) rgba(215,242,5,.16);opacity:var(--lit,0)}
.tour-stage .hole::after{content:"";position:absolute;inset:calc(-5 * var(--u));border-radius:inherit;border:max(2px,calc(2.5 * var(--u))) solid var(--lime);box-shadow:0 0 18px 3px rgba(215,242,5,.55),inset 0 0 10px rgba(215,242,5,.35);opacity:var(--lit,0);animation:t-pulse 1.6s ease-in-out infinite}
@keyframes t-pulse{0%,100%{transform:scale(1);opacity:var(--lit,0)}50%{transform:scale(1.04);opacity:calc(var(--lit,0) * .7)}}
.tour-stage .arrow{z-index:4;position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;opacity:0;transition:opacity .25s}
.tour-stage .arrow.on{opacity:1}
.tour-stage .arrow path{fill:none;stroke:var(--lime);stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 0 5px rgba(215,242,5,.6))}
/* The finger: a press, and a ripple out from it. */
.tour-stage .tap{z-index:5;position:absolute;width:calc(46 * var(--u));height:calc(46 * var(--u));margin:calc(-23 * var(--u)) 0 0 calc(-23 * var(--u));border-radius:50%;background:rgba(255,255,255,.55);border:2px solid #fff;box-shadow:0 2px 10px rgba(0,0,0,.25);opacity:0;pointer-events:none}
.tour-stage .tap::after{content:"";position:absolute;inset:-2px;border-radius:50%;border:2px solid #fff;opacity:0}
.tour-stage .tap.go{animation:t-tap .7s var(--ease)}
.tour-stage .tap.go::after{animation:t-ripple .8s ease-out .12s}
/* With motion reduced, the tap stays put on the still that shows it. */
.tour-stage .tap.still{opacity:.85}
@keyframes t-tap{0%{opacity:0;transform:scale(1.5)}30%{opacity:1;transform:scale(1)}55%{transform:scale(.82)}100%{opacity:0;transform:scale(1.25)}}
@keyframes t-ripple{0%{opacity:.9;transform:scale(1)}100%{opacity:0;transform:scale(2.4)}}

/* The whole screen pauses and plays the pictures; paused, it shows the play button. */
.tour-stage .toggle{z-index:6;position:absolute;inset:0;width:100%;height:100%;border-radius:inherit;display:grid;place-items:center}
.tour-stage .toggle:focus-visible{outline-offset:-4px}
.tour-stage .toggle:disabled{cursor:default}

/* ---------- The step's card, floating over the screen at its top or bottom ---------- */
.tour-stage .card{
  z-index:7;position:absolute;left:calc(14 * var(--u));right:calc(14 * var(--u));top:0;
  border-radius:calc(28 * var(--u));background:#fff;color:var(--ink);
  padding:max(10px,calc(14 * var(--u))) max(12px,calc(18 * var(--u))) max(10px,calc(14 * var(--u)));
  box-shadow:0 16px 40px rgba(0,0,0,.30);transition:opacity .3s,visibility 0s;
}
/* While the ask is up, the card waits out of sight. */
.tour-stage .card.away{opacity:0;visibility:hidden;transition:opacity .2s,visibility 0s .2s}
.tour-stage .card .top{display:flex;align-items:center;gap:4px;height:max(26px,calc(30 * var(--u)))}
.tour-stage .card .top .sp{flex:1}
.tour-stage .count{font-size:max(11.5px,calc(13 * var(--u)));color:var(--ink3);font-variant-numeric:tabular-nums;font-weight:500;margin-right:6px;white-space:nowrap}
/* A step for a plan above Basic carries that plan's pill, as in the app. */
.tour-stage .pill{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:10px;color:#fff;font-size:12px;font-weight:700;line-height:1;flex:none}
.tour-stage .pill[hidden]{display:none}
.tour-stage .pill.extra{background:linear-gradient(90deg,#FF8D28,#FF383C)}
.tour-stage .pill.pro{background:linear-gradient(90deg,#8B5CFF,#5B2CF0)}
.tour-stage .again{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 11px;margin-right:4px;border-radius:14px;background:rgba(11,16,48,.06);color:var(--ink2);font-size:13.5px;font-weight:600;white-space:nowrap;flex:none;animation:again-in .2s var(--ease)}
.tour-stage .again:hover{background:rgba(11,16,48,.1)}
.tour-stage .again[hidden]{display:none}
@keyframes again-in{from{opacity:0;transform:scale(.9)}}
@media (prefers-reduced-motion:reduce){.tour-stage .again{animation:none}}
.tour-stage .t-skip{font-size:max(13px,calc(14 * var(--u)));font-weight:600;color:var(--ink2);padding:4px 2px 4px 6px}
.tour-stage .t-skip[hidden]{display:none}
.tour-stage .card h3{margin:max(4px,calc(6 * var(--u))) 0 max(3px,calc(4 * var(--u)));font:700 max(16px,calc(22 * var(--u)))/1.18 var(--sf);letter-spacing:-.02em;text-wrap:balance;min-height:2.36em;display:flex;align-items:flex-end}
.tour-stage .card p{margin:0;font-size:max(12.5px,calc(15 * var(--u)));line-height:1.33;color:var(--ink2);min-height:3.99em;text-wrap:pretty}
.tour-stage .card .words{transition:opacity .25s,transform .35s var(--ease)}
.tour-stage .card .words.out{opacity:0;transform:translateY(6px)}
.tour-stage .t-foot{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:max(8px,calc(12 * var(--u)))}
.tour-stage .back{height:max(36px,calc(44 * var(--u)));padding:0 10px 0 0;border-radius:22px;display:inline-flex;align-items:center;gap:2px;font-weight:600;font-size:max(13px,calc(15 * var(--u)));color:var(--ink2);white-space:nowrap}
.tour-stage .back[hidden]{display:inline-flex!important;visibility:hidden}
.tour-stage .dots{display:flex;gap:4px;min-width:0}
.tour-stage .dots i{width:4px;height:4px;border-radius:2px;background:rgba(11,16,48,.14);flex:none;transition:width .25s var(--ease),background .25s}
.tour-stage .dots i.on{width:10px;background:var(--violet)}
.tour-stage .next{height:max(36px,calc(44 * var(--u)));min-width:max(72px,calc(100 * var(--u)));padding:0 max(14px,calc(20 * var(--u)));border-radius:999px;background:var(--lime);border:1px solid var(--lime-2);font-weight:700;font-size:max(14px,calc(16 * var(--u)));color:var(--ink);white-space:nowrap;transition:transform .15s}
.tour-stage .next:active{transform:scale(.95)}

/* The ask before the tour (TourPop in the app): a dim over the screen, and on it a
   card in the middle with the scout reading over its top edge. */
.tour-stage .screen::after{content:"";z-index:8;position:absolute;inset:0;background:var(--ask-dim);opacity:0;pointer-events:none;transition:opacity .3s}
.tour-stage .screen.asking::after{opacity:1}
.tour-stage .screen.asking .hole{opacity:0}
.tour-stage .ask{
  z-index:9;position:absolute;left:calc(24 * var(--u));right:calc(24 * var(--u));top:50%;
  border-radius:calc(28 * var(--u));background:#fff;padding:calc(84 * var(--u)) calc(20 * var(--u)) calc(20 * var(--u));
  text-align:center;box-shadow:0 16px 40px rgba(0,0,0,.30);
  transform:translateY(calc(-50% + 45 * var(--u)));opacity:0;visibility:hidden;
  transition:opacity .25s,transform .45s var(--ease),visibility 0s .45s;
}
.tour-stage .screen.asking .ask{opacity:1;visibility:visible;transform:translateY(calc(-50% + 33 * var(--u)));transition:opacity .25s,transform .45s var(--ease)}
.tour-stage .ask .reader{position:absolute;left:50%;top:calc(-66 * var(--u));width:auto;height:calc(140 * var(--u));max-width:none;margin-left:calc(-69 * var(--u));transform-origin:50% 100%;transform:scale(.6);opacity:0}
.tour-stage .screen.asking .ask .reader{transform:none;opacity:1;transition:transform .5s cubic-bezier(.3,1.5,.5,1) .15s,opacity .2s .15s}
.tour-stage .ask h3{margin:0;font-size:max(16px,calc(22 * var(--u)));line-height:1.18;font-weight:700;letter-spacing:-.02em;text-wrap:balance}
.tour-stage .ask p{margin:calc(6 * var(--u)) 0 0;font-size:max(12.5px,calc(15 * var(--u)));line-height:1.33;color:var(--ink2);text-wrap:pretty}
.tour-stage .ask-foot{display:flex;gap:calc(10 * var(--u));margin-top:calc(20 * var(--u))}
.tour-stage .ask-foot button{flex:1;min-width:0;height:max(36px,calc(48 * var(--u)));border-radius:999px;font-size:max(13px,calc(16 * var(--u)));white-space:nowrap;transition:transform .15s}
.tour-stage .ask-foot button:active{transform:scale(.95)}
.tour-stage .later{background:rgba(11,16,48,.06);color:var(--ink2);font-weight:600}
.tour-stage .start{background:var(--lime);border:1px solid var(--lime-2);color:var(--ink);font-weight:700}

/* The carousel's parts: on a wide screen only the playing slot shows, and no dots. */
.tour-stage .m-head,.tour-stage .tour-dots{display:none}
.tour-stage .tour-track{position:relative}
.tour-stage .slot:not(.live),.tour-stage .slot.live .ghost{display:none}
.tour-stage .ghost .screen{pointer-events:none}

/* ---------- A phone's width ----------
   The tour's name over a carousel of the three tours: the playing phone in the middle,
   nearly as wide as the page, the other two a faded sliver either side, and dots under
   them. The card is in the phone, so the list of steps is left out. */
@media (max-width:820px){
  .tour-section .wrap{padding-inline:0}
  .tour-stage{flex-direction:column;align-items:center;gap:14px}
  .tour-stage .side,.tour-stage .tour-switch{display:none}
  .tour-stage .phone-col{gap:10px;width:100%}
  .tour-stage .m-head{display:block;padding:0 24px;text-align:center}
  .tour-stage .m-head h2{margin:0;font:750 26px/1.15 var(--display);letter-spacing:-.02em}
  .tour-stage .m-head p{margin:4px 0 0;color:var(--text-2);font-size:15px;line-height:1.4}
  .tour-stage .tour-track,.tour-stage .phone-wrap{
    --pw:min(calc(100vw - 64px),max(360px,calc(86vh * 390 / 844)));
    --pw:min(calc(100vw - 64px),max(360px,calc(86svh * 390 / 844)));
  }
  .tour-stage .phone-wrap{margin:12px 10px 14px}
  /* The carousel runs the width of the window, past the page's margins. */
  .tour-stage .tour-track.js{display:flex;width:100vw;margin:0 calc(50% - 50vw);overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;
    padding-inline:calc((100vw - var(--pw) - 20px) / 2);scrollbar-width:none}
  .tour-stage .tour-track.js::-webkit-scrollbar{display:none}
  .tour-stage .tour-track.js .slot{display:block;flex:none;scroll-snap-align:center;scroll-snap-stop:always;transition:opacity .25s,transform .25s}
  .tour-stage .tour-track.js .slot:not(.on){opacity:.3;transform:scale(.96);cursor:pointer}
  .tour-stage .tour-track.js .slot.live .ghost{display:none}
  .tour-stage .tour-dots{display:flex;justify-content:center;gap:4px}
  .tour-stage .tour-dots button{width:24px;height:24px;display:grid;place-items:center}
  .tour-stage .tour-dots button::before{content:"";width:8px;height:8px;border-radius:99px;background:color-mix(in srgb,var(--text-2) 35%,transparent);transition:width .25s,background .25s}
  .tour-stage .tour-dots button[aria-current="true"]::before{width:22px;background:var(--royal)}
}
@media (max-width:360px){
  .tour-stage .tour-switch button{min-width:0}
}

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