:root {
  /* Paleta Corporativa Neomoderna */
  --primary: #1e3a8a;          /* Azul Marino */
  --primary-hover: #2563eb;    /* Azul Cobalto */
  --accent: #3b82f6;           /* Azul Neón suave */

  /* Degradado de fondo */
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --bg-card: rgba(255, 255, 255, 0.85); /* Efecto cristal */
  --bg-alt-gradient: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);

  /* Tipografía y bordes */
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: rgba(203, 213, 225, 0.6);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(30, 58, 138, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-family);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
}

body {
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section {
  padding: 80px 0;
}

.bg-alt {
  background: var(--bg-alt-gradient);
}

.section-title {
  font-size: 2.2rem;
  margin-bottom: 24px;
  position: relative;
  font-weight: 800;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  margin-top: 8px;
  border-radius: 2px;
}

.text-center {
  text-align: center;
}

.text-center .section-title::after {
  margin: 8px auto 0;
}

.section-description {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
  max-width: 800px;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 58, 138, 0.45);
}

.btn-secondary {
  border: 1px solid var(--border-color);
  color: var(--text-main);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background-color: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  padding: 16px 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 800;
  font-size: 1.3rem;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 24px;
  align-items: center;
}

.nav-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-menu a:hover {
  color: var(--primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 120px 0 80px;
}

.badge {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.hero h1 {
  font-size: 3.2rem;
  margin: 18px 0;
  line-height: 1.2;
  font-weight: 800;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.25rem;
  max-width: 650px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Tarjetas y Grilla de Skills */
.skills-grid, .projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.skill-card, .project-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 28px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.skill-card:hover, .project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.3);
}

/* Estilos de Badges / Etiquetas */
.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.skill-badges span {
  background: rgba(30, 58, 138, 0.08);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(30, 58, 138, 0.15);
}

.skill-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.project-tags {
  display: flex;
  gap: 8px;
  list-style: none;
  margin-top: 16px;
  flex-wrap: wrap;
}

.project-tags li {
  background: rgba(30, 58, 138, 0.08);
  color: var(--primary);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
}

/* Timeline */
.timeline {
  border-left: 2px solid var(--border-color);
  padding-left: 24px;
  margin-top: 32px;
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -31px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.15);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 700;
}

.timeline-content {
  margin-top: 12px;
}

.timeline-content ul {
  list-style-type: disc;
  padding-left: 20px;
  margin-bottom: 16px;
}

.timeline-content li {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.5;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.timeline-tags span {
  background: rgba(30, 58, 138, 0.08);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(30, 58, 138, 0.15);
}

/* Botones Social */
.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.social-links a.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.social-links a.social-btn:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.social-links a.social-btn i {
  font-size: 1.2rem;
  color: var(--primary);
}

/* Scroll Reveal */
.reveal {
  opacity: 1 !important;
  transform: none !important;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   AJUSTES PARA MENÚ MÓVIL (CORREGIDO)
   ========================================================================== */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  /* El menú desplegable */
  header .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #f8fafc !important; /* Fondo 100% sólido */
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.15) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 24px 0;
    display: none;
    z-index: 99999;
  }

  header .nav-menu.active {
    display: block !important;
  }

  /* Estructura vertical de los elementos del menú */
  header .nav-menu ul {
    flex-direction: column !important;
    gap: 16px !important;
    width: 100%;
    padding: 0 24px;
  }

  header .nav-menu li {
    width: 100%;
    text-align: center;
  }

  header .nav-menu a {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    display: block;
    padding: 10px 0;
  }
}