#preloader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f6fa;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

#preloader.fade-out {
  opacity: 0;
  pointer-events: none;
}

#preloader svg {
  width: 280px;
  height: auto;
}

/* Drawing animation base - start completely hidden */
.draw-path {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill-opacity: 0;
  opacity: 0;
}

/* House paths - draw first, then fill */
.draw-path.house {
  animation: draw-fill-fade 3.5s ease-in-out infinite;
  animation-delay: 0.3s;
}

/* Text OUSE - draw second, then fill */
.draw-path.text {
  animation: draw-fill-fade 3.5s ease-in-out infinite;
  animation-delay: 0.5s;
}

/* Text SPEK - draw third, then fill */
.draw-path.text2 {
  animation: draw-fill-fade 3.5s ease-in-out infinite;
  animation-delay: 0.7s;
}

@keyframes draw-fill-fade {
  /* Start hidden */
  0% {
    stroke-dashoffset: 500;
    fill-opacity: 0;
    opacity: 0;
  }
  /* Fade in and start drawing */
  5% {
    opacity: 1;
  }
  /* Drawing the stroke */
  35% {
    stroke-dashoffset: 0;
    fill-opacity: 0;
  }
  /* Fill appears */
  45% {
    stroke-dashoffset: 0;
    fill-opacity: 1;
  }
  /* Stay visible */
  70% {
    stroke-dashoffset: 0;
    fill-opacity: 1;
    opacity: 1;
  }
  /* Fade out */
  85% {
    opacity: 0;
    fill-opacity: 0;
  }
  /* Reset for loop */
  100% {
    stroke-dashoffset: 500;
    fill-opacity: 0;
    opacity: 0;
  }
}
