/* ===============================
   VARIABLES Y CONFIGURACIÓN GLOBAL
================================ */
:root {
  --bg: #1f2937;
  --primary: #facc15;
  --muted: #9aa2ad;
  --text: #e6eef6;
  --sub: #9aa2ad;
  --maxw: 90vw;
  --maxw-content: 1500px; /* ✨ Un ancho máximo fijo para el contenido */
}

/* ✨ Añadido 'box-sizing' para un control de tamaño predecible */
html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*, *:before, *:after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  
  /* ✨ Hacemos espacio para el menú y la ola superior, que están en 'position: absolute' */
  padding-top: 100px; 
  padding-bottom: 30px;
  overflow-x: hidden; /* ❗ Evita el desbordamiento horizontal */
}

.wave-top {
  width: 100%;
  height: 120px;
  background: #facc15;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  mask-image: url("data:image/svg+xml;utf8,<svg width='100%' height='100%' viewBox='0 0 1440 320' xmlns='http://www.w3.org/2000/svg'><path fill='black' d='M0,256L60,234.7C120,213,240,171,360,149.3C480,128,600,128,720,149.3C840,171,960,213,1080,197.3C1200,181,1320,107,1380,69.3L1440,32L1440,0L1380,0C1320,0,1200,0,1080,0C960,0,840,0,720,0C600,0,480,0,360,0C240,0,120,0,60,0L0,0Z'/></svg>");
  mask-size: cover;
  mask-repeat: no-repeat;
}

/* ===============================
   MENÚ
================================ */
.menu {
  /* ❗ Centrado profesional: se alinea al 50% y se autocentra con transform */
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  
  /* ❗ Ancho fluido con un máximo, igual que el contenido */
  width: var(--maxw);
  max-width: var(--maxw-content);
  
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 30px;
  z-index: 2;
}

.menu a {
  color: #111 !important;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
  font-size: 15px; /* ✨ Ligeramente más grande para legibilidad */
  letter-spacing: 0.5px;
  white-space: nowrap; /* ✨ Evita que los enlaces se rompan en dos líneas */
}

.menu a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0%;
  height: 3px;
  background-color: #facc15;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.menu a:hover {
  background: rgba(250, 203, 21, 0.15);
}

.menu a:hover::after {
  width: 60%;
}

.menu a.active {
  background: #facc15;
  color: #111;
}

.menu a.active::after {
  width: 60%;
  background-color: #111;
}

/* Responsive menú */
@media (max-width: 720px) {
  .menu {
    justify-content: center;
    gap: 10px; /* ✨ Espacio reducido para móviles */
    padding: 10px 15px;
  }
  .menu a {
    padding: 6px 10px;
    font-size: 13px;
  }
}

/* === MENÚ HAMBURGER === */
.menu {
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: var(--maxw);
  max-width: var(--maxw-content);
  display: flex;
  justify-content: space-between; /* 👈 permite alinear el botón a la izquierda */
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 30px;
  border-radius: 10px;
  box-shadow: 0 1px 15px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

/* Botón de los tres palitos */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: #111;
  border-radius: 2px;
  transition: 0.3s ease;
}

/* Efecto cruz */
.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Contenedor de enlaces */
.menu-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

@media (max-width: 720px) {
  .menu {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 20px;
  }

  .menu-toggle {
    display: flex;
  }

  .menu-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 10px 0;
    margin-top: 10px;
  }

  .menu-links.active {
    display: flex;
  }

  .menu-links a {
    color: #111 !important;
    padding: 10px 0;
    font-size: 15px;
    text-align: center;
    width: 100%;
    border-radius: 0;
  }

  .menu-links a:hover {
    background: rgba(250, 203, 21, 0.25);
  }
}

/* ===============================
   ESTRUCTURA PRINCIPAL
================================ */
.page {
  /* ❗ LA CORRECCIÓN MÁS IMPORTANTE:
     Eliminado 'width: 1900px'. 
     Usamos 'width' fluido y 'max-width' fijo.
  */
  width: var(--maxw); /* 90vw */
  max-width: var(--maxw-content); /* 1200px */
  margin: 0 auto;
  
  /* ✨ Convertimos '.page' en el ancla para elementos absolutos internos */
  position: relative; 
}

/* ===============================
   FONDO (IMAGEN)
================================ */
.background-fixed {
  position: absolute;
  /* ✨ Anclado al contenedor '.page', no a un píxel fijo de la ventana */
  top: 250px; /* Ajustado para empezar cerca del grid */
  left: 50%;
  transform: translateX(-50%);
  
  /* ❗ Corrección de Zoom/Responsive */
  width: 100%; /* Ocupa el 100% de '.page' */
  max-width: 1100px; /* Tu ancho original, ahora es un 'max' */
  height: auto; /* El alto es automático */
  aspect-ratio: 1100 / 900; /* Mantiene la proporción de la imagen */
  
  overflow: hidden;
  pointer-events: none;
  z-index: -1000;
  
  /* ❗ Eliminados 'margin-left: -150px' y 'margin-top' */
}

.background-fixed img {
  display: block;
  /* ❗ La imagen llena su contenedor (que ahora es responsivo) */
  height: 100%;
  width: 100% ;
  opacity: 0.1;
  object-fit: contain;
}


/* ===============================
   HEADER (Avatar, Nombre)
================================ */
.header {
  text-align: center;
  margin-bottom: 36px;
  position: relative;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 18px;
  width: 148px;
  height: 148px;
}
.avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid #fff;
  position: relative;
  z-index: 3;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.avatar-ring-left {
  position: absolute;
  width: 205px;
  height: 200px;
  border-radius: 90%;
  border: 6px solid var(--primary);
  top: -3px;
  left: -1px;
  z-index: 2;
  transform: translate(-5px, 3px);
}
.avatar-ring-right {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.35);
  top: 4px;
  left: 6px;
  z-index: 1;
  transform: translate(5px, 6px);
}

.name {
  font-size: 46px;
  letter-spacing: 3px;
  font-weight: 800;
  margin-top: 12px; /* ✨ Más espacio */
  color: #fff;
}
.meta {
  color: var(--sub);
  font-size: 13px;
  margin-top: 8px;
}

/* ===============================
   GRID DE 3 COLUMNAS
================================ */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 30px; /* ✨ Separa el grid del header */
}

/* ✨ Eliminado 'padding: 6px' de .col para que los elementos internos manejen su espacio */
.col {
}

.section-title {
  color: var(--primary);
  font-weight: 800;
  font-size: 23px;
  margin-bottom: 18px;
  letter-spacing: 1px;
}

/* ===============================
   COLUMNA IZQUIERDA
================================ */
.experience {
  list-style: none;
}
.experience li {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  align-items: flex-start;
}
.experience p {
  color: var(--text);
  font-size: 14px;
  margin-top: 2px;
  max-width: 100%; /* ❗ Eliminado 'max-width: 360px' para que sea fluido */
}
.year {
  background: var(--primary);
  color: #111827;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  min-width: 48px;
  text-align: center;
}

/* AFICIONES */
.hobbies {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 18px;
}
.hobbies li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  width: calc(50% - 9px); /* ✨ Ajuste del 'calc' para el gap */
  min-width: 140px; /* ✨ Evita que se colapse en pantallas pequeñas */
}
.hobbies li.full {
  width: 100%;
}
.material-icons {
  font-size: 18px;
  color: var(--primary);
}

/* IDIOMAS */
.languages img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 12px;
  border: 3px solid rgba(255, 255, 255, 0.03);
}

/* ===============================
   COLUMNA CENTRAL
================================ */
.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 12px;
}
.quote {
  max-width: 520px;
  margin-bottom: 20px;
  position: relative;
  top: -50px; /* Sube la cita al espacio vacío */
}
.quote em {
  font-style: normal;
  color: #cbd5e1;
  font-size: 19px;
  line-height: 1.6;
}
.open-quote, .close-quote {
  color: var(--primary);
  font-size: 36px;
  vertical-align: middle;
  margin: 0 2px;
}

/* ===============================
   CENTRO: IMÁGENES DEL PORTAFOLIO
================================ */
/* (Esta sección ya era bastante robusta, se mantiene) */
.center-art {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 420px;
  margin: 40px auto 0;
  overflow: visible;
  display: block;
  z-index: 2;
  perspective: 1000px;
}
.center-art img {
  position: absolute;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35));
  will-change: transform, opacity;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  animation: floaty 5s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}
.center-art img {
  animation-name: floaty, fadeIn;
  animation-duration: 5s, 1s;
  animation-delay: 0s, 0.2s;
  animation-iteration-count: infinite, 1;
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 0.9; transform: scale(1); }
}
.center-art img:hover {
  transform: scale(1.15) rotateY(10deg) rotateX(6deg);
  opacity: 1;
  z-index: 10;
  transition: transform 0.4s ease, opacity 0.3s ease;
}
/* Posiciones personalizadas */
.center-art img.audiculares { top: 90px; left: -5%; width: 105px; transform: rotate(-10deg); }
.center-art img.celular    { top: 90px; left: 80%; width: 105px; transform: rotate(8deg); }
.center-art img.computadora { top: 160px; left: 30%; width: 220px; transform: translateX(-50%); z-index: 3; }
.center-art img.libro      { top: 270px; left: -3%; width: 105px; transform: rotate(3deg); z-index: 2; }
.center-art img.mouse      { top: 270px; left: 80%; width: 105px; transform: rotate(-6deg); z-index: 3; }
.center-art img.portafolio  { top: 20px; left: 40%; width: 105px; transform: translateX(-50%) rotate(-2deg); z-index: 4; }

/* ===============================
   EDUCACIÓN
================================ */
.education-list {
  list-style: none;
  margin-top: 12px;
}
.education-list li {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.education-list strong {
  color: var(--text);
  display: block;
}

/* ===============================
   COLUMNA DERECHA
================================ */
.contact {
  list-style: none;
}
.contact li {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 14px;
}
.contact .material-icons {
  font-size: 20px;
  color: var(--primary);
}

/* ===============================
   HABILIDADES (CÍRCULOS)
================================ */
.skills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 14px;
  justify-items: center;
  margin-top: 18px;
}
.skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* ❗ Eliminado 'width: 100px' para que el grid responsivo maneje el tamaño */
}
.circle {
  width: 86px;
  height: 86px;
  transform: rotate(-90deg);
}
.circle-bg {
  fill: none;
  stroke: #39434a;
  stroke-width: 4;
}
.circle-fill {
  fill: none;
  stroke: #facc15;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}
.skill-label {
  margin-top: 0px;
  font-weight: bold;
  font-size: 14px; /* ✨ Unificado (tenías 14px y 16px) */
  color: #fff;
}
.skill:hover .circle-fill {
  stroke-dasharray: 100,100;
}

/* ===============================
   MEDIA QUERIES (RESPONSIVE)
================================ */

/* Tablets - 2 columnas */
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
  .center {
    order: 3; /* Manda la columna central al final */
    grid-column: 1 / -1; /* Ocupa todo el ancho */
  }
}

/* Móviles - 1 columna */
@media (max-width: 720px) {

.background-fixed {
    display: none !important; 
  }

  body {
    padding-top: 80px; /* ✨ Menos espacio superior en móvil */
  }
  
  .grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .center {
    order: 0; /* ✨ Restaura el orden original en 1 columna */
    grid-column: auto; /* Restaura el flujo */
  }
  
  .name { font-size: 26px; }
  .avatar-wrap { width: 120px; height: 120px; }
  .avatar { width: 120px; height: 120px; }
  .avatar-ring-left, .avatar-ring-right { width: 120px; height: 120px; }
  .section-title { font-size: 16px; }
  
  /* Habilidades en móvil */
  .skills {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  
  /* Hobbies en móvil */
  .hobbies li {
    width: 100%; /* ✨ Ocupa todo el ancho en móvil */
  }
  
  /* Arte central en móvil */
  .center-art { max-width: 340px; height: 280px; }
  .center-art img { animation: floatyMobile 6s ease-in-out infinite, fadeIn 1s ease forwards; opacity: 1; }
  @keyframes floatyMobile {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(1deg); }
  }
  .center-art img.audiculares { top: 18px; left: 8%; width: 50px; }
  .center-art img.celular    { top: 18px; left: 74%; width: 44px; }
  .center-art img.computadora { top: 90px; width: 150px; }
  .center-art img.libro      { top: 180px; left: 2%; width: 55px; }
  .center-art img.mouse      { top: 140px; left: 80%; width: 50px; }
  .center-art img.portafolio { top: 70px; left: 50%; width: 70px; }
}

/* ❗❗❗
   LIMPIEZA: Se eliminó un gran bloque de CSS duplicado
   que tenías al final de tu archivo original.
   (Desde '.center-art img' hasta '.skill:hover .circle-fill')
*/