/* Initial loader - refined full-page loading */
html {
  overflow: hidden scroll;
}

body {
  margin: 0;
  min-block-size: 100vh;
}

#loading-bg {
  position: fixed;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--initial-loader-bg, #f8f9fa);
  inset: 0;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 1.75rem;
}

.loading-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: loader-logo-in 0.5s ease-out;
}

.loading-logo .loader-logo-img {
  display: block;
  block-size: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 6%));
  max-block-size: 48px;
  max-inline-size: 160px;
  object-fit: contain;
}

/* 점 깜박임 로딩 */
.loader-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.loader-dot {
  border-radius: 50%;
  animation: loader-dot-blink 1.2s ease-in-out infinite both;
  background: #f30789;
  block-size: 8px;
  inline-size: 8px;
}

.loader-dot:nth-child(1) {
  animation-delay: 0s;
}

.loader-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.loader-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes loader-dot-blink {

  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.loader-text {
  margin: 0;
  animation: loader-text-pulse 1.2s ease-in-out infinite;
  color: var(--initial-loader-text, rgba(0, 0, 0, 45%));
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes loader-logo-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes loader-text-pulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* Dark background: adjust text color for contrast */
@media (prefers-color-scheme: dark) {
  #loading-bg:not([data-theme="light"]) {
    --initial-loader-text: rgba(255, 255, 255, 50%);
  }

}
