:root {
  --bg-body: #000000;
  --bg-card: rgba(10, 10, 10, 0.7); /* Transparencia para efecto glass */
  --bg-glass: rgba(0, 0, 0, 0.8);
  --primary: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.5);
  --accent: #6366f1;
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  --border: rgba(255, 255, 255, 0.1); /* Borde sutil, no sólido */
  --border-hover: rgba(255, 255, 255, 0.3);
  --radius: 12px; /* Un poco más suave */
  --font-main: 'Montserrat', sans-serif;
  --font-title: 'Merriweather', serif;
  --glass-filter: blur(12px); /* Estandarizamos el blur */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  /* TU FONDO DE GRILLA ORIGINAL (INTACTO) */
  background-image: linear-gradient(#111 1px, transparent 1px), linear-gradient(90deg, #111 1px, transparent 1px);
  background-size: 40px 40px;
}

h1, h2, h3, h4 {
  font-family: var(--font-title);
  color: #fff;
  letter-spacing: -0.02em;
  font-weight: 700;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* BOTONES MEJORADOS (MÁS PRO) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  font-size: 0.95rem;
  text-align: center;
}

.btn-primary {
  background: #fff;
  color: #000;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: #e5e5e5;
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
}

.btn-secondary, .btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #fff;
  backdrop-filter: blur(4px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
  transform: translateY(-2px);
}

.btn-whatsapp {
  background-color: #25D366;
  color: white;
  width: 100%;
  margin-top: 0.5rem;
  border: none;
  font-weight: 700;
}

/* HEADER LIQUID GLASS (EL QUE PEDISTE) */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 9999;
  /* Efecto Glass Intenso */
  background: rgba(0, 0, 0, 0.7); 
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px; /* Un poco más alto para elegancia */
}

.logo img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s;
}

.logo:hover img {
  transform: scale(1.05);
  border-color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  position: relative;
  padding: 5px 0;
}

/* Subrayado elegante en vez de cambio de color simple */
.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  color: #fff;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

/* HERO SECTION */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}

/* Glow azul sutil detrás del texto (Mejora visual sin cambiar estructura) */
.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 20%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: var(--primary);
  opacity: 0.08; /* Muy sutil */
  filter: blur(100px);
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.hero-container {
  display: flex;
  align-items: center;
  gap: 4rem;
  width: 100%;
}

.hero-content {
  flex: 1;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
}

.hero-image img {
  border-radius: 20px;
  /* Borde glass en la imagen también */
  border: 1px solid rgba(255, 255, 255, 0.1); 
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
  width: 100%;
}

.section {
  padding: 6rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  color: #fff;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* CARDS CON EFECTO LIQUID GLASS TÉCNICO */
.project-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-filter); /* Aquí está la magia */
  -webkit-backdrop-filter: var(--glass-filter);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
  background: rgba(20, 20, 20, 0.8);
}

.project-info {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-info h3 {
  color: #fff;
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
}

.project-info p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.service-icon {
  font-size: 2.5rem;
  /* Gradiente sutil en iconos */
  background: linear-gradient(to bottom, #fff, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  display: inline-block;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  color: #ddd;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 5px;
  display: inline-block;
  text-transform: uppercase;
}

/* Componentes de ABOUT.PHP y DRONE */
.cv-viewer-section {
  padding-top: 120px;
  padding-bottom: 80px;
}

.digital-paper {
  background: #050505;
  border: 1px solid var(--border);
  padding: 3rem;
  border-radius: 24px;
  color: var(--text-main);
}

.paper-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.paper-title {
  font-size: 3rem;
  color: #fff;
}

.paper-body {
  display: flex;
  gap: 4rem;
}

.paper-main { flex: 7; }

.paper-sidebar {
  flex: 4;
  background: rgba(20, 20, 20, 0.5); /* Glass */
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.block-heading {
  color: #fff;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
}

.paper-project {
  background: rgba(255, 255, 255, 0.02);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.mini-tag {
  border: 1px solid #444;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  color: #aaa;
  background: #000;
}

.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-pill {
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  color: #fff;
}

.contact-content {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.contact-item {
  flex: 1;
  min-width: 300px;
}

/* Formulario con Glassmorphism */
.about-content {
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
}

input, textarea {
  width: 100%;
  padding: 1.2rem;
  background: rgba(0, 0, 0, 0.4); /* Input más oscuro para contraste */
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 8px;
  margin-top: 0.5rem;
  font-family: var(--font-main);
  transition: 0.3s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

label {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.social-link {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 0.8rem;
  border: 1px solid var(--border);
  transition: 0.3s;
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.social-icon {
  width: 30px;
  text-align: center;
  margin-right: 1rem;
  font-size: 1.3rem;
}

.social-icon.facebook { color: #1877F2; }
.social-icon.instagram { color: #E4405F; }
.social-icon.tiktok { color: #fff; }
.social-icon.linkedin-in { color: #0A66C2; }
.social-icon.github { color: #fff; }

.footer {
  border-top: 1px solid var(--border);
  padding: 4rem 0;
  margin-top: 6rem;
  background: #050505;
  text-align: center;
  color: #666;
}

/* HERO DRONE (Glass box improved) */
.hero-drone {
  background-size: cover;
  background-position: center top;
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.hero-drone::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to top, #000 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
  z-index: 1;
}

.hero-glass {
  background: rgba(0, 0, 0, 0.5); /* Semi transparente */
  backdrop-filter: blur(15px); /* Blur fuerte */
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: 900px;
  width: 100%;
  margin-bottom: 3rem;
}

.hero-drone h1 {
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero-drone p {
  text-shadow: 0 2px 5px rgba(0,0,0,0.9);
  color: #fff;
  font-size: 1.2rem;
  opacity: 0.9;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.gallery-item {
  border-radius: 12px;
  height: 300px;
  background: #111;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.gallery-item:hover {
    border-color: #fff;
}

.gallery-item img, .gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }

  .hero-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-container {
    flex-direction: column-reverse;
    gap: 2rem;
  }

  .hero-image img {
    width: 100%;
    max-width: 350px;
  }

  .section-title {
    font-size: 2rem;
  }

  .paper-title {
    font-size: 2rem;
  }

  .paper-body {
    flex-direction: column;
  }

  .contact-content {
    flex-direction: column;
  }

  .menu-toggle {
    display: block;
    z-index: 10001;
  }

  .nav-links {
    position: fixed;
    top: 0; /* Cambio para ocupar toda la pantalla */
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.95); /* Fondo sólido móvil */
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Centrado total */
    padding-top: 0;
    gap: 2rem;
    border-top: none;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1; /* Manejamos visibilidad con transform */
    z-index: 10000;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .nav-link {
    font-size: 1.5rem; /* Letra más grande en móvil */
  }

  .hero-drone {
    background-position: center center;
    align-items: flex-end;
  }

  .hero-glass {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }

  .hero-drone h1 {
    font-size: 2rem;
  }
}