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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* evita que el navbar tape secciones */
}

body {
  font-family: 'Inter', Arial, sans-serif;
  background: #050505;
  color: white;
  overflow-x: hidden;
  position: relative;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
  position: relative;
  z-index: 2;
}

/* ----- BACKGROUNDS ----- */
.bg-grid {
  position: fixed;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(0,140,255,0.2), transparent 70%);
  top: -200px;
  right: -200px;
  z-index: -1;
  transition: transform 0.1s ease-out;
  pointer-events: none;
  will-change: transform;
}

/* ----- PARTICLES (solo escritorio) ----- */
.particles {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(0,140,255,0.6);
  border-radius: 50%;
  bottom: -20px;
  animation: particleFloat linear infinite;
  will-change: transform;
}

@keyframes particleFloat {
  from {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  to {
    transform: translateY(-120vh);
    opacity: 0;
  }
}

/* ----- NAVBAR ----- */
nav {
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(12px);
  background: rgba(0,0,0,0.75);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: all 0.3s ease;
}

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

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 12px;
  background: #0a0f1a;
}

.logo-text h1 {
  font-size: 22px;
  font-weight: 800;
}

.logo-text p {
  font-size: 12px;
  color: #9aa0aa;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: #e2e8f0;
  font-weight: 500;
  transition: 0.3s;
}

.nav-links a:hover {
  color: #4da3ff;
}

/* mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: white;
  transition: 0.3s;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 75%;
  max-width: 280px;
  height: 100vh;
  background: rgba(8, 12, 20, 0.98);
  backdrop-filter: blur(16px);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 32px;
  transition: 0.3s ease-in-out;
  z-index: 1000;
  display: flex;
  border-left: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu a {
  color: white;
  font-size: 20px;
  font-weight: 500;
  padding: 10px;
}

/* ----- HERO ----- */
.hero {
  padding: 100px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 10px 16px;
  background: rgba(0,140,255,0.12);
  border: 1px solid rgba(0,140,255,0.25);
  border-radius: 999px;
  margin-bottom: 25px;
  color: #8ec5ff;
  font-weight: 500;
}

.hero h2 {
  font-size: 58px;
  line-height: 1.1;
  margin-bottom: 25px;
}

.hero h2 span {
  color: #4da3ff;
  background: linear-gradient(135deg, #4da3ff, #00c3ff);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: 18px;
  color: #b5b5b5;
  line-height: 1.7;
  margin-bottom: 30px;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 35px;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.btn {
  padding: 14px 24px;
  border-radius: 12px;
  transition: 0.3s;
  font-weight: bold;
  display: inline-block;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #1877ff, #0e5ac2);
  color: white;
  box-shadow: 0 4px 12px rgba(0,100,255,0.2);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,100,255,0.4);
}

.btn-secondary {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.02);
  color: white;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-3px);
}

/* ----- TERMINAL ----- */
.terminal {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
  transition: box-shadow 0.3s;
}

.terminal:hover {
  box-shadow: 0 0 40px rgba(0,140,255,0.2);
}

.terminal-top {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: #161b22;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.red { background: #ff5f57; }
.yellow { background: #ffbd2e; }
.green { background: #28c840; }

.terminal-content {
  padding: 25px;
  font-family: monospace;
  line-height: 1.9;
  overflow-x: auto;
}

.cyan {
  color: #58a6ff;
}

.green-text {
  color: #3fb950;
}

.typing-box {
  margin-top: 20px;
  color: #3fb950;
  min-height: 30px;
}

.cursor {
  animation: blink 0.8s infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ----- SECTIONS GENERAL ----- */
section {
  padding: 100px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
}

.section-title h2 {
  font-size: 42px;
  margin-bottom: 15px;
}

.section-title p {
  color: #aaaaaa;
  max-width: 700px;
  margin: auto;
  line-height: 1.7;
}

/* CARDS */
.services-grid,
.solutions-grid,
.stack-grid {
  display: grid;
  gap: 25px;
}

.services-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 24px;
  padding: 30px;
  transition: 0.3s;
  backdrop-filter: blur(4px);
}

.card:hover {
  transform: translateY(-8px);
  border-color: rgba(0,140,255,0.4);
  box-shadow: 0 20px 30px rgba(0,0,0,0.3);
}

.icon {
  font-size: 40px;
  margin-bottom: 20px;
}

.card h3 {
  margin-bottom: 15px;
  font-size: 22px;
}

.card p {
  color: #b7b7b7;
  line-height: 1.7;
}

.solutions-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.solution-box {
  padding: 20px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  transition: 0.2s;
}

.solution-box:hover {
  background: rgba(0,140,255,0.05);
  border-color: rgba(0,140,255,0.3);
}

.stack-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stack-item {
  padding: 18px;
  text-align: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  transition: 0.2s;
  font-weight: 500;
}

.stack-item:hover {
  background: rgba(0,140,255,0.1);
  transform: scale(1.02);
}

/* CTA Y FORMULARIO */
.cta-box {
  text-align: center;
  padding: 70px 30px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(0,140,255,0.12), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 60px;
}

.cta-box h2 {
  font-size: 44px;
  margin-bottom: 20px;
}

.cta-box p {
  color: #b7b7b7;
  margin-bottom: 35px;
  line-height: 1.7;
}

.contact-form-wrapper {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.contact-form-wrapper h3 {
  font-size: 28px;
  margin-bottom: 30px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-form input,
.contact-form textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 16px 20px;
  color: white;
  font-family: inherit;
  font-size: 16px;
  transition: 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #4da3ff;
  background: rgba(255,255,255,0.08);
}

.contact-form button {
  align-self: center;
  width: auto;
  min-width: 180px;
}

.form-feedback {
  margin-top: 15px;
  font-size: 14px;
  color: #3fb950;
}

/* BACK TO TOP BUTTON */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #1877ff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  background: #0e5ac2;
}

/* FOOTER */
footer {
  padding: 50px 20px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.6);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #8ec5ff;
  transition: 0.2s;
}

.footer-links a:hover {
  color: white;
}

.footer-copyright {
  font-size: 13px;
  color: #6c757d;
}

/* ANIMACIONES SCROLL REVEAL */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.9, 0.4, 1.1), transform 0.7s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.fade-up-visible {
  opacity: 1;
  transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero h2 {
    font-size: 42px;
  }
  .nav-links {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .nav-container {
    padding: 12px 0;
  }
  .cta-box h2 {
    font-size: 36px;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 60px 0;
  }
  .hero h2 {
    font-size: 34px;
  }
  .hero-points {
    grid-template-columns: 1fr;
  }
  .buttons {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
  .section-title h2 {
    font-size: 32px;
  }
  .cta-box h2 {
    font-size: 28px;
  }
  .terminal-content {
    font-size: 12px;
    padding: 16px;
  }
  .particle {
    display: none; /* mejora rendimiento en móvil */
  }
  .back-to-top {
    width: 40px;
    height: 40px;
    font-size: 20px;
    bottom: 20px;
    right: 20px;
  }
}

/* Prefiere movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}