:root {
  --bg: #06070d;
  --bg-2: #0c0f1a;
  --panel: #11141f;
  --panel-2: #161a28;
  --text: #e6e9f2;
  --muted: #8a91a6;
  --line: #1f2438;
  --cyan: #00e5ff;
  --violet: #9b5cff;
  --pink: #ff3da6;
  --grad: linear-gradient(135deg, #00e5ff 0%, #9b5cff 60%, #ff3da6 100%);
  --shadow-neon: 0 0 0 1px rgba(0,229,255,.15), 0 10px 40px -10px rgba(155,92,255,.45);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* ===== FONDO CYBER PCB GLOBAL ===== */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: -2;
  background:
    /* glow esquinas */
    radial-gradient(800px 600px at 10% 0%, rgba(0,229,255,.08), transparent 60%),
    radial-gradient(700px 500px at 90% 100%, rgba(155,92,255,.10), transparent 60%),
    /* grid base */
    linear-gradient(rgba(0,229,255,.04) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(0,229,255,.04) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg);
}

/* Capa de pistas PCB drifteando (sin puntos: los puntos van como SVG inline) */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: -1;
  opacity: .28;
  filter: blur(1.5px);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'>\
<g fill='none' stroke='%2300e5ff' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round' opacity='.7'>\
<path d='M0 80 L120 80 L150 50 L260 50 L290 80 L420 80 L450 110 L600 110'/>\
<path d='M80 0 L80 140 L110 170 L110 280 L140 310 L260 310'/>\
<path d='M600 220 L470 220 L440 250 L320 250 L290 220 L200 220'/>\
<path d='M0 360 L90 360 L120 390 L240 390 L270 420 L380 420 L410 450 L600 450'/>\
<path d='M520 0 L520 60 L490 90 L490 200'/>\
<path d='M180 600 L180 510 L210 480 L320 480'/>\
<path d='M380 600 L380 540 L410 510 L530 510 L560 540 L560 600'/>\
<path d='M0 540 L70 540 L100 510 L160 510'/>\
</g>\
<g fill='none' stroke='%239b5cff' stroke-width='1' stroke-linecap='round' stroke-linejoin='round' opacity='.5'>\
<path d='M40 200 L160 200 L190 230 L300 230'/>\
<path d='M340 150 L460 150 L490 180 L590 180'/>\
<path d='M250 460 L370 460'/>\
<path d='M30 100 L30 280'/>\
<path d='M570 320 L570 420'/>\
</g>\
</svg>");
  background-size: 600px 600px;
  background-repeat: repeat;
  animation: pcb-drift 60s linear infinite;
}

/* Puntos brillantes que pulsan (SVG inline para que SMIL anime de verdad) */
.pcb-dots {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: -1;
}

@keyframes pcb-drift {
  from { background-position: 0 0; }
  to   { background-position: 600px 600px; }
}

/* Las secciones necesitan fondo translúcido para dejar ver el PCB */
.section-alt {
  background: rgba(12, 15, 26, .72) !important;
  backdrop-filter: blur(2px);
}

.container { width: 90%; max-width: 1180px; margin: 0 auto; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6,7,13,.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.logo-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--grad);
  box-shadow: 0 0 18px rgba(0,229,255,.6);
}
.logo-text { letter-spacing: .5px; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; transition: color .2s; }
.nav-links a:hover { color: var(--cyan); }
.lang-toggle {
  background: transparent; color: var(--text);
  border: 1px solid var(--line); padding: 6px 12px;
  border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px;
  transition: all .2s;
}
.lang-toggle:hover { border-color: var(--cyan); color: var(--cyan); }

/* HERO */
.hero { position: relative; padding: 110px 0 90px; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(0,229,255,.22), transparent 60%),
    radial-gradient(700px 500px at 80% 30%, rgba(155,92,255,.25), transparent 60%),
    radial-gradient(500px 400px at 50% 90%, rgba(255,61,166,.15), transparent 60%);
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; }
.hero-inner { text-align: center; max-width: 880px; }
.container.hero-inner { margin: 0 auto; }
.badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--cyan); font-size: 12px; letter-spacing: 1px;
  margin-bottom: 22px; font-family: ui-monospace, monospace;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.15; font-weight: 800; letter-spacing: -.02em;
  margin-bottom: 18px;
  text-shadow: 0 2px 24px rgba(6, 7, 13, .85), 0 0 60px rgba(6, 7, 13, .6);
}
.lead, .section-sub {
  text-shadow: 0 2px 14px rgba(6, 7, 13, .8);
}
.section-title {
  text-shadow: 0 2px 18px rgba(6, 7, 13, .85);
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.lead { color: var(--muted); font-size: 1.1rem; max-width: 680px; margin: 0 auto 32px; }

.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 14px 26px; border-radius: 10px;
  font-weight: 600; text-decoration: none; cursor: pointer; font-size: 15px;
  transition: all .25s ease; border: none;
}
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: var(--shadow-neon);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(0,229,255,.4), 0 14px 50px -10px rgba(155,92,255,.7); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.block { display: block; text-align: center; width: 100%; margin-top: 14px; }

.stats {
  display: flex; gap: 28px; justify-content: center; flex-wrap: wrap;
  margin-top: 48px;
}
.stats > div {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 22px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); min-width: 160px;
}
.stats strong { font-size: 1.3rem; color: var(--cyan); }
.stats span { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* SECTIONS */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800; letter-spacing: -.02em; text-align: center;
  margin-bottom: 10px;
}
.section-sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 50px; }

/* GRID CARDS */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  transition: all .3s; position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0;
  background: var(--grad); opacity: 0;
  transition: opacity .3s; z-index: 0;
}
.card:hover { transform: translateY(-4px); border-color: rgba(0,229,255,.4); }
.card:hover::before { opacity: .04; }
.card > * { position: relative; z-index: 1; }
.card-icon { font-size: 28px; margin-bottom: 14px; }
.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; }

/* PRODUCTOS DESTACADOS */
.products-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.product-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: all .35s ease;
  position: relative;
}
.product-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: var(--radius); pointer-events: none;
  background: var(--grad); opacity: 0;
  transition: opacity .35s; z-index: 0;
}
.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0,229,255,.5);
  box-shadow: 0 24px 50px -20px rgba(0,229,255,.35), 0 0 0 1px rgba(0,229,255,.2);
}
.product-card:hover::before { opacity: .06; }
.product-img {
  position: relative;
  width: 100%; height: 220px;
  background-size: cover; background-position: center;
}
.product-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(17,20,31,.95) 100%);
}
.product-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: rgba(6,7,13,.85); color: var(--cyan);
  border: 1px solid rgba(0,229,255,.4);
  padding: 5px 12px; border-radius: 999px;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  font-family: ui-monospace, monospace;
  backdrop-filter: blur(4px);
}
.product-body {
  padding: 24px 24px 26px;
  display: flex; flex-direction: column; flex: 1;
  position: relative; z-index: 1;
}
.product-body h3 {
  font-size: 1.25rem; margin-bottom: 10px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.product-body > p { color: var(--muted); font-size: .95rem; margin-bottom: 16px; }
.product-features {
  list-style: none; padding: 0; margin: 0 0 22px;
  display: grid; gap: 8px; flex: 1;
}
.product-features li {
  font-size: .88rem; color: var(--text);
  padding: 6px 0; border-bottom: 1px dashed var(--line);
}
.product-features li:last-child { border-bottom: none; }
.product-card .btn { align-self: flex-start; font-size: .9rem; padding: 11px 22px; }
.product-card::after {
  content: '✦ ' attr(data-hint) ' →';
  position: absolute; bottom: 14px; right: 18px;
  font-size: 11px; letter-spacing: 1px;
  color: var(--cyan); opacity: 0;
  transition: opacity .25s, transform .25s;
  transform: translateX(-6px);
  pointer-events: none;
  font-family: ui-monospace, monospace;
  z-index: 2;
}
.product-card:hover::after { opacity: .9; transform: translateX(0); }

/* PORTFOLIO */
.portfolio-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.portfolio-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: all .3s;
}
.portfolio-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,229,255,.4);
  box-shadow: 0 18px 40px -20px rgba(0,229,255,.4);
}
.portfolio-img {
  width: 100%; height: 200px;
  background-size: cover; background-position: center;
  position: relative;
}
.portfolio-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(6,7,13,.85) 100%);
}
.portfolio-body { padding: 22px 24px 26px; }
.tag {
  display: inline-block; font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--cyan);
  padding: 4px 10px; border: 1px solid rgba(0,229,255,.3);
  border-radius: 999px; margin-bottom: 12px;
  font-family: ui-monospace, monospace;
}
.portfolio-body h3 { font-size: 1.1rem; margin-bottom: 8px; }
.portfolio-body p { color: var(--muted); font-size: .92rem; }
.portfolio-card { cursor: pointer; }
.portfolio-more {
  display: inline-block; margin-top: 14px;
  font-size: .85rem; color: var(--cyan); font-weight: 600;
  letter-spacing: .3px;
  transition: transform .2s;
}
.portfolio-card:hover .portfolio-more { transform: translateX(4px); }

/* ===== MODAL PORTAFOLIO ===== */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 7, 13, .65);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}
.modal-content {
  position: relative; z-index: 2;
  width: 100%; max-width: 1100px; max-height: 92vh;
  display: grid; grid-template-columns: 1.3fr 1fr;
  background: var(--panel);
  border: 1px solid rgba(0, 229, 255, .25);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 229, 255, .35),
              0 0 0 1px rgba(0, 229, 255, .1),
              0 60px 120px -30px rgba(0, 0, 0, .8);
  transform: scale(.92) translateY(20px);
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.2);
}
.modal.open .modal-content { transform: scale(1) translateY(0); }

@media (max-width: 920px) {
  .modal-content { grid-template-columns: 1fr; max-height: 94vh; overflow-y: auto; }
}

.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(6, 7, 13, .75); color: var(--text);
  border: 1px solid var(--line);
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  backdrop-filter: blur(6px);
}
.modal-close:hover {
  border-color: var(--cyan); color: var(--cyan);
  transform: rotate(90deg);
}

.modal-image {
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 229, 255, .08), transparent 70%),
    var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  min-height: 360px;
  padding: 18px;
  overflow: hidden;
}
.modal-image img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

@media (max-width: 920px) {
  .modal-image { min-height: 240px; padding: 14px; }
  .modal-image img { max-height: 50vh; }
}

.modal-body {
  padding: 36px 36px 32px;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.modal-body .tag {
  align-self: flex-start;
  margin-bottom: 14px;
}
.modal-body h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.2; margin-bottom: 14px; letter-spacing: -.01em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal-body > p {
  color: var(--muted); font-size: .98rem;
  margin-bottom: 20px; line-height: 1.65;
}
.modal-body h4 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--muted); margin-bottom: 12px;
  font-family: ui-monospace, monospace;
}
.modal-features {
  list-style: none; padding: 0; margin: 0 0 26px;
  display: grid; gap: 10px;
}
.modal-features li {
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .92rem;
  display: flex; align-items: center; gap: 10px;
}
.modal-features li::before {
  content: '▹'; color: var(--cyan); font-weight: 700;
}
.modal-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: auto;
}
.modal-actions .btn { font-size: .9rem; padding: 12px 22px; }

/* Bloquear scroll del body cuando modal está abierto */
body.modal-open { overflow: hidden; }

/* TIMELINE */
.timeline { list-style: none; display: grid; gap: 18px; max-width: 800px; margin: 0 auto; }
.timeline li {
  background: var(--panel); border: 1px solid var(--line);
  padding: 22px 26px; border-radius: var(--radius);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 22px; align-items: start;
  position: relative;
}
.timeline .step {
  grid-row: span 2;
  font-family: ui-monospace, monospace; font-size: 1.4rem;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800;
}
.timeline h3 { font-size: 1.05rem; }
.timeline p { color: var(--muted); font-size: .95rem; }

/* NEED CARDS (tarjetas de necesidades) */
.need-card { display: flex; flex-direction: column; }
.need-card p { flex: 1; margin-bottom: 18px; }
.need-card .btn {
  align-self: flex-start; font-size: .88rem; padding: 10px 18px;
}

/* CONTACTO */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start;
}
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { list-style: none; padding: 0; margin-top: 22px; display: grid; gap: 12px; color: var(--muted); }
.contact-info a { color: var(--cyan); text-decoration: none; }
.contact-form { display: grid; gap: 16px; }
.contact-form label { display: grid; gap: 6px; }
.contact-form span { font-size: .85rem; color: var(--muted); }
.contact-form input,
.contact-form textarea {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-family: inherit; font-size: .95rem;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--cyan); }
.form-feedback { font-size: .9rem; color: var(--cyan); min-height: 18px; }

/* FOOTER */
.footer {
  padding: 26px 0; border-top: 1px solid var(--line);
  background: var(--bg-2); color: var(--muted); font-size: .85rem;
}
.footer-row { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* MOBILE NAV */
@media (max-width: 700px) {
  .nav-links { display: none; }
}
