* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.preloader-active {
  overflow: hidden;
}

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a0a0f 0%, #3d1419 25%, #86262b 50%, #3d1419 75%, #1a0a0f 100%);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  overflow: hidden;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.silk-threads {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(216, 153, 70, 0.04) 2px, rgba(216, 153, 70, 0.04) 4px),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(134, 38, 43, 0.04) 2px, rgba(134, 38, 43, 0.04) 4px);
  animation: weaveMove 4s linear infinite;
}

.weaving-container {
  position: relative;
  width: 250px;
  height: 250px;
  animation: float 3s ease-in-out infinite;
}

.ikat-pattern {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 30px rgba(216, 153, 70, 0.6)) drop-shadow(0 0 60px rgba(134, 38, 43, 0.4));
  animation: rotate 12s linear infinite;
}

.thread {
  animation: weave 1.5s ease-out forwards;
  transform-origin: center;
}

.thread-1 { animation-delay: 0s; }
.thread-2 { animation-delay: 0.15s; }
.thread-3 { animation-delay: 0.3s; }
.thread-4 { animation-delay: 0.45s; }
.thread-5 { animation-delay: 0.6s; }
.thread-6 { animation-delay: 0.75s; }

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes weaveMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(4px, 4px); }
}

@keyframes weave {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.1) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes rotate {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@media (max-width: 768px) {
  .weaving-container {
    width: 180px;
    height: 180px;
  }
}
