/* The first screen of the site (step 66в): the logo in the middle, two rings spreading from
   it, the name under it, while the code loads. It stands in index.html and en/index.html
   inside #site, and Vue replaces it when the site starts. A file of its own: the CSP
   (D-050) forbids styles inside the page. The colors repeat src/styles/_themes.scss: the
   themes are not loaded yet, so the screen follows the theme of the system. */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: #f5f6f8;
  color: #1b1f24;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* The logo and the name show only when loading takes longer than 150 ms: a quick load
   does not flash them. The ground is there at once, so a dark system is never white. */
.splash__logo,
.splash__name {
  opacity: 0;
  animation: splash-in 240ms ease-out 150ms forwards;
}

.splash__logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  color: #2459d6;
}

/* Two rings, half a period apart: like the halo of a device online in the panel. */
.splash__logo::before,
.splash__logo::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: 0;
  animation: splash-ring 1800ms ease-out infinite;
}

.splash__logo::after {
  animation-delay: 900ms;
}

.splash__logo svg {
  position: relative;
  width: 48px;
  height: 48px;
  animation: splash-breathe 1800ms ease-in-out infinite;
}

.splash__name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Without scripts the site cannot start: its text covers the logo. */
.no-js {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  background: #f5f6f8;
  color: #1b1f24;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .splash,
  .no-js {
    background: #121418;
    color: #e6e8eb;
  }

  .splash__logo {
    color: #5b8cff;
  }
}

@keyframes splash-in {
  to {
    opacity: 1;
  }
}

@keyframes splash-ring {
  0% {
    transform: scale(0.55);
    opacity: 0.45;
  }

  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes splash-breathe {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash__logo,
  .splash__name {
    animation: none;
    opacity: 1;
  }

  .splash__logo::before,
  .splash__logo::after,
  .splash__logo svg {
    animation: none;
  }
}
