/* =====================================
   RESET BÁSICO
===================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =====================================
   VARIABLES GLOBALES (Estilo FadCam)
===================================== */
:root {
  --primary-color: #e53935;      /* Rojo Principal */
  --secondary-color: #0a0a0a;    /* Fondo Casi Negro */
  --accent-color: #b71c1c;       /* Rojo Oscuro */
  --text-color: #f3f4f6;         /* Blanco Hueso */
  --light-text: #aaaaaa;         /* Texto secundario */
  --card-bg: rgba(10, 10, 10, 0.85); 
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --neu-base: #1A1A1A;
  color-scheme: dark; /* Fuerza modo oscuro para assets del navegador */
}

/* =====================================
   ESTILOS GENERALES Y FONDO
===================================== */
body {
  font-family: var(--font-family);
  background-color: var(--secondary-color);
  color: var(--text-color);
  margin: 0;
  overflow-x: hidden;
  
  /* Degradado sutil de fondo */
  background-image: 
      radial-gradient(circle at top right, rgba(229, 57, 53, 0.1), transparent 30%),
      radial-gradient(circle at bottom left, rgba(183, 28, 28, 0.1), transparent 40%);
      
  /* Estructura Flex para Footer Sticky */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* El main ocupará todo el espacio disponible */
main {
  flex: 1;
  width: 100%;
}

/* Contenedor de Partículas */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1; 
  background: transparent;
}

/* Selección de texto */
::selection {
  background: var(--primary-color);
  color: #fff;
}

/* =====================================
   BARRA DE NAVEGACIÓN
===================================== */
header {
  background-color: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid rgba(229, 57, 53, 0.2);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.brand {
  grid-column: 1 / 2;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(229, 57, 53, 0.4);
}

/* Enlaces de navegación (desktop) */
.nav-links {
  grid-column: 2 / 3;
  justify-self: center;
  list-style: none;
  display: flex;
  gap: 2rem;
  transition: opacity 0.4s ease;
}

.nav-links li a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s, text-shadow 0.3s;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: var(--primary-color);
  text-shadow: 0 0 8px rgba(229, 57, 53, 0.6);
}

/* Botón de menú hamburguesa */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-color);
  cursor: pointer;
}

/* =====================================
   CURSOR PERSONALIZADO (JS INJECTED)
===================================== */
/* Lógica para PC: Ocultar cursor nativo */
@media (min-width: 769px) {
  body {
    cursor: none; 
  }
  a, button, input, label, .switch {
    cursor: none;
  }
}

/* El contorno (Rombo) */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary-color);
  background: rgba(229, 57, 53, 0.1);
  border-radius: 0; /* Cuadrado */
  transform: translate(-50%, -50%) rotate(45deg); /* Rombo */
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 0 15px var(--primary-color);
  mix-blend-mode: normal; 
  transition: width 0.2s, height 0.2s, background 0.2s, transform 0.2s;
}

/* El punto central */
.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 10000;
  box-shadow: 0 0 5px #fff;
}

/* Efecto Hover: Se transforma */
.custom-cursor.hovered {
  width: 30px;
  height: 30px;
  background: rgba(229, 57, 53, 0.3);
  transform: translate(-50%, -50%) rotate(0deg); /* Cuadrado recto */
  border-color: #fff;
}

/* Excepción para videos (necesitan controles nativos) */
video, .carousel-slide video {
  cursor: auto !important; 
}

/* =====================================
   SCROLLBAR (Estilo Neón)
===================================== */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
  border: 2px solid #0a0a0a;
}
::-webkit-scrollbar-thumb:hover {
  background: #ff5252;
  box-shadow: 0 0 10px var(--primary-color);
}

/* =====================================
   NAVEGACIÓN VERTICAL (FLECHAS)
   Agrega esto en global.css para que funcione en todas las páginas
===================================== */
.vertical-nav {
  position: fixed;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 2000;
}

.vertical-nav button {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 1px solid var(--primary-color);
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.vertical-nav button:hover {
  background: var(--primary-color);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(229, 57, 53, 0.5);
}

/* RESPONSIVO: Ajuste para móviles */
@media (max-width: 768px) {
  .vertical-nav {
    /* Opcional: Ocultarlas en móvil si estorban, o hacerlas más chicas */
    right: 1rem; 
  }
  
  .vertical-nav button {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

/* =====================================
   FOOTER
===================================== */
.footer {
  text-align: center;
  padding: 2rem;
  background-color: rgba(10, 10, 10, 0.9);
  color: var(--light-text);
  font-size: 0.9rem;
  border-top: 1px solid rgba(229, 57, 53, 0.2);
  margin-top: auto; 
}

/* ============================
   Lenis – Smooth Scroll helper
============================ */
html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto; /* Deja que Lenis mande */
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}



/* =====================================
   RESPONSIVIDAD (Media Queries)
===================================== */

/* MÓVIL (Menor a 768px) */
@media (max-width: 768px) {
  
  /* Menú Desplegable */
  .menu-toggle {
    display: block;
  }
  
  .nav-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    text-align: center;
    background-color: var(--secondary-color);
    position: absolute;
    top: 60px;
    left: 0;
    padding: 1rem 0;
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    border-bottom: 1px solid var(--primary-color);
  }
  
  .nav-links.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  
  .nav-links li a {
    font-size: 1.1rem;
  }

  /* FIX CRÍTICO MÓVIL: Cursor y Assets */
  
  /* 1. Ocultar cursor personalizado para que no estorbe */
  .custom-cursor, .custom-cursor-dot {
    display: none !important;
  }
  
  /* 2. Restaurar cursor nativo */
  body, a, button {
    cursor: auto !important;
  }
  
  /* 3. Asegurar que imágenes/iconos se vean originales (sin filtros raros) */
  .social-links li a img, 
  .skill-card .skill-icon,
  .estudio-logo {
      filter: none !important;
      -webkit-filter: none !important;
  }
}

/* DESKTOP (Mayor a 769px) */
@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }
  .nav-links {
    display: flex !important;
    position: static;
    flex-direction: row;
    gap: 2rem;
    background: none;
    padding: 0;
    pointer-events: auto;
    opacity: 1;
    transform: none;
    border: none;
  }
}

/* =====================================
   FIX GLOBAL DE IMÁGENES/SVG
===================================== */
svg, video, .skill-icon, .social-links img, .estudio-logo {
  filter: none !important;
  -webkit-filter: none !important;
  mix-blend-mode: normal !important;
  color: transparent !important; 
}

.custom-cursor,
.custom-cursor-dot {
  position: fixed;
  pointer-events: none;
  z-index: 999999 !important;
}