/* =========================================================
   CURTAIN.CSS — Theater Entrance Animation
   Rich Burgundy-Brown | Caricature Folds | Premium Feel
   ========================================================= */

.curtain-wrapper {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  overflow: hidden;
  pointer-events: none; /* Allows interaction beneath once animation starts */
}

.curtain-panel {
  position: relative;
  width: 50%;
  height: 100%;
  background-color: #6B3D23; /* Further lightened rich brown */
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent 0,
      rgba(0, 0, 0, 0.15) 20px,
      rgba(255, 255, 255, 0.05) 40px,
      transparent 60px
    ),
    linear-gradient(
      to bottom,
      rgba(0,0,0,0.2) 0%,
      transparent 10%,
      transparent 90%,
      rgba(0,0,0,0.3) 100%
    );
  transition: transform 1.8s cubic-bezier(0.77, 0, 0.175, 1);
  pointer-events: all;
  box-shadow: 0 0 100px rgba(0,0,0,0.8);
}

/* Folds detail - Caricature style */
.curtain-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    repeating-linear-gradient(
      to right,
      transparent 0%,
      rgba(0,0,0,0.15) 5%,
      rgba(0,0,0,0.3) 10%,
      rgba(0,0,0,0.15) 15%,
      transparent 20%
    );
  background-size: 200px 100%;
  opacity: 0.6;
}

/* Golden rope / Tie back */
.curtain-rope {
  position: absolute;
  top: 60%;
  width: 100px;
  height: 20px;
  background: radial-gradient(circle, #E5C08A 0%, #A07554 100%);
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.4);
  z-index: 10001;
  transition: opacity 1s ease, transform 1.5s ease;
}

.curtain-left .curtain-rope {
  left: 10%;
  transform: rotate(-10deg);
}

.curtain-right .curtain-rope {
  right: 10%;
  transform: rotate(10deg);
}

/* Stitching detail */
.curtain-panel::after {
  content: '';
  position: absolute;
  bottom: 40px;
  left: 0;
  width: 100%;
  height: 2px;
  background-image: repeating-linear-gradient(90deg, #D4A96A 0, #D4A96A 5px, transparent 5px, transparent 15px);
  opacity: 0.5;
}

/* Animation triggers */
.curtain-left {
  transform: translateX(0);
  border-right: 2px solid rgba(0,0,0,0.3);
}

.curtain-right {
  transform: translateX(0);
  border-left: 2px solid rgba(0,0,0,0.3);
}

.curtain-wrapper.is-opening .curtain-left {
  transform: translateX(-100%);
}

.curtain-wrapper.is-opening .curtain-right {
  transform: translateX(100%);
}

.curtain-wrapper.is-opening .curtain-rope {
  opacity: 0;
  transform: scale(0.8) translateY(20px);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .curtain-panel::before {
    background-size: 100px 100%;
  }
  
  .curtain-rope {
    width: 60px;
    height: 12px;
  }
}
