/* ============= NAVEGACION Y CABECERAS ============= */
.menu-principal__enlace {
  position: relative;
  padding: 0.8rem 0.15rem;
  color: var(--texto-suave);
  font-size: 0.72rem;
  font-weight: 600;
}
.menu-principal__enlace::after {
  content: "";
  position: absolute;
  bottom: 0.52rem;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--texto);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transicion), background var(--transicion);
}
.menu-principal__enlace.activo {
  color: var(--coral);
}
.menu-principal__enlace:hover {
  color: var(--coral);
}
.menu-principal__enlace.activo::after,
.menu-principal__enlace:hover::after {
  background: var(--coral);
}
.menu-principal__enlace.activo::after,
.menu-principal__enlace:hover::after {
  transform: scaleX(1);
}
.boton-hamburguesa {
  display: none;
  background: none;
  border: 0;
  padding: 0.5rem 0;
  width: 2.3rem;
}
.boton-hamburguesa span {
  display: block;
  height: 2px;
  background: var(--texto);
  margin: 0.35rem 0;
  transition:
    transform var(--transicion),
    opacity var(--transicion);
}
.boton-hamburguesa.abierto span:nth-child(1) {
  transform: translateY(0.7rem) rotate(45deg);
}
.boton-hamburguesa.abierto span:nth-child(2) {
  opacity: 0;
}
.boton-hamburguesa.abierto span:nth-child(3) {
  transform: translateY(-0.7rem) rotate(-45deg);
}
.grupo-botones {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ============= HABILIDADES ============= */
.lista-habilidades {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.1rem;
}
.habilidad {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}
.habilidad__icono {
  display: grid;
  place-items: center;
  width: 2.9rem;
  aspect-ratio: 1;
  border-radius: 0.38rem;
  border: 1px solid var(--texto-suave);
  background: var(--superficie);
  font-size: 0.75rem;
  font-weight: 700;
}
.habilidad strong {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
}
.habilidad small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: var(--texto-suave);
}
.nota-habilidades {
  margin-top: 1.5rem;
  font-size: 0.72rem;
  color: var(--texto-suave);
}

/* Los cuadrados de las dos tarjetas de Sobre mi alternan los acentos. */
.informacion-sobre__habilidades .habilidad:nth-child(odd) .habilidad__icono {
  border-color: var(--coral);
}
.informacion-sobre__habilidades .habilidad:nth-child(even) .habilidad__icono {
  border-color: var(--cian);
}

/* ============= FILTROS Y TARJETAS ============= */
.selector-categoria {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--texto);
  padding: 0.78rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  transition:
    background var(--transicion),
    border-color var(--transicion),
    color var(--transicion),
    font-weight var(--transicion);
}
.selector-categoria:hover {
  border-color: var(--cian);
  color: var(--cian);
  background: rgba(28, 174, 191, 0.07);
}
.selector-categoria.activo,
.selector-categoria.activo:hover {
  border-color: var(--coral);
  color: var(--coral);
  font-weight: 700;
  background: rgba(227, 81, 64, 0.08);
}
.tarjetas-proyectos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--separacion);
  margin-top: 1.4rem;
}
.tarjeta-proyecto {
  min-width: 0;
  position: relative;
  padding: clamp(0.6rem, 0.85vw, 0.9rem);
  border: 1px solid rgba(241, 238, 233, 0.22);
  border-radius: 0.55rem;
  background: rgba(11, 15, 18, 0.5);
  transition: background 300ms ease, border-color 300ms ease,
              box-shadow 300ms ease, transform 420ms cubic-bezier(.22,1.45,.36,1);
}
.tarjeta-proyecto:hover,
.tarjeta-proyecto:focus-within {
  background: #0b0f12;
  border-color: var(--coral);
  box-shadow: inset 0 0 0 1px var(--coral), 0 0.65rem 1.6rem rgba(11,15,18,.45);
}
.tarjeta-proyecto__accion {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
.tarjeta-proyecto__imagen {
  width: 100%;
  aspect-ratio: 2.28/1;
  border: 1px solid rgba(241, 238, 233, 0.24);
  border-radius: 0.38rem;
  background: var(--superficie);
  transition: border-color 300ms ease, box-shadow 300ms ease;
}
/* Las tarjetas muestran la imagen limpia, sin diagonales ni etiquetas provisionales. */
.tarjeta-proyecto__imagen::before,
.tarjeta-proyecto__imagen::after { content: none; }
.tarjeta-proyecto__imagen .imagen-real {
  position: absolute;
  inset: 2.5% 0 auto;
  width: 100%;
  height: 95%;
  max-height: 95%;
  object-fit: contain;
}
.tarjeta-proyecto:hover .tarjeta-proyecto__imagen,
.tarjeta-proyecto:focus-within .tarjeta-proyecto__imagen {
  border-color: var(--coral);
  box-shadow: inset 0 0 0 1px var(--coral);
}
.tarjeta-proyecto__titulo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.65rem;
  margin-top: 0.65rem;
  font-size: 0.85rem;
  font-weight: 700;
}
.tarjeta-proyecto__descripcion {
  margin-top: 0.35rem;
  max-width: 36ch;
  font-size: 0.84rem;
  color: var(--texto-suave);
}
@media (hover: hover) {
  .tarjeta-proyecto:hover { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .tarjeta-proyecto { transition: background 300ms ease, border-color 300ms ease; }
  .tarjeta-proyecto:hover { transform: none; }
}

/* ============= CONTACTO Y FOOTER ============= */
/* Cada enlace es un CTA secundario; el circulo espera el SVG definitivo. */
.fila-contacto {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(241, 238, 233, 0.35);
  border-radius: 0.38rem;
  background: rgba(11, 15, 18, 0.28);
  color: var(--texto);
  font-size: 0.88rem;
  text-align: left;
  transition: border-color var(--transicion), color var(--transicion), background var(--transicion);
}
.fila-contacto__icono {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 1.75rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: rgba(241, 238, 233, 0.08);
  transition: border-color var(--transicion), background var(--transicion);
}
.fila-contacto:hover {
  border-color: var(--cian);
  color: var(--cian);
  background: rgba(28, 174, 191, 0.07);
}
.fila-contacto:hover .fila-contacto__icono {
  background: rgba(28, 174, 191, 0.13);
}
.linea-bicolor {
  display: flex;
  width: 12rem;
  height: 0.2rem;
}
.linea-bicolor span {
  width: 50%;
  background: var(--coral);
}
.linea-bicolor span + span {
  background: var(--cian);
}

/* ============= HERRAMIENTAS, PROCESOS Y GALERIA ============= */
/* Herramientas reutilizan los cuadrados del componente Habilidad. */
.lista-herramientas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 0.45rem;
}
.herramienta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
  font-size: 0.77rem;
  color: var(--texto);
}
.herramienta__simbolo {
  flex: 0 0 auto;
  width: 2.9rem;
  height: 2.9rem;
  font-size: 0.72rem;
}
.herramienta__nombre {
  display: block;
  min-width: 0;
  width: 100%;
  overflow-wrap: anywhere;
  font-weight: 700;
}
.lista-herramientas .herramienta:nth-child(4n + 1) .herramienta__simbolo,
.lista-herramientas .herramienta:nth-child(4n) .herramienta__simbolo {
  border-color: var(--coral);
}
.lista-herramientas .herramienta:nth-child(4n + 2) .herramienta__simbolo,
.lista-herramientas .herramienta:nth-child(4n + 3) .herramienta__simbolo {
  border-color: var(--cian);
}
.herramienta__nota {
  display: none;
  font-size: 0.55rem;
  color: var(--texto-suave);
  font-weight: 400;
}
/* ============= PROCESO / DESIGN THINKING ============= */
.linea-proceso {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: 0.8rem;
  margin-top: 1.4rem;
}
.etapa-proceso {
  min-width: 0;
  padding: 1.1rem 0.95rem;
  text-align: left;
  border: 1px solid var(--coral);
  border-radius: 0.55rem;
  background: rgba(30, 37, 45, 0.42);
}
.etapa-proceso:nth-child(even) { border-color: var(--cian); }
.etapa-proceso__numero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  margin-bottom: 0.7rem;
  background: var(--coral);
  color: var(--fondo);
  font-size: 0.7rem;
  font-weight: 800;
}
.etapa-proceso:nth-child(even) .etapa-proceso__numero { background: var(--cian); }
.etapa-proceso__titulo {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
}
.etapa-proceso__descripcion {
  margin-top: 0.5rem;
  color: var(--texto-suave);
  font-size: 0.69rem;
  line-height: 1.65;
}

/* ============= LISTAS EN CASOS DE ESTUDIO ============= */
.lista-puntos {
  padding-left: 1.35rem;
  margin: 1rem 0 0;
  color: var(--texto-suave);
}
.lista-puntos li { padding-left: 0.1rem; margin-bottom: 0.65rem; }
.lista-puntos li::marker { color: var(--acento-caso, var(--coral)); }
.seccion-caso--marcador-celeste .lista-puntos--numerada li::marker {
  font-weight: 800;
}
.lista-puntos--numerada { list-style-type: decimal-leading-zero; }

.columnas-alcance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.3rem;
}
.columnas-alcance__tarjeta {
  min-width: 0;
  padding: clamp(0.9rem, 1.3vw, 1.4rem);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: rgba(30, 37, 45, 0.4);
}
.columnas-alcance__titulo { font-size: 0.88rem; color: var(--coral); }
.columnas-alcance__tarjeta:nth-child(even) .columnas-alcance__titulo { color: var(--cian); }
.columnas-alcance__tarjeta:nth-child(even) li::marker { color: var(--cian); }

/* ============= MOLECULA: CARRUSEL CIRCULAR ============= */
.carrusel {
  width: calc(100% - 2 * clamp(0.9rem, 2vw, 2.25rem));
  margin: 1.45rem auto 0;
  min-width: 0;
}
.carrusel__escenario {
  position: relative;
  width: 100%;
  aspect-ratio: 1.7;
  overflow: visible;
  isolation: isolate;
}
.carrusel__elemento {
  display: block;
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(241, 238, 233, 0.38);
  background: rgba(11, 15, 18, 0.5);
  color: var(--texto);
  box-shadow: 0 0.5rem 1.6rem rgba(11, 15, 18, 0.45);
  transform-origin: 50% 50%;
  transition: border-color 300ms ease, box-shadow 300ms ease;
}
.carrusel__elemento[data-rol="-1"],
.carrusel__elemento[data-rol="1"] {
  border: 1.5px solid var(--texto-suave);
  cursor: pointer;
}
.carrusel__elemento[data-rol="0"] { cursor: zoom-in; }
.carrusel__elemento[data-rol="-1"]:hover,
.carrusel__elemento[data-rol="1"]:hover {
  border-color: var(--cian);
  box-shadow: 0 0 0 2px rgba(28, 174, 191, 0.2);
}
.carrusel__elemento[data-rol="0"]:hover {
  border-color: var(--coral);
}
.carrusel__elemento[data-rol="-2"],
.carrusel__elemento[data-rol="2"],
.carrusel__elemento[data-rol="-3"],
.carrusel__elemento[data-rol="3"] {
  pointer-events: none;
  cursor: default;
}
.carrusel__imagen {
  position: absolute;
  top: 10%;
  left: 10%;
  display: block;
  width: 80%;
  height: 80%;
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  pointer-events: none;
}
/* Mismo encuadre en todos los roles para evitar saltos durante el morph. */
.carrusel__elemento[data-rol="0"] .carrusel__imagen { object-fit: contain; }
.carrusel__pendiente {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  font-size: 0;
  text-align: center;
  color: var(--texto-suave);
  line-height: 1.5;
  background: transparent;
  pointer-events: none;
}
.carrusel__elemento:not([data-rol="0"]) .carrusel__pendiente { font-size: 0; }
.carrusel__flecha {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--texto);
  font-size: clamp(1rem, 2.1vw, 1.7rem);
  line-height: 1;
  text-shadow: 0 1px 8px var(--fondo);
  pointer-events: none;
  transition: color 300ms ease;
}
.carrusel__elemento[data-rol="-1"] .carrusel__flecha,
.carrusel__elemento[data-rol="1"] .carrusel__flecha { display: grid; }
.carrusel__elemento[data-rol="-1"] .carrusel__flecha::before { content: '‹'; }
.carrusel__elemento[data-rol="1"] .carrusel__flecha::before { content: '›'; }
.carrusel__elemento[data-rol="-1"]:hover .carrusel__flecha,
.carrusel__elemento[data-rol="1"]:hover .carrusel__flecha { color: var(--cian); }
.carrusel__ampliar {
  position: absolute;
  right: 0.7rem;
  bottom: 0.5rem;
  padding: 0.2rem 0.6rem;
  display: none;
  border: 1px solid var(--borde);
  border-radius: 2rem;
  color: var(--texto);
  background: rgba(11, 15, 18, 0.5);
  pointer-events: none;
  font-size: 1rem;
}
.carrusel__elemento[data-rol="0"] .carrusel__ampliar { display: block; }
.carrusel__contador {
  margin: 0.05rem 0 0;
  color: var(--texto-suave);
  font-size: 0.68rem;
  text-align: center;
}
@media (max-width: 767px) {
  .carrusel { width: calc(100% - 0.55rem); margin: 1rem auto 0; }
  .carrusel__escenario { aspect-ratio: 0.91; }
  .carrusel__pendiente { font-size: 0; padding: 0.65rem; }
  .carrusel__ampliar { right: 0.45rem; bottom: 0.45rem; }
}

/* Optimizar capas únicamente mientras ocurre la transición. */
.carrusel--animando .carrusel__elemento { will-change: left, top, width, height, border-radius, opacity; }

/* ============= ICONOS SVG ============= */
.habilidad__icono img {
  display: block;
  width: 68%;
  height: 68%;
  object-fit: contain;
}
.fila-contacto__icono { display: grid; place-items: center; }
.fila-contacto__icono img { width: 65%; height: 65%; object-fit: contain; }
.herramientas-adicionales { grid-column: 1 / -1; margin-top: 0.6rem; }
.herramientas-adicionales > .etiqueta-seccion { display: block; margin-bottom: 0.85rem; }

/* ============= LOGO COSMOPOLITA ============= */
.imagen-provisional--cosmopolita { background: #f1eee9; }
img[src$="/cosmopolita_logo_SVG.svg"], img[src$="/cosmopolita_logo_grid.webp"] { background-color: #f1eee9; }

/* Selector de idioma: el globo acompaña al idioma activo. */
.selector-idioma {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
  margin-right: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 5.7rem;
  height: 2rem;
  padding: 2px;
  border: 1px solid var(--borde);
  border-radius: 2rem;
  background: var(--fondo);
  color: var(--texto-suave);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
}
.selector-idioma > span:not(.idioma-globo) { text-align: center; }
.idioma-globo {
  display: grid;
  place-items: center;
  position: absolute;
  left: 2px;
  top: 2px;
  bottom: 2px;
  width: calc(50% - 2px);
  border-radius: 2rem;
  color: var(--texto);
  background: var(--superficie);
  transition: transform var(--transicion);
  pointer-events: none;
}
.idioma-globo svg { width: 1.25rem; height: 1.25rem; }
.selector-idioma[data-idioma="en"] .idioma-globo { transform: translateX(100%); }
.selector-idioma:hover { border-color: var(--texto-suave); }
.selector-idioma:focus-visible { outline: 2px solid var(--cian); outline-offset: 3px; }
@media (max-width: 767px) {
  .selector-idioma { margin-right: .85rem; }
  .boton-hamburguesa { flex-direction: column; align-items: center; justify-content: center; gap: .35rem; }
  .boton-hamburguesa span { margin: 0; width: 100%; transform-origin: center; }
  .boton-hamburguesa.abierto span:nth-child(1) { transform: translateY(calc(2px + .35rem)) rotate(45deg); }
  .boton-hamburguesa.abierto span:nth-child(3) { transform: translateY(calc(-2px - .35rem)) rotate(-45deg); }
}
@media (prefers-reduced-motion: reduce) {
  .idioma-globo, .boton-hamburguesa span { transition: none; }
}
