/* ==========================================================================
   WIF IMMERSIVE EXPERIENCE ENGINE — CIDI Stylesheet
   Paleta oficial CIDI: --noche #0A1E30 | --carbon #0E2840 | --fuego #167AB7
   --luz #36A9E8 | --verde #44BD83 | --mostaza #F7C844 | --hueso #EAF4FB
   ========================================================================== */

.wif-experience {
  position: relative;
  height: 700vh;
  background: #050e18;
  color: var(--hueso, #EAF4FB);
  isolation: isolate;
}

.wif-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #0c2238 0%, #050e18 78%);
}

#wif-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

.wif-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 14, 24, 0.72) 0%, rgba(5, 14, 24, 0.08) 24%, rgba(5, 14, 24, 0.14) 68%, rgba(5, 14, 24, 0.86) 100%),
    radial-gradient(ellipse at center, transparent 48%, rgba(5, 14, 24, 0.58) 100%);
}

/* ---------- HUD Superior e Inferior ---------- */
.wif-hud-top {
  position: absolute;
  top: 92px;
  left: 0;
  right: 0;
  z-index: 5;
  pointer-events: none;
}

.wif-hud-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wif-chapter-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(54, 169, 232, 0.28);
  background: rgba(10, 30, 48, 0.74);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cfe8f8;
}

.wif-chapter-pill .wif-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--luz, #36A9E8);
  box-shadow: 0 0 10px var(--luz, #36A9E8);
}

.wif-skip-exp {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(234, 247, 255, 0.2);
  background: rgba(10, 30, 48, 0.68);
  backdrop-filter: blur(8px);
  color: #bfd8ea;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.wif-skip-exp:hover {
  border-color: var(--luz, #36A9E8);
  color: #ffffff;
  background: rgba(22, 122, 183, 0.35);
}

/* ---------- Rail Lateral de 7 Capítulos ---------- */
.wif-rail {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wif-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(234, 247, 255, 0.42);
  background: rgba(10, 30, 48, 0.6);
  cursor: pointer;
  transition: height 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.wif-dot:hover {
  border-color: var(--luz, #36A9E8);
}

.wif-dot.is-active {
  height: 26px;
  background: var(--luz, #36A9E8);
  border-color: var(--luz, #36A9E8);
  box-shadow: 0 0 12px rgba(54, 169, 232, 0.7);
}

/* ---------- Overlays Narrativos (Escenas 1 a 7) ---------- */
.wif-overlays {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.wif-scene-copy {
  position: absolute;
  left: max(22px, calc((100% - 1180px) / 2));
  bottom: 58px;
  max-width: 490px;
  padding: 20px 24px;
  border-radius: 14px;
  border: 1px solid rgba(54, 169, 232, 0.22);
  background: linear-gradient(155deg, rgba(10, 30, 48, 0.80), rgba(5, 14, 24, 0.72));
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s cubic-bezier(.22, 1, .36, 1), transform 0.45s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}

.wif-scene-copy.is-active {
  opacity: 1;
  transform: translateY(0);
}

.wif-scene-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--luz, #36A9E8);
  margin-bottom: 8px;
}

.wif-scene-kicker:before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--mostaza, #F7C844);
}

.wif-scene-copy h2 {
  font-family: var(--ff-d);
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 0.96;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 10px;
}

.wif-scene-copy p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: #cde0ed;
}

.wif-scene-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.wif-scene-tags span {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(54, 169, 232, 0.14);
  border: 1px solid rgba(54, 169, 232, 0.28);
  color: #dff2ff;
}

/* ---------- Escena 7: Revelación Final CIDI ---------- */
.wif-scene-finale {
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 24px);
  width: min(620px, calc(100% - 44px));
  max-width: 620px;
  text-align: center;
  padding: 18px 24px;
  border-color: rgba(54, 169, 232, 0.36);
  background: linear-gradient(160deg, rgba(10, 30, 48, 0.90), rgba(5, 14, 24, 0.86));
}

.wif-scene-finale.is-active {
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.wif-finale-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.wif-finale-brand svg {
  width: 38px;
  height: 38px;
  flex: none;
}

.wif-finale-sub {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--luz, #36A9E8);
}

.wif-scene-finale h2 {
  font-size: clamp(32px, 4.8vw, 52px);
  margin-bottom: 8px;
}

.wif-scene-copy.wif-scene-finale .wif-finale-cta-copy {
  font-size: 14.5px;
  color: #d9ebf8;
  margin: 0 auto 16px;
  max-width: 46ch;
  text-align: center;
}

.wif-finale-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.wif-btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid rgba(68, 189, 131, 0.55);
  background: rgba(68, 189, 131, 0.16);
  color: #eafaf2;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, transform 0.2s ease;
}

.wif-btn-wa:hover {
  background: rgba(68, 189, 131, 0.32);
  transform: translateY(-2px);
}

/* ---------- Barra de Progreso y Scroll Hint ---------- */
.wif-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9ec0d6;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.wif-scroll-hint.is-hidden {
  opacity: 0;
}

.wif-scroll-hint .wif-hint-line {
  width: 1px;
  height: 22px;
  background: linear-gradient(var(--luz, #36A9E8), transparent);
}

.wif-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 7;
  background: rgba(234, 247, 255, 0.12);
}

#wif-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--fuego, #167AB7), var(--luz, #36A9E8), var(--verde, #44BD83));
}

/* ---------- Fallback Profesional (Sin WebGL o Reduced Motion) ---------- */
.wif-fallback {
  position: relative;
  z-index: 10;
  padding: 120px 0 72px;
  background:
    radial-gradient(640px 420px at 80% 10%, rgba(54, 169, 232, 0.22), transparent 70%),
    radial-gradient(480px 360px at 12% 90%, rgba(68, 189, 131, 0.14), transparent 65%),
    linear-gradient(180deg, #061321 0%, #0A1E30 100%);
}

.wif-experience.wif-is-fallback {
  height: auto;
}

.wif-experience.wif-is-fallback .wif-stage {
  display: none;
}

.wif-fallback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 28px 0 32px;
}

.wif-fallback-step {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(54, 169, 232, 0.2);
  background: rgba(14, 40, 64, 0.65);
}

.wif-fallback-step b {
  display: block;
  font-family: var(--ff-d);
  font-size: 18px;
  letter-spacing: 0.02em;
  color: #ffffff;
  margin-bottom: 4px;
}

.wif-fallback-step span {
  font-size: 13px;
  color: #bfd4e3;
}

/* ---------- Responsive Tablet y Móvil ---------- */
@media (max-width: 860px) {
  .wif-experience {
    height: 600vh;
  }
  .wif-rail {
    right: 12px;
    gap: 8px;
  }
  .wif-scene-copy {
    left: 16px;
    right: 36px;
    max-width: none;
    bottom: 50px;
    padding: 16px 18px;
  }
  .wif-scene-finale {
    left: 50%;
    right: auto;
    width: calc(100% - 32px);
    bottom: 24px;
    padding: 18px 18px;
  }
}

@media (max-width: 600px) {
  .wif-experience {
    height: 540vh;
  }
  .wif-hud-top {
    top: 76px;
  }
  .wif-chapter-pill {
    font-size: 10px;
    padding: 6px 10px;
  }
  .wif-skip-exp {
    font-size: 10px;
    padding: 6px 10px;
  }
  .wif-scene-copy {
    bottom: 86px;
    padding: 14px 16px;
  }
  .wif-scene-finale {
    bottom: 86px;
    padding: 15px 16px;
  }
  .wif-scene-copy h2 {
    font-size: 26px;
  }
  .wif-scene-finale h2 {
    font-size: 26px;
  }
  .wif-scene-copy p {
    font-size: 13px;
  }
  .wif-scroll-hint {
    display: none;
  }
  .wif-finale-actions .button,
  .wif-finale-actions .wif-btn-wa {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 12.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wif-experience {
    height: auto !important;
  }
  .wif-stage {
    display: none !important;
  }
  .wif-fallback {
    display: block !important;
  }
}
