:root {
  --black: #080A0C;
  --dark-surface: #11151A;
  --paper: #FAFAFA;
  --white: #FFFFFF;
  --slate: #657585;
  --orange: #FC782D;
  --orange-bright: #FF6010;
  --orange-dim: rgba(252, 120, 45, 0.12);
  --blue: #5473F7;
  --green: #59EF3F;
  --display: 'Poppins', system-ui, -apple-system, sans-serif;
  --max: 1180px;
  --nav-h: 76px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--display);
  background: var(--black);
  color: var(--paper);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--orange);
  color: var(--black);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-weight: 800;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
}

.lead {
  font-size: 1.12rem;
  color: #A0AEC0;
  max-width: 720px;
}

section {
  padding: clamp(60px, 8vw, 100px) 0;
  position: relative;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-weight: 600;
}

.eyebrow .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  flex: none;
  animation: pulse 2.4s ease infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(252, 120, 45, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(252, 120, 45, 0); }
}

.eyebrow .line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.eyebrow b {
  color: var(--orange);
  font-weight: 700;
}

.rv {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.rv.in {
  opacity: 1;
  transform: none;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000 !important;
  background: rgba(8, 10, 12, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-in {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--white);
}

.nav-logo svg {
  height: 36px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 10px;
  color: #A0AEC0;
  transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--white);
  background: var(--orange-dim);
}

.nav-cta {
  background: var(--orange) !important;
  color: var(--black) !important;
  border-radius: 999px;
  padding: 10px 24px !important;
  font-weight: 700 !important;
}

/* Hero Portfolio */
.hero-port {
  padding: calc(var(--nav-h) + 60px) 0 40px;
  position: relative;
  background: radial-gradient(circle at 85% 20%, rgba(252, 120, 45, 0.08), transparent 40%);
}

#dotgrid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Grid de Casos de Éxito */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.port-card {
  background: var(--dark-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
}

.port-card:hover {
  transform: translateY(-6px);
  border-color: rgba(252, 120, 45, 0.4);
}

.port-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: contain;
  background: #0d1117;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.port-body {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.port-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--orange);
}

.port-title {
  font-size: 1.35rem;
  color: var(--white);
  margin-bottom: 8px;
}

.port-desc {
  font-size: 0.92rem;
  color: #A0AEC0;
  margin-bottom: 16px;
}

.port-metrics {
  display: flex;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
  margin-top: auto;
}

.m-item .n {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
}

.m-item .l {
  font-size: 0.75rem;
  color: var(--slate);
}

/* Clientes Adicionales / Logotipos sin foto */
.clients-section {
  background: rgba(255, 255, 255, 0.01);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 36px;
}

.client-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 24px;
}

.client-card h4 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.client-card p {
  font-size: 0.88rem;
  color: #A0AEC0;
}

/* Footer & WA */
footer {
  background: #040507;
  color: var(--slate);
  padding: 64px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.foot-grid {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.foot-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.wa-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 960;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
}

/* ==========================================================================
   Menú Hamburguesa & Navegación Responsive
   ========================================================================== */

/* Botón Hamburguesa (Oculto en Desktop) */
.nav-toggle {
  display: none !important;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  cursor: pointer;
  padding: 0;
  margin: 0;
  z-index: 310;
}

.nav-toggle svg {
  width: 28px;
  height: 28px;
  display: block;
  stroke: var(--white);
}

/* Media Queries */
@media (max-width: 900px) {
  .hero-in {
    grid-template-columns: 1fr;
  }

  .hero-rail {
    display: none;
  }

  .hero-body {
    padding: 0;
  }

  .pain-grid,
  .pcard,
  .cta-grid {
    grid-template-columns: 1fr;
  }

  .pviz {
    display: none;
  }

  .nav-toggle {
    z-index: 1010 !important;
  }    
  
  .nav-links {
    display: none;
  }
}

/* ==========================================================================
   Menú Hamburguesa & Navegación Responsive (Definitivo)
   ========================================================================== */

/* Botón Hamburguesa en Desktop */
.nav-toggle {
  display: none !important;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  cursor: pointer;
  padding: 8px;
  margin: 0;
  z-index: 1010 !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle svg,
.nav-toggle svg * {
  width: 28px;
  height: 28px;
  display: block;
  stroke: var(--white);
  pointer-events: none; /* Asegura que el toque en pantalla lo reciba el botón */
}

/* Adaptación a Pantallas Móviles (menos de 900px) */
@media (max-width: 900px) {
  .hero-in {
    grid-template-columns: 1fr;
  }

  .hero-rail,
  .pviz {
    display: none;
  }

  .hero-body {
    padding: 0;
  }

  .pain-grid,
  .pcard,
  .cta-grid {
    grid-template-columns: 1fr;
  }

  /* Hacer visible el botón hamburguesa */
  .nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Estado OCULTO por defecto para evitar espacio/desplazamientos fantasma */
  .nav-links {
    display: none !important;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    width: 100%;
    background: #080a0c;
    background: rgba(8, 10, 12, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px;
    gap: 16px;
    z-index: 1000 !important;
    flex-direction: column;
  }

  /* Estado DESPLEGADO al hacer clic (cuando JS suma la clase .active) */
  .nav-links.active {
    display: flex !important;
  }

  .nav-links a {
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    padding: 12px;
  }
}