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

body {
  font-family: 'Inter', sans-serif;
  background-color: #fdfdfd;
  color: #1c1c1c;
  line-height: 1.6;
  font-size: 16px;

  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* Footer sticky */
}

main {
  flex: 1;
  /* ocupa espacio entre navbar y footer */
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
}

/* Navbar */
.navbar {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar .logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1c1c1c;
  text-decoration: none;
}

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

.nav-links a {
  text-decoration: none;
  color: #555;
  font-weight: 500;
  transition: color 0.3s ease, background 0.3s ease;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
}

.nav-links a:hover,
.nav-links .active {
  color: #9b5de5;
  background: #f4eaff;
}

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

.section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.section h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: #9b5de5;
  margin-top: 0.5rem;
  border-radius: 2px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 6rem 0;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 2rem;
}

/* Botones Hero */
.btn-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn-primary {
  background: #9b5de5;
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s ease;
}

.btn-primary:hover {
  background: #7a3ec5;
}

.btn-secondary {
  display: inline-block;
  background: #fff;
  color: #9b5de5;
  border: 2px solid #9b5de5;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn-secondary:hover {
  background: #9b5de5;
  color: #fff;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
}

.skills-grid li {
  background: #fff;
  border: 1px solid #eee;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skills-grid li:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  background: #fdf9ff;
}

/* Grid de proyectos */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 2rem;
}

.project-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.project-card p {
  margin-bottom: 1rem;
  color: #555;
  font-size: 0.95rem;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  background: #fdf9ff;
}

.project-card .btn-primary {
  display: inline-block;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  background: #9b5de5;
  color: #fff;
  font-weight: 500;
  transition: background 0.3s ease;
}

.project-card .btn-primary:hover {
  background: #7a3ec5;
}

/* Experiencia laboral */
.job {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.job h3 {
  margin-bottom: 0.3rem;
  font-size: 1.25rem;
}

.job-date {
  font-size: 0.9rem;
  color: #9b5de5;
  margin-bottom: 0.8rem;
  display: block;
}

.job p {
  color: #555;
  font-size: 0.95rem;
}

.job:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  background: #fdf9ff;
}

/* Contacto */
.contact-list {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.contact-list li {
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.contact-list a {
  color: #9b5de5;
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-list a:hover {
  color: #7a3ec5;
}

/* Footer */
footer {
  background: #fafafa;
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.9rem;
  color: #555;
  border-top: 1px solid #eee;
  margin-top: auto;
  /* empuja el footer hacia abajo */
}

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

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

  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

  #chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    z-index: 1000;
  }

  #chat-header {
    background: #9b5de5;
    color: #fff;
    padding: 0.8rem;
    font-weight: 600;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    cursor: pointer;
  }

  #chat-body {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    overflow-y: auto;
    height: 250px;
  }

  .hidden {
    display: none;
  }

  #messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0.5rem;
  }

  #chat-input-container {
    display: flex;
    gap: 0.5rem;
  }

  #chat-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #eee;
    border-radius: 6px;
  }

  #chat-send {
    padding: 0.5rem 0.8rem;
    border: none;
    background: #9b5de5;
    color: #fff;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
  }

  #chat-send:hover {
    background: #7a3ec5;
  }