/* Franja superior y relato audiovisual controlado por el desplazamiento */
.encabezado {
  background: rgba(12, 63, 31, .96);
  border-bottom-color: rgba(255, 255, 255, .12);
  box-shadow: 0 12px 34px rgba(7, 37, 18, .18);
}

.encabezado .marca-nav {
  flex: 0 0 auto;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.encabezado .marca-nav img {
  width: 150px;
  height: 52px;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, .95))
    drop-shadow(0 0 5px rgba(255, 255, 255, .35))
    drop-shadow(0 8px 12px rgba(4, 31, 14, .32));
}

.encabezado .nav-principal a {
  color: rgba(255, 255, 255, .9);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.encabezado .politicas-enlace-movil { color: rgba(255, 255, 255, .9); }
.encabezado .nav-principal a:hover { color: #ffbd18; }
.encabezado .selector-idioma {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .14);
}
.encabezado .selector-idioma button { color: rgba(255, 255, 255, .68); }
.encabezado .selector-idioma button.activo {
  background: #ffbd18;
  color: #123d24;
}
.encabezado .boton-solido {
  background: #ff7a12;
  color: white;
  box-shadow: 0 8px 22px rgba(255, 122, 18, .26);
}

.barra-identidad {
  position: relative;
  z-index: 3;
  height: clamp(104px, 13vw, 176px);
  overflow: hidden;
  background: #25861b;
}
.barra-identidad::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -24px 34px -28px rgba(5, 52, 19, .75);
  pointer-events: none;
}
.barra-identidad img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.historia-scroll {
  --story-progress: 0;
  --story-one: 1;
  --story-two: 0;
  --story-three: 0;
  --story-video-opacity: .28;
  --story-video-scale: 1.08;
  --story-glow-x: 20%;
  --story-notes-opacity: .05;
  --story-notes-x: 0%;
  --story-notes-y: 0%;
  --story-notes-scale: .92;
  --story-one-y: 0px;
  --story-two-y: 46px;
  --story-three-y: 60px;
  --story-portrait-scale: .88;
  --story-portrait-rotate: 2deg;
  position: relative;
  height: 360vh;
  margin-top: clamp(56px, 8vw, 120px);
  background: #071d0f;
}

.historia-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
  color: white;
  background: #071d0f;
}

.historia-video,
.historia-velo,
.historia-notas {
  position: absolute;
  inset: 0;
}

.historia-video {
  z-index: -4;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: var(--story-video-opacity);
  filter: saturate(1.08) contrast(1.08);
  transform: scale(var(--story-video-scale));
}

.historia-velo {
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(4, 35, 17, .94) 0%, rgba(7, 55, 25, .68) 42%, rgba(10, 29, 14, .22) 70%, rgba(255, 115, 15, .18) 100%),
    radial-gradient(circle at var(--story-glow-x) 68%, rgba(255, 126, 18, .5), transparent 31%),
    linear-gradient(180deg, rgba(3, 19, 9, .16), rgba(3, 24, 11, .82));
}

.historia-notas {
  z-index: -2;
  width: 115%;
  height: auto;
  max-width: none;
  top: 2%;
  left: -8%;
  opacity: var(--story-notes-opacity);
  mix-blend-mode: screen;
  transform: translate3d(var(--story-notes-x), var(--story-notes-y), 0) scale(var(--story-notes-scale));
  filter: drop-shadow(0 0 32px rgba(255, 181, 28, .2));
}

.historia-contenido {
  position: relative;
  height: 100%;
}

.historia-paso,
.historia-final {
  position: absolute;
  inset: 0 clamp(20px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.historia-paso { max-width: 760px; }
.historia-paso-uno {
  opacity: var(--story-one);
  transform: translateY(var(--story-one-y));
}
.historia-paso-dos {
  left: auto;
  max-width: 690px;
  text-align: right;
  align-items: flex-end;
  opacity: var(--story-two);
  transform: translateY(var(--story-two-y));
}

.historia-numero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #ffbd18;
  font-family: var(--fuente-mono);
  font-weight: 700;
  letter-spacing: .16em;
}
.historia-numero::after {
  content: "";
  width: 52px;
  height: 2px;
  background: #ff7815;
}
.historia-kicker {
  margin: 0 0 14px;
  color: #87df43;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.historia-scroll h2 {
  max-width: 12ch;
  margin: 0;
  color: white;
  font-family: var(--fuente-display);
  font-size: clamp(38px, 6.1vw, 82px);
  line-height: 1.02;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.historia-paso > p:last-child {
  max-width: 52ch;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, .76);
  font-size: clamp(16px, 1.5vw, 20px);
}

.historia-final {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(340px, .82fr);
  align-items: center;
  gap: clamp(30px, 6vw, 84px);
  opacity: var(--story-three);
  transform: translateY(var(--story-three-y));
  pointer-events: none;
}
.historia-scroll.historia-final-visible .historia-final { pointer-events: auto; }
.historia-final-texto { position: relative; z-index: 2; }
.historia-final h2 { font-size: clamp(36px, 4.8vw, 68px); }
.historia-cta {
  margin-top: 30px;
  background: #ff7815;
  color: white;
  box-shadow: 0 18px 40px rgba(255, 120, 21, .26);
}
.historia-retrato {
  align-self: end;
  justify-self: end;
  width: min(100%, 650px);
  height: 88vh;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 30px 30px 0 0;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .42), 0 0 0 8px rgba(255, 120, 21, .08);
  transform: scale(var(--story-portrait-scale)) rotate(var(--story-portrait-rotate));
  transform-origin: bottom right;
}
.historia-retrato img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.historia-progreso {
  position: absolute;
  z-index: 4;
  right: clamp(18px, 3vw, 42px);
  bottom: 24px;
  left: clamp(18px, 3vw, 42px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, .58);
  font-family: var(--fuente-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.historia-progreso i {
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, .18);
}
.historia-progreso b {
  display: block;
  width: calc(var(--story-progress) * 100%);
  height: 100%;
  background: linear-gradient(90deg, #72d52d, #ffbd18, #ff7815);
}

@media (max-width: 760px) {
  .encabezado .marca-nav { padding: 2px 0; }
  .encabezado .marca-nav img { width: 118px; height: 44px; }
  .barra-identidad { height: 112px; }
  .barra-identidad img { object-position: 42% center; }
  .historia-scroll { height: 320vh; }
  .historia-sticky { min-height: 560px; }
  .historia-paso-dos { text-align: left; align-items: flex-start; }
  .historia-final {
    grid-template-columns: 1fr;
    align-content: end;
    gap: 18px;
    padding-bottom: 50px;
  }
  .historia-final-texto {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 52px;
    z-index: 3;
    padding: 46px 20px 24px;
    background: linear-gradient(transparent, rgba(5, 35, 17, .93) 33%);
  }
  .historia-final h2 { max-width: 10ch; font-size: clamp(36px, 11vw, 56px); }
  .historia-final .historia-kicker,
  .historia-final .historia-numero { margin-bottom: 8px; }
  .historia-cta { margin-top: 18px; }
  .historia-retrato {
    width: 100%;
    height: 78vh;
    border-radius: 24px 24px 0 0;
  }
  .historia-progreso { bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .historia-scroll { height: auto; }
  .historia-sticky { position: relative; height: auto; min-height: 100vh; }
  .historia-video { transform: none; }
  .historia-paso { display: none; }
  .historia-final {
    position: relative;
    min-height: 100vh;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .historia-retrato { transform: none; }
  .historia-progreso { display: none; }
}
