/* ==========================================================================
   ANZA(30) — hoja de estilos
   --------------------------------------------------------------------------
   Todo el tamaño se expresa en "--u": 1 unidad = 1 px del diseño de Figma.
   El lienzo de referencia cambia según el dispositivo, así que la página
   escala de forma proporcional sin saltos:
     · Desktop  (> 1024 px)  lienzo de 1727 px  → partners en 3 columnas
     · iPad     (641–1024)   lienzo de 1178 px  → partners en 2 columnas
     · Móvil    (≤ 640 px)   lienzo de  626 px  → partners en 1 columna
   ========================================================================== */

:root {
  color-scheme: dark;
  --grey: #383838;
  --blue: #1438e0;
  --accent: #5170ff;
  --white: #ffffff;

  --canvas: 1727;
  --u: calc(100vw / var(--canvas));
  --cols: 3;
  --header-h: calc(69 * var(--u));
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --soft: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1024px) {
  :root { --canvas: 1178; --cols: 2; }
}
@media (max-width: 640px) {
  :root { --canvas: 626; --cols: 1; --header-h: calc(84 * var(--u)); }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--grey);
  color: var(--white);
  font-family: "Host Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  line-height: 1.28;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; font-weight: 300; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font: inherit; color: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Cabecera
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  padding: 0 calc(48 * var(--u));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--grey);
  border-bottom: 1px solid var(--white);
  transition: background-color 0.25s linear;
}
/* al llegar al footer el menú pierde su fondo */
.header.is-clear { background-color: transparent; }

.header__logo svg {
  width: calc(47 * var(--u));
  height: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: calc(16 * var(--u));
  font-size: calc(26 * var(--u));
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.nav a,
.nav span { opacity: 0.57; transition: opacity 0.3s; }
.nav a:hover,
.nav a.is-active { opacity: 1; }

@media (max-width: 640px) {
  .header { padding: 0 calc(25 * var(--u)); }
  .header__logo svg { width: calc(58 * var(--u)); }
  .nav { font-size: calc(22 * var(--u)); gap: calc(10 * var(--u)); }
}

/* --------------------------------------------------------------------------
   Hero: 4 escenas que avanzan con el scroll
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  /* 5 alturas de pantalla de recorrido: cada escena tiene margen antes de cambiar */
  height: 520vh;
  height: 520svh;
}

.hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 480px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 0 0 calc(60 * var(--u)) calc(60 * var(--u));
  background: var(--grey);
}

.hero__bg,
.hero__light,
.hero__smoke,
.hero__map,
.scene {
  position: absolute;
  inset: 0;
}

.hero__bg { opacity: 0; transition: opacity 1.4s var(--soft); }
.hero__bg--1 { background: radial-gradient(ellipse 50% 50% at 50% 50%, #383838 0%, #2f3862 25%, #26388c 50%, #1d38b6 75%, #1438e0 100%); }
.hero__bg--2 { background: radial-gradient(ellipse 22.6% 22.6% at 50% 50%, #383838 0%, #2f3862 25%, #26388c 50%, #1d38b6 75%, #1438e0 100%); }
.hero__bg--3 { background: linear-gradient(to bottom, #383838 20.5%, #1438e0 64.7%); }
.hero__bg--4 { background: var(--blue); }

.hero__light,
.hero__smoke {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.4s var(--soft);
}
/* Capas de fondo del hero.
   Las dos capas que se mezclan con el fondo (.hero__drift y .hero__screen) están
   quietas y recortan su contenido; lo que se mueve es la imagen de dentro. Así el
   borde de la capa nunca se ve (si se animaba la propia capa mezclada, algunos
   navegadores dibujaban su contorno como un marco). */
.hero__drift,
.hero__screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero__drift { mix-blend-mode: multiply; }
.hero__screen { mix-blend-mode: screen; }
/* Las imágenes de fondo están quietas: al moverse, en algunos navegadores se veía su borde. */

.hero__map {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.hero__map-inner {
  position: relative;
  width: 82.9%;
  flex: none;
}
.hero__map img {
  opacity: 0.21; /* los puntos son blancos; esta es la intensidad de base del mapa */
  width: 100%;
  max-width: none;
  height: auto;
}

/* Zonas del mapa que se encienden y apagan con suavidad. La máscara hace que
   solo se iluminen los puntos del mapamundi. */
.hero__lights {
  position: absolute;
  inset: 0;
  -webkit-mask: url("../assets/img/world-map.svg") center / 100% 100% no-repeat;
  mask: url("../assets/img/world-map.svg") center / 100% 100% no-repeat;
}
.hero__lights i {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0.8) 40%, rgba(255, 255, 255, 0) 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: twinkle 7s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; }
  40%, 62% { opacity: 0.55; } /* intensidad máxima del blanco de las luces */
}

[data-state="0"] .hero__bg--1,
[data-state="1"] .hero__bg--2,
[data-state="2"] .hero__bg--3,
[data-state="3"] .hero__bg--4,
[data-state="0"] .hero__light,
[data-state="0"] .hero__smoke { opacity: 1; }

/* Letras gigantes ANZA / (30) de la primera escena */
.hero__big {
  position: absolute;
  /* a la altura del titular de la primera escena */
  top: calc(50% + var(--header-h) / 2 - 46 * var(--u));
  transform: translateY(-50%);
  mix-blend-mode: overlay;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}
.hero__big svg { height: 100%; width: auto; }
.hero__big--anza { left: calc(48 * var(--u)); height: calc(140 * var(--u)); }
.hero__big--30 { right: calc(57 * var(--u)); height: calc(191 * var(--u)); }
[data-state="0"] .hero__big { opacity: 1; }

/* Destello que recorre las letras ANZA (30): una copia de las letras, visible solo
   a través de una franja de luz que entra por los lados y se cruza en el centro. */
.hero__shine {
  mix-blend-mode: normal;
  -webkit-mask: linear-gradient(100deg, transparent 38%, rgba(0, 0, 0, 0.75) 50%, transparent 62%) 100% 0 / 300% 100% no-repeat;
  mask: linear-gradient(100deg, transparent 38%, rgba(0, 0, 0, 0.75) 50%, transparent 62%) 100% 0 / 300% 100% no-repeat;
  animation: shine 5.5s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}
.hero__big--30.hero__shine { animation-name: shine-back; }
@keyframes shine {
  0%, 12% { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  62%, 100% { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
}
@keyframes shine-back {
  0%, 12% { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
  62%, 100% { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
}

/* Escenas */
.scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* el texto de las cuatro escenas queda centrado en alto en la zona visible bajo el menú */
  padding: var(--header-h) calc(40 * var(--u)) 0;
  text-align: center;
  letter-spacing: -0.04em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(36 * var(--u)));
  transition: opacity 0.7s var(--soft), transform 1.1s var(--soft), visibility 0s linear 0.7s;
}
.scene.is-past { transform: translateY(calc(-36 * var(--u))); }
.scene.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 1.1s var(--soft) 0.35s, transform 1.4s var(--soft) 0.35s, visibility 0s;
}

.scene--1 h1 {
  font-size: calc(58 * var(--u));
  line-height: 1.22;
  max-width: 100%;
}
.scene--1 h1 u {
  text-decoration-line: underline;
  text-decoration-thickness: calc(4 * var(--u));
  text-underline-offset: calc(11 * var(--u));
  text-decoration-skip-ink: none;
}
.scene--1 p {
  margin-top: calc(32 * var(--u));
  width: calc(994 * var(--u));
  max-width: 100%;
  font-size: calc(24 * var(--u));
  line-height: 1.33;
}

.scene--2 p {
  width: calc(1185 * var(--u));
  max-width: 100%;
  font-size: calc(58 * var(--u));
  line-height: 1.33;
  color: rgba(255, 255, 255, 0.68);
}
.scene__wordmark {
  display: inline-block;
  width: calc(281 * var(--u));
  height: auto;
  margin-right: calc(14 * var(--u));
  vertical-align: -0.2em;
}

.scene--3 p {
  width: calc(1131 * var(--u));
  max-width: 100%;
  font-size: calc(24 * var(--u));
  line-height: 1.33;
}
.scene--3 p + p { margin-top: calc(46 * var(--u)); }

.scene--4 p {
  width: calc(1529 * var(--u));
  max-width: 100%;
  font-size: calc(60 * var(--u));
  line-height: 1.33;
  color: rgba(255, 255, 255, 0.6);
}
.scene__cta {
  position: relative;
  margin-top: calc(81 * var(--u));
  padding: calc(2 * var(--u)) calc(92 * var(--u));
  font-size: calc(60 * var(--u));
  line-height: 1.33;
  white-space: nowrap;
}

/* Con JavaScript la animación del hero va ligada al scroll (js/main.js pinta cada
   fotograma), así que aquí se desactivan las transiciones automáticas. */
.is-scrub .scene,
.is-scrub .hero__bg,
.is-scrub .hero__light,
.is-scrub .hero__smoke,
.is-scrub .hero__big,
.is-scrub .hero__frame,
.is-scrub .deco::before,
.is-scrub .deco svg,
.is-scrub .hero__route-reveal { transition: none; }
.is-scrub .scene { will-change: opacity, transform; }

/* Marco de esquinas tipo "visor": un único marco que se queda en pantalla y
   se transforma de una escena a otra (js/main.js calcula su caja). */
.hero__frame {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--fw, 100%);
  height: var(--fh, 100%);
  transform: translate(var(--fx, 0px), var(--fy, 0px));
  opacity: 0;
  pointer-events: none;
  transition: transform 1.3s var(--soft), width 1.3s var(--soft), height 1.3s var(--soft), opacity 0.9s var(--soft);
}
.hero__frame.is-instant { transition: none; }
.hero__frame i {
  position: absolute;
  width: var(--cw, calc(32 * var(--u)));
  height: var(--ch, calc(46 * var(--u)));
  border: 0 solid var(--white);
}
.hero__frame i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }
.hero__frame i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }
.hero__frame i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.hero__frame i:nth-child(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

/* Al pasar el ratón por "View the network" el marco se cierra sobre el texto */
.hero__frame i { transition: transform 0.45s var(--ease); }
.hero__stage:has(.scene__cta:hover) .hero__frame i:nth-child(1),
.hero__stage:has(.scene__cta:focus-visible) .hero__frame i:nth-child(1) { transform: translate(calc(52 * var(--u)), calc(7 * var(--u))); }
.hero__stage:has(.scene__cta:hover) .hero__frame i:nth-child(2),
.hero__stage:has(.scene__cta:focus-visible) .hero__frame i:nth-child(2) { transform: translate(calc(-52 * var(--u)), calc(7 * var(--u))); }
.hero__stage:has(.scene__cta:hover) .hero__frame i:nth-child(3),
.hero__stage:has(.scene__cta:focus-visible) .hero__frame i:nth-child(3) { transform: translate(calc(52 * var(--u)), calc(-7 * var(--u))); }
.hero__stage:has(.scene__cta:hover) .hero__frame i:nth-child(4),
.hero__stage:has(.scene__cta:focus-visible) .hero__frame i:nth-child(4) { transform: translate(calc(-52 * var(--u)), calc(-7 * var(--u))); }

[data-state="1"] .hero__frame,
[data-state="2"] .hero__frame,
[data-state="3"] .hero__frame { opacity: 1; }

/* Cuadros decorativos con elipses: siempre en el mismo sitio, solo cambia su opacidad */
.deco {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--s) * var(--u));
  height: calc(var(--s) * var(--u));
  pointer-events: none;
}
.deco::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--white);
  opacity: var(--sq);
  transition: opacity 0.9s var(--ease);
}
.deco svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: var(--el);
  transition: opacity 0.9s var(--ease);
}
.deco ellipse {
  fill: none;
  stroke: var(--white);
  stroke-width: 1px;
  stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
}

/* reparto simétrico: un par grande a cada lado y uno pequeño en el centro, a la misma altura */
.deco--a { --x: 47.83%; --y: calc(34% + 59.5 * var(--u)); --s: 75; --sq: 0; --el: 0; }
.deco--b { --x: 13%; --y: 34%; --s: 194; --sq: 0; --el: 0; }
.deco--c { --x: 75.77%; --y: 34%; --s: 194; --sq: 0; --el: 0; }
[data-state="1"] .deco--a { --sq: 0.15; --el: 0.28; }
[data-state="2"] .deco,
[data-state="3"] .deco { --sq: 0.26; --el: 0.48; }

/* Constelación: la línea se va dibujando a medida que se hace scroll.
   --draw (0 → 1) lo actualiza js/main.js; la máscara descubre el trazo. */
.hero__route {
  position: absolute;
  left: 9.8%;
  top: 24.3%;
  width: 76.4%;
  height: 62.9%;
  opacity: 0.3;
  pointer-events: none;
}
.hero__route { transform-origin: 52.6% 40.9%; } /* centro de la pantalla, para crecer junto con el mapa */
.hero__route path { fill: none; }
/* Puntos en los vértices de la constelación: aparecen uno tras otro en la última
   pantalla (--dots, de 0 a 1, lo actualiza js/main.js). */
.hero__route--dots {
  left: calc(9.8% - 76.4% * 10 / 1321);
  top: calc(24.3% - 62.9% * 10 / 704);
  width: calc(76.4% * 1341 / 1321);
  height: calc(62.9% * 724 / 704);
  opacity: 1;
  overflow: visible;
}
.hero__route--dots path {
  stroke: var(--white);
  stroke-width: 7px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: clamp(0, calc(var(--dots, 0) * 16 - var(--i)), 0.85);
}
/* En la última pantalla las conexiones siguen vivas: los puntos laten uno tras otro
   y un trazo de luz recorre la constelación sin parar. */
.hero__route--dots path { animation: dot-pulse 5.6s ease-in-out infinite; animation-delay: calc(var(--i) * 0.35s); }
@keyframes dot-pulse {
  0%, 22%, 100% { stroke-width: 7px; }
  9% { stroke-width: 13px; }
}
.hero__route--flow { opacity: calc(var(--dots, 0) * 0.3); }
.hero__route--flow path {
  stroke: var(--white);
  stroke-width: 1px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 0.05 0.2;
  animation: route-flow 9s linear infinite;
}
@keyframes route-flow { from { stroke-dashoffset: 0.25; } to { stroke-dashoffset: 0; } }
.hero__route-line {
  stroke: var(--white);
  stroke-width: 1px;
  stroke-dasharray: 2 2;
  vector-effect: non-scaling-stroke;
}
.hero__route-reveal {
  stroke: #fff;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--draw, 0));
  transition: stroke-dashoffset 0.7s ease-out; /* sigue al scroll con un pequeño retardo */
}

@media (max-width: 1024px) {
  .hero__map-inner { width: 120%; }
  .scene--2 p { font-size: calc(52 * var(--u)); }
  .scene--4 p { font-size: calc(52 * var(--u)); }
}

@media (max-width: 640px) {
  .hero__stage { border-radius: 0 0 calc(40 * var(--u)) calc(40 * var(--u)); }
  .hero__map-inner { width: 210%; }
  /* en móvil todo va centrado en la zona visible bajo el menú: letras, mapa y texto */
  /* Primera pantalla: composición del frame "COMPOSICION MOBILE" del Figma (402 × 874).
     --m = 1 px de ese frame. ANZA arriba a la izquierda, (30) abajo a sangre por la derecha,
     y el texto entre ambos; el conjunto va centrado en la zona visible bajo el menú. */
  .hero__stage { --m: calc(100vw / 402); --mid: calc(50% + var(--header-h) / 2); }
  .hero__big--anza { left: calc(5 * var(--m)); height: calc(90 * var(--m)); top: calc(var(--mid) - 167 * var(--m)); }
  .hero__big--30 { right: 0; height: calc(125 * var(--m)); top: calc(var(--mid) + 150 * var(--m)); }
  .scene--1 { padding: var(--header-h) 0 calc(24 * var(--m)); }
  .scene--1 h1 { width: calc(355 * var(--m)); line-height: calc(30 * var(--m)); }
  .scene--1 h1 u { text-decoration: none; }
  .hero__map { padding-top: var(--header-h); }
  .scene { padding-left: calc(25 * var(--u)); padding-right: calc(25 * var(--u)); }
  .scene--1 h1 { font-size: calc(28 * var(--m)); }
  .scene--1 p { font-size: calc(16 * var(--m)); width: calc(309 * var(--m)); margin-top: calc(11 * var(--m)); line-height: 1.3; }
  .scene--2 p { font-size: calc(40 * var(--u)); }
  .scene__wordmark { width: calc(194 * var(--u)); }
  .scene--3 p { font-size: calc(28 * var(--u)); }
  .scene--4 p { font-size: calc(40 * var(--u)); }
  .scene__cta { font-size: calc(46 * var(--u)); padding: calc(4 * var(--u)) calc(48 * var(--u)); margin-top: calc(60 * var(--u)); }
  .deco, .hero__route { display: none; }
}

/* En vertical (iPad de pie) los adornos pensados para apaisado se ocultan */
@media (max-aspect-ratio: 1/1) {
  .deco, .hero__route { display: none; }
}

/* Pantallas apaisadas muy bajas (móvil en horizontal) */
@media (max-height: 520px) and (min-width: 641px) {
  .scene--2 p, .scene--4 p { font-size: calc(40 * var(--u)); }
  .scene__cta { font-size: calc(40 * var(--u)); margin-top: calc(40 * var(--u)); }
}

/* --------------------------------------------------------------------------
   Animación de entrada (solo al cargar la página arriba del todo).
   Orden: negro → aparece el mapamundi → se forma la luz azul del fondo →
   baja el menú → letras ANZA (30) → sube el titular y su texto.
   js/main.js pone .is-intro en .page y la quita al terminar o al hacer scroll.
   -------------------------------------------------------------------------- */
@keyframes intro-fade { from { opacity: 0; } }
@keyframes intro-drop { from { transform: translateY(-101%); } }
@keyframes intro-rise { from { opacity: 0; transform: translateY(calc(70 * var(--u))); } }

.is-intro .hero__stage { background: #000; }
.is-intro .hero__map { animation: intro-fade 1.3s var(--soft) 0.15s backwards; }
.is-intro .hero__bg--1 { animation: intro-fade 1.6s var(--soft) 1s backwards; }
.is-intro .hero__drift { animation: intro-fade 2s var(--ease) 1s backwards; }
.is-intro .hero__screen { animation: intro-fade 1.6s var(--soft) 1.4s backwards; }
.is-intro .header { animation: intro-drop 0.9s var(--ease) 2.5s backwards; }
.is-intro .hero__big { animation: intro-fade 1.2s var(--soft) 2.7s backwards; }
.is-intro .scene--1 h1 { animation: intro-rise 1.1s var(--ease) 3s backwards; }
.is-intro .scene--1 p { animation: intro-rise 1.1s var(--ease) 3.2s backwards; }

/* --------------------------------------------------------------------------
   Fondo compartido por la red de partners y el cierre
   -------------------------------------------------------------------------- */
.flow {
  background: linear-gradient(to bottom, #383838 28.3%, #1438e0 60.7%);
}

/* --------------------------------------------------------------------------
   The partner network
   -------------------------------------------------------------------------- */
.network {
  padding: calc(158 * var(--u)) 0 0; /* sin hueco entre la última fila y el cierre */
  scroll-margin-top: calc(var(--header-h) - 60 * var(--u));
  overflow: hidden;
  overflow: clip;
}

.network__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 calc(40 * var(--u));
  text-align: center;
}

/* La etiqueta y el titular entran suavemente de abajo arriba al llegar con el scroll */
.page:not(.no-js) .network__intro > * {
  opacity: 0;
  transform: translateY(calc(70 * var(--u)));
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
}
.page:not(.no-js) .network__intro > :nth-child(2) { transition-delay: 0.14s; }
.page:not(.no-js) .network__intro.is-in > * { opacity: 1; transform: none; }

.network__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(251 * var(--u));
  height: calc(40 * var(--u));
  padding: 0 calc(8 * var(--u));
  background: var(--accent);
  color: #000;
  font-size: calc(24 * var(--u));
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.network__title {
  margin-top: calc(27 * var(--u));
  width: calc(1300 * var(--u));
  max-width: 100%;
  font-size: calc(58 * var(--u));
  letter-spacing: -0.06em;
}

.grid {
  position: relative;
  display: grid;
  /* cada tarjeta ocupa 2 pistas: así una última fila incompleta puede quedar centrada */
  grid-template-columns: repeat(calc(var(--cols) * 2), minmax(0, 1fr));
  margin: calc(66 * var(--u)) calc(35 * var(--u)) 0 calc(40 * var(--u));
  padding: 0;
  list-style: none;
}
.grid > .card { grid-column: span 2; }
/* Última fila incompleta: sus tarjetas se ensanchan hasta ocupar todo el ancho,
   con la misma altura que el resto (--px y --shift recolocan foto y texto). */
@media (min-width: 1025px) {
  .grid > .card:nth-last-child(2):nth-child(3n + 1),
  .grid > .card:last-child:nth-child(3n + 2) {
    grid-column: span 3;
    aspect-ratio: 3 / 2;
    --px: calc(100cqw / 825);
    --shift: 112.5;
  }
  .grid > .card:last-child:nth-child(3n + 1) {
    grid-column: span 6;
    aspect-ratio: 3 / 1;
    --px: calc(100cqw / 1650);
    --shift: 525;
  }
}
@media (min-width: 641px) and (max-width: 1024px) {
  .grid > .card:last-child:nth-child(2n + 1) {
    grid-column: span 4;
    aspect-ratio: 2 / 1;
    --px: calc(100cqw / 1100);
    --shift: 250;
  }
}

/* líneas horizontales a sangre, como en el diseño */
.grid::before,
.grid::after {
  content: "";
  position: absolute;
  left: -100vw;
  right: -100vw;
  height: 1px;
  background: var(--white);
  pointer-events: none;
}
.grid::before { top: 0; }
.grid::after { bottom: 0; }

@media (max-width: 1024px) {
  .network__title { font-size: calc(52 * var(--u)); }
}
@media (max-width: 640px) {
  .network { padding-top: calc(110 * var(--u)); }
  .network__intro { padding: 0 calc(25 * var(--u)); }
  .network__label { font-size: calc(22 * var(--u)); height: calc(38 * var(--u)); }
  .network__title { font-size: calc(40 * var(--u)); margin-top: calc(24 * var(--u)); }
  .grid { margin: calc(56 * var(--u)) calc(37 * var(--u)) 0; }
}

/* --------------------------------------------------------------------------
   Tarjeta de partner (diseño base: 550 × 550 px → 1 px = 100cqw / 550)
   -------------------------------------------------------------------------- */
.card {
  --px: calc(100cqw / 550);
  position: relative;
  aspect-ratio: 1 / 1;
  margin: 0 -1px -1px 0;
  overflow: hidden;
  container-type: inline-size;
  color: var(--accent);
}

/* Al pasar el ratón por el "+", la forma del retrato se extiende hasta ocupar toda
   la tarjeta y el retrato crece un poco. --blob-scale es la escala de la forma y
   --zoom la del retrato; se registran como números para poder animarlas. */
@property --blob-scale { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --zoom { syntax: "<number>"; inherits: true; initial-value: 1; }
@media (hover: hover) {
  .card:not(.is-open):has(.card__toggle:hover) .card__pic { --blob-scale: 2.8; --zoom: 1.04; }
}

.card__pic { transition: opacity 0.5s var(--ease), --blob-scale 0.9s var(--soft), --zoom 1.4s var(--soft); }

.card__pic,
.card__lines {
  position: absolute;
  left: calc((var(--shift, 0) - 25) * var(--px));
  top: calc(-26 * var(--px));
  width: calc(600 * var(--px));
  height: calc(600 * var(--px));
}

/* La mancha de la foto se aclara en las últimas filas y, a partir de la 4ª fila
   (fondo ya azulado), la bio usa un azul más claro. Depende de la posición en la
   lista, así que no hay que tocar nada al añadir, quitar o mover partners. */
.grid > .card:nth-child(n + 10) { --bio: #c5d0ff; }
.grid > .card:nth-child(n + 22) { --blob: 0.1; }
.grid > .card:nth-child(n + 28) { --blob: 0.03; }
.card__pic {
  background: rgba(0, 0, 0, var(--blob, 0.24));
  transform: scale(var(--blob-scale));
  transition: opacity 0.5s var(--ease), --blob-scale 0.9s var(--soft), --zoom 0.9s var(--soft);
}
.card__pic img {
  /* compensa la escala de la forma, para que el retrato solo crezca lo que marca --zoom */
  transform: scale(calc(var(--zoom) / var(--blob-scale)));
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.card__lines {
  overflow: visible;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.5s var(--ease), transform 0.8s var(--ease);
  pointer-events: none;
}

.card__name {
  position: absolute;
  left: calc(16.3 * var(--px));
  /* --fit (1 = tamaño normal) lo reduce js/main.js si un nombre largo no cabe en la tarjeta;
     el texto se mantiene apoyado abajo */
  top: calc((325 + 190 * (1 - var(--fit, 1))) * var(--px));
  width: calc(600 * var(--px));
  height: calc(220 * var(--px));
  font-size: calc(100 * var(--px) * var(--fit, 1));
  line-height: normal;
  white-space: pre;
  pointer-events: none;
}
/* dos líneas: nombre (1er span) y apellido (2º span) */
.card__name span { position: absolute; left: 0; letter-spacing: -0.06em; }
.card__name span:first-child { top: 0.11em; }
.card__name span:last-child { top: 0.86em; }
/* "A" especial: va en la línea, apoyada en la línea base, con la misma separación
   respecto a las letras vecinas en todos los nombres. */
.card__name .a {
  position: static;
  display: inline-block;
  vertical-align: baseline;
  width: 0.82em;
  height: 0.7em;
  margin: 0 -0.13em 0 -0.085em;
  fill: currentColor;
}
.card__name .a--first { margin-left: 0; }

.card__bio {
  /* mismo margen a izquierda y derecha, y por debajo del botón de cerrar */
  position: absolute;
  left: calc(32 * var(--px));
  right: calc(32 * var(--px));
  top: calc(92 * var(--px));
  max-height: calc(240 * var(--px));
  overflow: hidden;
  font-size: calc(24 * var(--px) * var(--fit, 1));
  line-height: 1.33;
  letter-spacing: -0.06em;
  text-align: justify;
  hyphens: auto;
  color: var(--bio, var(--accent));
  opacity: 0;
  transform: translateY(calc(14 * var(--px)));
  transition: opacity 0.4s var(--ease), transform 0.6s var(--ease);
  pointer-events: none;
}

.card__toggle {
  position: absolute;
  top: calc(26 * var(--px));
  right: calc(26 * var(--px));
  width: calc(48 * var(--px));
  height: calc(48 * var(--px));
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  display: none;
  place-items: center;
  background: transparent;
  border: calc(3 * var(--px)) solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, opacity 0.6s var(--ease);
}
/* amplía la zona pulsable sin cambiar el tamaño visible */
.card__toggle::after { content: ""; position: absolute; inset: -10px; }
.card__toggle svg {
  width: 56%;
  height: auto;
  fill: currentColor;
  transition: transform 0.5s var(--ease);
}
@media (hover: hover) {
  .card__toggle:hover { background: var(--accent); color: var(--grey); }
}

/* Líneas blancas de cada tarjeta: dos trazos en L que se dibujan al llegar con
   el scroll (arriba + izquierda desde una esquina, derecha + abajo desde la otra). */
.card::before,
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0 solid var(--white);
  pointer-events: none;
  transition: clip-path 1.5s var(--soft);
}
.card::before { border-width: 1px 0 0 1px; clip-path: inset(0); }
.card::after { border-width: 0 1px 1px 0; clip-path: inset(0); transition-delay: 0.25s; }
.page:not(.no-js) .card:not(.is-visible)::before { clip-path: inset(0 100% 100% 0); }
.page:not(.no-js) .card:not(.is-visible)::after { clip-path: inset(0 0 100% 100%); }

/* Contenido de la tarjeta: entra desde abajo con un fundido lento, después de las líneas
   (js/main.js añade .is-visible cuando la tarjeta entra en pantalla). */
@keyframes card-rise {
  from { opacity: 0; transform: translateY(calc(var(--rise, 40) * var(--px))); }
}
@keyframes card-fade { from { opacity: 0; } }
.page:not(.no-js) .card:not(.is-visible) .card__pic,
.page:not(.no-js) .card:not(.is-visible) .card__name,
.page:not(.no-js) .card:not(.is-visible) .card__toggle { opacity: 0; }
.card.is-visible .card__pic { --rise: 44; animation: card-rise 1.5s var(--soft) 0.3s backwards; }
.card.is-visible .card__name { --rise: 26; animation: card-rise 1.4s var(--soft) 0.5s backwards; }
.card.is-visible .card__toggle { animation: card-fade 1s var(--soft) 0.9s backwards; }

/* Líneas horizontales a sangre: también se trazan de izquierda a derecha */
.page:not(.no-js) .grid::before,
.page:not(.no-js) .grid::after { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.8s var(--soft); }
.page:not(.no-js) .grid.is-in::before,
.page:not(.no-js) .grid.is-end::after { transform: none; }

.card.has-bio { cursor: pointer; }
.card.has-bio .card__toggle { display: grid; }
.card.is-open .card__pic { opacity: 0; --blob-scale: 1.04; --zoom: 1.04; }
.card.is-open .card__lines { opacity: 0.3; transform: none; } /* tenue para que la bio se lea bien encima */
.card.is-open .card__bio { opacity: 1; transform: none; transition-delay: 0.15s; }
.card.is-open .card__toggle svg { transform: rotate(45deg); }
.card.is-open .card__toggle { border-color: var(--bio, var(--accent)); color: var(--bio, var(--accent)); }

/* --------------------------------------------------------------------------
   Cierre / contacto
   -------------------------------------------------------------------------- */
.closing {
  position: relative;
  /* ocupa justo la pantalla; texto y botón centrados en alto en la zona visible bajo el menú */
  min-height: 100vh;
  padding: var(--header-h) calc(40 * var(--u)) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--blue);
  scroll-margin-top: var(--header-h);
}

.closing__rider {
  position: absolute;
  left: 0;
  top: calc(66 * var(--u));
  width: 100%;
  height: calc(100% - 66 * var(--u));
  object-fit: cover;
  object-position: 50% 0;
  mix-blend-mode: overlay;
  opacity: 0.31;
  transition: opacity 1.4s var(--ease);
  z-index: -3;
}

.closing__sun {
  position: absolute;
  left: 50%;
  top: calc(895 * var(--u));
  width: calc(587 * var(--u));
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 calc(42 * var(--u)) calc(7 * var(--u)) var(--accent);
  mix-blend-mode: hard-light;
  transform: translate(-50%, -50%);
  transition: top 1.6s var(--ease), width 1.6s var(--ease);
  z-index: -2;
}

.closing__haze {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(81, 112, 255) 0%, rgba(20, 56, 224, 0) 50%);
  opacity: 0.08;
  transition: opacity 1.4s var(--ease);
  z-index: -1;
}

.closing p,
.closing__cta {
  opacity: 0;
  transform: translateY(calc(160 * var(--u)));
  transition: opacity 0.9s var(--ease), transform 1.3s var(--ease);
}

.closing__lead {
  width: calc(902 * var(--u));
  max-width: 100%;
  font-size: calc(58 * var(--u));
  letter-spacing: -0.06em;
  line-height: 1.33;
  color: rgba(255, 255, 255, 0.5);
}
.closing__main {
  margin-top: calc(12 * var(--u));
  width: calc(963 * var(--u));
  max-width: 100%;
  font-size: calc(59 * var(--u));
  letter-spacing: -0.06em;
  line-height: 1.33;
  transition-delay: 0.12s;
}
.closing__cta {
  margin-top: calc(44 * var(--u));
  padding: calc(8 * var(--u)) calc(16 * var(--u));
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(81, 112, 255, 0.35);
  font-size: calc(24 * var(--u));
  letter-spacing: -0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 0.9s var(--ease) 0.24s, transform 1.3s var(--ease) 0.24s, background-color 0.3s;
}
.closing__cta:hover { background: rgba(81, 112, 255, 0.75); }
.closing__cta { color: var(--white); cursor: pointer; }
.closing__cta.is-copied {
  /* muestra el email tal cual, seleccionable por si el copiado automático falla */
  text-transform: none;
  letter-spacing: -0.03em;
  -webkit-user-select: all;
  user-select: all;
}

.closing.is-in .closing__rider { opacity: 1; }
.closing.is-in .closing__haze { opacity: 1; }
.closing.is-in .closing__sun { top: calc(681 * var(--u)); width: calc(1495 * var(--u)); }
.closing.is-in p,
.closing.is-in .closing__cta { opacity: 1; transform: none; }

@media (max-width: 1024px) {
  /* tablet: texto y botón centrados en alto y ancho en la zona visible bajo el menú */
  .closing { min-height: 100vh; justify-content: center; padding: var(--header-h) calc(40 * var(--u)) 0; }
  .closing__lead, .closing__main { font-size: calc(52 * var(--u)); }
}
@media (max-width: 640px) {
  .closing {
    min-height: max(calc(1000 * var(--u)), 100vh);
    /* texto y botón centrados en alto en la zona visible bajo el menú */
    justify-content: center;
    padding: var(--header-h) calc(25 * var(--u)) 0;
  }
  .closing__rider { object-position: 46% 0; }
  .closing__lead, .closing__main { font-size: calc(40 * var(--u)); }
  .closing__cta { font-size: calc(24 * var(--u)); padding: calc(12 * var(--u)) calc(22 * var(--u)); }
  .closing.is-in .closing__sun { top: calc(640 * var(--u)); width: calc(1250 * var(--u)); }
}

/* --------------------------------------------------------------------------
   Sin JavaScript, o con "reducir movimiento" activado
   -------------------------------------------------------------------------- */
.no-js .hero { height: auto; }
.no-js .hero__stage { position: relative; }
.no-js .closing p,
.no-js .closing__cta { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__light, .hero__smoke, .hero__lights i, .hero__route--dots path, .hero__route--flow path { animation: none; }
  .hero__route--flow { display: none; }
  .hero__shine { display: none; }
  .card.is-visible .card__pic, .card.is-visible .card__name, .card.is-visible .card__toggle { animation: none; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
