/* Estilos generales y variables */
:root {
  --color-primario: #1a1a2e;
  --color-secundario: #16213e;
  --color-acento: #e94560;
  --color-texto: #dcdcdc;
  --fuente-principal: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--fuente-principal);
  background-color: var(--color-primario);
  color: var(--color-texto);
  margin: 0;
  line-height: 1.6;
}

/* Encabezado */
header {
  background-color: var(--color-secundario);
  padding: 0.5rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-contenido {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

header h1 {
  color: var(--color-acento);
  margin: 0;
  font-size: 1.8rem;
}

/* Navegación */
nav a {
  color: var(--color-texto);
  text-decoration: none;
  margin: 0 1rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--color-acento);
}

/* Botón de hamburguesa (móvil) */
.hamburguesa {
  display: none; /* Oculto por defecto */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburguesa span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--color-texto);
  margin: 5px 0;
  transition: all 0.3s ease-in-out;
}

.hamburguesa.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburguesa.open span:nth-child(2) {
  opacity: 0;
}
.hamburguesa.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}


/* Secciones generales */
section {
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
  border-bottom: 1px solid #2a2a4a;
}

section:last-of-type {
  border-bottom: none;
}

h2, h3, h4 {
  color: var(--color-acento);
}

h3 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2.5rem;
}

/* Sección Hero */
#hero {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.hero-contenedor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-texto {
  flex: 1;
  min-width: 300px;
}

.hero-foto img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-acento);
  box-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

/* Sección CV */
#CV {
  text-align: center;
}

.btn-cv {
  background-color: var(--color-acento);
  color: #fff;
  padding: 0.8rem 1.8rem;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.btn-cv:hover {
  background-color: #d43d51;
}

/* Sección Proyectos */
.proyectos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.proyecto-card {
  background-color: var(--color-secundario);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.proyecto-card:hover,
.proyecto-card.active {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.proyecto-card h4 {
  margin-top: 0;
}

.proyecto-card a {
  color: var(--color-acento);
  font-weight: bold;
}

/* Sección Skills */
.skills-list {
  list-style: none;
  padding: 0;
  font-size: 1.1rem;
}

.skills-list li {
  background-color: var(--color-secundario);
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 5px;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  background-color: var(--color-secundario);
}

.footer-social a {
  color: #fff;
  margin: 0 1rem;
  font-size: 1.8rem;
  transition: color 0.2s;
}

.footer-social a:hover {
  color: var(--color-acento);
}

.footer-copy {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #aaa;
}

/* Animaciones */
.animated {
  opacity: 0; /* Oculto por defecto */
}

/* Se aplica la animación cuando el elemento es visible */
.animated.visible.slide-in-left {
  animation: slideInLeft 1s ease-out forwards;
}

.animated.visible.slide-in-right {
  animation: slideInRight 1s ease-out forwards;
}

@keyframes slideInLeft {
  from { transform: translateX(-100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- Media Queries para Responsividad --- */

@media (max-width: 768px) {
  /* Menú de hamburguesa visible */
  .hamburguesa {
    display: block;
  }
  
  /* Ocultar navegación normal y mostrarla como menú desplegable */
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-secundario);
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
  }

  nav.open {
    display: flex;
  }

  nav a {
    margin: 0.8rem 0;
  }

  /* Ajustes de layout */
  .header-contenido {
    flex-wrap: wrap;
  }

  .hero-contenedor {
    flex-direction: column;
    text-align: center;
  }

  .hero-foto img {
    width: 250px;
    height: 250px;
  }
  
  section {
    padding: 3rem 1rem;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  .hero-foto img {
    width: 200px;
    height: 200px;
  }
}
