/* ===================== 
   RESET Y VARIABLES GLOBALES
   ===================== */

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

:root {
  --primary-black: #000000;
  --secondary-black: #0a0a0a;
  --dark-gray: #1a1a1a;
  --gray-800: #2d2d2d;
  --gray-700: #404040;
  --gray-600: #595959;
  --gray-300: #d0d0d0;
  --gray-200: #e0e0e0;

  --purple-950: #2d1b4e;
  --purple-900: #3d2566;
  --purple-800: #4d2f7e;
  --purple-700: #5d3996;
  --purple-600: #6d43ae;

  --white: #ffffff;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--primary-black);
  color: var(--white);
  line-height: 1.6;
}

/* ===================== 
   TIPOGRAFÍA
   ===================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 3.5rem;
}
h2 {
  font-size: 2.5rem;
}
h3 {
  font-size: 1.75rem;
}
h4 {
  font-size: 1.5rem;
}

p {
  color: var(--gray-300);
  line-height: 1.8;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===================== 
   NAVEGACIÓN
   ===================== */

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--purple-900);
  z-index: 1000;
  padding: 1rem 0;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.logo-box {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--purple-700) 0%, var(--purple-900) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(109, 67, 174, 0.3);
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.logo-text {
  background: linear-gradient(135deg, var(--white) 0%, var(--gray-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Menú Desktop */
.nav-menu {
  display: none;
  align-items: center;
  gap: 0;
  background: rgba(41, 41, 41, 0.5);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  border: 1px solid var(--purple-900);
}

.nav-menu.active {
  display: flex;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--gray-300);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--purple-600);
  background: rgba(93, 57, 150, 0.3);
}

.nav-icon {
  font-size: 1rem;
}

/* Menú Móvil */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--primary-black);
  border-top: 1px solid var(--purple-900);
}

.mobile-menu.active {
  display: flex;
}

.mobile-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--gray-300);
  transition: var(--transition);
}

.mobile-item:hover {
  color: var(--purple-600);
  background: rgba(93, 57, 150, 0.3);
}

/* Derecha Nav */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-toggle {
  background: none;
  border: 1px solid var(--purple-700);
  color: var(--white);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  transition: var(--transition);
}

.lang-toggle:hover {
  background: rgba(93, 57, 150, 0.3);
  color: var(--purple-600);
}

.lang-icon {
  font-size: 1rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* ===================== 
   SECCIÓN HERO
   ===================== */

.hero-section {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-black) 0%, var(--purple-950) 50%, var(--purple-900) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  margin-top: 60px;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  animation: fadeInUp 0.8s ease-out;
}

.hero-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid var(--purple-600);
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(109, 67, 174, 0.3);
  object-fit: cover;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.hero-highlight {
  color: var(--purple-600);
}

.hero-description {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

.hero-socials {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  font-size: 1.5rem;
}

.social-link {
  transition: var(--transition);
  opacity: 0.7;
}

.social-link:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* ===================== 
   BOTONES
   ===================== */

.btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--purple-700);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary,
.btn-secondary,
.btn-submit {
  background: var(--gray-800);
  color: var(--white);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-submit:hover {
  background: var(--gray-700);
  border-color: var(--purple-600);
}

.btn-view {
  background: var(--purple-800);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: var(--transition);
}

.btn-view:hover {
  background: var(--purple-900);
}

/* ===================== 
   SECCIONES GENERALES
   ===================== */

section {
  padding: 5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

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

.section-title {
  margin-bottom: 1rem;
  color: var(--white);
}

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

/* ===================== 
   SECCIÓN SOBRE MÍ
   ===================== */

#sobre-mi {
  background: linear-gradient(180deg, var(--purple-950) 0%, var(--primary-black) 100%);
}

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

.about-image {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(109, 67, 174, 0.2);
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-description {
  font-size: 1.125rem;
  line-height: 1.8;
}

.stats-grid {
    justify-content: flex-start; 
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
  background: var(--gray-900);
  border: 1px solid var(--purple-800);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--purple-600);
  box-shadow: 0 4px 16px rgba(109, 67, 174, 0.2);
}

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

.stat-label {
  color: var(--gray-300);
  font-size: 0.95rem;
}

/* ===================== 
   SECCIÓN HABILIDADES
   ===================== */

#habilidades {
  background: linear-gradient(180deg, var(--primary-black) 0%, var(--gray-900) 100%);
}

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

.skill-card {
  background: var(--gray-800);
  border: 1px solid var(--purple-700);
  padding: 1.5rem;
  border-radius: 8px;
  transition: var(--transition);
}

.skill-card:hover {
  border-color: var(--purple-600);
  box-shadow: 0 8px 24px rgba(109, 67, 174, 0.2);
  transform: translateY(-4px);
}

.skill-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--purple-800, #9e46f0);
}

.skill-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--white);
}

.skill-desc {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--gray-300);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tags span {
  background: var(--purple-800);
  color: var(--white);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
}

/* ===================== 
   SECCIÓN PROYECTOS
   ===================== */

#proyectos {
  background: linear-gradient(180deg, var(--gray-900) 0%, var(--purple-950) 100%);
}

/* --- 1. CONFIGURACIÓN DE LA CUADRÍCULA (GRID) --- */
.projects-grid {
    display: grid;
    /* Esto hace que quepan tantas tarjetas como sea posible (mínimo 300px cada una) */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px; /* Espacio entre tarjetas */
    width: 100%;
    padding: 20px 0;
}

/* --- 2. ESTILO DE LA TARJETA (CONTENEDOR) --- */
.project-card {
    background-color: #111111; /* Fondo muy oscuro (casi negro) */
    border-radius: 20px;       /* Bordes muy redondeados como en la imagen */
    overflow: hidden;          /* Para que la imagen no se salga de las curvas */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); /* Sombra elegante */
    display: flex;
    flex-direction: column;    /* Asegura que la imagen quede arriba y texto abajo */
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px); /* Pequeña elevación al pasar el mouse */
}

/* --- 3. CAJA DE LA IMAGEN --- */
.card-image-box {
    position: relative;
    width: 100%;
    height: 220px; /* Altura fija para uniformidad */
    overflow: hidden;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recorta la imagen para llenar el espacio sin deformarse */
    display: block;
}

/* --- 4. OVERLAY Y BOTÓN --- */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Fondo oscuro semitransparente */
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* EFECTO HOVER: */
    opacity: 0; /* Invisible por defecto */
    transition: opacity 0.3s ease;
}

/* Al pasar el mouse sobre la CAJA DE LA IMAGEN, aparece el overlay */
.card-image-box:hover .card-overlay {
    opacity: 1; 
}

.btn-view {
    background-color: #5b2a88; /* Color morado oscuro */
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(91, 42, 136, 0.4);
}

/* --- 5. CAJA DEL CONTENIDO (TEXTO) --- */
.card-content-box {
    padding: 25px; /* Espacio interno para el texto */
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 0;
    color: #ffffff;
}

.project-desc {
    font-size: 0.9rem;
    color: #cccccc; /* Gris claro para lectura fácil */
    line-height: 1.5;
    margin-bottom: 10px;
}

/* --- 6. ETIQUETAS (TAGS) --- */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto; /* Empuja los tags al final si sobra espacio */
}

.project-tags span {
    background-color: #2d1b4e; /* Fondo morado muy oscuro */
    color: #a855f7;            /* Texto morado neón */
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}


.project-card:hover .project-image {
  filter: brightness(0.6);
}

.project-overlay {
  position: relative;
  height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-top: -200px;
}

.project-card:hover .project-overlay {
  height: 200px;
  margin-top: 0;
}

.project-title {
  font-size: 1.25rem;
  padding: 1rem 1.5rem 0;
  color: var(--white);
}

.project-desc {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  color: var(--gray-300);
}

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

.project-tags span {
  background: var(--purple-900);
  color: var(--white);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* ===================== 
   SECCIÓN EXPERIENCIA
   ===================== */

#experiencia {
  background: linear-gradient(180deg, var(--purple-950) 0%, var(--primary-black) 100%);
}

.timeline {
  max-width: 800px;
  margin: 0 auto;
}

.timeline-item {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--purple-700);
}

.timeline-icon {
  width: 64px;
  height: 64px;
  background: var(--purple-800);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(109, 67, 174, 0.3);
}

.timeline-card {
  background: var(--gray-800);
  border: 1px solid var(--purple-700);
  padding: 1.5rem;
  border-radius: 8px;
  flex: 1;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.timeline-title {
  font-size: 1.25rem;
  color: var(--white);
}

.timeline-period {
  color: var(--purple-600);
  font-weight: 600;
  white-space: nowrap;
}

.timeline-company {
  font-size: 1.05rem;
  color: var(--gray-300);
  margin-bottom: 0.75rem;
}

.timeline-desc {
  font-size: 0.95rem;
  color: var(--gray-300);
}

/* ===================== 
   SECCIÓN CONTACTO
   ===================== */

#contacto {
  background: linear-gradient(180deg, var(--primary-black) 0%, var(--gray-900) 100%);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

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

.contact-info-title {
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 1rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
}

.contact-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.contact-label {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.contact-value {
  color: var(--gray-300);
  font-size: 0.95rem;
}

.contact-benefits {
  background: linear-gradient(135deg, var(--purple-900) 0%, var(--purple-950) 100%);
  padding: 1.5rem;
  border-radius: 8px;
}

.benefits-title {
  font-size: 1.125rem;
  color: var(--white);
  margin-bottom: 1rem;
}

.benefits-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.benefits-list li {
  color: var(--gray-200);
  font-size: 0.95rem;
}

/* Formulario */
.contact-form-wrapper {
  background: var(--gray-800);
  border: 1px solid var(--purple-700);
  padding: 2rem;
  border-radius: 8px;
}

.form-title {
  font-size: 1.25rem;
  color: var(--white);
  margin-bottom: 1.5rem;
}

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

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

.form-input,
.form-textarea {
  background: var(--gray-700);
  border: 1px solid var(--purple-700);
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray-600);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--purple-600);
  background: var(--gray-800);
}

.form-textarea {
  resize: none;
}

.btn-submit {
  background: var(--purple-800);
  border-color: var(--purple-600);
  width: 100%;
  padding: 1rem;
}

.btn-submit:hover {
  background: var(--purple-900);
}

/* ===================== 
   FOOTER
   ===================== */

.footer {
  background: linear-gradient(90deg, var(--primary-black) 0%, var(--purple-950) 50%, var(--primary-black) 100%);
  padding: 3rem 2rem 1rem;
  border-top: 1px solid var(--purple-900);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-title {
  font-size: 1.25rem;
  color: var(--white);
}

.footer-desc {
  font-size: 0.95rem;
  color: var(--gray-300);
}

.footer-socials {
  display: flex;
  gap: 1rem;
  font-size: 1.25rem;
}

.footer-social {
  opacity: 0.7;
  transition: var(--transition);
}

.footer-social:hover {
  opacity: 1;
  transform: scale(1.2);
}

.footer-subtitle {
  font-size: 1.05rem;
  color: var(--white);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a,
.footer-links li {
  color: var(--gray-300);
  font-size: 0.95rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--purple-600);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--purple-900);
  color: var(--gray-300);
  font-size: 0.95rem;
}

/* ===================== 
   BOTÓN SCROLL TO TOP
   ===================== */

.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--purple-700) 0%, var(--purple-900) 100%);
  border: 2px solid var(--purple-600);
  color: var(--white);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(109, 67, 174, 0.3);
  z-index: 999;
}

.scroll-to-top.active {
  display: flex;
}

.scroll-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(109, 67, 174, 0.4);
}

/* ===================== 
   ANIMACIONES
   ===================== */

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

/* ===================== 
   RESPONSIVE
   ===================== */

@media (max-width: 768px) {
  .nav-menu {
    display: none !important;
  }

  .mobile-toggle {
    display: block;
  }

  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }
  h3 {
    font-size: 1.5rem;
  }

  .hero-section {
    margin-top: 50px;
  }

  .hero-image {
    width: 150px;
    height: 150px;
  }

  .hero-buttons {
    flex-direction: column;
  }

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

  .about-content {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .contact-content {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .timeline::before {
    left: 32px;
  }

  .timeline-item {
    gap: 1rem;
  }

  .timeline-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  section {
    padding: 3rem 1rem;
  }

  .scroll-to-top {
    width: 45px;
    height: 45px;
    bottom: 1rem;
    right: 1rem;
    font-size: 1.25rem;
  }

  .nav-container {
    flex-wrap: wrap;
  }

  .nav-logo {
    gap: 0.5rem;
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.25rem;
  }

  .hero-image {
    width: 120px;
    height: 120px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-socials {
    gap: 1rem;
    font-size: 1.25rem;
  }

  .timeline-header {
    flex-direction: column;
  }

  .timeline-period {
    white-space: normal;
  }

  .contact-info-title {
    font-size: 1.25rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}
