/* Procochil · inicio: el gran scroll y la escena final */

/* ---------- La obra ---------- */
.obra { position: relative; height: 1300vh; background: var(--azul-noche); }
.obra__escenario { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.obra__lienzo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.obra__velo {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7,27,38,.62) 0%, rgba(7,27,38,.18) 42%, rgba(7,27,38,0) 60%),
    linear-gradient(0deg, rgba(7,27,38,.55) 0%, rgba(7,27,38,0) 30%);
  transition: background .6s ease;
}
.obra[data-lado="der"] .obra__velo {
  background:
    linear-gradient(270deg, rgba(7,27,38,.62) 0%, rgba(7,27,38,.18) 42%, rgba(7,27,38,0) 60%),
    linear-gradient(0deg, rgba(7,27,38,.55) 0%, rgba(7,27,38,0) 30%);
}

/* Textos que entran por etapa */
.obra__textos { position: absolute; inset: 0; pointer-events: none; }
.texto {
  position: absolute; left: var(--margen); top: 50%;
  width: min(460px, calc(100% - 2 * var(--margen)));
  color: #fff; opacity: 0; visibility: hidden;
  transform: translateY(calc(-50% + var(--y, 24px)));
  text-shadow: 0 2px 18px rgba(0,0,0,.35);
  will-change: opacity, transform;
}
.texto--der { left: auto; right: var(--margen); }
.texto h1 { font-size: clamp(54px, 8.4vw, 118px); font-weight: 800; text-transform: uppercase; letter-spacing: -.005em; }
.texto h2 { font-size: clamp(36px, 4.4vw, 60px); }
.texto p { margin: 14px 0 0; font-size: 18px; color: rgba(255,255,255,.9); }
.texto__etapa, .texto__antetitulo {
  margin: 0 0 14px !important; font-family: var(--titular); font-weight: 700; font-size: 17px !important;
  letter-spacing: .18em; text-transform: uppercase; color: var(--naranjo) !important;
}
.texto--portada { width: min(820px, calc(100% - 2 * var(--margen))); }
.texto__bajada { font-size: clamp(20px, 2.2vw, 26px) !important; }
.texto__guia {
  margin-top: 42px !important; font-size: 13px !important; letter-spacing: .2em; text-transform: uppercase;
  display: inline-flex; flex-direction: column; gap: 10px;
}
.texto__guia::after {
  content: ""; width: 1px; height: 46px; background: linear-gradient(var(--naranjo), transparent);
  animation: guia 1.8s ease-in-out infinite;
}
@keyframes guia { 0%, 100% { transform: scaleY(.4); transform-origin: top; } 50% { transform: scaleY(1); } }

.texto--aislacion { width: min(520px, calc(100% - 2 * var(--margen))); }
.texto ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.texto li {
  position: relative; padding: 12px 14px 12px 46px; font-size: 16px; line-height: 1.35;
  background: rgba(7,27,38,.55); border-left: 3px solid var(--naranjo); border-radius: 3px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.texto li::before {
  content: ""; position: absolute; left: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%; background: var(--naranjo); box-shadow: 0 0 0 4px rgba(224,139,54,.25);
}
.sello {
  display: inline-block; margin-top: 18px !important; padding: 8px 14px; font-weight: 600; font-size: 15px !important;
  background: #fff; color: var(--azul) !important; text-shadow: none; border-radius: 3px;
}
.texto--final { left: 50%; top: auto; bottom: 16vh; text-align: center; width: min(900px, calc(100% - 2 * var(--margen))); transform: translate(-50%, var(--y, 24px)); }
.texto--final h2 { font-size: clamp(42px, 6vw, 86px); text-transform: uppercase; font-weight: 800; }

/* Línea de etapas */
.etapas {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 3;
  display: flex; gap: 6px; list-style: none; margin: 0; padding: 6px;
  background: rgba(7,27,38,.55); border-radius: 40px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .5s ease;
}
.obra[data-activa] .etapas { opacity: 1; }
.etapas li {
  font-family: var(--titular); font-weight: 600; font-size: 14px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.55); padding: 7px 14px; border-radius: 30px; transition: background .35s ease, color .35s ease;
  white-space: nowrap;
}
.etapas li.hecha { color: rgba(255,255,255,.85); }
.etapas li.actual { background: var(--naranjo); color: #fff; }

.obra__barra { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255,255,255,.08); z-index: 3; }
.obra__barra span { display: block; height: 100%; width: 0; background: var(--naranjo); }

/* ---------- Escena final por capas ---------- */
.equipo { position: relative; background: var(--azul-noche); }
.equipo__pista { height: 280vh; }
.equipo__escena {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 20%, #2B5A73 0%, var(--azul-hondo) 70%);
}
.capa { position: absolute; left: 50%; bottom: 0; will-change: transform, opacity; opacity: 0; }
.capa--fondo, .capa--cuadrilla { inset: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.capa--carlos { height: 86%; width: auto; max-width: none; transform: translate(-50%, 6%); }
.equipo__degradado { position: absolute; inset: auto 0 0 0; height: 26%; background: linear-gradient(transparent, var(--azul-noche)); }
.equipo.sin-imagenes .capa { display: none; }

.equipo__cierre { text-align: center; color: #fff; padding: 56px var(--margen) 110px; }
.equipo__cierre h2 { font-size: clamp(44px, 6vw, 84px); font-weight: 800; text-transform: uppercase; }
.equipo__cierre p { margin: 16px auto 34px; max-width: 520px; color: rgba(255,255,255,.75); font-size: 19px; }
.equipo__cierre .boton { font-size: 26px; padding: 20px 46px; }

@media (max-width: 760px) {
  .obra { height: 1150vh; }
  .obra__velo, .obra[data-lado="der"] .obra__velo {
    background: linear-gradient(0deg, rgba(7,27,38,.85) 0%, rgba(7,27,38,.35) 45%, rgba(7,27,38,0) 70%);
  }
  .texto, .texto--der { left: var(--margen); right: auto; top: auto; bottom: 92px; transform: translateY(var(--y, 24px)); }
  .texto--portada { bottom: auto; top: 30%; }
  .texto--final { left: 50%; bottom: 96px; transform: translate(-50%, var(--y, 24px)); }
  .texto p { font-size: 16px; }
  .texto li { font-size: 14px; padding: 9px 12px 9px 40px; }
  .texto li::before { left: 13px; width: 13px; height: 13px; margin-top: -6.5px; }
  .etapas { bottom: 18px; gap: 2px; padding: 4px; max-width: calc(100% - 24px); }
  .etapas li { font-size: 0; padding: 0; width: 34px; height: 6px; border-radius: 4px; background: rgba(255,255,255,.22); }
  .etapas li.hecha { background: rgba(255,255,255,.6); }
  .etapas li.actual { background: var(--naranjo); }
  .capa--carlos { height: 70%; }
}
