/* TRACEIN — sitio comercial estático. Sin dependencias externas. */
:root {
  --navy-900: #0c2744;
  --navy: #173b61;
  --blue: #20558b;
  --green: #16a34a;
  --green-dark: #127a3a;
  --cyan: #19a7c8;
  --bg: #f5f8fc;
  --white: #ffffff;
  --ink: #12263f;
  --muted: #4f647d;
  --line: #dbe5f0;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(12, 39, 68, 0.1);
  --shadow-lg: 0 24px 60px rgba(12, 39, 68, 0.22);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--white);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--navy-900); letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.container { width: min(var(--max), 100% - 40px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.icon { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em; padding: .8em 1.4em;
  border-radius: 999px; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--green); color: var(--navy-900); box-shadow: 0 8px 22px rgba(22,163,74,.35); }
.btn-primary:hover { background: #1bb552; }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-dark:hover { background: var(--blue); }
.btn-ghost { border-color: rgba(255,255,255,.45); color: var(--white); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: .55em 1.1em; font-size: .92rem; }

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(12,39,68,.94);
  backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white); }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 1.25rem; letter-spacing: .04em; }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: #d6e4f5; text-decoration: none; padding: .5em .85em; border-radius: 8px; font-size: .95rem; }
.nav-links a:hover { color: var(--white); background: rgba(255,255,255,.08); }
.nav-links .btn { color: var(--navy-900); margin-left: 8px; padding: .55em 1.1em; }
.nav-toggle { display: none; background: none; border: 0; color: var(--white); font-size: 1.7rem; cursor: pointer; padding: 6px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--white);
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(25,167,200,.28), transparent 60%),
    radial-gradient(700px 420px at 0% 100%, rgba(22,163,74,.18), transparent 60%),
    linear-gradient(160deg, var(--navy-900) 0%, var(--navy) 100%);
  padding: 84px 0 110px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .07;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em; font-size: .82rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--cyan); }
.hero h1 { color: var(--white); font-size: clamp(2.1rem, 4.4vw, 3.4rem); margin-bottom: .45em; }
.hero h1 span { color: var(--cyan); }
.hero .lead { color: #c9daf0; font-size: 1.15rem; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 34px 0 0; padding: 0; list-style: none; }
.hero-tags li {
  font-size: .85rem; color: #d6e4f5; border: 1px solid rgba(255,255,255,.18);
  padding: .35em .85em; border-radius: 999px; background: rgba(255,255,255,.05);
}

/* ---------- Marco de pantalla ---------- */
.frame {
  background: #0a1d33; border-radius: 14px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.12); overflow: hidden; position: relative;
}
.frame-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: #10304f; }
.frame-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3b5877; display: block; }
.frame-bar i:nth-child(1) { background: #ef6b6b; }
.frame-bar i:nth-child(2) { background: #f0c05a; }
.frame-bar i:nth-child(3) { background: #5fcf80; }
.frame-bar span { margin-left: 10px; font-size: .76rem; color: #9db6d3; letter-spacing: .04em; }
.frame-body { background: var(--bg); position: relative; }
.frame-body img { width: 100%; height: auto; }
.frame.light { background: var(--white); border-color: var(--line); box-shadow: var(--shadow); }
.frame.light .frame-bar { background: #eaf1f9; }
.frame.light .frame-bar span { color: var(--muted); }

.shot-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; font: inherit; color: inherit; }
.shot-btn:hover .zoom-hint { opacity: 1; }
.zoom-hint {
  position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: .4em;
  background: rgba(12,39,68,.85); color: #fff; font-size: .78rem; padding: .35em .75em; border-radius: 999px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}

/* Marcador cuando falta la imagen */
.slot-missing {
  display: none; aspect-ratio: 16 / 10; align-items: center; justify-content: center; text-align: center;
  padding: 24px; color: var(--muted); font-size: .9rem;
  background: repeating-linear-gradient(45deg, #eef3f9, #eef3f9 12px, #e6edf6 12px, #e6edf6 24px);
}
.slot-missing code { display: block; margin-top: 6px; font-size: .82rem; color: var(--blue); }
.is-missing img { display: none; }
.is-missing .slot-missing { display: flex; flex-direction: column; }
.is-missing .zoom-hint { display: none; }
.sprite { position: absolute; width: 0; height: 0; }
.secure-note { font-size: .88rem; color: #9db6d3; margin-top: 24px; }
.secure-note .icon { vertical-align: -2px; }
.foot-tagline { margin-top: 12px; }
.pos-top-center { object-position: top center; }

/* ---------- Secciones ---------- */
section { padding: 88px 0; }
.section-alt { background: var(--bg); }
.section-head { max-width: 720px; margin: 0 auto 52px; text-align: center; }
.section-head .eyebrow { justify-content: center; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.section-head p { color: var(--muted); font-size: 1.08rem; }

.grid { display: grid; gap: 22px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #c4d6ea; }
.card h3 { font-size: 1.12rem; margin-bottom: .4em; }
.card p { color: var(--muted); font-size: .97rem; margin: 0; }
.ico {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem;
  margin-bottom: 18px; color: var(--white); background: linear-gradient(135deg, var(--blue), var(--cyan));
}
.ico.g { background: linear-gradient(135deg, var(--green-dark), var(--green)); }

/* ---------- Circuito ---------- */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; counter-reset: step; position: relative; }
.flow li {
  list-style: none; position: relative; padding: 0 14px; text-align: center; counter-increment: step;
}
.flow li::before {
  content: counter(step); display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; position: relative; z-index: 1;
  box-shadow: 0 0 0 6px var(--bg);
}
.flow li::after {
  content: ""; position: absolute; top: 22px; left: calc(50% + 28px); right: calc(-50% + 28px); height: 2px;
  background: repeating-linear-gradient(90deg, var(--cyan) 0 6px, transparent 6px 12px);
}
.flow li:last-child::after { display: none; }
.flow h3 { font-size: 1rem; margin-bottom: .25em; }
.flow p { font-size: .9rem; color: var(--muted); margin: 0; }
ol.flow { padding: 0; margin: 0; }

/* ---------- Módulos ---------- */
.module { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; margin-bottom: 76px; }
.module:last-child { margin-bottom: 0; }
.module.reverse > .module-text { order: 2; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green-dark); background: #e4f6ea; padding: .3em .8em; border-radius: 999px; margin-bottom: 14px; }
.module h3 { font-size: 1.7rem; }
.module p.lead { color: var(--muted); font-size: 1.05rem; }
.checks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: .98rem; }
.checks .icon { color: var(--green); margin-top: .28em; font-size: 1.05rem; }

/* ---------- Galería ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.g-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.g-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.g-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line); }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.g-thumb .slot-missing { aspect-ratio: auto; height: 100%; }
.g-cap { padding: 18px 20px 22px; }
.g-cap h3 { font-size: 1.02rem; margin-bottom: .3em; }
.g-cap p { font-size: .9rem; color: var(--muted); margin: 0; }

/* ---------- Aplicaciones ---------- */
.scope { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: stretch; }
.panel { border-radius: var(--radius); padding: 34px; border: 1px solid var(--line); background: var(--white); }
.panel.dark { background: linear-gradient(160deg, var(--navy-900), var(--navy)); color: #d6e4f5; border: 0; }
.panel.dark h3 { color: #fff; }
.panel h3 { font-size: 1.3rem; }
.panel ul { padding-left: 1.1em; margin: 0; display: grid; gap: .5em; }
.note { font-size: .9rem; color: var(--muted); border-left: 3px solid var(--cyan); padding-left: 14px; margin-top: 20px; }
.panel.dark .note { color: #b4c9e3; }

/* ---------- Contacto ---------- */
.contact { background: linear-gradient(160deg, var(--navy-900), var(--navy)); color: #d6e4f5; }
.contact h2 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.contact-info li { list-style: none; display: flex; gap: 12px; margin-bottom: 14px; align-items: center; }
.contact-info { padding: 0; margin: 28px 0 0; }
.contact-info .icon { color: var(--cyan); font-size: 1.3rem; }
form.card { background: var(--white); color: var(--ink); padding: 32px; }
form.card:hover { transform: none; box-shadow: none; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--navy-900); }
.field input, .field textarea {
  width: 100%; font: inherit; padding: .7em .9em; border: 1.5px solid #c3d2e3; border-radius: 10px; background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: 3px solid rgba(25,167,200,.35); border-color: var(--cyan); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--muted); margin-bottom: 18px; }
.check input { margin-top: .3em; }
.form-msg { margin-top: 14px; font-size: .92rem; padding: .8em 1em; border-radius: 10px; display: none; }
.form-msg.show { display: block; }
.form-msg.warn { background: #fff4d6; color: #6b4a00; border: 1px solid #f0d58a; }
.form-msg.ok { background: #e4f6ea; color: #0f5a2a; border: 1px solid #b6e3c5; }

/* Campos pendientes por completar */
.pending { background: #fff1b8; color: #5c4300; padding: 0 .4em; border-radius: 4px; font-weight: 600; font-size: .92em; }

/* ---------- Pie ---------- */
.site-footer { background: #081c33; color: #9db6d3; padding: 48px 0 28px; font-size: .92rem; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot .brand-name { color: #fff; }
.foot h4 { color: #fff; font-size: .95rem; margin-bottom: .8em; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5em; }
.foot a { text-decoration: none; }
.foot a:hover { color: #fff; }
.legal { border-top: 1px solid rgba(255,255,255,.1); margin-top: 32px; padding-top: 20px; font-size: .82rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

/* ---------- Visor ---------- */
dialog.viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; }
dialog.viewer::backdrop { background: rgba(6,18,33,.88); }
.v-wrap { width: min(1180px, 100% - 24px); margin: 0 auto; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.v-stage { position: relative; background: #0a1d33; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); display: grid; place-items: center; max-height: 76vh; }
.v-stage img { max-height: 76vh; width: auto; max-width: 100%; object-fit: contain; }
.v-stage .slot-missing { width: 100%; }
.v-caption { color: #d6e4f5; }
.v-caption h3 { color: #fff; margin-bottom: .2em; font-size: 1.15rem; }
.v-caption p { margin: 0; font-size: .95rem; }
.v-controls { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 10px; pointer-events: none; }
.v-btn { pointer-events: auto; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--navy-900); font-size: 1.3rem; cursor: pointer; display: grid; place-items: center; }
.v-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); cursor: pointer; font-size: 1.2rem; display: grid; place-items: center; color: var(--navy-900); }
.v-count { font-size: .82rem; color: #8fa9c9; margin-top: 6px; }

/* ---------- Animación ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .g-item { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-grid, .module, .scope, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .module.reverse > .module-text { order: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .gallery { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: 1fr; gap: 24px; }
  .flow li { text-align: left; display: grid; grid-template-columns: 46px 1fr; column-gap: 16px; padding: 0; }
  .flow li::before { margin: 0; grid-row: 1 / 3; }
  .flow li::after { display: none; }
  .foot { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0; background: var(--navy-900); flex-direction: column;
    align-items: stretch; padding: 14px 20px 22px; display: none; border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .nav-links.open { display: flex; }
  .nav-links .btn { margin: 8px 0 0; justify-content: center; }
}
@media (max-width: 620px) {
  section { padding: 64px 0; }
  .hero { padding: 56px 0 72px; }
  .grid-4, .grid-3, .gallery, .row, .foot { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

/* ---------- Aplicaciones: cifra y etiquetas ---------- */
.stat { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.stat strong { font-size: 2.6rem; line-height: 1; color: var(--green-dark); letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: .95rem; }
.chips { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.panel .chips { padding-left: 0; margin: 0 0 20px; display: flex; gap: 8px; }
.chips li { font-size: .86rem; font-weight: 600; padding: .35em .9em; border-radius: 999px; background: #e8f1fb; color: var(--navy); border: 1px solid #cfe0f2; }
.panel.dark .chips li { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.mini { font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 8px 0 .7em; }

[hidden] { display: none !important; }
.contact-info a { text-decoration: underline; text-underline-offset: 3px; }
