/* The ring of twelve "i" figures (司さん 09-29「人のローディングめっちゃいい。他のローディングにも」/ 09-30「もっと完璧に仕上げて」).
   The start-up loader (assets/i-classic-startup.svg) as a part: the same figure, the same colours (red green blue cyan magenta yellow,
   twice round), the same light — its opacity curve copied from the SVG (21 of its 121 keys, within 0.004) on the same 1.8 s cycle.
   Three layers: the whole ring always there, each figure in its own colour, dimmed (--iload-base; 司さん 09-30「全部円が見える方がいい、
   その中で点滅する感じ」), the light running round through it (each figure flashes up to full, then sinks back), and a "bloom" layer
   that lights all twelve at once when the wait is over.
   light/i-loader.js builds it (<span class="wa-iload" data-i-loader>) and runs the managed ones: shown only if the wait is longer
   than a moment, kept at least long enough to be read, and when it ends: everyone lights up, then the ring lets go. */
.wa-iload{display:inline-block;flex:none;width:var(--iload,56px);aspect-ratio:1;line-height:0;vertical-align:middle;pointer-events:none}
.wa-iload>svg{display:block;width:100%;height:100%;overflow:visible;transform-origin:50% 50%}
.wa-iload .wa-iload__ghost{opacity:var(--iload-base,.4)}     /* on dark; light grounds set about .34 */
.wa-iload .wa-iload__bloom{opacity:0}
.wa-iload g[data-p]{opacity:0;animation:wa-iload 1.8s linear infinite;animation-delay:calc(var(--k) * .15s - 1.8s)}
@keyframes wa-iload{0%{opacity:1.000}6.67%{opacity:1.000}8.33%{opacity:0.791}10.83%{opacity:0.688}15%{opacity:0.530}15.83%{opacity:0.445}16.67%{opacity:0.369}18.33%{opacity:0.289}20.83%{opacity:0.184}24.17%{opacity:0.063}25%{opacity:0.038}26.67%{opacity:0.010}28.33%{opacity:0.000}95%{opacity:0.000}95.83%{opacity:0.079}96.67%{opacity:0.283}97.50%{opacity:0.562}98.33%{opacity:0.861}99.17%{opacity:1.000}100%{opacity:1.000}}
.wa-iload--s{--iload:22px;--iload-base:.48}     /* at button size a brighter ring keeps it reading as a ring, not a smudge */
.wa-iload--m{--iload:48px}
.wa-iload--l{--iload:112px}
.wa-iload--xl{--iload:clamp(170px,20vw,220px)}

/* managed rings (placed over something that is on its way): hidden and still until the wait is real */
.wa-iload[data-managed]{opacity:0;transform:scale(.92);transition:opacity .26s ease,transform .5s cubic-bezier(.2,.8,.2,1)}
.wa-iload[data-managed] g[data-p]{animation-play-state:paused}
.wa-iload[data-managed].is-on{opacity:1;transform:none}
.wa-iload[data-managed].is-on g[data-p]{animation-play-state:running}
.wa-iload[data-managed]:not(.is-on):not(.is-done){visibility:hidden;transition:opacity .26s ease,transform .5s cubic-bezier(.2,.8,.2,1),visibility 0s linear .26s}
/* the wait is over: all twelve light at once, then the ring opens out and lets go */
.wa-iload.is-done .wa-iload__bloom{animation:wa-iload-bloom .2s cubic-bezier(.2,.7,.3,1) forwards}
.wa-iload.is-done>svg{animation:wa-iload-out .44s cubic-bezier(.4,0,.2,1) .17s forwards}
@keyframes wa-iload-bloom{to{opacity:1}}
@keyframes wa-iload-out{to{opacity:0;transform:scale(1.09)}}
/* a ring placed over a frame that is waiting for its picture */
.wa-iload--fill{position:absolute;left:50%;top:50%;margin:calc(var(--iload) / -2) 0 0 calc(var(--iload) / -2);z-index:1}
/* a picture a ring was shown for comes in softly */
img.iload-hold{opacity:0!important}
img.iload-reveal{transition:opacity .5s ease}

/* reduced motion: no running light; the whole ring breathes slowly; the ending is a plain fade */
@media (prefers-reduced-motion:reduce){
  .wa-iload g[data-p]{animation:none;opacity:0}
  .wa-iload .wa-iload__ghost{opacity:0}
  .wa-iload .wa-iload__bloom{animation:wa-iload-breathe 2.4s ease-in-out infinite}
  @keyframes wa-iload-breathe{0%,100%{opacity:.35}50%{opacity:.9}}
  .wa-iload.is-done .wa-iload__bloom{animation:none;opacity:.9}
  .wa-iload.is-done>svg{animation:wa-iload-fade .3s ease forwards}
  @keyframes wa-iload-fade{to{opacity:0}}
  .wa-iload[data-managed]{transform:none}
}
