#cuik-loading[hidden] { display: none; }
/* Individual boxes own the animation; the old whole-page fade must not delay
 * clearing or restoring the canvas. */
#cuik-body.transition-fade { transition: none; }
html.cuik-transition-out #cuik-body { visibility: hidden; opacity: 0; }

/* Real box animations run before navigation, including cache hits and signed-in
 * kiosk pages. No hidden-on-entry CSS or browser snapshot support is required. */
@view-transition { navigation: none; }
@keyframes cuik-loading-in { to { opacity: 1; } }
@keyframes cuik-loading-dots {
  from { background-position: 0 0; }
  to { background-position: 10vw 0; }
}
@keyframes cuik-loading-shine {
  0%, 5% { transform: translateX(-75%); }
  95%, 100% { transform: translateX(75%); }
}
#cuik-loading {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: rgb(21 24 27 / 12%);
  color: white;
  text-align: center;
  font: 1.5rem system-ui, sans-serif;
  opacity: 0;
  animation: cuik-loading-in 100ms ease-out 600ms forwards;
}
#cuik-loading .cuik-loading-logo {
  position: relative;
  flex: none;
  width: 25vw;
  aspect-ratio: 9268 / 3446;
  background: url('../assets/cuik-light.svg') center / contain no-repeat;
}
#cuik-loading .cuik-loading-shine,
#cuik-loading .cuik-loading-logo::after {
  content: '';
  position: absolute;
  inset: 0;
}
#cuik-loading .cuik-loading-shine {
  overflow: hidden;
  -webkit-mask: url('../assets/cuik-loading-letters.svg') center / contain no-repeat;
  mask: url('../assets/cuik-loading-letters.svg') center / contain no-repeat;
}
#cuik-loading .cuik-loading-shine::before {
  content: '';
  position: absolute;
  inset: 0;
  /* A crisp bright reflection crosses the letters with a fine white line beside it. */
  background: linear-gradient(110deg,
    transparent 36%, rgb(255 255 255 / 85%) 36%,
    rgb(255 255 255 / 85%) 50%, transparent 50%,
    transparent 54%, #fff 54%, #fff 56%, transparent 56%);
  will-change: transform;
  animation: cuik-loading-shine 2.4s ease-in-out infinite;
}
#cuik-loading .cuik-loading-logo::after {
  /* Each orange-to-red fade spans roughly the full joined-dot width. */
  background: repeating-linear-gradient(90deg, #f08a52 0%, #e75b4b 20%, #f08a52 40%);
  -webkit-mask: url('../assets/cuik-loading-dots.svg') center / contain no-repeat;
  mask: url('../assets/cuik-loading-dots.svg') center / contain no-repeat;
  animation: cuik-loading-dots 3s linear infinite;
}
#cuik-loading.is-delayed { background: rgb(21 24 27 / 90%); }
#cuik-loading.is-delayed .cuik-loading-logo { display: none; }
#cuik-loading p { flex-basis: 100%; }
#cuik-loading button {
  padding: 1rem;
  background: #222;
  border: 2px solid white;
  border-radius: .4rem;
  color: white;
  font: inherit;
}
