/* What shows from the first paint until the page has something to show: the
   same quiet screen whether the document, the entry or the workspace is the
   one waiting, so a visitor sees one screen and then the page, not several. */
html {
  color-scheme: dark;
  background: #121212;
  color: #eee;
  font:
    1rem system-ui,
    sans-serif;
}
html[data-theme='light'] {
  color-scheme: light;
  background: white;
  color: #171717;
}
body {
  margin: 0;
}
.hx-opening {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #121212;
}
html[data-theme='light'] .hx-opening {
  background: white;
}
.hx-opening img {
  width: 40px;
  height: 40px;
}
.hx-opening i {
  position: relative;
  display: block;
  width: 96px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: rgb(128 128 128 / 22%);
}
/* The line's place in its cycle follows the clock, not when it was drawn, so
   one screen handing over to the next does not start it again. */
.hx-opening i::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 2px;
  background: #c8f04a;
  animation: hx-opening-run 1400ms ease-in-out infinite;
  animation-delay: var(--hx-opening-at, 0ms);
}
@keyframes hx-opening-run {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(250%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hx-opening i::after {
    animation: none;
    width: 100%;
    opacity: 0.5;
  }
}
