/* ==========================================================================
   AlfaSTEAM — hoja de estilo de la portada (alfasteam.org)
   Ronda 2 (2026-08-12): rediseño CON cambio de estructura, autorizado por el
   usuario. La ronda 1 fue solo-CSS y "se veía casi igual" — con razón: la
   primera pantalla era la barra + un hero de 100vh prácticamente vacío, así
   que todo el trabajo caía fuera de lo primero que se ve.

   Reglas del proyecto que se respetan aquí:
   - Azul de marca #36A9E1, muestreado del logo (no inventado).
   - SIN DEGRADADOS. Colores planos, siempre.
   - La aparición al bajar va en el CONTENEDOR y el hover en el HIJO: una
     animación con fill-mode:both le gana al transform del :hover, y ya mordió
     en Hackathon, Iberociencias, SOLACYT y AlfaSTEAM.
   ========================================================================== */

:root {
  --azul:        #36A9E1;   /* marca, del logo */
  --azul-hondo:  #1B7FB0;
  --azul-tenue:  #EAF6FC;
  --verde:       #3AAA35;   /* las 4 disciplinas STEAM, del logo */
  --rojo:        #E6332A;
  --morado:      #662483;
  --naranja:     #F39200;
  --tinta:       #14212B;
  --gris:        #5C6B76;
  --linea:       #E3E9ED;
  --papel:       #FFFFFF;
  --hueso:       #F6F9FB;
  --radio:       16px;
  --sombra:      0 1px 2px rgba(20,33,43,.06), 0 8px 24px rgba(20,33,43,.08);
  --sombra-alta: 0 2px 4px rgba(20,33,43,.08), 0 18px 40px rgba(20,33,43,.14);
}

* { font-family: 'Poppins', sans-serif; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--tinta);
  background: var(--papel);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;               /* nada de scroll horizontal */
}

h1, h2, h3, .titulo { font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }

a { color: var(--azul-hondo); text-decoration: none; }
a:hover { color: var(--azul); text-decoration: underline; }

.envoltura { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Barra de anuncio ------------------------------------------- */
.barra-anuncio {
  background: var(--azul);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  padding: 10px 16px;
}
.barra-anuncio a { color: #fff; text-decoration: underline; font-weight: 600; }
.barra-anuncio a:hover { color: #fff; opacity: .85; }

/* ---------- Cabecera ---------------------------------------------------- */
.cabecera {
  position: sticky; top: 0; z-index: 1030;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--linea);
}
.cabecera-fila { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.marca img { display: block; width: 168px; height: auto; }
.nav-escritorio { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-enlace {
  display: inline-block; padding: 9px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--tinta);
  text-transform: uppercase; letter-spacing: .02em; transition: background .18s, color .18s;
}
.nav-enlace:hover { background: var(--azul-tenue); color: var(--azul-hondo); text-decoration: none; }
.nav-cta {
  background: var(--azul); color: #fff !important;
  padding: 10px 20px; border-radius: 999px;
}
.nav-cta:hover { background: var(--azul-hondo); text-decoration: none; }

.abrir-menu {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--linea); border-radius: 10px;
  padding: 8px 11px; cursor: pointer; line-height: 0;
}
.abrir-menu span { display: block; width: 20px; height: 2px; background: var(--tinta); margin: 4px 0; border-radius: 2px; }

/* ---------- Portada ----------------------------------------------------- */
.portada { position: relative; padding: 76px 0 56px; background: var(--hueso); overflow: hidden; }
.portada-cuerpo { position: relative; z-index: 2; max-width: 760px; }
.pastilla {
  display: inline-block; background: var(--azul-tenue); color: var(--azul-hondo);
  font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 999px; margin-bottom: 20px;
}
.portada h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); margin: 0 0 20px; }
.portada h1 .resalte { color: var(--azul); }
.portada-bajada { font-size: clamp(1rem, 2.1vw, 1.2rem); color: var(--gris); margin: 0 0 32px; max-width: 620px; }
.portada-botones { display: flex; flex-wrap: wrap; gap: 12px; }

.boton {
  display: inline-block; padding: 14px 28px; border-radius: 999px;
  font-size: 15px; font-weight: 600; border: 2px solid transparent;
  cursor: pointer; transition: background .18s, color .18s, border-color .18s;
}
.boton-lleno { background: var(--azul); color: #fff; }
.boton-lleno:hover { background: var(--azul-hondo); color: #fff; text-decoration: none; }
.boton-linea { background: transparent; color: var(--tinta); border-color: var(--linea); }
.boton-linea:hover { border-color: var(--azul); color: var(--azul-hondo); text-decoration: none; }

/* Figuras decorativas: planas, sin degradado */
.figura { position: absolute; border-radius: 50%; opacity: .10; pointer-events: none; z-index: 1; }
.figura-1 { width: 320px; height: 320px; background: var(--azul);   top: -110px; right: -70px; }
.figura-2 { width: 200px; height: 200px; background: var(--naranja); bottom: -80px; right: 190px; }
.figura-3 { width: 140px; height: 140px; background: var(--verde);   top: 130px;  right: 300px; }

/* ---------- Secciones --------------------------------------------------- */
/* El ancla debe aterrizar DEBAJO de la cabecera sticky. Sin esto, #servicios y
   #certificacion sí saltaban, pero el título quedaba tapado por la barra y
   parecía que el enlace no hacía nada. */
section[id] { scroll-margin-top: 88px; }

.seccion { padding: 76px 0; }
.seccion-hueso { background: var(--hueso); }
.seccion-encabezado { max-width: 660px; margin: 0 0 44px; }
.seccion-encabezado.centrado { margin-left: auto; margin-right: auto; text-align: center; }
.seccion-etiqueta {
  display: block; color: var(--azul); font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px;
}
.seccion-encabezado h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 0 0 14px; }
.seccion-encabezado p { color: var(--gris); margin: 0; font-size: 1.02rem; }

/* ---------- Tarjetas de servicio --------------------------------------- */
.rejilla-servicios {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.tarjeta {
  display: flex; flex-direction: column; height: 100%;
  background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 28px 22px 24px; text-align: center;
  border-top: 4px solid var(--azul);
  box-shadow: var(--sombra);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.tarjeta:hover { transform: translateY(-6px); box-shadow: var(--sombra-alta); text-decoration: none; }
.tarjeta-icono { height: 92px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.tarjeta-icono img { max-height: 92px; max-width: 100%; width: auto; }
.tarjeta h3 { font-size: 1rem; margin: 0 0 8px; color: var(--tinta); }
.tarjeta p { font-size: .88rem; color: var(--gris); margin: 0; line-height: 1.5; }
.tarjeta .enlace-tarjeta {
  margin-top: auto; padding-top: 16px;
  font-size: .84rem; font-weight: 700; color: var(--azul-hondo);
}
/* Un acento STEAM por tarjeta (los 4 colores del logo + el azul de marca) */
.acento-azul    { border-top-color: var(--azul); }
.acento-verde   { border-top-color: var(--verde); }
.acento-rojo    { border-top-color: var(--rojo); }
.acento-morado  { border-top-color: var(--morado); }
.acento-naranja { border-top-color: var(--naranja); }
.acento-azul:hover    { border-color: var(--azul); }
.acento-verde:hover   { border-color: var(--verde); }
.acento-rojo:hover    { border-color: var(--rojo); }
.acento-morado:hover  { border-color: var(--morado); }
.acento-naranja:hover { border-color: var(--naranja); }

/* Enlaces sueltos que vivían bajo el logo de Institución STEAM en la portada
   original (Rúbrica Holística y FAQ) — se conservan, con forma de pastilla. */
.enlaces-extra { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 30px; }
.enlaces-extra a {
  display: inline-block; padding: 9px 20px; border-radius: 999px;
  border: 1px solid var(--linea); background: var(--papel);
  font-size: .88rem; font-weight: 600; color: var(--azul-hondo);
  transition: border-color .18s, background .18s;
}
.enlaces-extra a:hover { border-color: var(--azul); background: var(--azul-tenue); text-decoration: none; }

/* ---------- Cifras ------------------------------------------------------ */
.rejilla-cifras { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cifra { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 28px 22px; text-align: center; }
.cifra-numero { display: block; font-size: 2.3rem; font-weight: 700; color: var(--azul); line-height: 1; margin-bottom: 8px; }
.cifra-texto { font-size: .9rem; color: var(--gris); }

/* ---------- Acordeón de certificaciones -------------------------------- */
.acordeon { max-width: 900px; margin: 0 auto; }
.acordeon details {
  background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio);
  margin-bottom: 14px; overflow: hidden;
}
.acordeon details[open] { border-color: var(--azul); box-shadow: var(--sombra); }
.acordeon summary {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 22px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 1.02rem; color: var(--tinta);
  transition: background .18s;
}
.acordeon summary::-webkit-details-marker { display: none; }
.acordeon summary:hover { background: var(--azul-tenue); }
.acordeon summary::after {
  content: '+'; margin-left: auto; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--azul-tenue); color: var(--azul-hondo);
  font-size: 19px; font-weight: 700; line-height: 30px; text-align: center;
  transition: background .18s, color .18s;
}
.acordeon details[open] summary::after { content: '\2212'; background: var(--azul); color: #fff; }
.insignia {
  flex-shrink: 0; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 5px 11px; border-radius: 999px;
  background: var(--azul); color: #fff;
}
.insignia-platino { background: var(--morado); }
.acordeon-cuerpo { padding: 4px 22px 24px; border-top: 1px solid var(--linea); }
.acordeon-cuerpo p { color: var(--gris); font-size: .95rem; margin: 18px 0; }
.galeria { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: 18px; }
.galeria img { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; display: block; }

/* ---------- Aliados ----------------------------------------------------- */
.aliados { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 52px; }
.aliados img { height: 74px; width: auto; opacity: .62; transition: opacity .22s; }
.aliados img:hover { opacity: 1; }

/* ---------- Cierre ------------------------------------------------------ */
.cierre { background: var(--azul); color: #fff; text-align: center; padding: 68px 0; }
.cierre h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin: 0 0 14px; color: #fff; }
.cierre p { margin: 0 0 28px; opacity: .93; font-size: 1.02rem; }
.cierre .boton-lleno { background: #fff; color: var(--azul-hondo); }
.cierre .boton-lleno:hover { background: var(--hueso); color: var(--azul-hondo); }

/* ---------- Pie --------------------------------------------------------- */
.pie { background: var(--tinta); color: rgba(255,255,255,.66); padding: 44px 0 28px; font-size: .9rem; }
.pie-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.pie a { color: rgba(255,255,255,.66); }
.pie a:hover { color: #fff; }
.pie-derecha { margin-left: auto; }
.social-icons .icon {
  display: inline-block; height: 2.1rem; width: 2.1rem; margin-left: 8px;
  background-position: center; background-repeat: no-repeat; background-size: contain;
}
.facebook  { background-image: url(../images/facebook.png); }
.twitter   { background-image: url(../images/twitter.png); }
.instagram { background-image: url(../images/instagram.png); }
.social-icons-gray .icon { filter: invert(1); opacity: .5; transition: opacity .18s; }
.social-icons-gray .icon:hover { opacity: 1; }

/* ---------- Menú de celular (se conserva el mecanismo original) --------- */
.menu-mobile {
  display: inline-block; height: 100vh; width: 0px; overflow-x: hidden;
  position: fixed; left: 0; top: 0; z-index: 1050; padding: 0;
  background: var(--tinta); transition: .5s ease-in-out;
}
.show-menu { padding: 3rem 2rem; width: 100%; }
.menu-mobile .btn-close { display: inline-block; width: 3rem; position: absolute; right: 2rem; top: 2rem; cursor: pointer; }
.menu-mobile .marca-movil img { width: 168px; margin-bottom: 2.5rem; }
.menu-mobile a.enlace-movil {
  display: block; color: #fff; font-size: 1.15rem; font-weight: 600;
  padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.12); text-transform: uppercase;
}
.menu-mobile a.enlace-movil:hover { color: var(--azul); text-decoration: none; }

/* ---------- Aparición al bajar ------------------------------------------
   Va en el CONTENEDOR (.aparece). El hover vive en el hijo (.tarjeta), para
   que el fill-mode de esta animación no le gane al transform del :hover.     */
.aparece { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.aparece.visible { opacity: 1; transform: none; }
.aparece:nth-child(2) { transition-delay: .07s; }
.aparece:nth-child(3) { transition-delay: .14s; }
.aparece:nth-child(4) { transition-delay: .21s; }
.aparece:nth-child(5) { transition-delay: .28s; }

/* ---------- Entrada de la portada al cargar -----------------------------
   Secuencia escalonada, una sola vez. Va en elementos DISTINTOS a los que
   tienen hover, por la misma razón de siempre.                              */
@keyframes entra { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.portada-cuerpo > * { opacity: 0; animation: entra .7s cubic-bezier(.22,.61,.36,1) forwards; }
.portada-cuerpo > .pastilla        { animation-delay: .05s; }
.portada-cuerpo > h1               { animation-delay: .15s; }
.portada-cuerpo > .portada-bajada  { animation-delay: .27s; }
.portada-cuerpo > .portada-botones { animation-delay: .39s; }

/* Las figuras del fondo respiran, muy lento y muy sutil. Sin degradados. */
@keyframes flota { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-22px); } }
.figura-1 { animation: flota 13s ease-in-out infinite; }
.figura-2 { animation: flota 17s ease-in-out infinite .8s; }
.figura-3 { animation: flota 10s ease-in-out infinite 1.4s; }

/* El icono de la tarjeta acompaña al hover de su tarjeta. */
.tarjeta-icono img { transition: transform .28s cubic-bezier(.22,.61,.36,1); }
.tarjeta:hover .tarjeta-icono img { transform: scale(1.07); }
.tarjeta .enlace-tarjeta { transition: letter-spacing .2s; }
.tarjeta:hover .enlace-tarjeta { letter-spacing: .03em; }

/* Subrayado que crece bajo el enlace activo de la barra. */
.nav-enlace { position: relative; }
.nav-enlace::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; background: var(--azul); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .24s ease;
}
.nav-enlace.activo::after { transform: scaleX(1); }
.nav-cta::after { display: none; }

/* Foco visible para teclado — no se hereda del tema, hay que ponerlo. */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--azul); outline-offset: 3px; border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aparece { opacity: 1; transform: none; transition: none; }
  .tarjeta, .aliados img, .boton { transition: none; }
  .tarjeta:hover { transform: none; }
  .portada-cuerpo > * { opacity: 1; animation: none; }
  .figura-1, .figura-2, .figura-3 { animation: none; }
  .tarjeta:hover .tarjeta-icono img { transform: none; }
  .nav-enlace::after { transition: none; }
}

/* ---------- Celular ----------------------------------------------------- */
@media (max-width: 860px) {
  .nav-escritorio { display: none; }
  .abrir-menu { display: block; }
  .marca img { width: 138px; }
  .portada { padding: 52px 0 44px; }
  .seccion { padding: 54px 0; }
  .figura-1, .figura-2, .figura-3 { display: none; }
  .pie-derecha { margin-left: 0; }
  .pie-fila { justify-content: center; text-align: center; }
  .aliados { gap: 30px; }
  .aliados img { height: 54px; }
  .galeria img { height: 128px; }
}
