/* --- VARIABLES Y BASES --- */
:root {
  --font-main: 'Poppins', sans-serif;
  --bg-dark: #0a192f;
  --bg-card: #112240;
  --primary: #3b82f6;
  --accent-yellow: #fde047;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- NAVEGACIÓN CENTRADA --- */
header {
  background: rgba(10, 25, 47, 0.95);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  padding: 1rem 2rem;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  padding: 0;
  margin: 0;
}

nav a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

/* --- BEATLES FIJOS AL BORDE IZQUIERDO --- */
.beatles-fixed {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 85vh;
  z-index: 90;
  pointer-events: none;
}

.beatles-fixed img {
  height: 100%;
  width: auto;
  display: block;
}

/* --- HERO Y SUBMARINO --- */
.hero {
  position: relative;
  background: linear-gradient(135deg, #0a192f 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 4rem 2rem;
  width: 100%;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-content {
  max-width: 750px;
  z-index: 10;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.2rem;
  color: var(--accent-yellow);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-description {
  margin: 1.5rem 0;
  text-align: center;
}

.hero-description h3 {
  font-size: 1.3rem;
  color: var(--accent-yellow);
  margin-bottom: 0.8rem;
}

.hero-description p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #e2e8f0;
}

.btn-github {
  display: inline-block;
  background-color: var(--primary);
  color: #ffffff;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin-top: 1rem;
}

.btn-github:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
}

/* Submarino Amarillo */
.yellow-submarine {
  position: absolute;
  right: 2rem;
  top: 8%;
  width: 420px;
  z-index: 1;
  animation: floatAnim 4s ease-in-out infinite;
  pointer-events: none;
}

.yellow-submarine img {
  width: 100%;
  height: auto;
}

/* --- SECCIONES Y PERSONAJES ABSOLUTOS --- */
.section-with-side-img {
  position: relative;
  padding: 4rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-content {
  width: 100%;
}

.side-character {
  position: absolute;
  right: -160px;
  top: 50%;
  transform: translateY(-50%);
  width: 200px;
  z-index: 5;
  animation: floatAnim 4.5s ease-in-out infinite;
  pointer-events: none;
}

.side-character img {
  width: 100%;
  height: auto;
}

@keyframes floatAnim {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(-2deg); }
}

h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--accent-yellow);
}

/* --- GRIDS DE HABILIDADES Y PROYECTOS --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.skill-card, .project-card {
  background-color: var(--bg-card);
  padding: 1.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.skill-card:hover, .project-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.skill-card h3, .project-card h3 {
  margin-bottom: 0.8rem;
  color: #ffffff;
}

.skill-card p, .project-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- SOBRE MÍ --- */
.personal .section-content p {
  text-align: center;
  font-size: 1.1rem;
}

/* --- CONTACTO --- */
.contact {
  padding: 4rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.contact-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
}

.contact-form {
  flex: 1;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
}

.form-group input, .form-group textarea {
  padding: 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: var(--bg-card);
  color: #ffffff;
  font-family: inherit;
}

.btn-submit {
  background-color: var(--accent-yellow);
  color: #111111;
  padding: 0.8rem;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.btn-submit:hover {
  opacity: 0.9;
}

.contact-gif {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.contact-gif img {
  max-width: 280px;
  width: 100%;
  height: auto;
}

footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* --- RESPONSIVE --- */
@media (max-width: 1100px) {
  .yellow-submarine {
    width: 280px;
    opacity: 0.35; /* Transparencia tenue si se cruza con el texto */
    right: 1rem;
  }
  
  .side-character {
    right: 10px;
    opacity: 0.3;
  }
}

@media (max-width: 768px) {
  .beatles-fixed {
    height: 60vh;
    opacity: 0.25;
  }
  
  .yellow-submarine {
    width: 180px;
    top: 5%;
    opacity: 0.25;
  }
  
  .skills-grid, .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-container {
    flex-direction: column;
    gap: 2rem;
  }
}
/* --- BOTÓN HAMBURGUESA (Oculto en PC) --- */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 101;
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* --- RESPONSIVE HAMBURGUESA --- */
@media (max-width: 768px) {
    nav {
    justify-content: flex-end; /* Mueve la hamburguesa a la derecha */
    padding: 1rem;
  }
  
  .menu-toggle {
    display: flex; /* Aparece en celulares */
  }

  nav ul {
    position: fixed;
    top: 0;
    right: -100%; /* Oculto fuera de pantalla */
    width: 70%;
    height: 100vh;
    background-color: rgba(10, 25, 47, 0.98);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    transition: right 0.4s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
  }

  /* Menú Desplegado */
  nav ul.active {
    right: 0;
  }

  /* Animación icono X al abrir */
  .menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }
}