body:has(#startup-splash:not(.is-hidden)) {
  overflow: hidden;
}
#startup-splash {
  --splash-bg: #fafafa;
  --splash-mark: #d30000;
  --splash-word: #262626;
  --splash-rule: #c4c4c4;
  --splash-track: #e5e5e5;
  --splash-text: #737373;
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--splash-bg);
  color: var(--splash-text);
  font-family: Geist, system-ui, sans-serif;
  opacity: 1;
  transition: opacity 200ms ease-out;
}
/* Same surface as the app's dark scheme, so the cover never flashes light. */
.scheme-dark #startup-splash {
  --splash-bg: #171717;
  --splash-mark: #ffffff;
  --splash-word: #d4d4d4;
  --splash-rule: #525252;
  --splash-track: #2e2e2e;
  --splash-text: #a3a3a3;
}
#startup-splash.is-hidden {
  opacity: 0;
  pointer-events: none;
}
/* The bar takes its width from the lockup above it. */
.startup-brand {
  display: inline-flex;
  flex-direction: column;
  gap: 22px;
}
.startup-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}
.startup-logo {
  width: 172px;
  aspect-ratio: 635 / 155.4;
  background: var(--splash-mark);
  -webkit-mask: url('../images/logo/ckhub-red.svg') center / contain no-repeat;
  mask: url('../images/logo/ckhub-red.svg') center / contain no-repeat;
}
.startup-rule {
  width: 1px;
  height: 28px;
  background: var(--splash-rule);
}
.startup-word {
  color: var(--splash-word);
  font-size: 29px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.startup-bar {
  position: relative;
  height: 2px;
  overflow: hidden;
  border-radius: 1px;
  background: var(--splash-track);
}
.startup-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: #d30000;
  animation: startup-sweep 1.15s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
/* Quiet on fast loads: the line only explains itself if startup takes a while. */
#startup-message {
  margin: 20px 24px 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0;
  animation: startup-fade 300ms ease-out 1.4s forwards;
}
#startup-retry {
  margin-top: 16px;
  padding: 9px 18px;
  border: 1px solid var(--splash-rule);
  border-radius: 8px;
  background: transparent;
  color: var(--splash-word);
  font: inherit;
  cursor: pointer;
}
#startup-retry:focus-visible {
  outline: 2px solid #d30000;
  outline-offset: 2px;
}
#startup-splash.is-delayed .startup-bar i {
  animation: none;
  width: 0;
}
#startup-splash.is-delayed #startup-message {
  animation: none;
  opacity: 1;
}
@keyframes startup-sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(265%);
  }
}
@keyframes startup-fade {
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  #startup-splash {
    transition: none;
  }
  .startup-bar i {
    animation: none;
    width: 100%;
    opacity: 0.5;
  }
  #startup-message {
    animation: none;
    opacity: 1;
  }
}
