/* ============================================================
   ESTILOS BASE (Móvil Primero - Recomendado)
============================================================ */

/* TABLETS Y LAPTOPS PEQUEÑAS (1024px hacia abajo) */
@media (max-width: 1024px) {
  .hero__decoracion-codigo {
    display: none;
  }

  .sobre-mi__contenedor,
  .contacto__contenedor {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .sobre-mi__avatar {
    max-width: 220px;
    margin: 0 auto;
  }
}

/* MÓVILES GRANDES Y TABLETS EN VERTICAL (768px hacia abajo) */
@media (max-width: 768px) {
  .navegacion__enlaces {
    display: none;
  }

  .navegacion__menu-movil {
    display: flex;
  }


  .navegacion__enlaces.abierto {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100dvw;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    padding: clamp(4rem, 10vw, 8rem) clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem);
    z-index: 999;
    justify-content: flex-start;
    align-items: center;
    animation: menuApertura 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    overflow: hidden;
    overscroll-behavior: contain;
  }

  .navegacion__enlaces.abierto::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, color-mix(in srgb, var(--color-acento) 5%, transparent) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
  }

  @keyframes menuApertura {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  .navegacion__enlaces.abierto li {
    animation: enlaceAparicion 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
  }

  .navegacion__enlaces.abierto li:nth-child(1) { animation-delay: 0.1s; }
  .navegacion__enlaces.abierto li:nth-child(2) { animation-delay: 0.2s; }
  .navegacion__enlaces.abierto li:nth-child(3) { animation-delay: 0.3s; }
  .navegacion__enlaces.abierto li:nth-child(4) { animation-delay: 0.4s; }

  @keyframes enlaceAparicion {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .navegacion__enlaces.abierto a {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-texto-primario);
    letter-spacing: 0.02em;
    position: relative;
    padding: 1rem 0;
    text-align: center;
  }

  .navegacion__enlaces.abierto a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 2.5px;
    background: linear-gradient(90deg, var(--color-acento), var(--color-acento));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
  }

  .navegacion__enlaces.abierto a:active::after {
    width: 100%;
  }

  /* Ajuste de Timeline para móviles */
  .timeline__linea {
    left: 20px;
  }

  .timeline__elemento {
    grid-template-columns: 40px 1fr;
    gap: 1rem;
  }

  .timeline__elemento--izquierda .timeline__tarjeta,
  .timeline__elemento--derecha .timeline__tarjeta {
    grid-column: 2;
    margin: 0;
    width: 100%;
  }

  .timeline__punto {
    grid-column: 1;
    justify-self: center;
  }

  .timeline__elemento--izquierda .timeline__espacio,
  .timeline__elemento--derecha .timeline__espacio {
    display: none;
  }

  /* Desactivar cursores personalizados en táctiles */
  .cursor-punto,
  .cursor-anillo {
    display: none !important;
  }
  
  body {
    cursor: auto !important;
  }
}

/* MÓVILES PEQUEÑOS (480px hacia abajo) */
@media (max-width: 480px) {
  .seccion {
    padding: clamp(2rem, 6vw, 3rem) clamp(0.75rem, 2vw, 1rem);
  }

  .hero {
    padding: clamp(3rem, 6vw, 5rem) clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 3vw, 2rem);
  }

  h1 {
    font-size: clamp(1.5rem, 5vw, 1.8rem);
  }

  .sobre-mi__avatar {
    max-width: clamp(150px, 40vw, 180px);
  }
  
  .timeline__tarjeta {
    padding: clamp(0.75rem, 2vw, 1rem);
  }

  /* Optimizar alturas mínimas para dispositivos móviles */
  .hero {
    min-height: max(100dvh, 500px);
  }
}
