/* ============================================================
   Helixora — hoja de estilos
   Tipografía: IBM Plex Sans (auto-alojada) + mono del sistema
   para detalles técnicos. Paleta derivada del logo (#000B3D).
   ============================================================ */

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('ibm-plex-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --brand: #000b3d;
  --ink: #0b1233;
  --ink-soft: #46506b;
  --ink-faint: #6a7390;
  --rule: #c9d0de;
  --rule-soft: #dde2ec;
  --accent: #1c3faa;
  --accent-hover: #142e7e;
  --signal: #0a7d55;
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --radius: 4px;
  --measure: 64ch;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-underline-offset: 0.2em;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff; padding: .75rem 1rem; z-index: 200; text-decoration: none; }
.skip:focus { left: 0; color: #fff; }

/* Layout */
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: clamp(1.25rem, 5vw, 3rem); }
.band { padding-block: clamp(3rem, 7vw, 5.5rem); scroll-margin-top: 72px; }
.band--ink { background: var(--brand); color: #dde3f0; }
.band--surface { background: var(--surface); }
.split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,400px); gap: clamp(2rem,5vw,4rem); align-items: start; }
.split--even { grid-template-columns: 1fr 1fr; }
.measure { max-width: var(--measure); }

/* Tipografía */
h1, h2, h3, h4 { font-weight: 650; line-height: 1.18; letter-spacing: -0.018em; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); letter-spacing: -0.022em; }
h3 { font-size: 1.1rem; }
h4 { font-size: .95rem; }
p, li { color: var(--ink-soft); }
p + p { margin-top: 1rem; }
.lede { font-size: 1.1rem; line-height: 1.7; }
.small { font-size: .875rem; }
.faint { color: var(--ink-faint); }
strong { color: var(--ink); font-weight: 600; }

/* Etiqueta de sección */
.seg { font-family: var(--font-mono); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); display: flex; align-items: center; gap: .75rem; margin-bottom: 1.6rem; }
.seg::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.band--ink .seg { color: #93a0c4; }
.band--ink .seg::after { background: #26325e; }
.band--ink h2, .band--ink h3, .band--ink h4, .band--ink strong { color: #f3f5fb; }
.band--ink p, .band--ink li { color: #b6c0da; }
.band--ink a { color: #9db6ff; }
.band--ink a:hover { color: #c9d6ff; }

/* Cabecera */
.site-head { position: sticky; top: 0; z-index: 100; background: rgba(238,241,246,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.site-head__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand-link { display: inline-flex; align-items: center; }
.brand-link img { height: 30px; width: auto; }
.nav ul { list-style: none; display: flex; align-items: center; gap: 1.5rem; }
.nav a { font-size: .895rem; font-weight: 500; color: var(--ink-soft); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.nav a.is-active { color: var(--ink); font-weight: 600; }
.nav .nav-cta { background: var(--brand); color: #fff; padding: .5rem .95rem; border-radius: var(--radius); font-weight: 600; }
.nav .nav-cta:hover { background: var(--accent); color: #fff; }
.nav-toggle { display: none; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: transparent; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); padding: .45rem .7rem; cursor: pointer; }

/* Hero */
.hero { padding-block: clamp(3rem,7vw,5.5rem) clamp(3rem,6vw,5rem); }
.hero__eyebrow { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.25rem; font-weight: 600; }
.hero h1 { margin-bottom: 1.4rem; max-width: 21ch; }
.hero .lede { max-width: 56ch; }

/* Botones */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.1rem; }
.btn, .btn-alt { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-sans); font-size: .925rem; font-weight: 600; padding: .8rem 1.3rem; border-radius: var(--radius); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.btn { background: var(--brand); color: #fff; }
.btn:hover { background: var(--accent); color: #fff; }
.btn-alt { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-alt:hover { border-color: var(--ink); background: var(--surface); color: var(--ink); }
.band--ink .btn { background: #fff; color: var(--brand); }
.band--ink .btn:hover { background: #dbe4ff; color: var(--brand); }
.band--ink .btn-alt { color: #f3f5fb; border-color: #3b4877; }
.band--ink .btn-alt:hover { background: #131e4d; border-color: #7186c4; color: #fff; }

/* Lista de problemas */
.pains { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: .6rem 2.5rem; max-width: 900px; }
.pains li { position: relative; padding: .55rem 0 .55rem 1.7rem; border-bottom: 1px solid var(--rule-soft); font-size: .975rem; }
.pains li::before { content: "—"; position: absolute; left: 0; color: var(--accent); font-weight: 600; }

/* Soluciones (lista numerada) */
.svc { list-style: none; border-top: 1px solid var(--rule); }
.svc > li { border-bottom: 1px solid var(--rule); padding-block: 1.8rem; display: grid; grid-template-columns: 3rem minmax(0,1fr); gap: 0 1.25rem; }
.svc__n { font-family: var(--font-mono); font-size: .8rem; font-weight: 600; color: var(--accent); padding-top: .32rem; }
.svc h3 { margin-bottom: .45rem; font-size: 1.15rem; }
.svc p { max-width: var(--measure); }
.svc__tags { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin-top: .9rem; }
.svc__tags li { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: .2rem .5rem; }

/* Casos de uso */
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.cases > div { background: var(--surface); padding: 1.6rem 1.5rem; }
.cases h3 { font-size: 1rem; margin-bottom: .7rem; }
.cases ul { list-style: none; display: grid; gap: .4rem; }
.cases li { font-size: .875rem; position: relative; padding-left: 1.15rem; }
.cases li::before { content: "·"; position: absolute; left: .2rem; color: var(--accent); font-weight: 700; }

/* Metodología */
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1.6rem 2.5rem; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 2.6rem minmax(0,1fr); gap: 0 .9rem; }
.steps > li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: .8rem; font-weight: 600; color: var(--accent); padding-top: .3rem; }
.steps h3 { margin-bottom: .3rem; font-size: 1rem; }
.steps p { font-size: .9rem; }

/* Panel HL7 */
.msg { background: #0d143a; border: 1px solid #26325e; border-radius: var(--radius); overflow: hidden; }
.msg__bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem .9rem; border-bottom: 1px solid #26325e; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: #93a0c4; }
.msg__ack { color: #4fd6a4; font-weight: 700; }
.msg pre { font-family: var(--font-mono); font-size: .7rem; line-height: 1.85; padding: .9rem; overflow-x: auto; color: #dde3f0; white-space: pre; }
.msg pre b { color: #9db6ff; font-weight: 700; }

/* Precios */
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1rem; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.7rem 1.5rem; display: flex; flex-direction: column; gap: .9rem; position: relative; }
.plan--featured { border: 2px solid var(--brand); }
.plan__badge { position: absolute; top: -0.7rem; left: 1.25rem; background: var(--brand); color: #fff; font-family: var(--font-mono); font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: .22rem .6rem; border-radius: var(--radius); }
.plan h3 { font-size: 1.05rem; }
.plan__price { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.plan__price small { font-size: .85rem; font-weight: 500; color: var(--ink-faint); letter-spacing: 0; }
.plan__for { font-size: .875rem; min-height: 3.2em; }
.plan ul { list-style: none; display: grid; gap: .45rem; border-top: 1px solid var(--rule-soft); padding-top: .9rem; }
.plan li { font-size: .86rem; position: relative; padding-left: 1.5rem; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--signal); font-weight: 700; }
.plan__actions { margin-top: auto; display: grid; gap: .5rem; padding-top: .5rem; }
.plan__actions .btn, .plan__actions .btn-alt { width: 100%; }

/* Tarjetas sobrias */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.cards > * { background: var(--surface); padding: 1.6rem 1.5rem; }
.cards h3 { margin-bottom: .5rem; font-size: 1rem; }
.cards p { font-size: .9rem; }

/* Raíl / notas */
.rail { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 1.25rem 1.35rem; }
.rail h3 { font-size: .975rem; margin-bottom: .6rem; }
.rail ul { margin: .5rem 0 0 1.1rem; }
.rail li { font-size: .9rem; margin-bottom: .3rem; }
.band--surface .rail { background: var(--surface-2); }

/* Listas con signo */
.list { margin-left: 1.15rem; display: grid; gap: .5rem; }
.list--check, .list--no { list-style: none; margin-left: 0; }
.list--check li, .list--no li { position: relative; padding-left: 1.6rem; }
.list--check li::before { content: "✓"; position: absolute; left: 0; top: -.05rem; color: var(--signal); font-weight: 700; }
.list--no li::before { content: "×"; position: absolute; left: .15rem; top: -.1rem; color: #9a3412; font-weight: 700; font-size: 1.05rem; }

/* Desplegables */
.fold { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); margin-top: 1.25rem; }
.fold > summary { font-size: .95rem; font-weight: 600; color: var(--ink); padding: 1rem 2.25rem 1rem 1.15rem; cursor: pointer; position: relative; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "+"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-weight: 400; color: var(--ink-faint); font-size: 1.2rem; }
.fold[open] > summary::after { content: "−"; }
.fold > summary:hover { color: var(--accent); }
.fold__body { padding: 0 1.15rem 1.5rem; border-top: 1px solid var(--rule-soft); }
.fold__body > *:first-child { margin-top: 1.25rem; }

/* FAQ */
.faq { border-top: 1px solid var(--rule); max-width: 780px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { font-size: .95rem; font-weight: 600; color: var(--ink); padding: 1.1rem 2rem 1.1rem 0; cursor: pointer; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); font-weight: 400; color: var(--ink-faint); font-size: 1.15rem; }
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { color: var(--accent); }
.faq details > div { padding-bottom: 1.2rem; }
.faq p { font-size: .925rem; max-width: var(--measure); }

/* Formulario */
.form { display: grid; gap: 1rem; max-width: 640px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink); }
.field input, .field textarea { font-family: inherit; font-size: .95rem; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: .65rem .75rem; width: 100%; }
.band--surface .field input, .band--surface .field textarea { background: var(--surface-2); }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.field .hint { font-size: .78rem; color: var(--ink-faint); }
.consent { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .6rem; align-items: start; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: .9rem 1rem; }
.consent input { width: 1.05rem; height: 1.05rem; margin-top: .22rem; accent-color: var(--accent); }
.consent label { font-size: .825rem; color: var(--ink-soft); line-height: 1.55; }
.form__status { font-size: .9rem; font-weight: 600; border-radius: var(--radius); padding: .7rem .9rem; }
.form__status[hidden] { display: none; }
.form__status.is-ok { color: #05543a; background: #dff3ea; border: 1px solid #a7d9c6; }
.form__status.is-error { color: #7a2412; background: #fbe6e0; border: 1px solid #e8b6a8; }

/* Contacto */
.contact-list { display: grid; gap: .9rem; }
.contact-list dt { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.contact-list dd { font-size: .95rem; color: var(--ink-soft); }

/* Documento legal */
.doc { max-width: 72ch; }
.doc h3 { font-size: 1rem; margin-top: 1.75rem; margin-bottom: .6rem; }
.doc p, .doc li { font-size: .925rem; }
.doc ul, .doc ol { margin: .75rem 0 0 1.25rem; display: grid; gap: .4rem; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .9rem; }
.doc th, .doc td { text-align: left; border: 1px solid var(--rule); padding: .55rem .7rem; vertical-align: top; }
.doc th { background: var(--surface-2); font-weight: 600; color: var(--ink); }
.doc td { background: var(--surface); color: var(--ink-soft); }
.doc__meta { font-family: var(--font-mono); font-size: .75rem; color: var(--ink-faint); margin-bottom: 1.5rem; }

/* Pie */
.site-foot { background: var(--brand); color: #9aa6c8; padding-block: 2.75rem; font-size: .875rem; }
.site-foot__inner { display: grid; gap: 1.75rem; }
.site-foot__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 1.75rem; }
.site-foot h2 { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #6d7aa4; margin-bottom: .65rem; font-weight: 600; }
.site-foot ul { list-style: none; display: grid; gap: .45rem; }
.site-foot a { color: #c2cbe4; text-decoration: none; }
.site-foot a:hover { color: #fff; text-decoration: underline; }
.site-foot__bottom { border-top: 1px solid #222e5c; padding-top: 1.35rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; color: #6d7aa4; font-size: .8rem; }
.site-foot .brand-logo { height: 26px; width: auto; filter: brightness(0) invert(1); opacity: .95; }

/* Animación de aparición sutil */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
  .reveal.is-visible { opacity: 1; transform: none; }
}

/* Utilidades */
.mt-3 { margin-top: 2rem; }
.mt-4 { margin-top: 3rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Responsive */
@media (max-width: 940px) { .split, .split--even { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--rule); padding: 1rem clamp(1.25rem,5vw,3rem) 1.35rem; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; align-items: flex-start; gap: .95rem; }
  .site-head__inner { position: relative; }
  .form__row { grid-template-columns: 1fr; }
  .brand-link img { height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print { .site-head, .site-foot, .actions { display: none; } body { background: #fff; } }
