/* =========================================================
   ProjectBMS · Home
   Sistema: claro, sobrio, B2B. Un acento (cobalto) + verde WhatsApp solo para la acción.
   ========================================================= */

/* Fuentes autoalojadas (Geist, SIL Open Font License: assets/fonts/OFL.txt) */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #EEF1F5;
  --ink: #012049;            /* azul marino del logotipo */
  --brand-steel: #517283;    /* azul acero del logotipo */
  --text: #3D4859;
  --muted: #5D6878;
  --line: #E1E5EB;
  --line-2: #CDD3DC;

  --accent: #2445C7;
  --accent-ink: #1B3499;
  --accent-soft: #E9EEFC;
  --accent-soft-2: #D6DFFA;

  --wa: #0B7A43;
  --wa-hover: #096A3A;
  --wa-bright: #25D366;

  --dark: #0B1422;
  --dark-2: #13203A;
  --dark-line: #24324D;
  --dark-text: #B7C2D6;

  --ok: #0F7A4F;
  --ok-bg: #E3F4EC;
  --warn: #8A5A00;
  --warn-bg: #FBF0D9;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;

  --shadow-1: 0 1px 2px rgba(13, 23, 38, .05), 0 2px 8px rgba(13, 23, 38, .04);
  --shadow-2: 0 2px 6px rgba(19, 32, 70, .06), 0 24px 60px -18px rgba(19, 32, 70, .22);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --header-h: 68px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gutter: 20px;
}

@media (min-width: 768px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0; letter-spacing: -0.02em; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent-soft-2); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.i { width: 1.25em; height: 1.25em; flex: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-sm);
}
.skip:focus { top: 12px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-weight: 600; white-space: nowrap; border-radius: var(--r-sm);
  transition: background-color .2s var(--ease-out), transform .12s var(--ease-out), box-shadow .2s var(--ease-out), color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-sm { font-size: .9rem; padding: .55rem .9rem; }
.btn-lg { font-size: 1rem; padding: .85rem 1.25rem; }
.btn-xl { font-size: 1.075rem; padding: 1rem 1.6rem; }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 16px -8px rgba(11, 122, 67, .55); }
.btn-wa:hover { background: var(--wa-hover); }
.btn-ghost { color: var(--ink); border: 1px solid var(--line-2); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost .i { transition: transform .25s var(--ease-out); }
.btn-ghost:hover .i { transform: translateX(3px); }
.btn-light { background: #fff; color: var(--dark); }
.btn-light:hover { background: var(--accent-soft); }
.btn-light .i { transition: transform .25s var(--ease-out); }
.btn-light:hover .i { transform: translateX(3px); }

.text-link {
  display: inline-flex; align-items: center; gap: .45em; font-weight: 600; color: var(--wa);
  text-decoration: underline; text-decoration-color: rgba(11,122,67,.3); text-underline-offset: 4px; text-decoration-thickness: 1.5px;
}
.text-link:hover { text-decoration-color: currentColor; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand-logo { height: 30px; width: auto; }
.site-footer .brand-logo { height: 28px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 247, 249, .86);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background-color .25s;
}
.site-header.scrolled { border-bottom-color: var(--line); background: rgba(246, 247, 249, .94); }
.header-row { height: var(--header-h); display: flex; align-items: center; gap: 1.5rem; }
.main-nav { margin-left: auto; display: none; }
.main-nav ul { display: flex; gap: .15rem; }
.main-nav a {
  display: block; padding: .45rem .7rem; border-radius: 8px; font-size: .92rem; font-weight: 500; color: var(--text);
  transition: color .2s, background-color .2s;
}
.main-nav a:hover { color: var(--ink); background: var(--surface-2); }
.main-nav a.active { color: var(--accent-ink); background: var(--accent-soft); }
.header-cta { display: none; }
.menu-toggle { margin-left: auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--ink); }
.menu-toggle .i { width: 26px; height: 26px; }
.menu-toggle:hover { background: var(--surface-2); }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg); padding: 12px var(--gutter) 32px;
  display: flex; flex-direction: column; gap: 24px; overflow-y: auto; border-top: 1px solid var(--line);
  z-index: 49; animation: menu-in .3s var(--ease-out);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: flex; flex-direction: column; }
.mobile-menu nav a {
  padding: 14px 4px; font-size: 1.2rem; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line);
}
body.menu-open { overflow: hidden; }
body.menu-open .wa-float { display: none; }

@media (min-width: 1080px) {
  .main-nav, .header-cta { display: flex; }
  .menu-toggle, .mobile-menu { display: none !important; }
  .header-row { gap: 1rem; }
}

/* ---------- Secciones ---------- */
.section { padding-block: 88px; }
@media (min-width: 1024px) { .section { padding-block: 120px; } }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); letter-spacing: -0.03em; }
.section-head p { margin-top: 16px; font-size: 1.08rem; color: var(--muted); max-width: 62ch; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center p { margin-inline: auto; }

.ico {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); flex: none;
}
.ico .i { width: 22px; height: 22px; }

.ph-badge {
  display: inline-block; font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); white-space: nowrap;
}
.ph-badge.dark { background: rgba(255,255,255,.08); color: var(--dark-text); }

/* ---------- 1. Hero ---------- */
.hero { padding-top: 40px; padding-bottom: 72px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 55% 75% at 78% 42%, var(--accent-soft) 0%, rgba(233, 238, 252, .55) 40%, rgba(233, 238, 252, 0) 72%);
}
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero-grid > *, .problem-grid > *, .ai-grid > *, .why-grid > *, .bento > * { min-width: 0; }
.hero-tag {
  display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 500; color: var(--accent-ink);
  background: var(--surface); border: 1px solid var(--accent-soft-2); padding: .35rem .8rem .35rem .65rem; border-radius: 999px;
}
.hero-tag .i { width: 1.05em; height: 1.05em; }
.hero h1 {
  margin-top: 20px; font-size: clamp(2.3rem, 1.5rem + 3vw, 3.55rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 650;
  max-width: 15ch;
}
.hero .lead { margin-top: 20px; font-size: clamp(1.05rem, .98rem + .35vw, 1.22rem); color: var(--text); max-width: 46ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-facts li { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); }
.hero-facts .i { color: var(--accent); width: 1.1em; height: 1.1em; }

@media (min-width: 1024px) {
  .hero { padding-top: 64px; padding-bottom: 104px; }
  .hero-grid { grid-template-columns: minmax(0, 5.6fr) minmax(0, 6.4fr); gap: 48px; }
}
@media (min-width: 1360px) {
  .hero-visual { margin-right: calc(var(--gutter) * -1 - 40px); }
}
@media (max-width: 520px) {
  .cta-row .btn { width: 100%; }
}
@media (max-width: 1023px) {
  .hero::before { inset: auto 0 0 0; width: 100%; height: 42%; border-radius: 0; background: linear-gradient(0deg, var(--accent-soft) 0%, rgba(233, 238, 252, 0) 100%); }
}

/* Ventana ERP ilustrativa */
.erp-window {
  margin: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow-2); overflow: hidden; font-size: 12.5px; color: var(--text);
}
.erp-titlebar {
  display: flex; align-items: center; gap: 14px; height: 36px; padding-left: 12px;
  background: #F1F3F7; border-bottom: 1px solid var(--line);
}
.erp-app img { height: 14px; width: auto; }
.erp-app { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.erp-path { color: var(--muted); }
.erp-winbtns { margin-left: auto; display: flex; height: 100%; }
.erp-winbtns i { width: 42px; height: 100%; position: relative; }
.erp-winbtns i::before { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1px; background: var(--muted); transform: translate(-50%, -50%); }
.erp-winbtns i:nth-child(2)::before { height: 9px; background: none; border: 1px solid var(--muted); }
.erp-winbtns i:nth-child(3)::before { width: 11px; background: var(--muted); transform: translate(-50%, -50%) rotate(45deg); }
.erp-winbtns i:nth-child(3)::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1px; background: var(--muted); transform: translate(-50%, -50%) rotate(-45deg); }
.erp-body { display: grid; grid-template-columns: 148px 1fr; min-height: 340px; }
.erp-side { background: #FAFBFC; border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.erp-side span { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; color: var(--text); }
.erp-side span .i { width: 15px; height: 15px; color: var(--muted); }
.erp-side span.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.erp-side span.on .i { color: var(--accent); }
.erp-main { padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.erp-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.erp-kpis div { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.erp-kpis small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-kpis strong { color: var(--ink); font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; }
.erp-kpis em { font-style: normal; font-size: 11px; color: var(--muted); }
.erp-kpis em.up { color: var(--ok); }
.erp-chart { height: 74px; display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px 0; border: 1px solid var(--line); border-radius: 8px; }
.erp-chart span { flex: 1; height: var(--h); background: var(--accent-soft-2); border-radius: 3px 3px 0 0; transform-origin: bottom; }
.erp-chart span.now { background: var(--accent); }
.erp-table { width: 100%; border-collapse: collapse; }
.erp-table th { text-align: left; font-weight: 500; font-size: 11px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.erp-table td { padding: 7px 8px; border-bottom: 1px solid #F0F2F5; white-space: nowrap; color: var(--ink); }
.erp-table tr:last-child td { border-bottom: 0; }
.erp-table .r { text-align: right; }
.erp-table td.mono { font-size: 12px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.wait { background: var(--warn-bg); color: var(--warn); }
.erp-window figcaption { font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 7px 12px; border-top: 1px solid var(--line); background: #FAFBFC; }

@media (max-width: 760px) {
  .erp-body { grid-template-columns: 1fr; min-height: 0; }
  .erp-side { display: none; }
  .erp-table th:nth-child(2), .erp-table td:nth-child(2) { display: none; }
  .erp-kpis div:nth-child(3) { display: none; }
  .erp-kpis { grid-template-columns: 1fr 1fr; }
  .erp-path { display: none; }
}

/* Laptops (1024–1279 px): la ventana es más angosta, se simplifica para que no se corte */
@media (min-width: 1024px) and (max-width: 1279px) {
  .erp-body { grid-template-columns: 128px 1fr; }
  .erp-table th:nth-child(2), .erp-table td:nth-child(2) { display: none; }
}

/* ---------- 2. Problema ---------- */
.problem { background: var(--surface); border-block: 1px solid var(--line); }
.problem-grid { display: grid; gap: 40px; }
.pain-list { display: grid; gap: 0 32px; align-content: start; }
.pain-list li {
  display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); font-weight: 500;
}
.pain-list .i { color: var(--muted); width: 22px; height: 22px; }
.solution-card {
  background: var(--dark); color: var(--dark-text); border-radius: var(--r-lg); padding: 32px;
  display: flex; flex-direction: column; gap: 16px; align-self: start;
}
.solution-card h3 { color: #fff; font-size: 1.45rem; letter-spacing: -0.02em; }
.check-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; color: #E6EBF4; }
.check-list .i { color: #8FA8FF; margin-top: 2px; width: 20px; height: 20px; }
@media (min-width: 720px) { .pain-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) {
  .problem-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; }
  .solution-card { padding: 40px; position: sticky; top: calc(var(--header-h) + 24px); }
}

/* ---------- 3. Valor (bento) ---------- */
.bento { display: grid; gap: 16px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 28px;
  display: flex; flex-direction: column; gap: 12px;
}
.tile h3 { font-size: 1.2rem; margin-top: 8px; }
.tile p { color: var(--muted); }
.tile-main { padding: 0; overflow: hidden; }
.tile-main .tile-text { padding: 32px 32px 0; display: flex; flex-direction: column; gap: 12px; }
.tile-main h3 { font-size: 1.6rem; letter-spacing: -0.025em; }
.tile-main p { max-width: 42ch; font-size: 1.05rem; }
.tile-peru { background: var(--accent); border-color: var(--accent); }
.tile-peru h3 { color: #fff; }
.tile-peru p { color: #DCE4FF; }
.tile-peru .ico { background: rgba(255,255,255,.14); color: #fff; }
.tile-soft { background: var(--surface-2); border-color: transparent; }
.tile-soft .ico { background: var(--surface); }

.hub { position: relative; height: 300px; margin: 16px 16px 20px; }
.hub-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.hub-lines line { stroke: var(--accent-soft-2); stroke-width: 1.5; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.hub-core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 84px; height: 76px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-2);
  display: grid; place-items: center; box-shadow: var(--shadow-1);
}
.hub-core img { width: 52px; height: auto; }
.hub-node {
  position: absolute; z-index: 2; transform: translate(-50%, -50%);
  font-size: .82rem; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap; box-shadow: var(--shadow-1);
}
/* 8 módulos: operaciones a la izquierda, finanzas y personas a la derecha (posiciones en el HTML) */
.tile-link { align-self: flex-start; margin-top: 4px; color: var(--accent-ink); text-decoration-color: rgba(36, 69, 199, .3); } /* verde reservado a WhatsApp */
.tile-link .i { width: 1em; height: 1em; transition: transform .25s var(--ease-out); }
.tile-link:hover .i { transform: translateX(3px); }
@media (max-width: 520px) {
  .hub-core { width: 64px; height: 56px; border-radius: 16px; }
  .hub-core img { width: 40px; }
}
@media (max-width: 400px) { .hub-node { font-size: .78rem; padding: 5px 10px; } }

@media (min-width: 720px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .tile-main { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .bento { grid-template-columns: 1.35fr 1fr 1fr; grid-auto-rows: minmax(220px, auto); }
  .tile-main { grid-column: 1; grid-row: 1 / span 2; }
  .hub { height: 320px; margin-top: auto; }
}

/* ---------- 4. Módulos ---------- */
/* Las tarjetas son informativas (no clicables): sin efectos hover que sugieran un enlace. */
.modules { background: var(--surface); border-block: 1px solid var(--line); }
.mod-legend { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: .85rem; font-weight: 500; color: var(--accent-ink); }
.pe-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent-soft); border: 1px solid var(--accent); }
.area-grid { display: grid; gap: 14px; }
.area-card {
  display: flex; flex-direction: column; padding: 24px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.area-card .ico { background: var(--surface); align-self: flex-start; }
.area-card h3 { margin-top: 18px; font-size: 1.2rem; letter-spacing: -0.02em; }
.area-card > p { margin-top: 6px; color: var(--muted); font-size: .95rem; }
.mod-chips { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.mod-chips li {
  display: inline-flex; align-items: center; max-width: 100%; padding: 6px 11px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: .88rem; font-weight: 500; line-height: 1.2;
}
/* Funcionalidades de cumplimiento SUNAT: acento sutil (ver leyenda) */
.mod-chips li.pe { background: var(--accent-soft); border-color: var(--accent-soft-2); color: var(--accent-ink); }
/* Botón "+N más" (solo móvil, lo crea main.js) */
.mod-chips li.more { padding: 0; border: 0; background: none; }
.mod-chips .more button {
  padding: 6px 11px; border-radius: 8px; border: 1px dashed var(--line-2); background: transparent;
  color: var(--accent-ink); font: inherit; font-size: .85rem; font-weight: 600; line-height: 1.2; cursor: pointer;
}
.mod-chips .more button:hover { border-color: var(--accent); }
.mod-chips.is-collapsed li.extra { display: none; }
.mod-chips li[hidden] { display: none; }

.mod-demo {
  display: flex; flex-direction: column; align-items: flex-start; gap: 20px; margin-top: 24px; padding: 28px;
  border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-soft-2);
}
.mod-demo h3 { font-size: 1.2rem; letter-spacing: -0.02em; max-width: 34ch; }
.mod-demo p { margin-top: 6px; color: var(--text); max-width: 56ch; }
@media (max-width: 520px) { .mod-demo .btn { width: 100%; } }

/* Móvil: tarjeta compacta (icono y título en la misma fila) */
@media (max-width: 719px) {
  .area-card { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 20px; }
  .area-card h3 { margin-top: 0; font-size: 1.12rem; }
  .area-card > p, .mod-chips { grid-column: 1 / -1; }
  .area-card > p { margin-top: 12px; }
  .mod-chips { margin-top: 14px; padding-top: 14px; gap: 6px; }
  .mod-chips li { font-size: .85rem; padding: 5px 10px; }
  .mod-demo { padding: 24px 20px; }
}

@media (min-width: 720px) {
  .area-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  /* Subgrid: icono, título, texto y funcionalidades quedan alineados entre tarjetas de la misma fila */
  @supports (grid-template-rows: subgrid) {
    .area-card { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
  }
}
/* 8 áreas: 2 columnas en tablet/laptop y 4 columnas (4×2) en pantallas anchas */
@media (min-width: 1200px) {
  .area-grid { grid-template-columns: repeat(4, 1fr); }
  .area-card { padding: 24px 20px; }
  .area-card h3 { font-size: 1.12rem; }
  .area-card > p { font-size: .92rem; }
  .mod-chips { gap: 6px; }
  .mod-chips li { font-size: .83rem; padding: 5px 9px; line-height: 1.25; }
}
@media (min-width: 1024px) {
  .mod-demo { flex-direction: row; align-items: center; justify-content: space-between; gap: 40px; padding: 28px 32px; }
  .mod-demo .btn { flex: none; }
}

/* ---------- 5. Cómo funciona ---------- */
.flow-track { display: grid; gap: 0; position: relative; counter-reset: none; }
.flow-track li { position: relative; display: grid; grid-template-columns: 56px 1fr; column-gap: 18px; padding-bottom: 28px; }
.flow-track li:last-child { padding-bottom: 0; }
.flow-track li::before {
  content: ""; position: absolute; left: 27px; top: 56px; bottom: 0; width: 2px; background: var(--accent-soft-2);
}
.flow-track li:last-child::before { display: none; }
.flow-track .node {
  grid-row: span 2; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--accent); box-shadow: var(--shadow-1); position: relative; z-index: 1;
}
.flow-track .node .i { width: 26px; height: 26px; }
.flow-track h3 { font-size: 1.12rem; align-self: end; }
.flow-track p { color: var(--muted); font-size: .95rem; }
.flow-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 40px; font-size: .88rem; color: var(--muted); }
.flow-note .i { margin-top: .2em; }
@media (min-width: 900px) { .flow-note { justify-content: center; align-items: center; } .flow-note .i { margin-top: 0; } }
.flow-note .i { color: var(--accent); }

@media (min-width: 900px) {
  .flow-track { grid-template-columns: repeat(5, 1fr); gap: 24px; }
  .flow-track li { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 0; row-gap: 6px; }
  .flow-track li::before { left: calc(50% + 40px); right: calc(-50% - 24px + 40px); top: 33px; bottom: auto; width: auto; height: 2px; }
  .flow-track .node { grid-row: auto; width: 68px; height: 68px; border-radius: 20px; margin-bottom: 14px; }
  .flow-track .node .i { width: 30px; height: 30px; }
  .flow-track p { max-width: 24ch; }
  /* Pulso que recorre el flujo: el único momento animado protagonista */
  .flow-track li:not(:last-child)::after {
    content: ""; position: absolute; top: 30px; left: calc(50% + 36px); width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); opacity: 0; box-shadow: 0 0 0 4px var(--accent-soft);
  }
  .flow.in-view .flow-track li:not(:last-child)::after { animation: travel 5s var(--ease-out) infinite; }
  .flow.in-view .flow-track li:nth-child(2)::after { animation-delay: 1s; }
  .flow.in-view .flow-track li:nth-child(3)::after { animation-delay: 2s; }
  .flow.in-view .flow-track li:nth-child(4)::after { animation-delay: 3s; }
  .flow.in-view .flow-track .node { animation: node-ping 5s ease-out infinite; }
  .flow.in-view .flow-track li:nth-child(2) .node { animation-delay: 1s; }
  .flow.in-view .flow-track li:nth-child(3) .node { animation-delay: 2s; }
  .flow.in-view .flow-track li:nth-child(4) .node { animation-delay: 3s; }
  .flow.in-view .flow-track li:nth-child(5) .node { animation-delay: 4s; }
}
@keyframes travel {
  0% { opacity: 0; transform: translateX(0); }
  4% { opacity: 1; }
  18% { opacity: 1; transform: translateX(var(--travel, 120px)); }
  22%, 100% { opacity: 0; transform: translateX(var(--travel, 120px)); }
}
@keyframes node-ping {
  0% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-1); }
  14%, 100% { border-color: var(--line-2); box-shadow: 0 0 0 0 var(--accent-soft), var(--shadow-1); }
}

/* ---------- 6. Por qué ---------- */
.why { background: var(--surface); border-block: 1px solid var(--line); }
.why-grid { display: grid; gap: 40px; }
.why-head h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); letter-spacing: -0.03em; }
.why-head p { margin-top: 16px; font-size: 1.08rem; color: var(--muted); max-width: 42ch; }
.why-head .text-link { margin-top: 24px; }
.why-list { display: grid; gap: 0 40px; }
.why-list li { display: flex; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.why-list li > .i { color: var(--accent); width: 24px; height: 24px; margin-top: 1px; }
.why-list h3 { font-size: 1.03rem; letter-spacing: -0.01em; }
.why-list p { margin-top: 3px; color: var(--muted); font-size: .95rem; }
@media (min-width: 720px) { .why-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) {
  .why-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 72px; }
  .why-head { position: sticky; top: calc(var(--header-h) + 40px); align-self: start; }
}

/* ---------- 7. Clientes ---------- */
.logo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.logo-item {
  --h: 40px;
  height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.logo-item img {
  height: var(--h); width: auto; max-width: 100%; object-fit: contain;
  filter: grayscale(1); opacity: .72; transition: filter .3s var(--ease-out), opacity .3s var(--ease-out);
}
.logo-item:hover img { filter: none; opacity: 1; }
.logo-name { font-size: .78rem; font-weight: 600; letter-spacing: .01em; color: var(--muted); line-height: 1.2; }
/* Tamaño óptico: cada logo se ajusta según su proporción para que todos pesen parecido */
.logo-swisscorp { --h: 32px; }
.logo-ambercrest { --h: 36px; }
.logo-amprimo { --h: 34px; }
.logo-balflex { --h: 38px; }
.logo-incotep { --h: 30px; }
.logo-harbormarine { --h: 34px; }
@media (min-width: 720px) {
  .logo-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .logo-item { height: 128px; }
  .logo-swisscorp { --h: 40px; }
  .logo-ambercrest { --h: 44px; }
  .logo-amprimo { --h: 44px; }
  .logo-balflex { --h: 50px; }
  .logo-incotep { --h: 38px; }
  .logo-harbormarine { --h: 44px; }
}
@media (hover: none) { .logo-item img { filter: none; opacity: 1; } }
.testimonial {
  position: relative; margin: 48px auto 0; max-width: 820px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 36px 32px 32px;
}
.testimonial.is-placeholder { border-style: dashed; border-color: var(--line-2); }
.quote-ico { color: var(--accent-soft-2); display: block; }
.quote-ico .i { width: 40px; height: 40px; }
.testimonial blockquote { margin: 12px 0 0; }
.testimonial blockquote p { font-size: 1.2rem; line-height: 1.5; color: var(--ink); letter-spacing: -0.01em; }
.testimonial figcaption { margin-top: 20px; display: flex; flex-direction: column; font-size: .95rem; }
.testimonial figcaption strong { color: var(--ink); font-weight: 600; }
.testimonial figcaption span { color: var(--muted); }
.testimonial .ph-badge { position: absolute; top: 16px; right: 16px; }

/* ---------- 8. Trayectoria ---------- */
.history { padding-bottom: 72px; }
.timeline { display: grid; gap: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 32px 32px; border-left: 2px solid var(--accent-soft-2); }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before {
  content: ""; position: absolute; left: -8px; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.timeline li.next::before { background: var(--accent); }
.timeline .year { font-family: var(--mono); font-size: .95rem; font-weight: 500; color: var(--accent-ink); }
.timeline h3 { margin-top: 6px; font-size: 1.2rem; }
.timeline p { margin-top: 6px; color: var(--muted); max-width: 34ch; }
@media (min-width: 900px) {
  .timeline { grid-template-columns: repeat(4, 1fr); gap: 32px; }
  .timeline li { padding: 32px 0 0; border-left: 0; border-top: 2px solid var(--accent-soft-2); }
  .timeline li:last-child { border-top-style: dashed; border-top-color: var(--accent-soft-2); }
  .timeline li::before { left: 0; top: -8px; }
}

/* ---------- 9. Konecta (banda oscura) ---------- */
.konecta { background: var(--dark); color: var(--dark-text); position: relative; overflow: hidden; }
.konecta::before {
  content: ""; position: absolute; inset: auto -10% -40% auto; width: 70%; height: 90%;
  background: radial-gradient(closest-side, rgba(36, 69, 199, .32), rgba(36, 69, 199, 0));
  pointer-events: none;
}
.konecta .container { position: relative; }
.konecta h2 { color: #fff; }
.konecta .section-head p { color: var(--dark-text); }
.konecta-lead { font-size: 1.2rem !important; }
.evo { display: grid; gap: 16px; position: relative; }
.evo-step {
  position: relative; background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: var(--r-md); padding: 28px;
  display: flex; flex-direction: column; gap: 12px;
}
.evo-step h3 { color: #fff; font-size: 1.5rem; letter-spacing: -0.025em; }
.evo-step p { color: var(--dark-text); }
.evo-label { font-family: var(--mono); font-size: .75rem; color: #9DB2FF; }
.evo-ai { background: linear-gradient(160deg, #1C3488 0%, #172A6B 100%); border-color: #3552C9; }
.evo-ai p { color: #D3DCF7; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: #E1E7F3;
  border: 1px solid var(--dark-line); background: rgba(255,255,255,.03); padding: 5px 10px; border-radius: 999px;
}
.tags .i { width: 15px; height: 15px; color: #9DB2FF; }
.konecta-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--dark-line); }
.konecta-foot p { color: #E1E7F3; font-size: 1.05rem; }

@media (min-width: 900px) {
  .evo { grid-template-columns: 1fr 1.25fr 1fr; gap: 40px; }
  .evo-step:not(:last-child)::after {
    content: ""; position: absolute; top: 50%; right: -40px; width: 40px; height: 2px;
    background: linear-gradient(90deg, var(--dark-line), #3552C9);
  }
  .evo-step:not(:last-child)::before {
    content: ""; position: absolute; top: calc(50% - 4px); right: -24px; width: 8px; height: 8px;
    border-top: 2px solid #3552C9; border-right: 2px solid #3552C9; transform: rotate(45deg); z-index: 1;
  }
}

/* ---------- 10. Konecta IA ---------- */
.ai-grid { display: grid; gap: 48px; align-items: center; }
.ai-copy h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem); letter-spacing: -0.03em; }
.ai-quote {
  margin-top: 20px; font-size: 1.25rem; line-height: 1.4; color: var(--accent-ink); font-weight: 500; letter-spacing: -0.015em; max-width: 34ch;
}
.ai-copy > p:not(.ai-quote):not(.ai-note) { margin-top: 16px; color: var(--text); max-width: 58ch; }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.ai-cols h3 { font-size: .95rem; margin-bottom: 12px; }
.dot-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dot-list li { font-size: .88rem; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.channel-list { display: flex; flex-direction: column; gap: 10px; }
.channel-list li { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; font-size: .95rem; }
.channel-list .i { color: var(--accent); }
.ai-note { margin-top: 24px; font-size: .9rem; color: var(--muted); max-width: 58ch; }

.chat {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  overflow: hidden; display: flex; flex-direction: column;
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--dark); color: #fff; }
.chat-head strong { display: block; font-size: .98rem; }
.chat-head small { display: block; color: var(--dark-text); font-size: .78rem; }
.chat-head .ph-badge { margin-left: auto; }
.chat-avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); }
.chat-avatar .i { width: 20px; height: 20px; }
.chat-body { padding: 20px 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; min-height: 330px; background: #FAFBFC; }
.msg { max-width: 88%; display: flex; flex-direction: column; gap: 10px; animation: msg-in .5s var(--ease-out) both; }
.msg p { font-size: .95rem; }
.msg.user { align-self: flex-end; }
.msg.user p { background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; }
.msg.bot { align-self: flex-start; animation-delay: .25s; }
.msg.bot > p { background: var(--surface); border: 1px solid var(--line); color: var(--ink); padding: 10px 14px; border-radius: 14px 14px 14px 4px; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; align-self: flex-start; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.data-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dc-kpi { display: flex; flex-direction: column; }
.dc-kpi small { color: var(--muted); font-size: .78rem; }
.dc-kpi strong { font-family: var(--mono); font-weight: 500; font-size: 1.25rem; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dc-kpi em { font-style: normal; font-size: .78rem; color: var(--muted); }
.dc-kpi em.up { color: var(--ok); }
.dc-rank { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.dc-rank li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: .88rem; color: var(--ink); }
.dc-rank .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--accent); width: var(--w); transform-origin: left; animation: bar-in .8s var(--ease-out) both; }
.dc-rank li:nth-child(n+2) .bar { background: var(--accent-soft-2); }
.dc-rank .mono { color: var(--text); font-size: .85rem; }
@keyframes bar-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
.chat-chips::-webkit-scrollbar { display: none; }
.chat-chips button {
  white-space: nowrap; font-size: .85rem; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink);
  transition: background-color .2s, border-color .2s, color .2s;
}
.chat-chips button:hover { border-color: var(--accent); color: var(--accent-ink); }
.chat-chips button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft-2); color: var(--accent-ink); font-weight: 500; }
.chat-input { display: flex; align-items: center; justify-content: space-between; margin: 0 18px 16px; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 12px; color: var(--muted); font-size: .92rem; }
.chat-input .i { color: var(--accent); }

@media (min-width: 1024px) {
  .ai-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 72px; }
}
@media (max-width: 719px) {
  .chat-chips { flex-wrap: nowrap; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
}
@media (max-width: 420px) {
  .ai-cols { grid-template-columns: 1fr; }
  .data-card { grid-template-columns: 1fr; }
}

/* ---------- 11. Contacto ---------- */
.contact { padding-top: 24px; }
.contact-panel {
  text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 28px;
  padding: 64px 24px; position: relative; overflow: hidden;
}
.contact-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 240px at 50% 0%, var(--accent-soft), rgba(233,238,252,0));
}
.contact-panel > * { position: relative; }
.contact-panel h2 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); letter-spacing: -0.035em; }
.contact-panel > p { margin: 20px auto 0; max-width: 56ch; font-size: 1.1rem; color: var(--text); }
.contact-panel .btn { margin-top: 32px; }
.contact-panel .contact-meta { margin-top: 18px; font-size: .9rem; color: var(--muted); }
@media (max-width: 520px) { .contact-panel .btn { width: 100%; } }

/* ---------- 12. Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-top: 56px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { margin-top: 12px; color: var(--muted); max-width: 34ch; font-size: .95rem; }
.site-footer h2 { font-size: .85rem; font-weight: 600; color: var(--ink); letter-spacing: 0; margin-bottom: 12px; }
.site-footer ul { display: flex; flex-direction: column; gap: 8px; }
.site-footer ul a { color: var(--muted); font-size: .95rem; transition: color .2s; }
.site-footer ul a:hover { color: var(--ink); }
.footer-bottom { margin-top: 48px; padding-bottom: 100px; font-size: .85rem; color: var(--muted); }
.footer-bottom p { border-top: 1px solid var(--line); padding-top: 24px; }
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.3fr; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { padding-bottom: 28px; }
}

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60;
  display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border-radius: 999px;
  background: var(--wa); color: #fff; font-weight: 600; box-shadow: 0 10px 30px -8px rgba(11, 122, 67, .6), 0 2px 6px rgba(13,23,38,.12);
  transition: transform .25s var(--ease-out), background-color .2s, opacity .3s;
}
.wa-float .i { width: 28px; height: 28px; }
.wa-float:hover { background: var(--wa-hover); transform: translateY(-2px); }
.wa-float-label { font-size: .95rem; }
@media (max-width: 719px) {
  .wa-float { width: 52px; height: 52px; padding: 0; justify-content: center; }
  .wa-float .i { width: 26px; height: 26px; }
  .wa-float-label { display: none; }
}
@media (min-width: 720px) {
  .wa-float { gap: 0; padding: 0 14px; }
  .wa-float-label { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .35s var(--ease-out), margin .35s var(--ease-out); }
  .wa-float:hover .wa-float-label, .wa-float:focus-visible .wa-float-label { max-width: 12rem; margin-left: 10px; }
}
.wa-float {
  opacity: 0; transform: translateY(12px); pointer-events: none; visibility: hidden;
  transition: transform .25s var(--ease-out), background-color .2s, opacity .3s, visibility 0s linear .3s;
}
.wa-float.show { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.wa-float.show:hover { transform: translateY(-2px); }

/* ---------- Revelado al hacer scroll (solo con JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .flow-track li::after { display: none !important; }
}

@media print {
  .site-header, .wa-float, .chat-chips { display: none; }
}
