/* ============================================================
   Helptic — Sistema de diseño único (design system)
   Se carga en TODAS las páginas, después del CSS de página.
   Objetivo: una sola paleta, una sola tipografía, un solo
   contenedor, un solo botón y un solo ritmo vertical.
   Referencia visual: index.html (home-v2.css).
   ============================================================ */

/* ---------- 1. Tokens ---------------------------------------
   Se declaran también los nombres heredados de cada hoja
   (--ink, --bg, --white, --text, --accent, --primary…) para que
   las páginas antiguas queden alineadas sin reescribir su CSS. */
:root {
  /* Superficies */
  --h-bg:            #07101f;
  --h-bg-alt:        #0b1729;
  --h-panel:         #101e32;
  --h-panel-alt:     #0e1c30;
  --h-line:          #20344d;
  --h-line-soft:     rgba(148, 163, 184, .16);

  /* Superficie clara (secciones "light") */
  --h-light-bg:      #eff1ed;
  --h-light-panel:   #ffffff;
  --h-light-text:    #07101f;
  --h-light-muted:   #55636f;
  --h-light-line:    #d7dbd4;

  /* Texto */
  --h-text:          #f4f7fb;
  --h-text-soft:     #cbd5e1;
  --h-muted:         #93a3b8;

  /* Acentos */
  --h-cyan:          #52d9ff;
  --h-blue:          #4187ff;
  --h-mint:          #62e6bd;
  --h-amber:         #f4b84a;
  --h-red:           #fb7185;
  --h-whatsapp:      #4ade80;
  --h-accent-grad:   linear-gradient(94deg, #52d9ff, #8fa5ff);
  --h-accent-light:  #1c6f78;   /* acento legible sobre superficie clara */

  /* Medidas */
  --h-max:           1380px;
  --h-gutter:        max(24px, calc((100vw - var(--h-max)) / 2));
  --h-section-y:     120px;
  --h-radius-sm:     10px;
  --h-radius:        16px;
  --h-radius-lg:     22px;
  --h-pill:          999px;
  --h-header-h:      76px;

  /* Tipografía */
  --h-display:       Manrope, 'Segoe UI', system-ui, sans-serif;
  --h-body:          'DM Sans', 'Segoe UI', system-ui, sans-serif;

  /* --- Alias heredados: home-v2.css --- */
  --ink:   var(--h-bg);
  --ink2:  var(--h-bg-alt);
  --white: var(--h-text);
  --max:   var(--h-max);

  /* --- Alias heredados: corporate.css / service-page.css / demos.css --- */
  --bg:     var(--h-bg);
  --panel:  var(--h-panel);
  --panel2: var(--h-panel-alt);
  --card:   var(--h-panel);
  --line:   var(--h-line);
  --text:   var(--h-text);
  --muted:  var(--h-muted);
  --cyan:   var(--h-cyan);
  --blue:   var(--h-blue);
  --mint:   var(--h-mint);
  --green:  var(--h-mint);
  --amber:  var(--h-amber);
  --red:    var(--h-red);

  /* --- Alias heredados: styles.css / lp-shared.css --- */
  --bg-dark:    var(--h-bg);
  --bg-card:    var(--h-panel);
  --primary:    var(--h-blue);
  --accent:     var(--h-cyan);
  --text-main:  var(--h-text);
  --text-muted: var(--h-muted);
  --border:     var(--h-line);
  --warning:    var(--h-amber);
  --whatsapp:   #25d366;
}

/* ---------- 2. Base ---------------------------------------- */
/* Base compartida: sin esto, un input con width:100% más padding
   se sale de su contenedor en las páginas que no traen reset propio. */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--h-bg);
  color: var(--h-text);
  font-family: var(--h-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--h-display); }

/* Los anclajes internos no deben quedar bajo el header fijo */
:target,
[id]:not(body):not(html) { scroll-margin-top: calc(var(--h-header-h) + 24px); }

::selection { background: var(--h-cyan); color: var(--h-bg); }

:focus-visible {
  outline: 2px solid var(--h-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

img, svg, video { max-width: 100%; }

/* ---------- 3. Contenedor único ----------------------------
   El header, el footer y el contenido comparten el mismo ancho
   y el mismo margen lateral en todas las páginas. */
.unified-header-inner { width: min(var(--h-max), calc(100% - 48px)); }
.unified-footer { padding: 64px var(--h-gutter) 28px !important; }

/* ---------- 4. Titulares ----------------------------------- */
h1 {
  font-family: var(--h-display);
  font-weight: 600;
  letter-spacing: -.058em;
  line-height: 1.02;
}

/* Titular principal de portada: una sola escala en todas las páginas.
   Se repiten los selectores porque cada hoja define el suyo. */
.hero h1,
.solutions-hero h1,
.service-hero h1,
.corp-hero h1,
.tech-new-hero h1,
.demo-hero h1,
.article-hero h1,
.page-hero h1 {
  font-family: var(--h-display);
  font-size: clamp(44px, 5.2vw, 84px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.058em;
}

@media (max-width: 700px) {
  .hero h1,
  .solutions-hero h1,
  .service-hero h1,
  .corp-hero h1,
  .tech-new-hero h1,
  .demo-hero h1,
  .article-hero h1,
  .page-hero h1 { font-size: 44px; }
}

/* Artículos: la entradilla y el cuerpo comparten medida y eje izquierdo. */
.article-hero,
.article-body { max-width: 860px; }
.article-hero h1 { font-size: clamp(40px, 4.4vw, 66px); }
.article-hero p { max-width: none; }

/* Titulares de sección: una sola escala en todo el sitio.
   Se repiten los selectores de cada hoja porque esta hoja carga al final. */
.section-title,
.problem h2, .section-head h2, .tech-intro h2, .ai-statement h2, .final-cta h2,
.company-brief h2,
.service-cta h2,
.demo-cta h2,
.tech-section-head h2, .tech-cta h2,
.process-copy h2, .ai-copy h2, .about-grid h2, .contact-copy h2,
.demo-intro h2, .product-intro h2, .product-second-intro h2 {
  font-family: var(--h-display);
  font-size: clamp(34px, 4.2vw, 62px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.045em;
}

/* styles.css pintaba este titular con un degradado de extremo a extremo;
   en el resto del sitio el degradado solo marca el <em>. */
.section-title {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--h-text);
}

/* Los titulares centrados necesitan una medida de lectura acotada. */
.solutions-section .section-title,
.solutions-cta h2,
.demo-cta h2,
.service-cta h2,
.tech-cta h2,
.final-cta h2 { max-width: 880px; margin-left: auto; margin-right: auto; }

@media (max-width: 700px) {
  .section-title,
  .problem h2, .section-head h2, .tech-intro h2, .ai-statement h2, .final-cta h2,
  .company-brief h2,
  .service-cta h2,
  .demo-cta h2,
  .tech-section-head h2, .tech-cta h2,
  .process-copy h2, .ai-copy h2, .about-grid h2, .contact-copy h2,
  .demo-intro h2, .product-intro h2, .product-second-intro h2 { font-size: 34px; }
}

/* Segundo nivel: titulares dentro de una columna estrecha. */
.monitoring-section h2,
.case-inner h2,
.demo-copy h2 {
  font-family: var(--h-display);
  font-size: clamp(30px, 3.1vw, 46px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.04em;
}

/* Acento degradado de los titulares: un solo degradado en todo el sitio */
h1 em, h2 em, h3 em,
.corp-hero h1 em, .section-title em,
.tech-new-hero h1 em, .tech-section h2 em,
.demo-hero h1 em, .service-hero h1 em {
  font-style: normal;
  color: transparent;
  background: var(--h-accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---------- 5. Eyebrow / kicker ----------------------------
   Una sola etiqueta superior: Manrope 11px, versalitas, cian. */
.kicker,
.eyebrow,
.case-label,
.diag-kicker,
.section-intro > span,
.panel-copy > span {
  font-family: var(--h-display);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--h-cyan);
}

/* ---------- 6. Botones -------------------------------------
   Primario: pastilla clara sobre fondo oscuro (referencia home).
   Secundario: pastilla delineada.
   Terciario: enlace de texto con acento cian. */
.button,
.btn,
.primary, .secondary,
.tech-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--h-pill);
  font-family: var(--h-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.005em;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.button.primary,
.btn.btn-main,
.primary,
.tech-button-primary,
.primary-button {
  border: 1px solid var(--h-text);
  background: var(--h-text);
  color: var(--h-bg);
  box-shadow: 0 12px 30px rgba(82, 217, 255, .13);
}

.button.secondary,
.btn.btn-sec,
.secondary,
.tech-button-secondary {
  border: 1px solid var(--h-line);
  background: rgba(16, 30, 50, .62);
  color: var(--h-text-soft);
  box-shadow: none;
}

.button:hover,
.btn:hover,
.primary:hover, .secondary:hover,
.tech-button:hover,
.primary-button:hover { transform: translateY(-2px); }

.button.secondary:hover,
.btn.btn-sec:hover,
.secondary:hover,
.tech-button-secondary:hover { border-color: var(--h-cyan); color: var(--h-text); }

/* Variante sobre fondo claro */
.button.light,
.light .button.primary,
.section.light .button.primary {
  border-color: var(--h-light-text);
  background: var(--h-light-text);
  color: var(--h-text);
}

/* Enlaces de texto */
.text-link,
.btn-link,
.textlink,
.inline-demo-link {
  font-family: var(--h-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--h-cyan);
  text-decoration: none;
}
.text-link:hover,
.btn-link:hover,
.textlink:hover,
.inline-demo-link:hover { color: var(--h-text); }

/* ---------- 7. Ritmo vertical ------------------------------ */
.section-pad,
.solutions-section, .technology-role, .solutions-cta,
.decision-section, .monitoring-section, .coverage-section,
.support-fit, .service-cta,
.tech-section, .tech-cta,
.section, .demo-block, .demo-cta {
  padding-top: var(--h-section-y);
  padding-bottom: var(--h-section-y);
}

/* ---------- 8. Secciones claras ----------------------------
   Un solo blanco roto en todo el sitio y un acento oscuro para
   que las etiquetas y los titulares mantengan contraste. */
.section.light,
.problem.section-pad,
.cases.section-pad,
.tech-section.tech-principles {
  background: var(--h-light-bg);
  color: var(--h-light-text);
}

.section.light .section-title,
.problem.section-pad .section-title,
.cases.section-pad .section-title,
.tech-principles .section-title { color: var(--h-light-text); }

.section.light .eyebrow,
.section.light .kicker,
.problem.section-pad .kicker,
.cases.section-pad .kicker,
.tech-principles .eyebrow,
.tech-principles .kicker,
.principle-grid span { color: var(--h-accent-light); }

.section.light h1 em,
.section.light h2 em,
.section.light h3 em,
.problem.section-pad h2 em,
.cases.section-pad h2 em,
.tech-principles h2 em,
.tech-principles h3 em {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--h-accent-light);
}

/* ---------- 9. Cabecera: enlace de salto y CTA -------------- */
.unified-skip {
  position: absolute;
  left: -9999px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 0 0 var(--h-radius-sm) 0;
  background: var(--h-text);
  color: var(--h-bg);
  font-family: var(--h-body);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.unified-skip:focus { left: 0; top: 0; }

.unified-diagnostic { white-space: nowrap; }

/* ---------- 10. Correcciones puntuales ---------------------- */
/* demos.css redefine `header` a secas y descuadraba el header global */
body > header.unified-header {
  display: block;
  padding: 0;
  min-height: var(--h-header-h);
  background: rgba(6, 15, 29, .94);
}
.unified-header .unified-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: var(--h-header-h);
  padding: 0;
}

/* ---------- 11. Responsive --------------------------------- */
@media (max-width: 1080px) {
  :root { --h-section-y: 88px; }
  .unified-header-inner { grid-template-columns: auto 1fr auto auto; }
  /* En el desplegable, el aire lo da el padding del enlace, no el gap. */
  .unified-nav { gap: 2px; }
  .unified-nav a { padding: 13px 12px; border-radius: 10px; font-size: 15px; }
  .unified-nav a.is-active { background: rgba(82, 217, 255, .08); }
}

@media (max-width: 700px) {
  :root { --h-section-y: 68px; }
  .unified-header-inner { width: calc(100% - 28px); }
  .button, .btn, .primary, .secondary, .tech-button, .primary-button {
    padding: 13px 20px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .btn, .primary, .secondary, .tech-button, .primary-button { transition: none; }
  .button:hover, .btn:hover, .primary:hover, .secondary:hover,
  .tech-button:hover, .primary-button:hover { transform: none; }
}
