:root {
  --tc-loading-ready: 1;
}

.tc-loading {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg, #f0f0f0);
  color: var(--text, #1c114d);
  pointer-events: none;
  user-select: none;
  animation: tc-loading-exit 1500ms linear both;
}

.tc-loading__identity {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
  animation: tc-loading-arrive 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.tc-loading__mark {
  display: block;
  width: clamp(88px, 16vw, 132px);
  height: auto;
  overflow: visible;
}

.tc-loading__mark-main {
  fill: #6340ff;
}

.tc-loading__mark-detail {
  fill: #ff6bd6;
}

.tc-loading__name {
  font: 500 12px/1.6 var(--font-body, system-ui, sans-serif);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tc-loading__cue {
  display: flex;
  gap: 7px;
  margin-top: 2px;
}

.tc-loading__cue i {
  width: 5px;
  height: 5px;
  background: #6340ff;
  border-radius: 50%;
  animation: tc-loading-dot 1000ms ease-in-out both;
}

.tc-loading__cue i:nth-child(2) {
  animation-delay: 90ms;
}

.tc-loading__cue i:nth-child(3) {
  background: #ff6bd6;
  animation-delay: 180ms;
}

html[data-theme="dark"] .tc-loading__mark-main {
  fill: #a99aff;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .tc-loading__mark-main {
    fill: #a99aff;
  }
}

@keyframes tc-loading-arrive {
  from {
    transform: translateY(4px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes tc-loading-dot {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* CSS also ends the cue if a later script fails before cleanup. */
@keyframes tc-loading-exit {
  0%,
  85% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce), print {
  .tc-loading {
    display: none;
    animation: none;
  }
  .tc-loading * {
    animation: none;
  }
}
