@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');

:root {
  /* Colores primarios */
  --primary: #FFB400;
  --primary-light: #FFB400;
  
  /* Texto */
  --text-primary: #111827;
  --text-secondary: #3a414b;
  
  /* Fondo */
  --bg-primary: #ffffff;
  --bg-secondary: #f3f4f6;
  --bg-tertiary: #fffdf4;
  --bg-quaternary: #f8fafc;
  
  /* Otros */
  --menu-active: #fddc8d;
  --transition: all 0.3s ease;
}

/* Modo oscuro */
.dark {
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --bg-primary: #111827;
  --bg-secondary: #1c2944;
  --bg-tertiary: #0c111c;
}


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

/* Aplicar scroll suave solo para enlaces de anclaje */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: auto;
  }
  
  html:focus-within {
    scroll-behavior: smooth;
  }
}

body {
  font-family: 'Open Sans', sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.5;
  transition: var(--transition);
}

h1,
h2,
h3,
h4,
h5,
h6,
.header-content a {
  font-family: 'Lexend', sans-serif;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 2.5rem;
}

h2 span {
  color: var(--primary);
}

/* Quitar subrayado de links */
a {
  text-decoration: none;
  color: var(--text-primary);
}

/* Opcional: evitar subrayado también al hacer hover/focus */
a:hover,
a:focus {
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}


section.hero,
section#inicio,
section#header,
section#quienes-somos,
section#contacto {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

/* Fondo tecnológico */
#bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: cover;
  background: linear-gradient(145deg, var(--bg-primary) 50%, var(--bg-secondary) 115%);
  pointer-events: none; /* Para que no interfiera con los clics */
}

/* Asegurar que el contenido esté por encima del fondo */
.contact .container,
.contact-form {
  position: relative;
  z-index: 1;
}
 
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: transparent;
  transition: var(--transition);
}

.header.scrolled {
  background-color: #111827;
  box-shadow: 0 2px 10px rgba(209, 209, 209, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;

}

.logo {
  width: 150px;   /* ajusta a tu tamaño */
  height: 50px;
  background: url('../img/logo.png') no-repeat center/contain;
  transition: background 0.3s;
}

.dark .logo {
  background-image: url('../img/logo-light.png');
}

.logo span {
  color: var(--primary);
}

.desktop-nav {
  display: none;
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
  }
}

.desktop-nav a {
  color: white;
  text-decoration: none;
  transition: var(--transition);
  font-weight: bold;
  text-transform: uppercase;
}

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

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: white;
  padding: 0.5rem;
  margin: 0;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.theme-toggle:hover {
  background-color: var(--bg-secondary);
}

.theme-toggle i {
  font-size: 1.25rem;
  line-height: 1;
}

.sun-icon {
  display: none;
}

.dark .moon-icon {
  display: none;
}

.dark .sun-icon {
  display: block;
}

.mobile-menu-btn {
  display: inline-flex;       /* recupera display:flex pero inline para que no rompa el flujo */
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

/* 2) Asegura que cada línea sea un bloque con ancho/alto válidos */
.mobile-menu-btn span {
  display: block;             /* de inline a block para que respete width/height */
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  transition: var(--transition);
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }

  h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
  }

}

.mobile-menu-btn span {
  width: 24px;
  height: 2px;
  background-color: white;
  transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}


.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--bg-primary);
  z-index: 1000;
  overflow-y: auto;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-nav.active {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 4rem;
}

.mobile-nav-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: var(--bg-primary);
  z-index: 1001;
  border-bottom: 1px solid var(--bg-secondary);
}

.mobile-logo {
  width: 120px;
  height: auto;
}

.mobile-close-btn {
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  position: relative;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
}

.mobile-close-btn span {
  position: absolute;
  height: 2px;
  width: 100%;
  background-color: var(--text-primary);
  transition: all 0.3s ease;
  left: 0;
}

.mobile-close-btn span:first-child {
  transform: rotate(45deg);
  top: 50%;
}

.mobile-close-btn span:last-child {
  transform: rotate(-45deg);
  top: 50%;
}

.mobile-nav-links {
  width: 100%;
  max-width: 500px;
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem 2rem;
}

.mobile-nav a {
  display: block;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  margin: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  transition: var(--transition);
  font-family: 'Lexend', sans-serif;
  font-weight: 700; /* Cambiado a Bold */
  font-size: 1.1rem; /* Ligeramente más pequeño para mejor ajuste */
  text-align: center;
  width: auto;
  letter-spacing: 0.03em; /* Reducido el espaciado entre letras */
  text-transform: uppercase;
  line-height: 1.2; /* Mejor interlineado */
}

.mobile-nav a:hover {
  color: var(--primary);
  background-color: transparent;
}

/* Estilos para el selector de tema en móvil */
.mobile-theme-toggle {
  margin-top: 2rem;
  padding: 1rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

.mobile-theme-toggle .theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-primary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
}

.mobile-theme-toggle .theme-toggle:hover {
  color: var(--primary);
  transform: scale(1.1);
}

/* Asegurar que los iconos del tema sean visibles */
.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: absolute;
}

.theme-toggle .sun-icon {
  color: #FFB400; /* Color amarillo para el sol */
}

.theme-toggle .moon-icon {
  color: #6B7280; /* Color gris para la luna */
}

/* Asegurar que el logo en el menú móvil tenga un tamaño consistente */
.mobile-logo {
  max-width: 100%;
  height: auto;
  transition: filter 0.3s ease;
}

/* Filtro para el logo en modo oscuro */
.dark .mobile-logo {
  filter: brightness(0) invert(1);
}

.hero, .services-hero {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.0);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  padding: 0 1rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s forwards 0.5s;
}

.hero-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .hero-content h2 {
    font-size: 3.5rem;
  }

}

.hero-content span {
  color: var(--primary-light);
}

.hero-content p {
  font-size: 1.5rem;
  opacity: 0;
  animation: fadeIn 1s forwards 1s;
  margin-bottom: 1.5rem;
}

.content-box {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 2rem;
  border-radius: 10px;
  display: inline-block;
  backdrop-filter: blur(5px);
  max-width: 90%;
  margin: 0 auto;
}

.content-box h2 {
  line-height: 1.2;
  margin-bottom: 1rem;
  font-size: 2rem;
}

/* Mobile styles */
@media (max-width: 768px) {
  .content-box {
    padding: 1.5rem;
  }
  
  .content-box h2 {
    font-size: 1.5rem;
  }
  
  .content-box p {
    font-size: 1.1rem;
  }
}

.contact-email a {
  color: var(--primary-light);
  font-size: 1.2rem;
  text-decoration: none;
  transition: color 0.3s ease;
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary-light);
  border-radius: 4px;
  opacity: 0;
  animation: fadeIn 1s forwards 1.2s;
}

.contact-email a:hover {
  color: #ffffff;
  background-color: var(--primary-light);
  text-decoration: none;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.about {
  background: linear-gradient(to bottom right, var(--bg-secondary), var(--bg-primary));
}

.about p {
  color: var(--text-secondary);

}

.about-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
  opacity: 0;
  transform: translateY(40px);
  font-size: 1.2rem;
}

.about.visible .about-content {
  animation: slideIn 0.8s forwards;
}

.services {
  background-color: var(--bg-secondary);
  text-align: center;
  padding: 2.5rem;

}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.service-card {
  background-color: var(--bg-primary);
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(20px);
  text-align: center;
}

.services.visible .service-card {
  animation: fadeInUp 0.8s forwards;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.service-card .icon {
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.service-card h3 {
  margin-bottom: 1rem;
  font-weight: 600;
}

.service-card p {
  color: var(--text-secondary);
}

.services-cta {
  background-color: var(--bg-secondary);
  padding: 6rem 0;
  text-align: center;
}

.services-cta h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.services-cta p {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.services-cta .submit-btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.contacto {
  background: linear-gradient(-45deg, var(--bg-quaternary) 0%, var(--bg-secondary) 100%);
}
.contact-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 2rem auto;
  flex-wrap: wrap;
  max-width: 1000px;
}

.contact-form {
  flex: 3;
  max-width: 100%;
}

.contact-form .submit-btn {
  display: block;
  margin: 2rem auto 0;
}



@media (max-width: 768px) {
  .portfolio-grid {
      grid-template-columns: 1fr;
  }

  .filters-wrapper {
      gap: 0.5rem;
  }

  .filter-btn {
      padding: 0.5rem 1rem;
      font-size: 0.9rem;
  }

  .cta h2 {
      font-size: 2rem;
  }


  .services-cta h2 {
    font-size: 2rem;
  }

  .cta p {
      font-size: 1rem;
  }

  .contact-wrapper {
      flex-direction: column;
      align-items: stretch;
  }

  .whatsapp-btn {
      width: 100%;
  }
}

.form-group label {
  text-align: left;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--text-secondary);
  border-radius: 0.375rem;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.error-message {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.form-group.error input,
.form-group.error textarea {
  border-color: #ef4444;
}

.form-group.error .error-message {
  display: block;
}
 /* VERSIÓN MEJORADA */
 .submit-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  padding: 0.7rem 2.5rem;
  background-color: var(--bg-secondary);
  border: 3px solid var(--primary);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 25px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1rem;
  letter-spacing: 1.5px;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  cursor: pointer;
  min-width: 200px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transform: translateY(0);
  text-align: center;
}

.submit-btn:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
  padding-right: 3.5rem;
}

/* Flecha mejorada y centrada */
.submit-btn::after {
  content: '→';
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%) translateX(-15px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  font-size: 1.3em;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.submit-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Texto del botón */
.submit-btn span {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  position: relative;
}

.submit-btn:hover span {
  transform: translateX(-10px);
}

/* Borde exterior mejorado */
.submit-btn::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: 28px;
  opacity: 0;
  transition: all 0.3s ease;
}

.submit-btn:hover::before {
  opacity: 0.5;
  transform: scale(1.05);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.submit-btn:disabled:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transform: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding-right: 2.5rem;
}



.spinner {
  display: none;
  border: 2px solid white;
  border-top: 2px solid transparent;
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
  animation: spin 0.8s linear infinite;
}

.submit-btn.loading .btn-text {
  display: none;
}

.submit-btn.loading .spinner {
  display: block;
}

.footer {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 1rem 0;
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: var(--text-primary);
  transition: var(--transition);
}

.social-links a:hover {
  color: var(--primary-light);
}

.copyright {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .contact-form {
    width: 100%;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }
}

.desktop-nav a.active {
  color: var(--menu-active);
}


.floating-whatsapp {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  border-radius: 50%;
  display: none;
  justify-content: center;
  align-items: center;
  color: white;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1000;
}

.floating-whatsapp:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.floating-whatsapp.visible {
  display: flex;
}

/* Preloader - Siempre usa colores modo oscuro */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #111827; /* Color de fondo oscuro fijo */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-container {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.preloader-logo {
  width: 100px;
  height: 100px;
  z-index: 2;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.preloader-logo::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  animation: glow 3s infinite ease-in-out;
  opacity: 0;
  z-index: 1;
  filter: blur(4px);
}

.preloader-logo img {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
}

.orbit {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.orbit {
  position: absolute;
  width: 150px;
  height: 150px;
  animation: rotate 4s linear infinite;
}

.orbit-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 180, 0, 0.3);
  border-radius: 50%;
}

.orbit-circle {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: #FFB400;
  border-radius: 50%;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  box-shadow: 0 0 10px #FFB400, 0 0 20px #FFB400;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes glow {
  0%, 100% {
    opacity: 0.1;
    transform: scale(0.9);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.1);
  }
}

/* Transición de página */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary);
  z-index: 9998;
  /* Iniciar con clip-path de tamaño 0 (círculo completamente cerrado) */
  clip-path: circle(0% at 50% 50%);
  -webkit-clip-path: circle(0% at 50% 50%);
  
  /* Primero: desenfoque rápido (0.3s) */
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  box-shadow: 0 0 0 0 rgba(255, 180, 0, 0);
  
  /* Transiciones */
  transition: 
    backdrop-filter 0.3s ease-out,
    box-shadow 0.3s ease-out,
    clip-path 0.6s 0.3s cubic-bezier(0.65, 0, 0.35, 1);
    
  -webkit-transition: 
    -webkit-backdrop-filter 0.3s ease-out,
    box-shadow 0.3s ease-out,
    -webkit-clip-path 0.6s 0.3s cubic-bezier(0.65, 0, 0.35, 1);
  
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  will-change: clip-path, backdrop-filter, box-shadow;
}

/* Estado activo */
.page-transition.active {
  /* 1. Aplicar desenfoque y resplandor rápidamente (0.3s) */
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 0 60px 25px rgba(255, 180, 0, 0.5);
  
  /* 2. Luego (después de 0.3s) expandir el círculo (0.6s) */
  clip-path: circle(150% at 50% 50%);
  -webkit-clip-path: circle(150% at 50% 50%);
  pointer-events: auto;
}