/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  line-height: 1.6;
  color: #333;
  background: #f9f7fb;
}

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

/* Navigation compacta */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px 0;
  position: relative; /* necesario para el avatar absoluto */
  height: 60px; /* altura fija del nav */
}

nav ul {
  display: flex;
  list-style: none;
  gap: 15px; /* reducido de 25px */
}

nav li a {
  font-weight: 500; /* un poco menos pesado */
  font-size: 0.95rem; /* ligeramente más pequeño */
  color: #5e3ec5; /* morado principal */
  transition: color 0.3s;
}

nav li a.active {
  color: #9b63ff; /* morado claro para destacar */
  font-weight: 600;
  border-bottom: 2px solid #9b63ff; /* opcional: subrayado */
  padding-bottom: 2px;
}

.logo {
  position: relative; /* contenedor relativo para el avatar */
  width: 60px;
  height: 60px;
}

.avatar {
  position: absolute; /* se “sale” del flujo del nav */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.5); /* agranda sin afectar nav */
  width: 60px; /* base del tamaño, luego escalado con transform */
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #5e3ec5;
  transition: transform 0.3s;
}

/* Sticky dinámico */
.sticky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #ffffffee;
  box-shadow: 0 4px 15px rgba(94, 62, 197, 0.2);
  z-index: 1000;
  transition: box-shadow 0.3s, background 0.3s;
}

/* Ajuste del padding de sección para compensar nav más delgada */
section {
  padding: 60px 20px;
  scroll-margin-top: 80px;
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #5e3ec5, #9b63ff);
  color: white;
}

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

.hero p {
  font-size: 1.2rem;
  margin-bottom: 30px;
}

.hero button {
  padding: 12px 25px;
  font-size: 1rem;
  background: #ffffff22;
  color: white;
  border: 2px solid white;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.hero button:hover {
  background: #ffffff44;
  transform: scale(1.05);
}

/* About */
.about {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #5e3ec5;
}

.about p {
  font-size: 1.1rem;
  color: #4a3a7c;
}

/* Portfolio */
.portfolio {
  background: #f3f0fa;
}

.portfolio h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
  color: #5e3ec5;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  max-width: 1000px;
  margin: 0 auto;
}

.project-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(94, 62, 197, 0.15);
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(94, 62, 197, 0.25);
}

.project-card h3 {
  margin-bottom: 10px;
  color: #5e3ec5;
}

.project-card p {
  font-size: 0.95rem;
  color: #4a3a7c;
}

/* Experience */
.experience h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
  color: #5e3ec5;
}

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

.experience-item {
  margin-bottom: 20px;
}

.experience-item h3 {
  font-size: 1.2rem;
  margin-bottom: 5px;
  color: #5e3ec5;
}

/* Contact */
.contact h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 20px;
  color: #5e3ec5;
}

.contact form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact input,
.contact textarea {
  padding: 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #bba8ff;
  outline: none;
  transition: border 0.3s, box-shadow 0.3s;
}

.contact input:focus,
.contact textarea:focus {
  border: 2px solid #9b63ff;
  box-shadow: 0 0 8px rgba(155, 99, 255, 0.4);
}

.contact button {
  padding: 12px;
  font-size: 1rem;
  background: #5e3ec5;
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.contact button:hover {
  background: #9b63ff;
  transform: scale(1.05);
}

/* Footer */
footer {
  text-align: center;
  padding: 25px;
  background: #4a3a7c;
  color: white;
}

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

  .avatar {
    width: 50px;
    height: 50px;
  }

  nav ul {
    gap: 15px;
  }
}
