* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f6faff;
  --bg-tertiary: #e2e8f0;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --accent-primary: #3b82f6;
  --accent-secondary: #1d4ed8;
  --border-color: #e2e8f0;
  --shadow-color: rgba(59, 130, 246, 0.1);
}

.dark-theme {
  --bg-primary: #0f0f23;
  --bg-secondary: #18182f;
  --bg-tertiary: #23234a;
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #a0aec0;
  --accent-primary: #8b5cf6;
  --accent-secondary: #7c3aed;
  --border-color: #2d3748;
  --shadow-color: rgba(139, 92, 246, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.7s cubic-bezier(0.4,0,0.2,1), color 0.7s cubic-bezier(0.4,0,0.2,1);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.hidden {
  display: none !important;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 0;
  pointer-events: none;
  animation: slideDown 0.5s ease-out;
  background: transparent;
}

@keyframes slideDown {
  from {
    transform: translateY(-100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  padding: 1rem 2rem;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 9999px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  pointer-events: auto;
  transition: all 0.3s ease;
  gap: 1.5rem;
}

body.light-theme .navbar-container {
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.1);
}

.navbar.scrolled .navbar-container {
  padding: 0.75rem 1.5rem;
  max-width: 1150px;
  gap: 1rem;
}

.navbar.scrolled .nav-link {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}

.navbar.scrolled .download-cv-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.navbar.scrolled .nav-links {
  margin-right: 0.5rem;
}

.navbar.scrolled .desktop-nav {
  gap: 0.875rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  animation: fadeInLeft 0.5s ease-out;
  flex-shrink: 0;
  white-space: nowrap;
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  justify-content: flex-end;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.25rem;
  border-radius: 9999px;
  position: relative;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.dark-theme .nav-links {
  background: rgba(0, 0, 0, 0.05);
}

.nav-link {
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1a202c !important;
  text-decoration: none;
  position: relative;
  z-index: 2;
  transition: color 0.2s, background 0.2s;
  animation: fadeInUp 0.5s ease-out;
  animation-fill-mode: both;
  background: transparent;
  white-space: nowrap;
}

.nav-link:nth-child(1) { animation-delay: 0.1s; }
.nav-link:nth-child(2) { animation-delay: 0.2s; }
.nav-link:nth-child(3) { animation-delay: 0.3s; }
.nav-link:nth-child(4) { animation-delay: 0.4s; }
.nav-link:nth-child(5) { animation-delay: 0.5s; }
.nav-link:nth-child(6) { animation-delay: 0.6s; }
.nav-link:nth-child(7) { animation-delay: 0.7s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-link.active {
  color: #ffffff !important;
  background: var(--accent-primary);
}

.nav-link:hover:not(.active) {
  color: var(--accent-primary) !important;
  background: rgba(139, 92, 246, 0.12);
}

.active-indicator {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  height: calc(100% - 0.5rem);
  background: var(--accent-primary);
  border-radius: 9999px;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1;
}

/* Overlay animado para cambio de tema */
.theme-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  background: linear-gradient(120deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1);
  filter: blur(0.5rem) brightness(1.2);
}
.theme-transition-overlay.active {
  opacity: 0.7;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 0 var(--accent-primary);
  transition: box-shadow 0.4s cubic-bezier(0.4,0,0.2,1), background 0.3s;
}
.dark-theme .theme-toggle {
  background: rgba(0, 0, 0, 0.08);
}
.theme-toggle:hover {
  background: var(--accent-primary);
  box-shadow: 0 0 0 8px var(--accent-primary, #8b5cf6, #3b82f6, #7c3aed, #1d4ed8, #fbbf24);
}

/* Botón Descargar CV - Estilo distintivo */
.download-cv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
  text-decoration: none;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Rajdhani', sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  z-index: 10;
  flex-shrink: 0;
  margin-right: 0.25rem;
}

/* Asegurar que el botón se vea bien en ambos temas */
.light-theme .download-cv-btn,
.dark-theme .download-cv-btn {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
}

.download-cv-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.download-cv-btn:hover::before {
  left: 100%;
}

.download-cv-btn:hover {
  background: linear-gradient(135deg, #059669, #0891b2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.download-cv-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.download-cv-btn i {
  width: 1rem;
  height: 1rem;
  transition: transform 0.3s ease;
}

.download-cv-btn:hover i {
  transform: translateY(-2px);
}

.download-cv-btn span {
  position: relative;
  z-index: 1;
}

/* Versión móvil del botón Descargar CV */
.mobile-download-cv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
  text-decoration: none;
  border-radius: 9999px;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: 'Rajdhani', sans-serif;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: translateY(20px);
  opacity: 0;
  position: relative;
  z-index: 10;
}

/* Asegurar que el botón móvil se vea bien en ambos temas */
.light-theme .mobile-download-cv-btn,
.dark-theme .mobile-download-cv-btn {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
}

.mobile-menu.active .mobile-download-cv-btn {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 0.45s;
}

.mobile-download-cv-btn:hover {
  background: linear-gradient(135deg, #059669, #0891b2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.mobile-download-cv-btn i {
  width: 1.25rem;
  height: 1.25rem;
}

.theme-img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.5rem;
  height: 1.5rem;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 12px 2px var(--accent-primary, #8b5cf6, #fbbf24, #7c3aed, #1d4ed8);
  background: transparent;
  transform: translate(-50%, -50%) translateY(0) scale(1);
  opacity: 1;
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1), opacity 0.6s cubic-bezier(0.4,0,0.2,1), box-shadow 0.4s;
  pointer-events: none;
}
.sun-img {
  z-index: 2;
  box-shadow: 0 0 16px 2px #fbbf24cc;
}
.moon-img {
  z-index: 1;
  box-shadow: 0 0 16px 2px var(--accent-primary);
}
body.light-theme .sun-img {
  transform: translate(-50%, -50%) translateY(0) scale(1.15);
  opacity: 1;
  animation: icon-bounce 0.7s;
}
body.light-theme .moon-img {
  transform: translate(-50%, -50%) translateY(100%) scale(0.8);
  opacity: 0;
}
body.dark-theme .sun-img {
  transform: translate(-50%, -50%) translateY(-100%) scale(0.8);
  opacity: 0;
}
body.dark-theme .moon-img {
  transform: translate(-50%, -50%) translateY(0) scale(1.15);
  opacity: 1;
  animation: icon-bounce 0.7s;
}
@keyframes icon-bounce {
  0% { transform: translate(-50%, -50%) scale(0.7); }
  60% { transform: translate(-50%, -50%) scale(1.25); }
  80% { transform: translate(-50%, -50%) scale(0.95); }
  100% { transform: translate(-50%, -50%) scale(1.15); }
}

.mobile-controls {
  display: none;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
}

.mobile-menu-toggle:hover {
  color: var(--text-primary);
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.dark-theme .mobile-menu {
  background: rgba(0, 0, 0, 0.95);
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 9999px;
  position: relative;
  transition: all 0.3s ease;
  transform: translateY(20px);
  opacity: 0;
}

.mobile-menu.active .mobile-nav-link {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-nav-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-nav-link:nth-child(4) { transition-delay: 0.25s; }
.mobile-nav-link:nth-child(5) { transition-delay: 0.3s; }
.mobile-nav-link:nth-child(6) { transition-delay: 0.35s; }
.mobile-nav-link:nth-child(7) { transition-delay: 0.4s; }

.mobile-nav-link.active {
  background: var(--accent-primary);
  color: white;
}

.mobile-nav-link:hover:not(.active) {
  color: var(--text-primary);
}

.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
}

.video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 1;
}

.dark-theme .overlay {
  background: transparent;
}

.hero video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
  /* Mejorar la calidad de renderizado del video */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 8rem; /* Espacio para el navbar fijo */
  padding-bottom: 2rem;
}

.hero-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.75rem, 8vw, 6.5rem);
  font-weight: 950;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #ffffff;
  padding: 0 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hero-subtitle {
  font-family: 'Times', sans-serif;
  font-size: clamp(0.95rem, 2.5vw, 1.8rem);
  font-weight: 400;
  color: #ffffff;
  margin-bottom: 2.5rem;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  padding: 0 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Botón con efecto de brillo flotante */
.glow-on-hover {
  width: 220px;
  height: 50px;
  border: none;
  outline: none;
  color: #1a1a1a;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  cursor: pointer;
  position: relative;
  z-index: 0;
  border-radius: 25px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-top: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 20px rgba(4, 217, 255, 0.6), 0 0 40px rgba(4, 217, 255, 0.4), 0 0 60px rgba(4, 217, 255, 0.2), 0 4px 15px rgba(0, 0, 0, 0.1);
}

.glow-on-hover:before {
  content: '';
  background: linear-gradient(45deg, #ffffff, #04d9ff, #006eff, #8b5cf6, #7c3aed, #04d9ff, #ffffff, #04d9ff);
  position: absolute;
  top: -2px;
  left: -2px;
  background-size: 400%;
  z-index: -1;
  filter: blur(8px);
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  animation: glowing 20s linear infinite;
  opacity: 0;
  transition: opacity .3s ease-in-out;
  border-radius: 25px;
}

.glow-on-hover:hover:before {
  opacity: 1;
}

.glow-on-hover:after {
  z-index: -1;
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  left: 0;
  top: 0;
  border-radius: 25px;
}

.glow-on-hover:hover {
  color: #1a1a1a;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 0 30px rgba(4, 217, 255, 0.5);
  background: rgba(255, 255, 255, 0.4);
}

.glow-on-hover:active {
  color: #1a1a1a;
  transform: scale(0.98);
}

.glow-on-hover:active:after {
  background: rgba(255, 255, 255, 0.5);
}

.glow-on-hover.clicking {
  animation: clickPulse 0.4s ease-out;
}

@keyframes glowing {
  0% { background-position: 0 0; }
  50% { background-position: 400% 0; }
  100% { background-position: 0 0; }
}

@keyframes clickPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
    box-shadow: 0 0 30px rgba(4, 217, 255, 0.6);
  }
  100% {
    transform: scale(0.98);
  }
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .glow-on-hover {
    width: 180px;
    height: 45px;
    font-size: 1rem;
  }
}

.hero-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #04d9ff, #006eff);
  color: #000000;
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 600;
  font-family: 'Rajdhani', sans-serif;
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease-out 0.6s both;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-button:hover {
  background: linear-gradient(135deg, #ffffff, #ffffff);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.6);
}

.button-82-pushable {
  position: relative;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  outline-offset: 4px;
  transition: filter 250ms;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.button-82-shadow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: hsl(0deg 0% 0% / 0.25);
  will-change: transform;
  transform: translateY(2px);
  transition:
    transform
    600ms
    cubic-bezier(.3, .7, .4, 1);
}

.button-82-edge {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(
    to left,
    hsl(249, 100%, 16%) 0%,
    hsl(236, 100%, 32%) 8%,
    hsl(236, 100%, 32%) 92%,
    hsl(249, 100%, 16%) 100%
  );
}

.button-82-front {
  display: block;
  position: relative;
  padding: 12px 27px;
  border-radius: 12px;
  font-size: 1.1rem;
  color: white;
  background: hsl(244, 100%, 47%);
  will-change: transform;
  transform: translateY(-4px);
  transition:
    transform
    600ms
    cubic-bezier(.3, .7, .4, 1);
}

@media (min-width: 768px) {
  .button-82-front {
    font-size: 1.25rem;
    padding: 12px 42px;
  }
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite 1s;
}

.scroll-indicator i {
  width: 2rem;
  height: 2rem;
  color: var(--accent-primary);
}

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

.section-heading {
  text-align: center;
  margin-bottom: 4rem;
}

.section-heading h2 {
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.section-heading p {
  color: var(--text-muted);
  max-width: 32rem;
  margin: 0 auto 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out 0.2s forwards;
}

.heading-line {
  width: 5rem;
  height: 0.25rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  margin: 0 auto;
  border-radius: 9999px;
  transform: scaleX(0);
  animation: scaleX 0.6s ease-out 0.4s forwards;
}

@keyframes scaleX {
  to {
    transform: scaleX(1);
  }
}

.about {
  padding: 5rem 0;
  background: var(--bg-primary);
  transition: background 0.7s cubic-bezier(0.4,0,0.2,1);
}

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

.about-image {
  position: relative;
}

.image-glow {
  position: absolute;
  inset: -1rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0.3;
  filter: blur(2rem);
  border-radius: 0.75rem;
}

.about-image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.75rem;
  position: relative;
  z-index: 1;
}

.about-text h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat {
  text-align: center;
  padding: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.stat:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
}

.stat i {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.technologies {
  padding: 5rem 0;
  background: var(--bg-secondary);
  transition: background 0.7s cubic-bezier(0.4,0,0.2,1);
}

.tech-categories {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.tech-category h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.tech-category h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  max-width: 100%;
}

@media (min-width: 768px) {
  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (min-width: 1024px) {
  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease-out forwards;
}

.tech-item:hover {
  transform: translateY(-10px);
  border-color: var(--accent-primary);
  box-shadow: 0 10px 30px rgba(4, 217, 255, 0.1);
}

.tech-item img {
  width: 5rem;
  height: 5rem;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.tech-item:hover img {
  transform: scale(1.1);
}

.education {
  padding: 5rem 0;
  background: var(--bg-primary);
  transition: background 0.7s cubic-bezier(0.4,0,0.2,1);
}

.timeline {
  max-width: 48rem;
  margin: 0 auto;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-primary);
}

.timeline-item {
  margin-bottom: 3rem;
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -2.625rem;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--accent-primary);
  border: 4px solid var(--bg-primary);
  border-radius: 50%;
}

.timeline-content {
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  opacity: 0;
  transform: translateX(-50px);
  animation: slideInLeft 0.5s ease-out forwards;
}

.timeline-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.timeline-content h4 {
  font-size: 1.125rem;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.timeline-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.timeline-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline-meta i {
  width: 1rem;
  height: 1rem;
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.languages {
  padding: 5rem 0;
  background: var(--bg-secondary);
  transition: background 0.7s cubic-bezier(0.4,0,0.2,1);
}

.languages-list {
  max-width: 48rem;
  margin: 0 auto;
}

.language-item {
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.language-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(4, 217, 255, 0.3);
  transform: translateY(-2px);
}

.language-item:nth-child(1) { animation-delay: 0.1s; }
.language-item:nth-child(2) { animation-delay: 0.2s; }
.language-item:nth-child(3) { animation-delay: 0.3s; }
.language-item:nth-child(4) { animation-delay: 0.4s; }
.language-item:nth-child(5) { animation-delay: 0.5s; }
.language-item:nth-child(6) { animation-delay: 0.6s; }
.language-item:nth-child(7) { animation-delay: 0.7s; }
.language-item:nth-child(8) { animation-delay: 0.8s; }
.language-item:nth-child(9) { animation-delay: 0.9s; }

.language-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  align-items: center;
}

.language-header span:first-child {
  font-size: 1.125rem;
  font-weight: 600;
  color: #000000;
  font-family: 'Rajdhani', sans-serif;
}

.percentage {
  color: #04d9ff;
  font-weight: 700;
  font-size: 1.1rem;
  font-family: 'Orbitron', monospace;
}

.progress-bar {
  height: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #04d9ff, #006eff);
  border-radius: 9999px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(4, 217, 255, 0.3);
}

.projects {
  padding: 5rem 0;
  background: var(--bg-primary);
  transition: background 0.7s cubic-bezier(0.4,0,0.2,1);
}

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

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease-out forwards;
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-primary);
}

.project-image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

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

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

.project-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}

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

.project-link i {
  width: 1.25rem;
  height: 1.25rem;
}

.project-content {
  padding: 1.5rem;
}

.project-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

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

.project-tags span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  transition: all 0.3s ease;
}

.project-tags span:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}

.project-tags span img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.contact {
  padding: 5rem 0;
  background: var(--bg-secondary);
  transition: background 0.7s cubic-bezier(0.4,0,0.2,1);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: 80rem;
  margin: 0 auto;
}

.contact-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.contact-icon i {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent-primary);
}

.contact-item h4 {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.contact-item p {
  color: var(--text-secondary);
}

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

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-link:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-5px);
}

.social-link i {
  width: 1.25rem;
  height: 1.25rem;
}

.contact-form h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
}

.contact-form input {
  margin-bottom: 1rem;
}

.contact-form textarea {
  margin-bottom: 1rem;
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  background: var(--accent-secondary);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.submit-btn i {
  width: 1rem;
  height: 1rem;
}

.form-message {
  padding: 1rem;
  border-radius: 0.375rem;
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.form-message.show {
  opacity: 1;
  transform: translateY(0);
}

.form-message.success {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.footer {
  padding: 2rem 0;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
}

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

.footer-brand p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.scroll-to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.scroll-to-top:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
}

.scroll-to-top i {
  width: 1.5rem;
  height: 1.5rem;
}

/* Media queries para pantallas grandes */
@media (min-width: 1400px) {
  .navbar-container {
    max-width: 1300px;
    padding: 1rem 2.5rem;
  }
  
  .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }
  
  .download-cv-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  
  .download-cv-btn {
    display: none;
  }
  
  .mobile-controls {
    display: flex;
  }
  
  .navbar-container {
    padding: 1rem 1.5rem;
  }
  
  .hero-content {
    padding-top: 7rem; /* Menos espacio en móvil pero suficiente */
    padding-bottom: 1.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .hero-title {
    margin-bottom: 1.25rem;
    line-height: 1.15;
  }
  
  .hero-subtitle {
    margin-bottom: 2rem;
    max-width: 95%;
    line-height: 1.5;
    padding: 0 0.5rem;
  }
  
  .glow-on-hover {
    margin-top: 1.5rem;
  }
  
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .stats {
    grid-template-columns: 1fr;
  }
  
  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .container, .projects-grid, .about-content, .tech-categories, .timeline, .languages-list, .contact-content {
    box-shadow: none;
    border-radius: 0.75rem;
  }
}

@media (max-width: 480px) {
  .navbar-container {
    padding: 0.75rem 1rem;
  }
  
  .hero-content {
    padding-top: 6.5rem; /* Aún menos espacio en pantallas muy pequeñas */
    padding-bottom: 1rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  .hero-title {
    font-size: clamp(1.5rem, 7vw, 2.5rem);
    margin-bottom: 1rem;
    padding: 0 0.25rem;
  }
  
  .hero-subtitle {
    font-size: clamp(0.875rem, 3.5vw, 1.125rem);
    margin-bottom: 1.5rem;
    max-width: 100%;
    padding: 0 0.5rem;
    line-height: 1.5;
  }
  
  .glow-on-hover {
    width: 160px;
    height: 42px;
    font-size: 0.95rem;
    margin-top: 1rem;
  }
  
  .container {
    padding: 0 0.5rem;
  }
  
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .mobile-download-cv-btn {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }
  
  .scroll-indicator {
    bottom: 1.5rem;
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px) scale(0.98) rotateX(10deg);
  filter: blur(6px);
  transition: all 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0) scale(1) rotateX(0);
  filter: blur(0);
}

.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Quitar box-shadow y border-radius de los contenedores principales */
.container, .projects-grid, .about-content, .tech-categories, .timeline, .languages-list, .contact-content {
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Mantener fondo negro solo en .hero */
.hero {
  background: #000000;
}

/* Mantener intercalado azul suave en las secciones */
.about {
  background: var(--bg-primary);
}
.technologies {
  background: var(--bg-secondary);
}
.education {
  background: var(--bg-primary);
}
.languages {
  background: var(--bg-secondary);
}
.projects {
  background: var(--bg-primary);
}
.contact {
  background: var(--bg-secondary);
}

/* ========================================== */
/* CV PASSWORD MODAL STYLES */
/* Modal de contraseña para descargar el CV */
/* ========================================== */
.cv-password-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.cv-password-modal.hidden {
  display: none;
}

.cv-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.cv-modal-container {
  position: relative;
  width: 100%;
  max-width: 450px;
  padding: 1.5rem;
  z-index: 1;
}

.cv-modal-content {
  background: var(--bg-primary);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
  position: relative;
  animation: modalSlideUp 0.4s ease;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cv-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--text-secondary);
}

.cv-modal-close:hover {
  background: var(--bg-tertiary);
  transform: rotate(90deg);
  color: var(--text-primary);
}

.cv-modal-close i {
  width: 1.25rem;
  height: 1.25rem;
}

.cv-modal-icon {
  margin-bottom: 1.5rem;
}

.cv-modal-icon i {
  width: 50px;
  height: 50px;
  color: var(--accent-primary);
}

.cv-modal-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-family: 'Inter', sans-serif;
}

.cv-modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.cv-password-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cv-password-input-wrapper {
  position: relative;
  width: 100%;
}

#cv-password-input {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 1.125rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

#cv-password-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.dark-theme #cv-password-input {
  background: var(--bg-tertiary);
}

.cv-password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  border-radius: 6px;
}

.cv-password-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.cv-password-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

.cv-password-toggle i {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.cv-password-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.cv-password-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, #059669, #0891b2);
}

.cv-password-submit-btn:active {
  transform: translateY(0);
}

.cv-password-submit-btn.shake {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.cv-password-submit-btn i {
  width: 18px;
  height: 18px;
}

.cv-password-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: 8px;
  font-size: 0.875rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cv-password-error.hidden {
  display: none;
}

.cv-password-error i {
  width: 16px;
  height: 16px;
}

/* Dark theme adjustments for CV modal */
.dark-theme .cv-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

/* Responsive design for CV modal */
@media (max-width: 768px) {
  .cv-modal-container {
    padding: 1rem;
  }
  
  .cv-modal-content {
    padding: 2rem 1.5rem;
  }
  
  .cv-modal-content h3 {
    font-size: 1.25rem;
  }
  
  .cv-modal-icon i {
    width: 45px;
    height: 45px;
  }
}
