/* ==========================================================================
   1. RESET Y CONFIGURACIÓN GLOBAL
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body, html {
  width: 100%;
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #2D2638; /* Color base general */
  color: #ffffff;
}

/* ==========================================================================
   2. COMPONENTES GLOBALES (Menú y Navegación)
   ========================================================================== */
.boton-hamburguesa {
  position: fixed;
  top: 2rem;
  right: 2.5rem;
  z-index: 1000;
  width: 48px;
  height: 48px;
  background-color: #2D2638;
  border: 2px solid #C77DFF;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.boton-hamburguesa:hover {
  background-color: #433854;
  border-color: #ffdfa9;
  transform: scale(1.05);
}

.boton-hamburguesa .linea {
  width: 22px;
  height: 2.5px;
  background-color: #ffdfa9;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

/* --- Botón de Idioma --- */
.btn-idioma {
  position: fixed;
  top: 2rem;
  right: 6.5rem;
  z-index: 1000;
  width: 48px;
  height: 48px;
  background-color: #2D2638;
  border: 2px solid #C77DFF;
  border-radius: 12px;
  color: #ffdfa9;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.btn-idioma:hover {
  background-color: #433854;
  border-color: #ffdfa9;
  transform: scale(1.05);
}

.overlay-menu {
  position: fixed;
  inset: 0;
  background-color: rgba(18, 14, 24, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-lateral {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background-color: #221c2c;
  border-left: 2px solid #7B2CBF;
  z-index: 1002;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 6rem 2.5rem 3rem;
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.5);
}

.overlay-menu.activo { opacity: 1; visibility: visible; }
.menu-lateral.activo { transform: translateX(0); }

.btn-cerrar-menu {
  position: absolute;
  top: 1.8rem;
  right: 2rem;
  background: none;
  border: none;
  color: #ffdfa9;
  font-size: 2.4rem;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
}

.btn-cerrar-menu:hover {
  color: #F6D4FF;
  transform: scale(1.15);
}

.enlaces-menu { display: flex; flex-direction: column; gap: 2rem; }
.enlaces-menu a {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.7rem;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 1.5px;
  transition: all 0.2s ease;
  display: inline-block;
}
.enlaces-menu a:hover { color: #ffdfa9; transform: translateX(8px); }

/* ==========================================================================
   3. PÁGINA PRINCIPAL (Index)
   ========================================================================== */
.pantalla-inicio {
  width: 100%;
  height: 100vh;
  background-image: url('img/bannerPrincipal.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-left: 6rem;
  scroll-snap-align: start;
}

.portada-texto h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 4.9rem;
  font-weight: 700;
  color: #ffdfa9;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.portada-texto p {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.1rem;
  color: #ffdfa9;
  letter-spacing: 1.5px;
}

.pantalla-dos {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100vh;
  background-color: #2D2638;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6rem;
  scroll-snap-align: start;
}

.contenedor-sobre-mi {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.columna-texto { flex: 1; max-width: 540px; text-align: left; }
.columna-texto h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3rem;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}
.columna-texto p { font-size: 1.15rem; line-height: 1.8; opacity: 0.9; margin-bottom: 1rem; }

/* Avatar interactivo */
.columna-avatar { flex: 1; display: flex; justify-content: center; align-items: center; }
.avatar-interactivo {
  --avatar-escala: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  transform: scale(var(--avatar-escala));
  margin-left: 10rem;
}

.flechas-columna { display: flex; flex-direction: column; justify-content: space-between; height: 220px; }
.flecha {
  background-color: #F6D4FF;
  border: 2px solid #C77DFF;
  color: #7B2CBF;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.flecha:hover { background-color: #FFF1A8; transform: scale(1.1); }

.avatar-marco {
  position: relative;
  width: 220px;
  height: 260px;
  background-color: #ffffff;
  border: 3px solid #7B2CBF;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.avatar-marco img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }

/* Burbujas */
.burbuja { position: absolute; pointer-events: none; z-index: 1; user-select: none; }
.burbuja-1 { width: 130px; top: 10%; left: 3%; }
.burbuja-2 { width: 290px; bottom: -70px; left: 3%; }
.burbuja-3 { width: 85px; bottom: 22%; left: 5%; }
.burbuja-4 { width: 75px; bottom: 9%; left: 32%; }
.burbuja-5 { width: 80px; top: 7%; right: 23%; }
.burbuja-6 { width: 220px; top: 6%; right: 4%; }
.burbuja-7 { width: 125px; top: 25%; right: 3%; }
.burbuja-8 { width: 60px; bottom: 36%; right: 9%; }
.burbuja-9 { width: 155px; bottom: 7%; right: 17%; }
.burbuja-10 { width: 40px; bottom: 12%; right: 12%; }

/* Franja inferior */
.barra-navegacion-espacio {
  width: 100%;
  min-height: 120px;
  background-color: #433854;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 2rem;
}
.contenedor-botones-nav { display: flex; gap: 1.5rem; }
.boton-nav {
  padding: 0.8rem 2.2rem;
  background-color: #F6D4FF;
  color: #7B2CBF;
  border: 2px solid #C77DFF;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  cursor: pointer;
}
.boton-nav:hover { background-color: #ffdfa9; border-color: #7B2CBF; color: #2D2638; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }

/* ==========================================================================
   4. PÁGINAS SECUNDARIAS (Estructura base)
   ========================================================================== */
.pagina-secundaria {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  scroll-snap-align: start;
}

.contenedor-pagina-secundaria { max-width: 800px; text-align: center; }
.contenedor-pagina-secundaria h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3.5rem;
  color: #ffdfa9;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}
.contenedor-pagina-secundaria p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 2.5rem; }

/* Contacto */
.texto-contacto p { font-size: 1.2rem; line-height: 1.7; margin-bottom: 1rem; opacity: 0.95; }
.enlace-correo { color: #ffdfa9; text-decoration: underline; text-underline-offset: 4px; font-weight: 600; transition: color 0.2s ease; }
.enlace-correo:hover { color: #F6D4FF; }

.redes-sociales { display: flex; justify-content: center; gap: 1.4rem; margin: 2.2rem 0 3rem 0; }
.icono-red {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: #F6D4FF;
  border: 2px solid #C77DFF;
  color: #7B2CBF;
  font-size: 1.55rem;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.icono-red:hover {
  background-color: #ffdfa9;
  border-color: #ffdfa9;
  color: #2D2638;
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 8px 18px rgba(255, 223, 169, 0.3);
}

/* ==========================================================================
   5. PORTFOLIO
   ========================================================================== */
.pagina-portfolio { align-items: flex-start; height: auto; padding-top: 3.5rem; padding-bottom: 6rem; scroll-snap-align: none; }
.contenedor-portfolio { width: 92%; max-width: 1680px; margin: 0 auto; text-align: center; }
.contenedor-portfolio h1 { font-family: 'Playfair Display', Georgia, serif; font-size: 3.2rem; color: #ffdfa9; margin-top: 1rem; margin-bottom: 3rem; letter-spacing: 2px; }

.grid-portfolio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.2rem; justify-content: center; }

.tarjeta-proyecto {
  background-color: #221c2c;
  border: 1.5px solid rgba(199, 125, 255, 0.3);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
}
.tarjeta-proyecto:hover { transform: translateY(-6px); border-color: #C77DFF; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45); }

.miniatura-wrapper { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background-color: #1a1522; }
.miniatura-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.tarjeta-proyecto:hover .miniatura-wrapper img { transform: scale(1.05); }

.tarjeta-info { padding: 1.2rem 1.5rem 1.5rem; }
.tarjeta-info h3 { font-family: 'Playfair Display', Georgia, serif; font-size: 1.3rem; color: #ffffff; margin-bottom: 0.3rem; }
.tarjeta-info p { font-size: 0.95rem; color: #ffdfa9; opacity: 0.85; }

/* Modal de Portfolio */
body.modal-abierto { overflow: hidden; }
.modal-proyecto {
  position: fixed; inset: 0; z-index: 2000; overflow: hidden; opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease; display: flex; justify-content: center; align-items: center; padding: 1.2rem 4.8rem;
}
.modal-proyecto.activo { opacity: 1; visibility: visible; }
.modal-overlay { position: fixed; inset: 0; background-color: rgba(14, 10, 20, 0.88); backdrop-filter: blur(6px); z-index: -1; }

.btn-cerrar-modal {
  position: fixed; top: 1.2rem; right: 1.5rem; z-index: 2100; background: rgba(34, 28, 44, 0.85); border: 1.5px solid #C77DFF;
  border-radius: 50%; width: 44px; height: 44px; color: #ffdfa9; font-size: 1.9rem; line-height: 1; cursor: pointer; transition: all 0.2s ease;
}
.btn-cerrar-modal:hover { background-color: #ffdfa9; color: #2D2638; transform: scale(1.1); }

.btn-nav-modal {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 2100; background: rgba(34, 28, 44, 0.9); border: 2px solid #C77DFF;
  border-radius: 50%; width: 48px; height: 48px; color: #ffdfa9; font-size: 1.1rem; cursor: pointer; transition: all 0.2s ease;
}
.btn-nav-modal:hover { background-color: #ffdfa9; color: #2D2638; border-color: #ffdfa9; transform: translateY(-50%) scale(1.12); }
.btn-modal-anterior { left: 1.2rem; }
.btn-modal-siguiente { right: 1.2rem; }
.btn-nav-modal.oculto { display: none !important; }

.modal-contenedor { position: relative; width: 100%; max-width: 1650px; height: 93vh; display: flex; gap: 2.2rem; align-items: flex-start; }
.modal-galeria {
  flex: 1; height: 100%; overflow-y: auto; direction: rtl; padding-left: 14px; padding-right: 6px;
  display: flex; flex-direction: column; gap: 2rem; scrollbar-width: thin; scrollbar-color: #C77DFF rgba(26, 21, 34, 0.85);
}
.modal-galeria::-webkit-scrollbar { width: 10px; }
.modal-galeria::-webkit-scrollbar-track { background: rgba(26, 21, 34, 0.85); border-radius: 6px; }
.modal-galeria::-webkit-scrollbar-thumb { background-color: #C77DFF; border-radius: 6px; }
.modal-galeria::-webkit-scrollbar-thumb:hover { background-color: #ffdfa9; }

.modal-figura { direction: ltr; width: 100%; display: flex; flex-direction: column; align-items: center; }
.modal-figura img { width: 100%; height: auto; border-radius: 10px; border: 1px solid rgba(199, 125, 255, 0.2); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); }
.modal-pie { margin-top: 0.8rem; font-size: 0.9rem; color: #ffdfa9; opacity: 0.85; text-align: center; font-style: italic; max-width: 800px; }

.modal-info {
  width: 330px; max-height: 100%; overflow-y: auto; flex-shrink: 0; background-color: #221c2c;
  border: 1.5px solid rgba(199, 125, 255, 0.35); border-radius: 14px; padding: 1.8rem 1.6rem; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.modal-info h2 { font-family: 'Playfair Display', Georgia, serif; font-size: 1.45rem; color: #ffdfa9; margin-bottom: 0.35rem; }
.modal-categoria { display: inline-block; font-size: 0.82rem; color: #F6D4FF; font-weight: 600; text-transform: uppercase; margin-bottom: 1.2rem; }
.modal-descripcion { font-size: 0.92rem; line-height: 1.65; color: #e4ddf0; border-top: 1px solid rgba(199, 125, 255, 0.2); padding-top: 1.1rem; }
.modal-descripcion p { margin-bottom: 0.9rem; }

.modal-enlaces { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1.4rem; border-top: 1px solid rgba(199, 125, 255, 0.2); padding-top: 1.2rem; }
.btn-proyecto-enlace {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.2rem; background-color: #2D2638;
  color: #ffdfa9; border: 1.5px solid #C77DFF; border-radius: 10px; text-decoration: none; font-weight: 600; transition: all 0.2s ease;
}
.btn-proyecto-enlace:hover { background-color: #ffdfa9; border-color: #ffdfa9; color: #2D2638; transform: translateY(-2px); }

/* ==========================================================================
   6. VISOR 3D (Teaser Art Book)
   ========================================================================== */
:root { --zoom-corte-libro: 1.19; }

.bloque-teaser-libro { margin-top: 1.4rem; border-top: 1px solid rgba(199, 125, 255, 0.2); padding-top: 1.2rem; }
.texto-teaser-libro { font-size: 0.88rem; line-height: 1.55; color: #dfd7eb; margin-bottom: 0.9rem; }
.btn-abrir-libro {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; padding: 0.75rem 1.2rem; background-color: #7B2CBF;
  color: #ffffff; border: 1.5px solid #C77DFF; border-radius: 10px; font-weight: 600; cursor: pointer; transition: all 0.2s ease;
}
.btn-abrir-libro:hover { background-color: #ffdfa9; border-color: #ffdfa9; color: #2D2638; transform: translateY(-2px); }

.modal-libro {
  position: fixed; inset: 0; z-index: 3000; display: flex; justify-content: center; align-items: center;
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; user-select: none;
}
.modal-libro.activo { opacity: 1; visibility: visible; }
.modal-libro-overlay { position: fixed; inset: 0; background-color: rgba(10, 7, 15, 0.94); backdrop-filter: blur(8px); }

.btn-cerrar-libro {
  position: fixed; top: 1.5rem; right: 2rem; z-index: 3200; background: rgba(34, 28, 44, 0.85); border: 1.5px solid #C77DFF;
  border-radius: 50%; width: 44px; height: 44px; color: #ffdfa9; font-size: 2rem; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease;
}
.btn-cerrar-libro:hover { background-color: #ffdfa9; color: #2D2638; transform: scale(1.1); }

.btn-hojear {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 3200; background: rgba(34, 28, 44, 0.9); border: 2px solid #C77DFF;
  border-radius: 50%; width: 54px; height: 54px; color: #ffdfa9; font-size: 1.25rem; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease;
}
.btn-hojear:hover { background-color: #ffdfa9; color: #2D2638; border-color: #ffdfa9; transform: translateY(-50%) scale(1.12); }
.btn-hojear-izq { left: max(2rem, calc(50% - 640px)); }
.btn-hojear-der { right: max(2rem, calc(50% - 640px)); }
.btn-hojear.oculto { opacity: 0.15; pointer-events: none; }

.libro-escenario { position: relative; z-index: 3050; display: flex; flex-direction: column; align-items: center; }
.libro-contenedor {
  position: relative; display: flex; height: min(82vh, 740px); aspect-ratio: 297 / 210; max-width: 92vw; perspective: 2500px;
  background: transparent !important; box-shadow: none !important; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.libro-contenedor:not(.modo-portada):not(.modo-contraportada) { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85) !important; border-radius: 8px; }
.libro-contenedor.modo-portada { transform: translateX(-25%); box-shadow: none !important; }
.libro-contenedor.modo-contraportada { transform: translateX(25%); box-shadow: none !important; }

.pagina-lado { width: 50%; height: 100%; background: #201a29; overflow: hidden; position: relative; display: flex; justify-content: center; align-items: center; }
.pagina-izq { border-radius: 8px 0 0 8px; border-right: 1px solid rgba(0, 0, 0, 0.2); }
.pagina-der { border-radius: 0 8px 8px 0; border-left: 1px solid rgba(0, 0, 0, 0.2); }
.pagina-lado img, .cara img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--zoom-corte-libro)); transform-origin: center center; display: block; }

.lomo-sombra {
  position: absolute; top: 0; bottom: 0; left: calc(50% - 22px); width: 44px; z-index: 10; pointer-events: none;
  background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.18) 35%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.18) 65%, rgba(0,0,0,0) 100%);
}

.libro-contenedor.modo-portada .lomo-sombra, .libro-contenedor.modo-contraportada .lomo-sombra { display: none !important; }
.libro-contenedor.modo-portada .pagina-izq { visibility: hidden !important; opacity: 0 !important; background: transparent !important; box-shadow: none !important; border: none !important; pointer-events: none !important; }
.libro-contenedor.modo-portada .pagina-der { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85) !important; border-radius: 8px !important; border: none !important; }
.libro-contenedor.modo-contraportada .pagina-der { visibility: hidden !important; opacity: 0 !important; background: transparent !important; box-shadow: none !important; border: none !important; pointer-events: none !important; }
.libro-contenedor.modo-contraportada .pagina-izq { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85) !important; border-radius: 8px !important; border: none !important; }

.hoja-animada { position: absolute; top: 0; height: 100%; width: 50%; z-index: 20; transform-style: preserve-3d; display: none; transition: transform 0.65s cubic-bezier(0.25, 1, 0.5, 1); }
.cara { position: absolute; inset: 0; width: 100%; height: 100%; background: #201a29; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; display: flex; justify-content: center; align-items: center; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }
.cara-dorso { transform: rotateY(180deg); }
.libro-contador { display: none !important; }

/* ==========================================================================
   7. PÁGINA DE CURRÍCULUM
   ========================================================================== */
.pagina-cv { align-items: flex-start; height: auto; scroll-snap-align: none; flex-direction: column; padding-top: 3.5rem; }
.pagina-cv > h1 { font-family: 'Playfair Display', Georgia, serif; font-size: 3.2rem; color: #ffdfa9; margin-top: 1rem; margin-bottom: 2rem; letter-spacing: 2px; text-align: center; width: 100%; }

.contenedor-cv { width: 94%; max-width: 1500px; margin: 0 auto; padding-bottom: 6rem; display: grid; grid-template-columns: 480px 1fr; gap: 5rem; align-items: start; }

.cv-lateral { background-color: #221c2c; padding: 3rem 2.8rem; border-radius: 14px; border: 1px solid rgba(199, 125, 255, 0.2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); position: sticky; top: 6rem; }
.cv-perfil h1 { font-family: 'Playfair Display', Georgia, serif; font-size: 2.5rem; color: #ffdfa9; margin-bottom: 0.2rem; line-height: 1.1; }
.cv-subtitulo { font-size: 1rem; color: #C77DFF; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 1.5rem; }
.cv-intro { font-size: 0.95rem; line-height: 1.6; color: #e4ddf0; margin-bottom: 2.2rem; }

.btn-descargar-cv { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; width: 100%; padding: 0.8rem; background-color: #F6D4FF; color: #7B2CBF; border-radius: 8px; text-decoration: none; font-weight: 700; transition: all 0.2s ease; }
.btn-descargar-cv:hover { background-color: #ffdfa9; color: #2D2638; transform: translateY(-2px); }

.cv-bloque-lateral { margin-top: 2.5rem; border-top: 1px dashed rgba(199, 125, 255, 0.3); padding-top: 1.5rem; }
.cv-bloque-lateral h3 { font-family: 'Playfair Display', Georgia, serif; font-size: 1.4rem; color: #ffdfa9; margin-bottom: 1.2rem; }
.cv-categoria-skills h4 { font-size: 0.85rem; color: #F6D4FF; text-transform: uppercase; margin-bottom: 0.6rem; margin-top: 1rem; }
.tags-skills { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tags-skills span { background-color: rgba(123, 44, 191, 0.2); border: 1px solid rgba(199, 125, 255, 0.4); color: #e4ddf0; padding: 0.4rem 0.8rem; border-radius: 20px; font-size: 0.85rem; }
.lista-idiomas { list-style: none; color: #e4ddf0; font-size: 0.95rem; }
.lista-idiomas li { margin-bottom: 0.6rem; }
.lista-idiomas strong { color: #ffdfa9; }

.cv-principal { padding-top: 0.5rem; }
.titulo-seccion-timeline { font-family: 'Playfair Display', Georgia, serif; font-size: 2rem; color: #ffdfa9; margin-bottom: 2.5rem; display: flex; align-items: center; gap: 1rem; }
.titulo-seccion-timeline i { color: #C77DFF; }

.timeline { position: relative; padding-left: 3.5rem; }
.timeline::before { content: ''; position: absolute; left: 0.9rem; top: 0; bottom: 0; width: 2px; background: rgba(199, 125, 255, 0.3); }
.timeline-item { position: relative; margin-bottom: 3.5rem; }
.timeline-item:last-child { margin-bottom: 0; }

.timeline-nodo {
  position: absolute; left: -3.55rem; top: 0; width: 36px; height: 36px; border-radius: 50%; background-color: #2D2638; border: 2px solid #C77DFF;
  display: flex; align-items: center; justify-content: center; z-index: 2; transition: all 0.2s ease;
}
.timeline-nodo i { font-size: 0.95rem; color: #ffdfa9; transition: color 0.2s ease; }
.timeline-item:hover .timeline-nodo { background-color: #ffdfa9; border-color: #ffdfa9; transform: scale(1.15); }
.timeline-item:hover .timeline-nodo i { color: #2D2638; }

.nodo-estudio { border-color: #F6D4FF; }
.nodo-trabajo { border-color: #C77DFF; }

.timeline-fecha { display: inline-block; background-color: rgba(123, 44, 191, 0.15); color: #F6D4FF; padding: 0.3rem 0.8rem; border-radius: 4px; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.8rem; }
.timeline-titulo { font-size: 1.3rem; color: #ffffff; margin-bottom: 0.3rem; }
.timeline-empresa { font-size: 1rem; font-style: italic; margin-bottom: 0.8rem; }
.enlace-empresa { color: #C77DFF; text-decoration: none; transition: color 0.2s ease; }
.enlace-empresa:hover { color: #ffdfa9; text-decoration: underline; text-underline-offset: 4px; }
.timeline-contenido p { font-size: 0.95rem; line-height: 1.6; color: #bfaecc; }


/* ==========================================================================
   8. DISEÑO RESPONSIVE (MÓVILES Y TABLETS)
   ========================================================================== */

/* --- TABLETS (Pantallas menores de 1024px) --- */
@media (max-width: 1024px) {
  .contenedor-cv {
    grid-template-columns: 320px 1fr; /* Estrecha un poco la barra lateral */
    gap: 3rem;
  }
  .grid-portfolio {
    grid-template-columns: repeat(2, 1fr); /* 2 columnas en portfolio en vez de 3 */
  }
  .avatar-interactivo {
    margin-left: 0; /* Quita el margen enorme del avatar */
  }
  .pantalla-dos {
    padding: 0 3rem;
  }
}

/* --- MÓVILES (Pantallas menores de 768px) --- */
@media (max-width: 768px) {
  
  /* Botones superiores más pequeños */
  .boton-hamburguesa { right: 1.5rem; top: 1.5rem; width: 42px; height: 42px; }
  .btn-idioma { right: 5.2rem; top: 1.5rem; width: 42px; height: 42px; font-size: 0.9rem; }

  /* Títulos más pequeños */
  .portada-texto h1 { font-size: 3.2rem; }
  .portada-texto p { font-size: 1.4rem; }
  .contenedor-pagina-secundaria h1, .pagina-cv > h1, .contenedor-portfolio h1 { font-size: 2.6rem; }
  
  /* Inicio y Sobre Mí */
  .pantalla-inicio { padding-left: 0; justify-content: center; text-align: center; }
  .portada-texto { text-align: center; }
  
  .contenedor-sobre-mi {
    flex-direction: column; /* Apila el texto arriba y el avatar abajo */
    gap: 2rem;
    text-align: center;
  }
  .columna-texto { max-width: 100%; text-align: center; }
  .columna-texto h2 { font-size: 2.2rem; }
  
  .avatar-interactivo {
    transform: scale(1.1); /* Reduce el tamaño del avatar para que quepa */
    margin: 2rem auto 0;
  }

  /* Oculta las burbujas en móvil para que no estorben en la lectura */
  .burbuja { display: none; }

  /* Menú inferior */
  .barra-navegacion-espacio { padding: 2rem 1.5rem; }
  .contenedor-botones-nav { flex-direction: column; gap: 1rem; width: 100%; }
  .boton-nav { width: 100%; text-align: center; }

  /* Currículum: 1 Sola columna */
  .contenedor-cv {
    grid-template-columns: 1fr; /* Todo en una columna */
    gap: 3rem;
    padding-bottom: 3rem;
  }
  .cv-lateral {
    position: relative; /* Quita el efecto pegajoso */
    top: 0;
    padding: 2rem 1.5rem;
  }
  
  /* Ajuste de la línea de tiempo para móvil */
  .timeline { padding-left: 2.5rem; }
  .timeline::before { left: 0.65rem; }
  .timeline-nodo { left: -2.3rem; width: 32px; height: 32px; }

  /* Portfolio: 1 Sola columna */
  .grid-portfolio { grid-template-columns: 1fr; gap: 1.5rem; }
  
  /* Modal de Portfolio adaptado a móvil */
  .modal-proyecto { padding: 1rem; }
  .modal-contenedor {
    flex-direction: column; /* Info arriba/abajo en vez de lados */
    height: 90vh;
    overflow-y: auto; /* Permite scroll a todo el conjunto */
    gap: 1.5rem;
  }
  .modal-galeria {
    overflow-y: visible; /* Quita el scroll interno */
    direction: ltr; /* Restaura la barra de scroll a la derecha */
    padding: 0;
  }
  .modal-info {
    width: 100%; 
    flex-shrink: 0;
    margin-bottom: 2rem;
  }
  
  /* Botones del modal más pequeños */
  .btn-cerrar-modal, .btn-cerrar-libro { right: 0.8rem; top: 0.8rem; width: 38px; height: 38px; font-size: 1.5rem; }
  .btn-nav-modal { width: 40px; height: 40px; font-size: 0.9rem; }
  .btn-modal-anterior { left: 0.2rem; }
  .btn-modal-siguiente { right: 0.2rem; }
}