/* Premium Preloader Styles inspired by Vorszk.com */

html.loading,
html.loading body {
  overflow: hidden !important;
  height: 100vh !important;
}

.page__loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--_color---bg-warm, #faf6ef); /* Premium natural white backdrop */
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: 'Jost', 'Inter', sans-serif;
  opacity: 1;
  will-change: opacity;
}

.page__loading__middle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-38px); /* Move 1 cm upward to match hero text displacement */
}

.loading-title {
  font-family: 'Jost', 'Inter', sans-serif;
  font-weight: 500;
  line-height: 0.93; /* Vorszk.com precise line-height */
  font-size: clamp(2.24rem, 5.6vw, 6.4rem); /* Reduced by 20% for cleaner visual scale */
  color: #1a1a1a; /* Refined dark charcoal text */
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0;
  text-shadow: none; /* Clean flat layout for editorial look */
}

/* Container to hide word overflow for slide-up reveal */
.loading-line-wrapper {
  display: block;
  overflow: hidden;
  height: 1.22em; /* Height to avoid clipping descenders */
  line-height: 1.22em;
  margin: -0.02em 0;
}

.loading-word {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  will-change: transform, opacity;
  
  /* Instant CSS Entrance Animation */
  animation: preloaderWordReveal 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.loading-word.em-serif {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: #1a1a1a; /* Matching title color */
  text-shadow: none; /* Clean flat layout */
  margin-right: 0.22em; /* Visually balanced gap between italic slant and following word */
}

/* Staggered delays for lines/words */
.loading-title .loading-line-wrapper:nth-child(1) .loading-word {
  animation-delay: 0.1s;
}

.loading-title .loading-line-wrapper:nth-child(2) .loading-word.em-serif {
  animation-delay: 0.35s;
}

.loading-title .loading-line-wrapper:nth-child(2) .loading-word:not(.em-serif) {
  animation-delay: 0.48s;
}

.page__loading__bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 40px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(15px);
  will-change: transform, opacity;
  
  /* Bottom credits fade in delay */
  animation: preloaderBottomReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.65s forwards;
}

.page__loading__bottom p {
  font-family: 'Jost', 'Inter', sans-serif;
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 400;
  letter-spacing: 0.05em;
  color: rgba(26, 26, 26, 0.7); /* Muted charcoal for bottom text */
  text-shadow: none;
  margin: 0;
  text-transform: uppercase;
}

@keyframes preloaderWordReveal {
  0% {
    transform: translateY(110%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes preloaderBottomReveal {
  0% {
    transform: translateY(15px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
