/* Versión C: efectos y transiciones sobre la versión B.
   Todo respeta prefers-reduced-motion. Sin JS, el sitio se ve como la B. */

/* Encabezado fijo que se compacta al bajar */
.encabezado {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow .3s ease, background-color .3s ease;
  view-transition-name: encabezado;
}
.encabezado .contenedor { transition: padding .3s ease; }
.logo-fed { transition: width .3s ease, height .3s ease; }
.marca-nombre { transition: opacity .3s ease, max-height .3s ease; max-height: 2.4em; overflow: hidden; }
.compacto .encabezado {
  background: color-mix(in srgb, var(--superficie) 86%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
          backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 6px 24px rgba(8, 22, 34, 0.12);
}
.compacto .encabezado .contenedor { padding-block: 0.45rem; }
.compacto .logo-fed { width: 2.5rem; height: 2.5rem; }
@media (min-width: 761px) { .compacto .marca-nombre { opacity: 0; max-height: 0; } }

/* Subrayado animado en el menú */
.nav a { position: relative; border-bottom-color: transparent !important; }
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--senal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Barra de carga al navegar */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  z-index: 100;
  background: linear-gradient(90deg, var(--senal), #e8a33d);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  pointer-events: none;
}
.cargando body::before { opacity: 1; transform: scaleX(0.7); transition: transform 1.2s cubic-bezier(.1,.6,.2,1); }

/* Portada: entrada del texto y foto con zoom lento */
@keyframes subir { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes acercar { from { scale: 1.12; } to { scale: 1.02; } }
.hero-texto > * { animation: subir .9s cubic-bezier(.2,.7,.2,1) both; }
.hero-texto > :nth-child(1) { animation-delay: .05s; }
.hero-texto > :nth-child(2) { animation-delay: .18s; }
.hero-texto > :nth-child(3) { animation-delay: .32s; }
.hero-texto > :nth-child(4) { animation-delay: .46s; }
.hero-lado { overflow: hidden; }
.hero-lado img { animation: acercar 9s cubic-bezier(.2,.6,.2,1) both; will-change: scale, translate; }
@media (min-width: 761px) {
  /* El degradé va en el contenedor, así el zoom no corta el fundido */
  .hero-lado {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 16%);
            mask-image: linear-gradient(to right, transparent 0%, #000 16%);
  }
  .hero-lado img { -webkit-mask-image: none; mask-image: none; }
}
.cabecera.con-foto .contenedor > * { animation: subir .8s cubic-bezier(.2,.7,.2,1) both; }
.cabecera.con-foto .contenedor > :nth-child(2) { animation-delay: .15s; }
.cabecera.con-foto > img, .banda-foto > img { scale: 1.18; will-change: translate; }

/* Aparición al hacer scroll (la activa efectos.js) */
.efectos .revelar {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.efectos .revelar.visible { opacity: 1; transform: none; }
.efectos .mosaico li.revelar { transform: translateY(32px) scale(.96); }
.efectos .mosaico li.revelar.visible { transform: none; }

/* Collage: zoom y brillo al pasar el mouse */
.mosaico li { overflow: hidden; }
.mosaico li img { transition: transform .9s cubic-bezier(.2,.7,.2,1), filter .5s ease; }
.mosaico li:hover img { transform: scale(1.08); filter: saturate(1.15) brightness(1.05); }
.mosaico li::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .9s ease;
}
.mosaico li:hover::before { transform: translateX(120%); }

/* Tarjetas que se elevan */
.cargos li, .club, .contacto-bloque, .tira a {
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease, border-color .35s ease;
}
.cargos li:hover, .club:hover, .contacto-bloque:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(8, 22, 34, 0.14);
  border-color: var(--rio);
}
.tira a:hover { transform: translateY(-4px); }

/* Botones con brillo */
.boton { position: relative; overflow: hidden; transition: background-color .25s, color .25s, border-color .25s, transform .25s; }
.boton:hover { transform: translateY(-2px); }
.boton:active { transform: translateY(0); }

/* Cifras: aparecen escalonadas, una tras otra */
.efectos .cifra.revelar { transition-duration: 1s; transition-delay: calc(var(--i, 0) * 180ms + 100ms); }

/* Transición entre páginas (navegadores con View Transitions) */
@keyframes vt-sale { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-entra { from { opacity: 0; transform: translateY(14px); } }
::view-transition-old(root) { animation: vt-sale .22s ease both; }
::view-transition-new(root) { animation: vt-entra .38s cubic-bezier(.2,.7,.2,1) both; }

/* Celular: margen extra en la foto de portada para la inclinación */
@media (max-width: 760px) {
  @keyframes acercar { from { scale: 1.14; } to { scale: 1.07; } }
}

@media (prefers-reduced-motion: reduce) {
  .hero-texto > *, .hero-lado img, .cabecera.con-foto .contenedor > * { animation: none !important; }
  .efectos .revelar { opacity: 1 !important; transform: none !important; }
  .cabecera.con-foto > img, .banda-foto > img { scale: 1; translate: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
