/* The 7 Nov picks, approval round: tab-anim. Every rule under html.uf-<switch>:is([data-skin=r]).
   The tab bar's own icons (PkTabIcon, js/components/tab-anim.js): the outline while idle, filled in the tab's blue when
   chosen, and one move when a tab becomes the chosen one (.go), on the Stageshow kit's curves (references/motion.md,
   Pace and easing): arrival (.25,.8,.25,1), travel (.45,0,.1,1), UI feedback (.3,.75,.1,1), a small icon's local
   overshoot (.34,1.56,.64,1) and the kit's settle (.22,1,.36,1). 300 to 820 ms, once; none under reduced motion. */

/* ---- the still states (also what reduced motion and every screenshot sees) ---- */
html.uf-tab-anim:is([data-skin=r]) .nav:not(#a#g#l){--pk-tab-cut:var(--surface)}
html.uf-tab-anim:is([data-skin=r]) .pk-ti:not(#a#g#l){overflow:visible;--pk-ti-arr:cubic-bezier(.25,.8,.25,1);--pk-ti-trv:cubic-bezier(.45,0,.1,1);--pk-ti-ui:cubic-bezier(.3,.75,.1,1);--pk-ti-spr:cubic-bezier(.34,1.56,.64,1);--pk-ti-out:cubic-bezier(.22,1,.36,1)}
html.uf-tab-anim:is([data-skin=r]) .pk-ti .o:not(#a#g#l){fill:none}
html.uf-tab-anim:is([data-skin=r]) .pk-ti .b:not(#a#g#l){fill:transparent}
html.uf-tab-anim:is([data-skin=r]) .pk-ti.on .b:not(#a#g#l){fill:currentColor}
html.uf-tab-anim:is([data-skin=r]) .pk-ti :is(.f,.c):not(#a#g#l){stroke:none;opacity:0}
html.uf-tab-anim:is([data-skin=r]) .pk-ti .f:not(#a#g#l){fill:currentColor}
html.uf-tab-anim:is([data-skin=r]) .pk-ti .c:not(#a#g#l){fill:var(--pk-tab-cut)}
html.uf-tab-anim:is([data-skin=r]) .pk-ti.on :is(.f,.c):not(#a#g#l){opacity:1}
/* Schedule: the line under the month and the day as cut-outs once chosen; the page that flips is hidden at rest */
html.uf-tab-anim:is([data-skin=r]) .pk-ti .ti-hd-c:not(#a#g#l){fill:none;stroke:var(--pk-tab-cut);stroke-width:1.5}
html.uf-tab-anim:is([data-skin=r]) .pk-ti .ti-day:not(#a#g#l){fill:currentColor;stroke:none}
html.uf-tab-anim:is([data-skin=r]) .pk-ti.on .ti-day:not(#a#g#l){fill:var(--pk-tab-cut)}
html.uf-tab-anim:is([data-skin=r]) .pk-ti .ti-pg:not(#a#g#l){fill:currentColor;stroke:var(--pk-tab-cut);stroke-width:1;opacity:0}
/* Insights: the spark is a solid mark */
html.uf-tab-anim:is([data-skin=r]) .pk-ti .ti-spk:not(#a#g#l){fill:currentColor;stroke:none}
/* Playground: the runner is one round dot on the track's middle line (a dash of no length with round ends), in the
   bar's surface once the track is filled; its trail only shows while it runs */
html.uf-tab-anim:is([data-skin=r]) .pk-ti :is(.ti-run,.ti-trail):not(#a#g#l){fill:none;stroke-width:3.2;stroke-dasharray:.01 99.99}
html.uf-tab-anim:is([data-skin=r]) .pk-ti.on :is(.ti-run,.ti-trail):not(#a#g#l){stroke:var(--pk-tab-cut)}
html.uf-tab-anim:is([data-skin=r]) .pk-ti .ti-trail:not(#a#g#l){opacity:0;stroke-width:2;stroke-dasharray:22 78;stroke-dashoffset:22}
/* a chart's time and a lap run the other way in Arabic */
html.uf-tab-anim:is([data-skin=r])[dir=rtl] .pk-ti .mir:not(#a#g#l){transform:scaleX(-1);transform-box:view-box;transform-origin:12px 12px}
/* on the side bar the chosen row has its own tint, so the cut-outs take it */
@media (min-width:900px){
  html.uf-tab-anim:is([data-skin=r]) .nav button.on:not(#a#g#l){--pk-tab-cut:var(--accent-soft)}
}

/* ---- the moves ---- */
@media (prefers-reduced-motion:no-preference){
  /* the press: in at once, back on a small spring (feedback stays as quick as the real product) */
  html.uf-tab-anim:is([data-skin=r]) .nav button .nav-ic:not(#a#g#l){transition:transform 420ms var(--pk-ti-spr,cubic-bezier(.34,1.56,.64,1))}
  html.uf-tab-anim:is([data-skin=r]) .nav button:active .nav-ic:not(#a#g#l){transform:scale(.84);transition-duration:90ms}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go :not(.mir):not(#a#g#l){transform-box:fill-box}
  /* a tab let go fades back to its outline */
  html.uf-tab-anim:is([data-skin=r]) .pk-ti :is(.b,.ti-day):not(#a#g#l){transition:fill 200ms ease}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti :is(.f,.c):not(#a#g#l){transition:opacity 200ms ease}

  /* Home: the walls rise, the roof drops on, the door opens */
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-body:not(#a#g#l){transform-origin:50% 100%;animation:pk-ti-rise 420ms var(--pk-ti-spr) both}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-roof:not(#a#g#l){animation:pk-ti-drop 480ms var(--pk-ti-out) 120ms both}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-door:not(#a#g#l){transform-origin:0 100%;animation:pk-ti-door 320ms var(--pk-ti-out) 360ms both}
  html.uf-tab-anim:is([data-skin=r])[dir=rtl] .pk-ti.go .ti-door:not(#a#g#l){transform-origin:100% 100%}

  /* Workouts: the dumbbell does a rep, lifted and set down with a little give */
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-dbl:not(#a#g#l){transform-origin:50% 50%;animation:pk-ti-rep 700ms var(--pk-ti-ui) both}

  /* Analytics: the bars grow in reading order */
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-bar:not(#a#g#l){transform-origin:50% 100%;animation:pk-ti-grow 460ms var(--pk-ti-spr) both}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-bar:nth-child(2):not(#a#g#l){animation-delay:90ms}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-bar:nth-child(3):not(#a#g#l){animation-delay:180ms}

  /* Me and Profile: the shoulders draw in, the head drops on and nods */
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-sh:not(#a#g#l){stroke-dasharray:1;animation:pk-ti-draw 420ms var(--pk-ti-trv) both}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-sh-f:not(#a#g#l){transform-origin:50% 100%;animation:pk-ti-fill 380ms var(--pk-ti-out) 200ms both}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-head:not(#a#g#l){transform-origin:50% 100%;animation:pk-ti-nod 620ms var(--pk-ti-ui) 120ms both}

  /* Trainees: the people pop in, one after the other */
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go :is(.ti-p1,.ti-p2):not(#a#g#l){transform-origin:50% 100%;animation:pk-ti-pop 440ms var(--pk-ti-spr) both}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-p1:not(#a#g#l){animation-delay:120ms}

  /* Playground: the runner laps the track with a short trail and lands where it started */
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-run:not(#a#g#l){animation:pk-ti-lap 820ms var(--pk-ti-trv) 60ms both,pk-ti-land 820ms linear 60ms both}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-trail:not(#a#g#l){animation:pk-ti-trail 820ms var(--pk-ti-trv) 60ms both,pk-ti-tfade 820ms linear 60ms both}

  /* Schedule: the page flips up to a new day */
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-pg:not(#a#g#l){transform-origin:50% 0;animation:pk-ti-flip 380ms cubic-bezier(.55,0,1,.45) both}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-day:not(#a#g#l){transform-origin:50% 50%;animation:pk-ti-day 440ms var(--pk-ti-spr) 300ms both}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-rings:not(#a#g#l){animation:pk-ti-tug 380ms var(--pk-ti-ui) both}

  /* Insights: the line draws up, the area fills under it, a spark lands at its end */
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-line:not(#a#g#l){stroke-dasharray:1;animation:pk-ti-draw 480ms var(--pk-ti-trv) both}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-area:not(#a#g#l){transform-origin:50% 100%;animation:pk-ti-fill 460ms var(--pk-ti-out) 180ms both}
  html.uf-tab-anim:is([data-skin=r]) .pk-ti.go .ti-spk:not(#a#g#l){transform-origin:50% 50%;animation:pk-ti-spark 480ms var(--pk-ti-spr) 400ms both}
}
@keyframes pk-ti-rise{from{transform:scaleY(.5)}to{transform:none}}
@keyframes pk-ti-drop{0%{opacity:0;transform:translateY(-6px)}60%{opacity:1;transform:translateY(.8px)}100%{opacity:1;transform:none}}
@keyframes pk-ti-door{from{transform:scaleX(0)}to{transform:none}}
@keyframes pk-ti-rep{0%{transform:none}32%{transform:translateY(-4.5px) scale(1.05)}50%{transform:translateY(-4.5px) scale(1.05)}78%{transform:translateY(.8px) scale(1.02,.9)}100%{transform:none}}
@keyframes pk-ti-grow{from{opacity:0;transform:scaleY(0)}30%{opacity:1}to{opacity:1;transform:none}}
@keyframes pk-ti-draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
@keyframes pk-ti-fill{from{opacity:0;transform:scaleY(.35)}to{opacity:1;transform:none}}
@keyframes pk-ti-nod{0%{opacity:0;transform:translateY(-6px)}40%{opacity:1;transform:translateY(.6px)}62%{opacity:1;transform:translateY(-.8px) rotate(-7deg)}82%{opacity:1;transform:translateY(.3px) rotate(3deg)}100%{opacity:1;transform:none}}
@keyframes pk-ti-pop{from{opacity:0;transform:translateY(3px) scale(.4)}to{opacity:1;transform:none}}
@keyframes pk-ti-lap{from{stroke-dashoffset:0}to{stroke-dashoffset:-100}}
@keyframes pk-ti-land{0%,86%{stroke-width:3.2}93%{stroke-width:4.4}100%{stroke-width:3.2}}
@keyframes pk-ti-trail{from{stroke-dashoffset:22}to{stroke-dashoffset:-78}}
@keyframes pk-ti-tfade{0%{opacity:0}18%,70%{opacity:.5}100%{opacity:0}}
@keyframes pk-ti-flip{0%{opacity:1;transform:none}60%{opacity:1;transform:scaleY(.35) skewX(-8deg)}100%{opacity:0;transform:scaleY(0)}}
@keyframes pk-ti-day{from{transform:scale(0)}to{transform:none}}
@keyframes pk-ti-tug{0%,100%{transform:none}40%{transform:translateY(-1.4px)}}
@keyframes pk-ti-spark{from{opacity:0;transform:scale(0) rotate(-90deg)}to{opacity:1;transform:none}}
