/* Accrelio startup animation. The same file ships with the web app and the desktop app's own
   pages, so the logo moves the same way everywhere. Sequence: the tile springs in, the ribbon A
   unrolls up and over, the red and yellow tails run down, the green tick sweeps across, light
   glints off the tile, then the name rises in. About 1.8 seconds; still under reduced motion. */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  background:
    radial-gradient(60vmax 60vmax at 50% 42%, #0d5a62 0%, rgba(5, 42, 48, 0) 60%), #052a30;
  color: #fff;
  font-family:
    'Bricolage Grotesque Variable',
    'Inter Variable',
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  text-align: center;
  transition:
    opacity 420ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 420ms;
}
.splash-mark {
  position: relative;
  width: clamp(112px, 22vmin, 168px);
  aspect-ratio: 1;
}
.splash-mark .am {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.splash-ripple {
  position: absolute;
  inset: 4%;
  border-radius: 24%;
  border: 2px solid rgba(91, 224, 166, 0.55);
  opacity: 0;
  pointer-events: none;
}
.splash-word {
  margin: 0;
  font-size: clamp(30px, 5.4vmin, 42px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}
.splash-tag {
  margin: -10px 0 0;
  font-family:
    'Inter Variable',
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  font-size: 15px;
  color: #9fd3cd;
}
.splash-status {
  margin: 8px 0 0;
  min-height: 1.4em;
  font-family:
    'Inter Variable',
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  font-size: 14px;
  color: #7fb8b4;
}

/* The sequence */
.am-tile-group {
  transform-origin: 256px 256px;
  animation: am-tile-in 620ms cubic-bezier(0.34, 1.45, 0.64, 1) both;
}
.am-draw {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  animation: am-draw 560ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.am-ribbon {
  animation-duration: 720ms;
  animation-delay: 220ms;
}
.am-yellow {
  animation-delay: 760ms;
  animation-duration: 420ms;
}
.am-red {
  animation-delay: 840ms;
  animation-duration: 420ms;
}
.am-tick-reveal {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  animation: am-draw 520ms cubic-bezier(0.55, 0, 0.25, 1) 1000ms forwards;
}
.am-shine {
  animation: am-shine 900ms cubic-bezier(0.4, 0, 0.2, 1) 1380ms both;
}
.splash-ripple {
  animation: am-ripple 900ms cubic-bezier(0.22, 1, 0.36, 1) 1400ms both;
}
.splash-word {
  animation: am-rise 600ms cubic-bezier(0.22, 1, 0.36, 1) 1180ms both;
}
.splash-tag {
  animation: am-rise 600ms cubic-bezier(0.22, 1, 0.36, 1) 1300ms both;
}
.splash-status {
  animation: am-fade 500ms ease-out 1600ms both;
}

/* Waiting longer (the desktop app starting its database): the light keeps glinting */
.splash.is-waiting .am-shine {
  animation: am-shine 1400ms cubic-bezier(0.4, 0, 0.2, 1) 1380ms infinite;
}

/* A second start in the same session: no intro, just the finished logo */
.splash.is-quick *,
.splash.is-quick *::before {
  animation-duration: 1ms !important;
  animation-delay: 0ms !important;
  animation-iteration-count: 1 !important;
}

/* Hand over to the app: the logo lifts toward the viewer and everything fades */
.splash.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash.is-leaving .splash-mark {
  transform: scale(1.12);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes am-tile-in {
  from {
    opacity: 0;
    transform: scale(0.55) rotate(-8deg);
  }
}
@keyframes am-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes am-shine {
  from {
    transform: rotate(22deg) translateX(0);
  }
  to {
    transform: rotate(22deg) translateX(860px);
  }
}
@keyframes am-ripple {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  8% {
    opacity: 0.9;
    transform: scale(1.02);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}
@keyframes am-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
@keyframes am-fade {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash *,
  .splash *::before {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }
  .splash.is-leaving .splash-mark {
    transform: none;
  }
}

@media print {
  .splash {
    display: none;
  }
}
