/* V8.2 · movimiento editorial y estabilidad. Se carga al final de la cascada. */
:root {
  --v82-blue: #062847;
  --v82-enter: cubic-bezier(.16, 1, .3, 1);
  --v82-settle: cubic-bezier(.22, .61, .36, 1);
}

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
img, video { display: block; }
@supports (scrollbar-gutter: stable) { html { scrollbar-gutter: stable; } }

/* Intro OBRA: el wordmark se construye desde una línea base por cuatro franjas. */
html[data-sa-version="4"] body.b4-home .sa-obra {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: grid !important;
  place-items: center;
  align-content: center;
  gap: 30px;
  pointer-events: auto;
  background: var(--sa-paper, #fff);
  opacity: 1;
  visibility: visible;
  animation: none !important;
  transition: opacity 420ms var(--v82-settle), visibility 420ms step-end;
}

html[data-sa-version="4"] body.b4-home .sa-obra[hidden] { display: none !important; }
html[data-sa-version="4"] body.b4-home .sa-obra.sa-v8-intro-out {
  opacity: 0;
  visibility: hidden;
}

.sa-v8-intro-active,
.sa-v8-intro-active body { overflow: hidden; }

html[data-sa-version="4"] body.b4-home .sa-obra__logo {
  position: relative;
  width: min(72vw, 520px);
  aspect-ratio: 289 / 33;
  overflow: visible;
  animation: none !important;
}

html[data-sa-version="4"] body.b4-home .sa-obra__logo::after {
  content: "";
  position: absolute;
  inset: auto 0 -26px;
  height: 1px;
  background: var(--v82-blue);
  transform-origin: left;
  animation: v82-build-line 540ms var(--v82-enter) both;
}

html[data-sa-version="4"] body.b4-home .sa-obra__logo span {
  position: absolute;
  inset: 0;
  background: url("../img/logo-wordmark.png") center / 100% 100% no-repeat;
  animation: v82-build-mark 760ms var(--v82-enter) both;
}

html[data-sa-version="4"] body.b4-home .sa-obra__logo span:nth-child(1) {
  clip-path: inset(75% 0 0);
  animation-delay: 100ms;
}
html[data-sa-version="4"] body.b4-home .sa-obra__logo span:nth-child(2) {
  clip-path: inset(50% 0 25%);
  animation-delay: 180ms;
}
html[data-sa-version="4"] body.b4-home .sa-obra__logo span:nth-child(3) {
  clip-path: inset(25% 0 50%);
  animation-delay: 260ms;
}
html[data-sa-version="4"] body.b4-home .sa-obra__logo span:nth-child(4) {
  clip-path: inset(0 0 75%);
  animation-delay: 340ms;
}

html[data-sa-version="4"] body.b4-home .sa-obra__progreso {
  width: min(58vw, 420px);
  height: 1px;
  overflow: hidden;
  background: rgba(6, 40, 71, .18);
}

html[data-sa-version="4"] body.b4-home .sa-obra__progreso span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--v82-blue);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 260ms var(--v82-enter);
}

html[data-sa-version="4"] body.b4-home .sa-obra__estado {
  margin: -16px 0 0;
  color: var(--v82-blue);
  font: 600 10px/1.4 var(--font-base, Arial, sans-serif);
  letter-spacing: .14em;
  text-transform: uppercase;
}

html[data-sa-version="4"] body.b4-home .sa-obra__estado span {
  display: inline-block;
  min-width: 3.4ch;
  text-align: right;
}

@keyframes v82-build-line {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes v82-build-mark {
  from { opacity: 0; transform: translate3d(0, 34px, 0); }
  to { opacity: 1; transform: none; }
}

/* La home tiene un solo conductor: GSAP en b4-story.js y escenas en v3-scenes.js. */
html[data-sa-version="4"] .hero__linea--1 {
  margin-block: 0;
  font-family: var(--font-titular) !important;
  font-weight: 700;
  line-height: .86 !important;
  letter-spacing: -.035em;
}

/* El vídeo y su velo comparten una sola escala durante la salida del intro. */
html[data-sa-version="4"] body.b4-home .hero {
  --v82-hero-media-scale: 1;
}

html[data-sa-version="4"] body.b4-home .hero__video,
html[data-sa-version="4"] body.b4-home .hero::before {
  transform: scale(var(--v82-hero-media-scale)) !important;
  transform-origin: 50% 50%;
}

html[data-sa-version="4"] .hacemos__eyebrow {
  font-size: clamp(1rem, 1.15vw, 1.25rem) !important;
  font-weight: 600;
  letter-spacing: .08em;
}

html[data-sa-version="4"] .hacemos__titulo {
  line-height: .86 !important;
  letter-spacing: -.035em;
}

/* Ritmo tipográfico global: display compacto y lectura continua controlada. */
html[data-sa-version="4"] .hero__linea--1,
html[data-sa-version="4"] .hero__linea--2,
html[data-sa-version="4"] .proyectos__titulo,
html[data-sa-version="4"] .pais__rotulo,
html[data-sa-version="4"] .cifras__titulo,
html[data-sa-version="4"] .pais-hero__nombre,
html[data-sa-version="4"] .microciudades__titulo {
  line-height: .9 !important;
}

html[data-sa-version="4"] .cifras__valor { line-height: .92 !important; }
html[data-sa-version="4"] #datos-y-cifras { scroll-margin-top: 0; }
html[data-sa-version="4"] .hacemos__parrafo,
html[data-sa-version="4"] .proyectos__texto,
html[data-sa-version="4"] .cifras__subtitulo,
html[data-sa-version="4"] .cifras__pie,
html[data-sa-version="4"] .cr-hero__meta,
html[data-sa-version="4"] .microciudades__parrafo { line-height: 1.42 !important; }

html[data-sa-version="4"] .hacemos__titulo .v82-title-word {
  display: inline-block;
}

/* Nombre y CTA comparten una base; el frente conserva su recorte por encima
   para que ambos emerjan desde detrás del paisaje. */
html[data-sa-version="4"] .pais__identidad {
  position: absolute;
  z-index: 2 !important;
  display: flex;
  align-items: flex-end;
  gap: clamp(16px, 1.8vw, 32px);
}

html[data-sa-version="4"] .pais__rotulo {
  position: static !important;
  inset: auto !important;
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  text-shadow: 0 2px 24px rgba(4, 20, 36, .26);
}
html[data-sa-version="4"] .pais__letra {
  display: inline-block;
}
html[data-sa-version="4"] .pais__frente { z-index: 3 !important; pointer-events: none; }
html[data-sa-version="4"] .pais__flecha {
  position: relative !important;
  inset: auto !important;
  top: -8px !important;
  z-index: auto !important;
}

/* GSAP conduce la entrada del rótulo. La capa del paisaje sólo conserva
   profundidad/puntero; no interpola el mismo transform durante el scroll. */
html[data-sa-version="4"].sa-v3-scenes .pais__identidad {
}

html[data-sa-version="4"].sa-v3-scenes .pais__frente {
  opacity: 1;
  transition: none !important;
  backface-visibility: hidden;
}

html[data-sa-version="4"] .pais .pais__flecha {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  color: var(--v82-blue);
  background: #fff !important;
  box-shadow: none !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition:
    color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease,
    transform 320ms var(--v82-enter) !important;
}

html[data-sa-version="4"] .pais .pais__flecha svg {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  box-sizing: border-box;
  padding: 11px;
  border-radius: 50%;
  color: var(--v82-blue);
  background: #fff;
  transition: color 220ms ease, background-color 220ms ease, transform 320ms var(--v82-enter) !important;
}

html[data-sa-version="4"] .pais .pais__flecha:hover,
html[data-sa-version="4"] .pais .pais__flecha:focus-visible {
  color: var(--v82-blue);
  background: #fff !important;
  box-shadow: none;
}

html[data-sa-version="4"] .pais .pais__flecha:hover svg,
html[data-sa-version="4"] .pais .pais__flecha:focus-visible svg {
  color: var(--v82-blue);
  background: #fff;
  transform: translateY(-2px) rotate(8deg);
}

html[data-sa-version="4"] .pais .pais__flecha::before { display: none; }

html[data-sa-version="4"] .hacemos .hacemos__flecha {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50% !important;
  border-color: var(--v82-blue);
  background: var(--v82-blue);
}

html[data-sa-version="4"] .hacemos .hacemos__flecha::before {
  border-radius: 50%;
  background: #0b426f;
}

html[data-sa-version="4"] .hacemos .hacemos__flecha svg {
  color: #fff;
  transition: transform 320ms var(--v82-enter) !important;
}

html[data-sa-version="4"] .hacemos .hacemos__flecha:hover svg,
html[data-sa-version="4"] .hacemos .hacemos__flecha:focus-visible svg {
  transform: translateY(-2px) rotate(8deg) !important;
}

/* Revisión Gregorio · 18 sep 2026
   LATAM cierra la frase como una continuación editorial del subtítulo: serif,
   contenido y sin la lectura de etiqueta o bloque independiente. */
html[data-sa-version="4"] .hero__linea--3 {
  padding-top: 12px;
  font-family: var(--fuente-cuerpo-lectura, Georgia, serif);
  font-size: clamp(20px, 1.65vw, 27px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.25;
  letter-spacing: -.015em;
  text-transform: none;
}

/* El CTA de "Qué hacemos" no tiene un destino aprobado durante esta revisión.
   El estilo base de .flecha define display y, sin esta regla, anularía hidden. */
html[data-sa-version="4"] .hacemos__flecha[hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  html[data-sa-version="4"] .hero__linea--3 {
    padding-top: 8px;
    font-size: clamp(17px, 4.4vw, 20px);
    letter-spacing: -.012em;
  }
}

/* El grupo conserva exactamente el anclaje original del rótulo; sólo el CTA
   se integra a su lado y comparte la animación. */
@media (min-width: 501px) {
  html[data-sa-version="4"] .pais--costa-rica .pais__identidad { right: 5.2vw; top: calc(3.8vw + 50px); }
  html[data-sa-version="4"] .pais--costa-rica .pais__flecha { top: -12px !important; }
  html[data-sa-version="4"] .pais--chile .pais__identidad { left: 8.102vw; top: 6.366vw; }
  html[data-sa-version="4"] .pais--panama .pais__identidad { right: 6.9vw; top: 7.15vw; }
  html[data-sa-version="4"] .pais--colombia .pais__identidad { left: 2.431vw; top: 14.294vw; }

  /* Ajuste óptico de las máscaras: conservan profundidad sobre el rótulo,
     pero dejan legible la palabra sin mover identidad, CTA ni animación. */
  html[data-sa-version="4"] .pais--chile .pais__frente { object-position: center 44%; }
  html[data-sa-version="4"] .pais--colombia .pais__frente { object-position: center 42%; }
}

/* Transición entre páginas desde la hamburguesa. El propio menú es la
   cubierta: se conserva abierto en el destino hasta que la página está lista
   y entonces se retira. No se superpone una segunda capa azul. */
html[data-sa-version="4"]::before {
  opacity: 0 !important;
  transform: scaleX(0);
  transition: none !important;
}

html[data-sa-version="4"].sa-page-awaiting .menu {
  transform: translateX(0) !important;
  visibility: visible !important;
  transition: none !important;
}

html[data-sa-version="4"].sa-page-awaiting.sa-page-entering .menu {
  transform: translateX(100%) !important;
  visibility: visible !important;
  transition: transform 500ms var(--ease) !important;
}

/* Las fichas de países no se abren desde la hamburguesa. Un fade corto
   suaviza tanto la entrada como el regreso sin sumar otra capa visual. */
@media (prefers-reduced-motion: no-preference) {
  html[data-sa-version="4"].sa-country-leaving body {
    opacity: 0;
    transition: opacity 180ms ease-out !important;
  }

  html[data-sa-version="4"].sa-country-awaiting body { opacity: 0; }

  html[data-sa-version="4"].sa-country-awaiting.sa-country-entering body {
    opacity: 1;
    transition: opacity 320ms ease-out !important;
  }
}

/* Páginas interiores: una entrada discreta; la home queda fuera para evitar dobles dueños. */
@media (prefers-reduced-motion: no-preference) {
  html.sa-v8-ready body:not(.b4-home) .v8-reveal {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition:
      opacity 520ms var(--v82-enter),
      transform 680ms var(--v82-enter);
  }
  html.sa-v8-ready body:not(.b4-home) .v8-reveal.v8-in {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 760px) {
  html[data-sa-version="4"] .hacemos__eyebrow { font-size: 1rem !important; }
  html[data-sa-version="4"] .pais .pais__flecha {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0 !important;
    gap: 10px;
  }
  html[data-sa-version="4"] .pais .pais__flecha svg {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-sa-version="4"] body.b4-home .sa-obra__logo::after,
  html[data-sa-version="4"] body.b4-home .sa-obra__logo span { animation: none !important; }
  html[data-sa-version="4"]::before { display: none !important; }
  .v8-reveal,
  .v8-reveal.v8-in,
  .pais__rotulo,
  .pais__frente,
  .pais__fondo,
  .pais__flecha {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
    animation: none !important;
  }
}

.v8-language {
  position: fixed;
  z-index: 25;
  right: 1.25rem;
  bottom: 1.25rem;
  display: inline-flex;
  gap: .35rem;
  padding: .4rem;
  border: 1px solid rgba(0, 0, 0, .18);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
}

/* A country chapter enters as one composition, including deep-linked views. */
html[data-sa-version="4"].sa-v3-scenes .pais:not(.sa-v82-background-ready) .pais__rotulo,
html[data-sa-version="4"].sa-v3-scenes .pais:not(.sa-v82-background-ready) .pais__frente,
html[data-sa-version="4"].sa-v3-scenes .pais:not(.sa-v82-background-ready) .pais__flecha {
  opacity: 0 !important;
  transition: none !important;
}

@media (max-width: 500px) {
  html[data-sa-version="4"] .pais .pais__identidad {
    left: auto;
    right: 24px;
    top: 24px;
    max-width: calc(100vw - 48px);
    gap: 12px;
  }
}

.v8-language button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: .32rem .44rem;
  font: 600 .7rem/1 sans-serif;
  letter-spacing: .12em;
  color: #1d211f;
  cursor: pointer;
}

.idiomas button.idiomas__op {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.idiomas button.idiomas__op[aria-disabled="true"] { cursor: not-allowed; }

.v8-language button[aria-pressed="true"] { border-bottom: 1px solid currentColor; }
.v8-language button[aria-disabled="true"] { opacity: .42; cursor: not-allowed; }

@media (prefers-reduced-motion: no-preference) {
  .v8-language-changing [data-i18n] {
    animation: v8-language-ripple 420ms var(--v82-enter) both;
    animation-delay: var(--v8-i18n-delay, 0ms);
  }
}

@keyframes v8-language-ripple {
  0%, 100% { opacity: 1; transform: none; }
  45% { opacity: .35; transform: translateY(-4px); }
}
