:root {
  --primary: #2d3748;
  --primary-light: #4a5568;
  --accent: #4299e1;
  --accent-dark: #2b6cb0;
  --accent-light: #ebf8ff;
  --bg: #f8fafc;
  --glass: rgba(255, 255, 255, 0.95);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-lg: 20px;
  --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-title: 'Playfair Display', serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--primary);
  background-color: var(--bg);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-title);
  line-height: 1.2;
  font-weight: 700;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: white;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-secondary:hover {
  background-color: var(--accent-light);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background-color: var(--accent);
  color: white;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--glass);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  padding: 0 1.5rem;
}

.logo img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: var(--shadow);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
  z-index: 1001;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--accent);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background: linear-gradient(135deg, #f8fafc 0%, #ebf8ff 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(66, 153, 225, 0.1) 0%, rgba(66, 153, 225, 0) 70%);
  z-index: 0;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  position: relative;
  z-index: 1;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-title {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, var(--primary), var(--accent-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-title .greeting {
  display: block;
  font-size: 1.25rem;
  font-family: var(--font-main);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--primary-light);
  margin-bottom: 2rem;
  font-weight: 500;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero-image {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.hero-image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: float 4s ease-in-out infinite; /* Animación de flote */
}

.profile-img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.profile-img:hover {
  transform: scale(1.02);
}

.scroll-down {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent);
  font-size: 1.5rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0) translateX(-50%); }
  50% { transform: translateY(-10px) translateX(-50%); }
}

/* Secciones */
.section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(to right, var(--accent), var(--accent-dark));
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--primary-light);
  max-width: 600px;
  margin: 0 auto;
}

/* About Section / Contact Cards */
.about-content {
  background-color: var(--glass);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  height: 100%; /* Para igualar alturas */
}

.about-content h3 {
  font-size: 1.5rem;
  color: var(--accent-dark);
  margin-bottom: 1.5rem;
}

.about-content p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

.about-text h3 {
  font-size: 1.5rem;
  color: var(--accent-dark);
  margin-bottom: 1.5rem;
}

.about-text p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

.skills {
  margin: 2rem 0;
}

.skills h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--primary);
  font-family: var(--font-main);
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  background-color: var(--accent-light);
  color: var(--accent-dark);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
}

.skill-tag:hover {
  background-color: var(--accent);
  color: white;
}

.facts {
  margin: 2rem 0;
}

.facts h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--primary);
  font-family: var(--font-main);
}

.facts ul {
  padding-left: 1.5rem;
}

.facts li {
  margin-bottom: 0.5rem;
  position: relative;
}

.facts li::before {
  content: '•';
  color: var(--accent);
  font-weight: bold;
  position: absolute;
  left: -1.25rem;
}

.cv-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex; 
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px) scale(1.02); /* Efecto hover mejorado */
  box-shadow: var(--shadow-lg);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.project-info {
  padding: 1.5rem;
  flex-grow: 1; /* Empuja el contenido hacia abajo */
  display: flex;
  flex-direction: column;
}

.project-info h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.project-info p {
  color: var(--primary-light);
  font-size: 0.95rem;
  margin-bottom: 1rem; /* Añadido para espaciado */
}

.project-tags {
  margin-top: auto; /* Empuja los tags al fondo */
  padding-top: 1rem;
}

.tag {
  background-color: var(--accent-light);
  color: var(--accent-dark);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-block;
  margin-top: 0.5rem;
  margin-right: 0.5rem;
}

/* Estilos para iconos de servicios (Añadido) */
.service-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.services-grid .project-card {
  text-align: center;
}

/* Contact Section */
.contact-content {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: stretch; 
}

.contact-item {
  flex: 1; 
  min-width: 300px;
  display: flex; 
}

.contact-item .about-content {
  width: 100%;
}

.contact-form {
  background-color: var(--glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: var(--transition);
  background-color: rgba(255, 255, 255, 0.8);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.form-group label {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--primary-light);
  transition: var(--transition);
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 0 0.5rem;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -0.5rem;
  left: 0.8rem;
  font-size: 0.75rem;
  color: var(--accent);
}

.contact-info {
  background-color: var(--glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.contact-info h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.contact-details {
  margin-bottom: 2rem;
}

.contact-details li {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-details i {
  color: var(--accent);
  font-size: 1.25rem;
  width: 30px;
  text-align: center;
}

.social-links {
  margin-top: 1.5rem;
}

.social-title {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 1rem;
  font-weight: 600;
  font-family: var(--font-main); /* Coherencia de fuente */
}

.social-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.social-item {
  margin-bottom: 0.8rem;
}

.social-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition);
  padding: 0.5rem;
  border-radius: var(--radius);
}

.social-link:hover {
  background-color: rgba(53, 118, 186, 0.1);
  transform: translateX(5px);
}

.social-icon {
  font-size: 1.3rem;
  width: 30px;
  text-align: center;
  margin-right: 1rem;
  color: var(--accent);
}

.social-name {
  font-size: 1rem;
  font-weight: 500;
}

/* Colores específicos para hover */
.social-link:hover .social-icon.github { color: #333; }
.social-link:hover .social-icon.linkedin-in { color: #0a66c2; }
.social-link:hover .social-icon.instagram { color: #e1306c; }
.social-link:hover .social-icon.facebook { color: #1877f2; }
.social-link:hover .social-icon.whatsapp { color: #25d366; }

/* Versión móvil */
@media (max-width: 768px) {
  .social-link {
    padding: 0.5rem 0.3rem;
  }
  
  .social-icon {
    font-size: 1.2rem;
    margin-right: 0.8rem;
  }
}
/* Footer */
.footer {
  background-color: var(--primary);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.footer-content p {
  margin-bottom: 1rem;
}

/* Modal */
.modal-glass {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-glass.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content-glass {
  background-color: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-glass.active .modal-content-glass {
  transform: translateY(0);
}

.close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: var(--primary-light);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

.close:hover {
  color: var(--accent);
}

.modal-content-glass iframe {
  width: 100%;
  height: 80vh;
  border: none;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--glass);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 2rem;
    gap: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: var(--shadow);
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  }
  
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
  }
  
  .hero-container {
    flex-direction: column;
    text-align: center;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  .hero-image {
    margin-top: 2rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .about-content,
  .contact-form,
  .contact-info {
    padding: 1.5rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Animaciones */

/* Animación de flote (Añadida) */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* Animación de aparición (Añadida) */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

/* Estados del formulario */
.form-response {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 500;
  transition: all 0.3s ease;
}

.form-response.loading {
  background-color: rgba(13, 110, 253, 0.1);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.form-response.success {
  background-color: rgba(25, 135, 84, 0.1);
  color: #28a745;
  border: 1px solid #28a745;
}

.form-response.warning {
  background-color: rgba(255, 193, 7, 0.1);
  color: #ffc107;
  border: 1px solid #ffc107;
}

.form-response.error {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid #dc3545;
}
/* --- Estilos Adicionales para el Modal Pop-up --- */

/* Ajusta el modal para contenido general, no solo iframes */
.modal-content-glass {
  padding: 2.5rem;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  background-color: var(--accent-light); /* <-- AÑADIDO: Color azul claro */
}
/* Estilo para el título dentro del modal */
.modal-title {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* Estilo para el texto/subtítulo del modal */
.modal-text {
  font-size: 1.1rem;
  color: var(--primary-light);
  margin-bottom: 1.5rem;
}

/* Estilo para la imagen de la infografía en el modal */
.modal-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* MODIFICADO: Se añaden márgenes 'auto' para centrar la imagen */
  margin: 1rem auto 2rem auto; 
  border: 1px solid rgba(0,0,0,0.1);
}

/* Ajusta la posición del botón de cerrar con el nuevo padding */
.modal-content-glass .close {
  top: 1rem;
  right: 1rem;
}