/* The first thing a page loads, on its own, so that the loading indicator and
   the background of the theme are up before the rest of the site arrives. The
   background is that of tokens.css, which takes over from it. */
:where(html) {
  background: #f3f8ff;
}

@media (prefers-color-scheme: dark) {
  :where(html:not([data-theme="light"])) {
    background: #0a1224;
  }
}

:where(html[data-theme="dark"]) {
  background: #0a1224;
}

/* Set before the first paint, so that a guest sees no white before the film. */
:root[data-opening] {
  background: #030409;
}

/* Not at all if the data comes at once: a flash reads as a fault. */
.spinner {
  display: flex;
  justify-content: center;
  padding: var(--space-5) 0;
  animation: spinner-in 280ms 240ms ease-out backwards;
}

@keyframes spinner-in {
  from {
    opacity: 0;
  }
}

.spinner__mark {
  width: 3rem;
  height: 3rem;
}

/* Light runs round the mark, ribbon by ribbon, and the mark itself keeps still.
   Only opacity changes, so it stays on for those who ask for less motion: a still
   mark would say nothing is happening. */
.spinner__mark > g > * {
  animation: ribbon-light 1.2s ease-in-out infinite;
}

.spinner__mark > g > :nth-child(2) {
  animation-delay: -0.8s;
}

.spinner__mark > g > :nth-child(3) {
  animation-delay: -0.4s;
}

@keyframes ribbon-light {
  0%,
  100% {
    opacity: 1;
  }

  50%,
  75% {
    opacity: 0.26;
  }
}

/* In the middle of the screen, over whatever is coming up under it. */
.boot {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.boot .logo-mark__blue {
  fill: #004efd;
}

.boot .logo-mark__cyan {
  fill: #00d6fe;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .boot .logo-mark__blue {
    fill: #1a63ff;
  }
}

:root[data-theme="dark"] .boot .logo-mark__blue {
  fill: #1a63ff;
}

:root[data-opening] .boot .logo-mark__blue {
  fill: #2f7bff;
}
