/* SYNAPSE LOADERS (Eden, 2026-10-14: a set of Figma motion designs, "use them in different animations and actions on the
   application, especially loading"). The set had six families: circles, dots, fading circles, a bouncing ball, time
   (clock, hourglass), signal (wifi bars), and small animated icons (search, mail, download). Each is rebuilt here as
   plain CSS that takes the colour of the text around it (currentColor) and its size from --sl, so one definition serves
   a button, a chat bubble, a map panel and a page.

   Markup (or use loaders.js:  SynLoad.html('ring'))
     <span class="sl sl-ring" role="status" aria-label="Loading"></span>

   Kinds: sl-ring  sl-arc  sl-dots  sl-pulse  sl-ball  sl-clock  sl-hourglass  sl-signal  sl-download  sl-mail  sl-search
   Reduced motion: every one stops moving and shows a still, readable shape instead. */
.sl { --sl: 20px; position: relative; display: inline-block; flex: none; width: var(--sl); height: var(--sl); color: currentColor; vertical-align: -0.2em; }
.sl::before, .sl::after, .sl i { box-sizing: border-box; }
.sl-lg { --sl: 34px; } .sl-sm { --sl: 14px; }

/* CIRCLE: a ring with a gap that turns */
.sl-ring::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: calc(var(--sl) * .11) solid currentColor; border-top-color: transparent; animation: slSpin .85s linear infinite; }
/* ARC: a thin track with a bright arc that speeds up and slows down */
.sl-arc::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: calc(var(--sl) * .09) solid color-mix(in srgb, currentColor 18%, transparent); }
.sl-arc::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: calc(var(--sl) * .09) solid transparent; border-top-color: currentColor; animation: slSpin 1.1s cubic-bezier(.5, .1, .5, .9) infinite; }
@keyframes slSpin { to { transform: rotate(360deg); } }

/* DOTS: three dots that rise and fall in turn */
.sl-dots { width: calc(var(--sl) * 1.7); }
.sl-dots i { position: absolute; top: 50%; width: calc(var(--sl) * .28); height: calc(var(--sl) * .28); margin-top: calc(var(--sl) * -.14); border-radius: 50%; background: currentColor; animation: slDot 1s ease-in-out infinite; }
.sl-dots i:nth-child(1) { left: 6%; } .sl-dots i:nth-child(2) { left: 38%; animation-delay: .15s; } .sl-dots i:nth-child(3) { left: 70%; animation-delay: .3s; }
@keyframes slDot { 0%, 70%, 100% { transform: translateY(0); opacity: .45; } 35% { transform: translateY(-45%); opacity: 1; } }

/* FADE CIRCLES: a dot with a ring that breathes outward and fades */
.sl-pulse::before { content: ''; position: absolute; inset: 32%; border-radius: 50%; background: currentColor; }
.sl-pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: calc(var(--sl) * .08) solid currentColor; animation: slPulse 1.3s ease-out infinite; }
@keyframes slPulse { from { transform: scale(.35); opacity: .9; } to { transform: scale(1.05); opacity: 0; } }

/* BALL: a ball that drops, squashes and bounces on a soft shadow */
.sl-ball::before { content: ''; position: absolute; left: 50%; top: 0; width: 34%; height: 34%; margin-left: -17%; border-radius: 50%; background: currentColor; animation: slBall .8s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
.sl-ball::after { content: ''; position: absolute; left: 50%; bottom: 4%; width: 40%; height: 8%; margin-left: -20%; border-radius: 50%; background: currentColor; opacity: .25; animation: slBallShadow .8s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
@keyframes slBall { from { transform: translateY(0) scale(.92, 1.08); } 85% { transform: translateY(150%) scale(1, 1); } to { transform: translateY(165%) scale(1.25, .7); } }
@keyframes slBallShadow { from { transform: scaleX(.45); opacity: .1; } to { transform: scaleX(1.1); opacity: .3; } }

/* TIME: a clock whose minute hand sweeps and hour hand creeps */
.sl-clock::before { content: ''; position: absolute; inset: 6%; border-radius: 50%; border: calc(var(--sl) * .09) solid currentColor; }
.sl-clock i { position: absolute; left: 50%; bottom: 50%; width: calc(var(--sl) * .09); margin-left: calc(var(--sl) * -.045); border-radius: 99px; background: currentColor; transform-origin: 50% 100%; }
.sl-clock i:nth-child(1) { height: 30%; animation: slSpin 6s linear infinite; }
.sl-clock i:nth-child(2) { height: 22%; animation: slSpin 36s linear infinite; }
.sl-hourglass { width: calc(var(--sl) * .72); animation: slFlip 2.4s cubic-bezier(.6, 0, .3, 1) infinite; }
.sl-hourglass::before { content: ''; position: absolute; inset: 0; background: currentColor; clip-path: polygon(0 0, 100% 0, 100% 8%, 62% 50%, 100% 92%, 100% 100%, 0 100%, 0 92%, 38% 50%, 0 8%); opacity: .9; }
.sl-hourglass::after { content: ''; position: absolute; left: 30%; right: 30%; top: 12%; height: 30%; background: color-mix(in srgb, currentColor 35%, transparent); clip-path: polygon(0 0, 100% 0, 50% 100%); animation: slSand 2.4s linear infinite; }
@keyframes slFlip { 0%, 70% { transform: rotate(0); } 90%, 100% { transform: rotate(180deg); } }
@keyframes slSand { 0% { transform: scaleY(1); } 70%, 100% { transform: scaleY(.05); } }

/* SIGNAL: bars (or wifi arcs) that light up in turn, for anything reaching out to the network */
.sl-signal { display: inline-flex; align-items: flex-end; gap: calc(var(--sl) * .1); }
.sl-signal i { flex: 1; border-radius: 2px; background: currentColor; opacity: .25; animation: slBars 1.2s ease-in-out infinite; }
.sl-signal i:nth-child(1) { height: 30%; } .sl-signal i:nth-child(2) { height: 55%; animation-delay: .18s; } .sl-signal i:nth-child(3) { height: 78%; animation-delay: .36s; } .sl-signal i:nth-child(4) { height: 100%; animation-delay: .54s; }
@keyframes slBars { 0%, 55%, 100% { opacity: .25; } 25% { opacity: 1; } }

/* ICONS: small things that act out what is happening */
.sl-download::before { content: ''; position: absolute; left: 50%; top: 4%; width: 14%; height: 52%; margin-left: -7%; border-radius: 99px; background: currentColor; animation: slDrop 1.1s ease-in infinite; }
.sl-download::after { content: ''; position: absolute; left: 14%; right: 14%; bottom: 8%; height: 32%; border: calc(var(--sl) * .1) solid currentColor; border-top: 0; border-radius: 0 0 4px 4px; }
@keyframes slDrop { 0% { transform: translateY(-20%); opacity: 0; } 30% { opacity: 1; } 80% { transform: translateY(70%); opacity: 1; } 100% { transform: translateY(75%); opacity: 0; } }
.sl-mail::before { content: ''; position: absolute; left: 6%; right: 6%; top: 22%; bottom: 18%; border: calc(var(--sl) * .09) solid currentColor; border-radius: 4px; }
.sl-mail::after { content: ''; position: absolute; left: 50%; top: 24%; width: 30%; height: 30%; margin-left: -15%; border-right: calc(var(--sl) * .09) solid currentColor; border-bottom: calc(var(--sl) * .09) solid currentColor; transform: rotate(45deg); transform-origin: 50% 50%; animation: slFlap 1.4s ease-in-out infinite; }
@keyframes slFlap { 0%, 100% { transform: rotate(45deg) translate(0, 0); } 50% { transform: rotate(45deg) translate(-12%, -12%); } }
.sl-search::before { content: ''; position: absolute; left: 8%; top: 8%; width: 58%; height: 58%; border-radius: 50%; border: calc(var(--sl) * .1) solid currentColor; animation: slLook 1.6s ease-in-out infinite; }
.sl-search::after { content: ''; position: absolute; right: 10%; bottom: 8%; width: 28%; height: calc(var(--sl) * .1); border-radius: 99px; background: currentColor; transform: rotate(45deg); transform-origin: 100% 50%; animation: slLookH 1.6s ease-in-out infinite; }
@keyframes slLook { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(8%, 6%); } 65% { transform: translate(-4%, 10%); } }
@keyframes slLookH { 0%, 100% { transform: rotate(45deg) translateX(0); } 30% { transform: rotate(45deg) translateX(8%); } 65% { transform: rotate(45deg) translateX(-4%); } }

/* A line of words that carries its loader: "[ring] Reading your description" */
.sl-line { display: inline-flex; align-items: center; gap: .55em; }
.sl-line .sl { --sl: 1.1em; }
/* inside a button */
button .sl, .btn .sl { vertical-align: middle; }

@media (prefers-reduced-motion: reduce) {
  .sl::before, .sl::after, .sl i { animation: none !important; }
  .sl-ring::before { border-top-color: currentColor; opacity: .6; }
  .sl-dots i { opacity: .8; } .sl-signal i { opacity: .8; }
  .sl-hourglass, .sl-hourglass::after { animation: none; }
}
