/* ============================================================
   ENGENITIX — Estilos principales (estética Lusion)
   Fondo oscuro, tipografía grande, textura, animaciones suaves
   ============================================================ */

:root {
  --bg: #050506;
  --bg-elev: #0b0b0e;
  --surface: #121218;
  --text: #f4f4f6;
  --muted: #9a9aa5;
  --accent: #0029FF;
  --accent-2: #FF0022;
  --accent-soft: #3A5BFF;
  --accent-2-soft: #FF4455;
  --border: rgba(255, 255, 255, 0.09);
  --radius: 18px;
  --font: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --nav-h: 70px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
section { position: relative; }
img { max-width: 100%; display: block; }

/* Lienzo 3D fijo de fondo */
#hero-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* El contenido queda por encima del canvas */
#ui {
  position: relative;
  z-index: 1;
}

/* ---------- Botones ---------- */
.btn-primary {
  display: inline-block;
  padding: 15px 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  box-shadow: 0 10px 30px -10px rgba(0, 41, 255, 0.5);
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 18px 40px -12px rgba(0, 41, 255, 0.7);
}
.btn-ghost {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: border-color 0.25s, background 0.25s;
}
.btn-ghost:hover { border-color: var(--accent); background: rgba(0, 41, 255, 0.08); }
.btn-sm { padding: 10px 22px; font-size: 0.85rem; }
.btn-light {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.25s;
}
.btn-light:hover { transform: translateY(-2px); }
.btn-block { width: 100%; }

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: #050506;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s;
}
.nav.scrolled {
  background: rgba(5, 5, 6, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.3px; }
.brand-logo {
  height: 38px;
  width: auto;
  max-width: 180px;
  display: block;
  object-fit: contain;
}
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px var(--accent);
}
.brand-text { font-size: 1.15rem; }

.nav-links { display: flex; gap: 34px; }
.nav-links a {
  font-size: 0.9rem;
  color: var(--muted);
  position: relative;
  transition: color 0.25s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-burger span {
  width: 24px; height: 2px;
  background: var(--text);
  transition: all 0.3s;
}

/* ============================================================
   HERO (texto gigante + esfera 3D detrás)
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 30px) 24px 40px;
  overflow: hidden;
}
/* Rejilla sutil de fondo */
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  opacity: 0.4;
  pointer-events: none;
}
.hero-content { position: relative; max-width: 1000px; }
.hero-eyebrow {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 26px;
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.hero-title {
  font-family: var(--font);
  font-size: clamp(2.6rem, 9vw, 6.5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
}
/* Máscara para cada línea del título */
.mask-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}
.mask-line > span { display: inline-block; will-change: transform; }

/* Texto con solo contorno (outline) */
.outline {
  color: transparent;
  -webkit-text-stroke: 1.6px rgba(244, 244, 246, 0.85);
}

.hero-title .outline {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
}

.hero-sub {
  margin: 30px auto 0;
  max-width: 580px;
  color: var(--muted);
  font-size: 1.08rem;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }

/* Estadísticas */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-top: 70px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
  font-size: 2rem;
  font-weight: 700;
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--font);
}
.stat-suffix { color: var(--text); font-size: 1.6rem; font-weight: 600; }
.stat-lbl { color: var(--muted); font-size: 0.85rem; display: block; margin-top: 2px; }

.scroll-hint {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.scroll-hint span {
  width: 1px; height: 44px;
  background: linear-gradient(var(--accent), transparent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}
@keyframes scrollPulse {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  50.1% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================================
   SECCIONES GENÉRICAS
   ============================================================ */
.section { padding: 110px 24px; }
.section-head { max-width: 760px; margin: 0 auto 60px; text-align: center; }
.section-title {
  font-family: var(--font);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 18px;
}
.section-sub { color: var(--muted); font-size: 1.05rem; }
.eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 16px;
}

/* ---------- Lista de servicios estilo "Featured Work" (Lusion) ---------- */
.work-list {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}
.work-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: padding 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s;
}
.work-row:hover {
  padding-left: 26px;
  padding-right: 26px;
  background: rgba(255, 255, 255, 0.02);
}
.work-info { display: flex; align-items: baseline; gap: 26px; min-width: 0; }
.work-index {
  font-family: var(--font);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  flex-shrink: 0;
}
.work-title {
  font-family: var(--font);
  font-size: clamp(1.6rem, 4.2vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}
.work-title > span {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: color 0.4s;
}
.work-title > span::after {
  content: '';
  display: block;
  height: 2px;
  margin-top: 4px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.work-row:hover .work-title > span::after { transform: scaleX(1); }
.work-meta { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.work-tags {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.work-arrow {
  font-size: 1.4rem;
  display: inline-flex;
  transform: rotate(-45deg);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--accent);
}
.work-row:hover .work-arrow { transform: rotate(0deg) translateX(4px); }

/* ---------- Pestañas del portafolio ---------- */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 1100px;
  margin: 0 auto 48px;
}
.pill {
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.pill:hover { border-color: var(--accent); color: var(--text); }
.pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(0, 41, 255, 0.6);
}

/* Paneles: solo se muestra el activo */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadePanel 0.6s ease; }
@keyframes fadePanel {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.tab-note {
  text-align: center;
  color: var(--muted);
  margin-bottom: 30px;
  font-size: 1.05rem;
}

/* ============================================================
   OVERLAY DE DETALLE por servicio ("adentrarse")
   ============================================================ */
.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  pointer-events: none;
}
.overlay-backdrop {
  position: absolute; inset: 0;
  background: rgba(3, 3, 4, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
}
.overlay-panel {
  position: relative;
  max-width: 760px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 56px 48px 48px;
  transform: scale(0.94) translateY(24px);
  opacity: 0;
}
.overlay-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.overlay-close:hover { background: rgba(0, 41, 255, 0.15); border-color: var(--accent); transform: rotate(90deg); }
.overlay-eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.overlay-title {
  font-family: var(--font);
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 18px;
}
.overlay-lead { color: var(--muted); font-size: 1.05rem; margin-bottom: 30px; }
.overlay-features { display: flex; flex-direction: column; margin-bottom: 36px; }
.ov-f {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  font-size: 1rem;
}
.ov-f:last-child { border-bottom: 1px solid var(--border); }
.ov-n {
  font-family: var(--font);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}
.overlay-cta .btn-primary { text-decoration: none; }

/* Cuando está activo */
.overlay.active { visibility: visible; pointer-events: auto; }

/* ============================================================
   MANIFIESTO — texto gigante con scroll
   ============================================================ */
.manifiesto {
  padding: 140px 24px;
  text-align: center;
}
.manifiesto h2 {
  font-family: var(--font);
  font-size: clamp(2.2rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.manifiesto h2 span { display: block; }

/* ============================================================
   VENTAS / CATÁLOGO
   ============================================================ */
.ventas { background: var(--bg-elev); }
.ventas-inner {
  max-width: 1150px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}
.ventas-text .section-title, .ventas-text .section-sub { text-align: left; }
.ventas-text .section-title { margin-bottom: 18px; }
.ventas-actions { margin-top: 32px; }

.pdf-card {
  background: #fff;
  color: #111;
  border-radius: 24px;
  padding: 14px;
  box-shadow: 0 40px 80px -20px rgba(0, 41, 255, 0.35);
  transform: rotate(3deg);
  transition: transform 0.5s ease;
}
.pdf-card:hover { transform: rotate(0deg) scale(1.02); }
.pdf-topbar { display: flex; gap: 6px; padding: 6px 8px; }
.pdf-topbar span { width: 10px; height: 10px; border-radius: 50%; background: #ddd; }
.pdf-topbar span:nth-child(1) { background: #ff5f57; }
.pdf-topbar span:nth-child(2) { background: #febc2e; }
.pdf-topbar span:nth-child(3) { background: #28c840; }
.pdf-body { background: #f6f6f8; border-radius: 16px; padding: 22px; }
.pdf-title { font-weight: 700; font-size: 1.3rem; margin-bottom: 14px; }
.pdf-line { height: 10px; background: #e3e3e8; border-radius: 6px; margin-bottom: 10px; }
.pdf-line.short { width: 55%; }
.pdf-blocks { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.pdf-row { display: flex; gap: 12px; align-items: center; }
.pdf-row .img {
  width: 52px; height: 52px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
}
.pdf-row .bar { height: 12px; background: #e3e3e8; border-radius: 6px; width: 100%; }

/* ============================================================
   NOSOTROS — Engenitix SAS
   ============================================================ */
.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1100px;
  margin: 20px auto 60px;
}
.about-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  transition: transform 0.4s ease, border-color 0.4s ease;
}
.about-stat:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 41, 255, 0.45);
}
.about-stat h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
  font-family: var(--font);
}
.about-stat p { margin: 0; font-size: 1.05rem; color: var(--text); }
.about-stat p strong {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}
.about-pillar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 24px 26px;
  position: relative;
  overflow: hidden;
  transition: transform 0.5s ease, border-color 0.5s ease;
}
.about-pillar::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at top right, rgba(0,41,255,0.16), transparent 60%);
  opacity: 0; transition: opacity 0.5s;
  pointer-events: none;
}
.about-pillar:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 0, 34, 0.4);
}
.about-pillar:hover::after { opacity: 1; }
.pillar-num {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-2-soft);
  margin-bottom: 18px;
}
.about-pillar h3 {
  font-size: 1.25rem;
  margin: 0 0 10px;
  font-family: var(--font);
  color: var(--text);
}
.about-pillar p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ============================================================
   CTA
   ============================================================ */
.cta { padding: 40px 24px 110px; }
.cta-card {
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 32px;
  padding: 80px 40px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 41, 255, 0.30), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(255, 0, 34, 0.25), transparent 45%),
    var(--surface);
  border: 1px solid var(--border);
}
.cta-card h2 { font-family: var(--font); font-size: clamp(1.9rem, 5vw, 3rem); margin-bottom: 16px; letter-spacing: -0.02em; }
.cta-card p { color: var(--muted); margin-bottom: 32px; font-size: 1.05rem; }

/* ============================================================
   CONTACTO
   ============================================================ */
.contact-form {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.field input,
.field select,
.field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.25s, box-shadow 0.25s;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.15);
}
.form-status { text-align: center; color: var(--accent); font-size: 0.9rem; min-height: 1.2em; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px 24px;
  background: var(--bg-elev);
  position: relative;
  z-index: 1;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer p { color: var(--muted); font-size: 0.9rem; }
.footer-social { display: flex; gap: 22px; }
.footer-social a { color: var(--muted); font-size: 0.9rem; transition: color 0.25s; }
.footer-social a:hover { color: var(--accent); }
.footer-bottom { text-align: center; margin-top: 32px; color: var(--muted); font-size: 0.8rem; }

/* Ocultar el fondo 3D detrás de las secciones de color para respirar */
.servicios, .ventas, .nosotros {
  /* fondo semitransparente para atenuar la esfera */
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .work-info { gap: 16px; }
  .ventas-inner { grid-template-columns: 1fr; gap: 40px; }
  .ventas-visual { max-width: 420px; margin: 0 auto; }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    background: rgba(5, 5, 6, 0.97);
    backdrop-filter: blur(16px);
    padding: 20px 24px;
    gap: 6px;
    transform: translateY(-130%);
    transition: transform 0.35s ease;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 0; font-size: 1.1rem; border-bottom: 1px solid var(--border); }
  .nav-cta { display: none; }
  .nav-burger { display: flex; }

  .section { padding: 80px 20px; }
  .hero-stats { gap: 40px; margin-top: 50px; }
  .form-row { grid-template-columns: 1fr; }
  .cta-card { padding: 50px 24px; }

  .about-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .about-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (max-width: 560px) {
  .overlay-panel { padding: 44px 24px 32px; }
  .ov-f { gap: 14px; }
  .work-row { flex-direction: column; align-items: flex-start; gap: 12px; padding: 26px 4px; }
  .work-row:hover { padding-left: 8px; padding-right: 8px; }
  .work-info { flex-direction: column; gap: 8px; }
  .work-title { font-size: 1.5rem; }
  .work-meta { width: 100%; justify-content: space-between; }
  .hero { min-height: 92vh; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn-primary, .hero-actions .btn-ghost { width: 100%; text-align: center; }
  .about-stats { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
}