/* ══════════════════════════════════════════════════════
   scenes.css — Sección de escenas parallax verticales
   (va entre el hero y la sección #servicios)

   Estructura HTML a agregar en index.html:

   <section class="scenes" id="escenas" aria-label="Operaciones">
     <div class="scene-wrap" data-scene="0">
       <div class="scene-bg" style="background-image:url('assets/scene-1-bg.jpg')"></div>
       <div class="scene-mid" style="background-image:url('assets/scene-1-mid.png')"></div>
       <div class="scene-fg"  style="background-image:url('assets/scene-1-fg.png')"></div>
       <div class="scene-overlay"></div>
       <div class="scene-body container">
         <span class="scene-eyebrow">01 — Puerto</span>
         <h2 class="scene-title">Retiro de <em>contenedores</em></h2>
         <p class="scene-desc">Coordinación con despachantes, gestión de turnos y traslado a depósito.</p>
       </div>
     </div>

     <!-- repetir .scene-wrap para cada escena -->
   </section>
   ══════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════
   CONTENEDOR DE ESCENAS
   ════════════════════════════════════════════════════ */

.scenes {
  position: relative;
  padding: 0;
  /* sin padding — cada escena maneja su propio espacio */
}

/* ════════════════════════════════════════════════════
   CADA ESCENA
   ════════════════════════════════════════════════════ */

.scene-wrap {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Degradado de salida hacia la escena siguiente */
.scene-wrap::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 220px;
  background: linear-gradient(to bottom, transparent, #050f08);
  z-index: 15;
  pointer-events: none;
}

/* Última escena no necesita fade de salida */
.scene-wrap:last-child::after {
  display: none;
}

/* ════════════════════════════════════════════════════
   CAPAS INTERNAS
   Cada capa se mueve a distinta velocidad con JS
   data-depth controla la velocidad: 0 = fijo, 1 = máximo
   ════════════════════════════════════════════════════ */

.scene-bg,
.scene-mid,
.scene-fg {
  position: absolute;
  /* ancho/alto extra para que el parallax no deje bordes */
  top: -15%;
  left: -5%;
  width: 110%;
  height: 130%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  pointer-events: none;
}

/* Fondo: foto de ambiente, se mueve poco */
.scene-bg {
  z-index: 1;
}

/* Medio: elemento a distancia (grúa, estantería), PNG transparente */
.scene-mid {
  z-index: 2;
  background-size: contain; /* PNG recortado, no estirar */
  background-position: bottom center;
  top: auto;
  bottom: -10%;
  height: 100%;
  left: 0;
  width: 100%;
}

/* Primer plano: elemento cercano, PNG transparente */
.scene-fg {
  z-index: 3;
  background-size: contain;
  background-position: bottom left; /* ajustar por escena si hace falta */
  top: auto;
  bottom: -15%;
  height: 110%;
  left: -2%;
  width: 60%;
}

.scene-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  /* Overlay más fuerte para que el texto siempre sea legible */
  background: linear-gradient(
    to bottom,
    rgba(3, 10, 5, 0.55) 0%,
    rgba(3, 10, 5, 0.65) 40%,
    rgba(3, 10, 5, 0.82) 100%
  );
  pointer-events: none;
}

/* ════════════════════════════════════════════════════
   CONTENIDO DE TEXTO
   ════════════════════════════════════════════════════ */

.scene-body {
  position: relative;
  z-index: 10;
  padding: 0 3rem;
  max-width: 620px;
}

.scene-eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-gold);
  background: rgba(201, 168, 76, 0.3);
  border: 1px solid rgba(201, 168, 76, 0.5);
  padding: 5px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;

  /* Animación de entrada */
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  transition-delay: 0s;
}

.scene-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.05;
  margin-bottom: 1.25rem;

  /* Animación de entrada */
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s ease,
    transform 0.65s ease;
  transition-delay: 0.12s;
}

.scene-title em {
  font-style: italic;
  color: var(--color-gold);
}

.scene-desc {
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
  max-width: 440px;

  /* Animación de entrada */
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  transition-delay: 0.26s;
}

/* Estado visible (clase agregada por JS cuando la escena entra en pantalla) */
.scene-wrap.in-view .scene-eyebrow,
.scene-wrap.in-view .scene-title,
.scene-wrap.in-view .scene-desc {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════════════════════════
   DOTS DE NAVEGACIÓN (lateral)
   ════════════════════════════════════════════════════ */

.scene-nav {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

/* Visible solo cuando .scenes está en pantalla (clase puesta por JS) */
.scene-nav.visible {
  opacity: 1;
  pointer-events: all;
}

.scene-nav-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition:
    background 0.3s,
    transform 0.3s;
}

.scene-nav-dot.active {
  background: var(--color-gold);
  transform: scale(1.4);
  border-color: var(--color-gold);
}

.scene-nav-dot:hover {
  background: rgba(255, 255, 255, 0.5);
}


.scene-wrap:nth-child(even) .scene-body {
  margin-left: auto;
  margin-right: 0;
}

.scene-wrap:nth-child(odd) .scene-body {
  margin-right: auto;
  margin-left: 0;
}


@media (max-width: 900px) {
  .scene-wrap {
    align-items: flex-end;
    padding-bottom: 4rem;
  }

  .scene-body {
    padding: 1.25rem;
    max-width: 100%;
    width: 100%;
    text-align: center;
    background: rgba(3, 10, 5, 0.35);
    border-radius: 4px;
    margin-left: 0;
    margin-right: 0;
  }

  /* Cancela el desplazamiento a la derecha de escenas pares */
  .scene-wrap:nth-child(even) .scene-body {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }

  .scene-wrap .scene-body {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .scene-fg {
    width: 80%;
    left: 10%;
    opacity: 0.25;
  }

  .scene-nav {
    display: none;
  }
}

@media (max-width: 600px) {
  .scene-title {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }
  .scene-desc {
    font-size: 0.92rem;
  }
}
