/* SPDX-FileCopyrightText: 2026 Kontrollfeld GmbH */
/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* The whosit logo animation, see logo-animation.js. Trigger: `la-play` on any ancestor of the
   svg.la. Times follow the sound mark: each ring piece appears with its tone (QRZ, --la-on set per
   piece from 0.016 s to 2.176 s), star and tick flash at 2.36 s, 0.12 s after the last tone. */
.la { --la-flash: 2.364s; overflow: visible; }
.la .la-tick, .la .la-star { transform-box: fill-box; transform-origin: center; }

/* resting state = the file: one ring path */
.la .la-arcs { display: none; }
.la-play .la .la-arcs { display: inline; }
.la-play .la .la-ring-file { opacity: 0; }

/* the ring builds up: each piece is hidden until its tone starts, then stays. A 1 ms linear fade
   is a hard switch to the eye. Not `step-end`: the end of a delay given in seconds is a float, so
   for some pieces (1.096 s, 1.336 s, ...) a finished animation rests at progress 0.9999999999999,
   which `step-end` rounds down to hidden, and those pieces never appear in real-time playback. */
.la-play .la .la-arc { animation: la-on 1ms linear var(--la-on) both; }
.la-play .la .la-star { animation: la-star 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) var(--la-flash) both; }
.la-play .la .la-tick { animation: la-tick 0.5s ease-out var(--la-flash) both; }

@keyframes la-on { from { opacity: 0; } to { opacity: 1; } }
@keyframes la-star {
  0% { transform: scale(1); }
  35% { transform: scale(1.7); filter: drop-shadow(0 0 5px rgba(255, 204, 0, 0.9)); }
  100% { transform: scale(1); }
}
@keyframes la-tick { 0%, 100% { transform: none; } 40% { transform: scale(1.15); } }

/* Along the steps of a call (steps() in logo-animation.js): the ring as its 11 pieces, a letter
   not reached yet faint, a reached one in full. Star and tick flash after the Z of a verified call. */
.la.la-steps .la-arcs { display: inline; }
.la.la-steps .la-ring-file { opacity: 0; }
.la.la-steps .la-arc { opacity: 0.2; transition: opacity 90ms linear; }
.la.la-steps .la-arc.la-lit { opacity: 1; }
.la.la-flash .la-star { animation: la-star 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.la.la-flash .la-tick { animation: la-tick 0.5s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .la.la-steps .la-arc { transition: none; }
  .la.la-flash .la-star, .la.la-flash .la-tick { animation: none; }
}
