/* RESET I TYPOGRAFIA */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Playfair Display', serif;
  background: #f5f1ea;
  overflow-x: hidden;
  color: #3e2f24;
}

.scroll-scene {
  height: 500vh;
}

/* =====================
   INTRO (NAPISY)
   ===================== */
.intro {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.intro h1 {
  font-size: clamp(1.8rem, 8vw, 3.5rem);
  letter-spacing: 0.2em;
  margin: 0;
  text-align: center;
  text-transform: uppercase;
}

.intro p {
  font-size: clamp(1rem, 3vw, 1.5rem);
  letter-spacing: 0.4em;
  margin-top: 10px;
  text-align: center;
}

/* =====================
   REALISTYCZNE KURTYNY
   ===================== */
.curtain {
  position: fixed;
  top: 0;
  width: 52%; /* Szerokość płata materiału */
  height: 100vh;
  z-index: 4;
  will-change: transform;
  min-width: 60px; /* Gwarancja, że zawsze coś widać */
  
  background-color: #f8e537; 
  background-image: 
    /* Głębia fałd materiału */
    repeating-linear-gradient(
      to right,
      transparent 0%,
      rgba(0, 0, 0, 0.3) 4%,
      rgba(255, 255, 255, 0.1) 8%,
      transparent 12%
    ),
    /* Tekstura tkaniny */
    url('https://www.transparenttextures.com/patterns/dark-linen.png');
    
  background-blend-mode: multiply;
  /* Mocniejszy cień, by odciąć kurtynę od tła */
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
}

.curtain.left {
  left: 0;
  transform-origin: left center;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.curtain.right {
  right: 0;
  transform-origin: right center;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient pionowy dla realizmu */
.curtain::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, transparent 15%, transparent 85%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
}

/* =====================
   WARSTWY TŁA I TEKSTU
   ===================== */
.image-layer, .text-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.image-layer { z-index: 1; }
.text-layer { z-index: 3; }

.image-block {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
  background-size: cover;
  background-position: center;
}

.image-block.active { opacity: 1; }

/* Kolory testowe */
.img1 { background-color: #f08604; }
.img2 { background-color: #04e735; }
.img3 { background-color: #e63605; }
.img4 { background-color: #340edf; }

.text-block {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80%;
  transform: translate(-50%, -50%) translateY(30px);
  font-size: clamp(1.5rem, 6vw, 3.5rem);
  font-weight: bold;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 4px 25px rgba(0,0,0,0.7);
  opacity: 0;
  transition: all 0.8s ease-out;
}

.text-block.active {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

/* DOPASOWANIE DLA MOBILES */
@media (max-width: 768px) {
  .curtain { width: 55%; }
}