/* ====================================================================
   NEW PREMIUM PRELOADER — SUB-ZERO INSPIRED
   Add this at the bottom of index.html <head> inside a <style> tag
   Or include as separate CSS file
   ==================================================================== */

/* Preloader container */
#sterling-preloader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFB 50%, #F0F4F7 100%);
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
              visibility 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

#sterling-preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sterling-preloader__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

/* Cooling Line Animation — Frost Crystal */
.sterling-preloader__crystal {
  position: relative;
  width: 100px;
  height: 100px;
}

.sterling-preloader__crystal svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 12px rgba(0, 128, 197, 0.25));
}

.sterling-preloader__crystal path {
  stroke: #0080C5;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: drawFrost 2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes drawFrost {
  to { stroke-dashoffset: 0; }
}

/* Sterling Home Group wordmark */
.sterling-preloader__brand {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #002E61;
  opacity: 0;
  animation: fadeInBrand 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 1.2s forwards;
}

@keyframes fadeInBrand {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Progress ring */
.sterling-preloader__ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(0, 128, 197, 0.1);
  border-top-color: #0080C5;
  animation: rotateRing 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes rotateRing {
  to { transform: rotate(360deg); }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .sterling-preloader__crystal path {
    animation: none;
    stroke-dashoffset: 0;
  }
  .sterling-preloader__ring {
    animation: none;
    opacity: 0.3;
  }
  .sterling-preloader__brand {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
