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

html {
  scroll-behavior: smooth;
  /* Optimización mobile: reducir reflow/repaint */
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
  /* Optimización mobile: mejor rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Variables CSS */
:root {
  --primary-color: #1e3a8a; /* Azul oscuro */
  --secondary-color: #065f46; /* Verde oscuro */
  --accent-color: #22d3ee; /* Azul claro */
  --gradient-start: #1e3a8a; /* Azul oscuro */
  --gradient-mid: #0891b2; /* Azul medio */
  --gradient-end: #065f46; /* Verde oscuro */
  --text-dark: #2d3748;
  --text-light: #718096;
  --bg-light: #f7fafc;
  --bg-dark: #1a202c;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 15px;
  
  /* Variables específicas para mobile */
  --mobile-padding: 1rem;
  --mobile-font-size: 0.9rem;
  --mobile-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --touch-target: 44px;
  --mobile-transition: all 0.2s ease;
}

/* Navegación */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
  transition: var(--mobile-transition);
  /* Optimización: usar transform3d para activar aceleración por hardware */
  transform: translate3d(0, 0, 0);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--mobile-shadow);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  /* Optimización mobile: reducir altura en mobile */
}

.nav-logo .logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  position: relative;
  transition: var(--mobile-transition);
  /* Optimización: touch target mínimo */
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  transition: var(--mobile-transition);
}

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

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  /* Optimización: touch target adecuado */
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  justify-content: center;
  align-items: center;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-dark);
  margin: 3px 0;
  transition: var(--mobile-transition);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #3b6e4e 100%);
  /* Optimización: usar will-change solo cuando necesario */
}

.hero-background.mobile-optimized {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* Simplificar animaciones en mobile */
.animated-bg[data-reduce-motion="true"] {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Sin animaciones complejas en mobile */
  background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 0 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-text {
  color: white;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  /* Simplificar animación para mobile */
  opacity: 1;
}

.highlight {
  background: linear-gradient(135deg, var(--accent-color), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.hero-description {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.8;
  line-height: 1.7;
}

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

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: var(--mobile-transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  /* Optimización: touch target adecuado */
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

/* Simplificar efectos hover para mobile */
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: var(--touch-target);
  height: var(--touch-target);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: var(--mobile-transition);
  backdrop-filter: blur(10px);
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-photo {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.3);
  /* Optimización: mejor rendering de imágenes */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.scroll-indicator[data-mobile-hide="true"] {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
}

.scroll-arrow {
  width: 30px;
  height: 30px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: rotate(45deg) translateY(0); }
  40% { transform: rotate(45deg) translateY(-10px); }
  60% { transform: rotate(45deg) translateY(-5px); }
}

/* Secciones generales */
section {
  padding: 5rem 0;
  /* Optimización: usar contain para mejor performance */
  contain: layout style paint;
}

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

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  position: relative;
}

.section-title::after {
  content: '';
  width: 60px;
  height: 4px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

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

/* About Section */
.about {
  background: var(--bg-light);
}

.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-description {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: var(--text-dark);
}

.about-highlights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--mobile-shadow);
  transition: var(--mobile-transition);
  /* Optimización: touch target */
  min-height: var(--touch-target);
}

.highlight-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.highlight-item i {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stat-item {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--mobile-shadow);
  transition: var(--mobile-transition);
}

.stat-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-light);
  font-weight: 500;
}

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

.skill-category {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--mobile-shadow);
  transition: var(--mobile-transition);
}

.skill-category:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.skill-category h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
  text-align: center;
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-light);
  border-radius: 10px;
  transition: var(--mobile-transition);
}

.skill-item i {
  color: var(--primary-color);
  font-size: 1.25rem;
  width: 20px;
}

.skill-item span {
  flex: 1;
  font-weight: 500;
}

.skill-level {
  width: 80px;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.skill-level::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--level, 0%);
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  transition: width 2s ease-in-out;
}

.skill-level.animate::before {
  width: var(--level);
}

/* Projects Section */
.projects {
  background: var(--bg-light);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.project-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.project-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-placeholder i {
  font-size: 3rem;
  color: white;
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: var(--transition);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-link,
.project-code {
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  text-decoration: none;
  transition: var(--transition);
}

.project-link:hover,
.project-code:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.project-content {
  padding: 1.5rem;
}

.project-content h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.project-content p {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-tech {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tech-tag {
  padding: 0.3rem 0.8rem;
  background: var(--bg-light);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--primary-color);
  font-weight: 500;
}

/* Education Section */
.education-content {
  max-width: 800px;
  margin: 0 auto;
}

.education-item {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.education-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.education-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.education-icon i {
  font-size: 2rem;
  color: white;
}

.education-details h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.education-institution {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.education-period {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.education-description {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.education-progress {
  background: var(--bg-light);
  border-radius: 10px;
  overflow: hidden;
  height: 30px;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  width: 0;
  transition: width 2s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.progress-bar.animate {
  width: var(--progress);
}

.progress-text {
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  position: absolute;
  right: 10px;
}

/* Testimonials Section */
.testimonials {
  background: var(--bg-light);
  position: relative;
}

.testimonials-slider {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  height: 300px;
}

.testimonial-item {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transition: var(--transition);
  background: white;
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.testimonial-item.active {
  opacity: 1;
}

.quote-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.testimonial-text {
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--text-dark);
  margin-bottom: 2rem;
  font-style: italic;
}

.author-name {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.author-role {
  color: var(--text-light);
  font-size: 0.9rem;
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  background: var(--primary-color);
  transform: scale(1.2);
}

/* Contact Section */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.contact-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.contact-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon i {
  font-size: 1.5rem;
  color: white;
}

.contact-details h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.contact-details p {
  color: var(--text-light);
}

.contact-details a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.contact-details a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.contact-form {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--bg-light);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: transparent;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group label {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: var(--text-light);
  transition: var(--transition);
  pointer-events: none;
  background: white;
  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;
  font-size: 0.8rem;
  color: var(--primary-color);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* Footer */
.footer {
  background: var(--text-dark);
  color: white;
  padding: 2rem 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text p {
  margin-bottom: 0.5rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer .social-link {
  background: rgba(255, 255, 255, 0.1);
}

.footer .social-link:hover {
  background: var(--primary-color);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Reducir espaciado general */
  section {
    padding: 3rem 0;
  }
  
  .container {
    padding: 0 var(--mobile-padding);
  }
  
  /* Navegación mobile optimizada */
  .nav-container {
    padding: 0.75rem 1rem;
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 2rem;
    transition: left 0.3s ease;
    /* Optimización: reducir blur en mobile */
    backdrop-filter: blur(10px);
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-link {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
  }
  
  .nav-link::after {
    display: none; /* Eliminar efectos innecesarios en mobile */
  }
  
  .hamburger {
    display: flex;
  }
  
  .hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-8px, 6px);
  }
  
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-8px, -6px);
  }
  
  /* Hero section mobile */
  .hero {
    min-height: 100vh;
    padding: 0 1rem;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
    padding: 2rem 0;
  }
  
  .hero-text {
    order: 2;
  }
  
  .hero-image {
    order: 1;
  }
  
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .hero-description {
    font-size: var(--mobile-font-size);
    margin-bottom: 1.5rem;
    line-height: 1.6;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  .btn {
    padding: 14px 24px;
    font-size: var(--mobile-font-size);
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
  
  .profile-photo {
    width: 200px;
    height: 200px;
  }
  
  .social-links {
    justify-content: center;
    gap: 0.75rem;
  }
  
  .social-link {
    width: 40px;
    height: 40px;
  }
  
  /* Ocultar elementos decorativos en mobile */
  .scroll-indicator[data-mobile-hide="true"] {
    display: none;
  }
  
  /* About section mobile */
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .about-highlights {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .highlight-item {
    padding: 0.75rem;
    font-size: var(--mobile-font-size);
  }
  
  /* Simplificar efectos hover en mobile (touch) */
  .highlight-item:active {
    transform: scale(0.98);
  }
  
  .about-stats {
    gap: 1rem;
  }
  
  .stat-item {
    padding: 1.5rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  /* Skills mobile */
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .skill-category {
    padding: 1.5rem;
  }
  
  .skill-item {
    padding: 0.5rem;
    font-size: var(--mobile-font-size);
  }
  
  /* Projects mobile */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .project-card {
    margin-bottom: 1rem;
  }
  
  /* Contact mobile */
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .contact-item {
    padding: 1rem;
    text-align: center;
  }
  
  .contact-form {
    padding: 1.5rem;
  }
  
  .form-group input,
  .form-group textarea {
    padding: 12px;
    font-size: var(--mobile-font-size);
  }
  
  /* Education mobile */
  .education-item {
    padding: 1.5rem;
    text-align: center;
  }
  
  /* Footer mobile */
  .footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  /* Typography mobile */
  .section-title {
    font-size: 2rem;
  }
  
  .section-subtitle {
    font-size: var(--mobile-font-size);
  }
  
  /* Back to top mobile */
  .back-to-top {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
  }
  
  /* Desactivar fondo complejo en mobile */
  .iridescent-bg[data-mobile-simple="true"] {
    background: linear-gradient(180deg, 
      rgba(30, 58, 138, 0.01) 0%, 
      transparent 100%);
    /* Sin animaciones */
    animation: none;
  }
  
  /* Optimizar formularios para mobile */
  input, textarea, select {
    font-size: 16px; /* Prevenir zoom en iOS */
    -webkit-appearance: none;
    border-radius: 8px;
  }
  
  input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
  }
}

/* Media query para mobile pequeño */
@media (max-width: 480px) {
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-subtitle {
    font-size: 0.9rem;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 0.85rem;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .container {
    padding: 0 0.75rem;
  }
  
  .profile-photo {
    width: 150px;
    height: 150px;
  }
  
  .social-link {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
  
  .highlight-item,
  .skill-item,
  .project-card {
    font-size: 0.85rem;
  }
  
  .contact-form {
    padding: 1rem;
  }
  
  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 15px;
    right: 15px;
  }
}

/* ===== OPTIMIZACIONES PARA DISPOSITIVOS DE BAJA GAMA ===== */

/* Reducción de motion para dispositivos que lo prefieren */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .iridescent-bg[data-mobile-simple="true"] {
    background: var(--bg-light);
    animation: none;
  }
  
  .animated-bg[data-reduce-motion="true"] {
    animation: none;
  }
}

/* Optimizaciones para conexiones lentas */
@media (max-width: 768px) and (prefers-reduced-data: true) {
  .iridescent-bg[data-mobile-simple="true"] {
    background: var(--bg-light);
  }
  
  .profile-photo {
    /* Usar imagen más pequeña si está disponible */
    width: 120px;
    height: 120px;
  }
  
  /* Eliminar sombras complejas */
  .skill-category,
  .project-card,
  .highlight-item,
  .stat-item {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
}

/* ===== UTILIDADES Y HELPERS ===== */

/* Clase para ocultar elementos en mobile */
@media (max-width: 768px) {
  .mobile-hidden {
    display: none !important;
  }
  
  .mobile-only {
    display: block !important;
  }
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

/* Clase para elementos que requieren touch targets */
.touch-target {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Optimizaciones para imágenes lazy loading */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Placeholder para imágenes WebP no soportadas */
.webp-fallback {
  background-color: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}