/* ═══════════════════════════════════════════════════════════════
   Soft&Data — main.css
   Sin frameworks. Tokens heredados del dashboard del Observatorio
   para que la marca se lea como un solo producto.
   ═══════════════════════════════════════════════════════════════ */

/* ── Tipografías self-hosted (variable, subset latin) ─────────── */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/spacegrotesk-latin-var.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-latin-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  /* Superficies */
  --bg:            hsl(222 47% 6%);
  --bg-soft:       hsl(222 42% 8%);
  --surface:       hsl(222 38% 11%);
  --surface-2:     hsl(222 34% 14%);
  --border:        hsl(222 26% 19%);
  --border-strong: hsl(222 24% 26%);

  /* Texto */
  --text:      hsl(210 40% 96%);
  --text-soft: hsl(214 20% 72%);
  --text-dim:  hsl(215 16% 55%);

  /* Marca */
  --primary:      hsl(187 80% 48%);
  --primary-hi:   hsl(187 90% 62%);
  --primary-lo:   hsl(192 85% 34%);
  --primary-ink:  hsl(195 100% 8%);
  --primary-glow: hsl(187 80% 48% / .22);

  /* Semáforo de datos (idéntico al dashboard) */
  --green:  hsl(152 60% 45%);
  --amber:  hsl(43 92% 55%);
  --orange: hsl(25 92% 56%);
  --red:    hsl(0 76% 56%);

  /* Escala tipográfica fluida */
  --fs-xs:  .8125rem;
  --fs-sm:  .9375rem;
  --fs-md:  1rem;
  --fs-lg:  clamp(1.0625rem, .3vw + 1rem, 1.1875rem);
  --fs-xl:  clamp(1.25rem, .6vw + 1.1rem, 1.5rem);
  --fs-2xl: clamp(1.5rem, 1.2vw + 1.2rem, 2rem);
  --fs-3xl: clamp(1.875rem, 2vw + 1.3rem, 2.75rem);
  --fs-4xl: clamp(2.25rem, 3.6vw + 1.2rem, 4rem);

  /* Ritmo */
  --sp-1: .25rem;  --sp-2: .5rem;   --sp-3: .75rem;
  --sp-4: 1rem;    --sp-5: 1.5rem;  --sp-6: 2rem;
  --sp-7: 3rem;    --sp-8: 4rem;    --sp-9: 6rem;

  --radius:    .5rem;
  --radius-lg: .875rem;
  --radius-xl: 1.25rem;
  --radius-pill: 999px;

  --shadow:    0 1px 2px hsl(222 60% 2% / .4);
  --shadow-md: 0 8px 24px -8px hsl(222 60% 2% / .6);
  --shadow-lg: 0 24px 60px -20px hsl(222 60% 2% / .75);

  --container: 1180px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  /* Red de seguridad contra desbordes laterales en móvil. Los casos
     concretos están corregidos en el origen (ver .hero-badge y
     .segment-name), esto solo evita que un descuido futuro rompa el
     ancho de la página completa. */
  overflow-x: clip;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  text-wrap: balance;
}
p { text-wrap: pretty; }

a { color: var(--primary-hi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Sin viñetas por defecto: en este sitio casi todas las listas son
   navegación o tarjetas. Se reactivan solo dentro de .prose. */
ul, ol { list-style: none; padding-left: 0; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -3rem;
  z-index: 200;
  padding: var(--sp-2) var(--sp-4);
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
  border-radius: var(--radius);
  transition: top .18s var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
@media (max-width: 480px) { .container { padding-inline: var(--sp-4); } }

.section { padding-block: var(--sp-9); position: relative; }
.section--tight { padding-block: var(--sp-8); }
.section--alt { background: var(--bg-soft); }
.section--alt::before,
.section--alt::after {
  content: '';
  position: absolute; inset-inline: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.section--alt::before { top: 0; }
.section--alt::after  { bottom: 0; }

.section-head { max-width: 62ch; margin-bottom: var(--sp-7); }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary-hi);
  margin-bottom: var(--sp-3);
}
.eyebrow::before {
  content: ''; width: 1.75rem; height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
}
.section-head--center .eyebrow::before { display: none; }

.section-title { font-size: var(--fs-3xl); margin-bottom: var(--sp-4); }
.section-lead  { font-size: var(--fs-lg); color: var(--text-soft); }

.grid { display: grid; gap: var(--sp-5); }
/* grid-2 es estrictamente de 2 columnas: con auto-fit, 4 tarjetas caían
   3+1 en pantallas anchas y se veía desbalanceado. */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ── Botones ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  padding: .8rem 1.4rem;
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: -.01em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease),
              background-color .18s var(--ease), border-color .18s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-hi), var(--primary-lo));
  color: var(--primary-ink);
  box-shadow: 0 6px 20px -6px var(--primary-glow);
}
.btn-primary:hover {
  box-shadow: 0 10px 28px -6px hsl(187 80% 48% / .45);
  transform: translateY(-2px);
}

.btn-ghost {
  background: hsl(222 38% 11% / .7);
  border-color: var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: var(--primary); background: var(--surface-2); }

.btn-sm    { padding: .55rem 1rem; font-size: var(--fs-xs); }
.btn-lg    { padding: 1rem 1.9rem; font-size: var(--fs-md); }
.btn-block { width: 100%; }

.btn-link {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-weight: 600; font-size: var(--fs-sm);
  color: var(--primary-hi);
}
.btn-link svg { transition: transform .2s var(--ease); }
.btn-link:hover svg { transform: translateX(4px); }

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: hsl(222 47% 6% / .82);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: var(--sp-5);
  min-height: 4.25rem;
}

.brand {
  display: inline-flex; align-items: center;
  margin-right: auto;
  flex-shrink: 0;
  text-decoration: none !important;
}
/* Los PNG del logo son 2x: se fija el alto y el ancho se deduce. */
.brand-logo { display: block; height: 34px; width: auto; }
.brand-logo-full { height: 44px; }
@media (max-width: 420px) { .brand-logo { height: 28px; } }

.nav-desktop ul { display: flex; gap: var(--sp-5); align-items: center; }
.nav-desktop a {
  position: relative;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none !important;
  padding-block: var(--sp-2);
  transition: color .16s var(--ease);
}
.nav-desktop a:hover,
.nav-desktop a[aria-current='page'] { color: var(--text); }
.nav-desktop a[aria-current='page']::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; border-radius: 2px;
  background: var(--primary);
}

.header-actions { display: flex; align-items: center; gap: var(--sp-3); }

/* Menú móvil sin JS: <details> + <summary> */
.nav-mobile { display: none; position: relative; }
.nav-mobile summary {
  list-style: none;
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-mobile summary::-webkit-details-marker { display: none; }
.burger { display: grid; gap: 5px; }
.burger span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.nav-mobile[open] .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-mobile[open] .burger span:nth-child(2) { opacity: 0; }
.nav-mobile[open] .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-panel {
  position: absolute; right: 0; top: calc(100% + .6rem);
  min-width: 15rem;
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.nav-mobile-panel ul { display: grid; gap: var(--sp-1); margin-bottom: var(--sp-4); }
.nav-mobile-panel a {
  display: block;
  padding: .6rem .75rem;
  border-radius: var(--radius);
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none !important;
}
.nav-mobile-panel a:hover { background: var(--surface-2); color: var(--text); }
.nav-mobile-panel a[aria-current='page'] { color: var(--primary-hi); background: var(--surface-2); }

@media (max-width: 900px) {
  .nav-desktop, .header-actions { display: none; }
  .nav-mobile { display: block; }
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 7vw, 6.5rem) clamp(3rem, 6vw, 5.5rem);
  background:
    radial-gradient(ellipse 70% 55% at 15% -5%, hsl(187 80% 20% / .5), transparent 70%),
    radial-gradient(ellipse 55% 45% at 90% 10%, hsl(192 85% 18% / .38), transparent 68%),
    var(--bg);
}
/* Retícula de datos de fondo */
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(hsl(187 60% 60% / .05) 1px, transparent 1px),
    linear-gradient(90deg, hsl(187 60% 60% / .05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 65% at 50% 30%, #000 30%, transparent 78%);
  pointer-events: none;
}
.hero > .container { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-badge {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .4rem .85rem .4rem .55rem;
  margin-bottom: var(--sp-5);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-soft);
  background: hsl(222 38% 11% / .8);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  max-width: 100%;
}
.hero-badge b { color: var(--text); font-weight: 600; }
/* En móvil el badge pasa a ser un bloque con esquinas suaves: como
   píldora de una línea se salía del viewport. */
@media (max-width: 560px) {
  .hero-badge {
    display: flex;
    align-items: flex-start;
    border-radius: var(--radius);
    padding: .5rem .75rem;
  }
  .hero-badge .pulse-dot { margin-top: .45rem; }
}

.hero h1 {
  font-size: var(--fs-4xl);
  margin-bottom: var(--sp-5);
  letter-spacing: -.035em;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--primary-hi), hsl(165 75% 55%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  font-size: var(--fs-lg);
  color: var(--text-soft);
  max-width: 54ch;
  margin-bottom: var(--sp-6);
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
@media (max-width: 560px) {
  /* Los CTA de texto largo ("Quiero algo así para mi operación") no caben en
     una línea a 320 px: .btn trae white-space:nowrap y el botón medía 313 px
     dentro de un contenedor de 288, desbordando la página. Apilados en una
     columna y con salto de línea permitido quedan del mismo ancho. */
  .hero-actions { display: grid; }
  .hero-actions .btn { white-space: normal; text-align: center; }
}
.hero-trust {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.hero-trust li { display: flex; align-items: flex-start; gap: .4rem; }
.hero-trust svg { color: var(--green); flex-shrink: 0; margin-top: .25rem; }
@media (max-width: 560px) {
  /* Una por línea: en dos columnas se cortaban los textos. */
  .hero-trust { display: grid; gap: var(--sp-2); }
}

/* Punto latiendo = dato en vivo */
.pulse-dot {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 hsl(152 60% 45% / .7);
  animation: pulse 2.4s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 hsl(152 60% 45% / .65); }
  70%  { box-shadow: 0 0 0 .5rem hsl(152 60% 45% / 0); }
  100% { box-shadow: 0 0 0 0 hsl(152 60% 45% / 0); }
}

/* ── Panel de KPIs en vivo (Observatorio) ────────────────────── */
.live-panel {
  background: linear-gradient(160deg, hsl(222 38% 12% / .95), hsl(222 44% 8% / .95));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.live-panel::before {
  content: '';
  position: absolute; inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.live-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.live-head h2, .live-head h3 {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: -.01em;
}
.live-head p { font-size: var(--fs-xs); color: var(--text-dim); }
.live-status {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: var(--sp-3);
}
/* En móvil siempre 2 columnas: con auto-fit quedaban 4 en una fila que
   desbordaba el ancho del panel. */
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi {
  background: hsl(222 40% 9% / .8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.kpi:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.kpi-label {
  display: block;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--sp-2);
}
.kpi-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: .2rem;
}
.kpi-unit { font-size: .875rem; font-weight: 500; color: var(--text-dim); }
.kpi-meta {
  display: block;
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--text-soft);
  min-height: 1.35em;
}
/* Colores semánticos según el estado que devuelve la API */
.is-green  .kpi-value { color: var(--green); }
.is-amber  .kpi-value { color: var(--amber); }
.is-orange .kpi-value { color: var(--orange); }
.is-red    .kpi-value { color: var(--red); }
.is-green  { border-color: hsl(152 60% 45% / .3); }
.is-amber  { border-color: hsl(43 92% 55% / .3); }
.is-orange { border-color: hsl(25 92% 56% / .3); }
.is-red    { border-color: hsl(0 76% 56% / .32); }

.live-foot {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
@media (max-width: 560px) {
  .live-panel { padding: var(--sp-4); }
  .live-head { flex-wrap: wrap; }
  .live-foot { flex-direction: column; align-items: flex-start; }
}

/* Skeleton mientras carga (evita CLS: mismas dimensiones) */
.kpi[data-loading='true'] .kpi-value,
.kpi[data-loading='true'] .kpi-meta {
  color: transparent;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  display: flex; flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color .22s var(--ease), transform .22s var(--ease),
              box-shadow .22s var(--ease);
}
/* Sin height:100%. Cuando la tarjeta es hija directa de .grid el propio
   grid ya la estira (align-items:stretch por defecto), así que la regla
   era redundante ahí y rompía los casos anidados: en /contacto/ las dos
   tarjetas viven dentro de un <aside> que sí se estira, y cada una tomaba
   el alto completo de la columna, desbordando por debajo del footer. */
.card:hover {
  border-color: hsl(187 60% 40% / .5);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.card h3 { font-size: var(--fs-xl); }
.card p  { color: var(--text-soft); font-size: var(--fs-sm); }
.card-icon {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: var(--radius);
  background: hsl(187 80% 48% / .12);
  border: 1px solid hsl(187 80% 48% / .25);
  color: var(--primary-hi);
  flex-shrink: 0;
}
.card ul {
  display: grid; gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-soft);
}
.card ul li { display: flex; gap: var(--sp-2); align-items: flex-start; }
.card ul li::before {
  content: '';
  width: 1rem; height: 1rem;
  margin-top: .3rem;
  flex-shrink: 0;
  background: var(--primary);
  clip-path: polygon(14% 47%, 0 61%, 42% 100%, 100% 20%, 84% 6%, 39% 68%);
}
/* Solo el enlace se ancla abajo: así las tarjetas de una fila alinean
   sus CTA sin abrir huecos raros en medio del texto. */
.card-link { margin-top: auto; padding-top: var(--sp-2); }

/* Card destacada */
.card--featured {
  background: linear-gradient(150deg, hsl(187 55% 14% / .55), var(--surface) 62%);
  border-color: hsl(187 60% 40% / .38);
}

/* Card destacada a todo el ancho del grid: la usa el servicio principal
   (IA y agentes) en la home, para que las otras cuatro queden en 2×2 y no
   sobre una fila con un hueco. */
.card--wide { grid-column: 1 / -1; }
@media (min-width: 681px) {
  .card--wide ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--sp-5); }
}

/* ── Bloque Observatorio (caso destacado) ────────────────────── */
.obs-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}
@media (max-width: 980px) { .obs-block { grid-template-columns: 1fr; } }

.obs-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: var(--sp-4);
  margin-block: var(--sp-5);
}
.metric-big {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--primary-hi);
  font-variant-numeric: tabular-nums;
}
.metric-label {
  display: block;
  margin-top: var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

/* Tira de segmentos críticos */
.segments {
  display: grid; gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.segment-row {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  padding: .65rem .85rem;
  background: hsl(222 40% 9% / .7);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
}
.segment-row.is-critical { border-left-color: var(--red); }
.segment-row.is-high     { border-left-color: var(--orange); }
.segment-row.is-medium   { border-left-color: var(--amber); }
.segment-rank {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--text-dim);
  font-size: var(--fs-xs);
}
.segment-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.segment-delta {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.segment-row.is-critical .segment-delta { color: var(--red); }
.segment-row.is-high     .segment-delta { color: var(--orange); }
.segment-row.is-medium   .segment-delta { color: var(--amber); }

/* ── Proceso (pasos numerados) ───────────────────────────────── */
.steps { counter-reset: step; display: grid; gap: var(--sp-5); }
.step {
  counter-increment: step;
  position: relative;
  padding-left: 3.5rem;
}
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--primary-hi);
  background: hsl(187 80% 48% / .1);
  border: 1px solid hsl(187 80% 48% / .3);
  border-radius: var(--radius);
}
.step h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.step p  { color: var(--text-soft); font-size: var(--fs-sm); }

/* ── Sectores (chips) ────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.chip:hover { border-color: var(--primary); color: var(--text); }

/* ── FAQ ─────────────────────────────────────────────────────── */
.faq { display: grid; gap: var(--sp-3); max-width: 52rem; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s var(--ease);
}
.faq-item[open] { border-color: hsl(187 60% 40% / .45); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '';
  width: .6rem; height: .6rem;
  border-right: 2px solid var(--primary-hi);
  border-bottom: 2px solid var(--primary-hi);
  transform: rotate(45deg);
  transition: transform .22s var(--ease);
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-body {
  padding: 0 var(--sp-5) var(--sp-5);
  color: var(--text-soft);
  font-size: var(--fs-sm);
}
.faq-body p + p { margin-top: var(--sp-3); }

/* ── CTA final ───────────────────────────────────────────────── */
.cta-band {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3rem, 6vw, 5rem);
  background:
    radial-gradient(ellipse 65% 100% at 50% 0%, hsl(187 75% 22% / .55), transparent 72%),
    var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.cta-band h2 { font-size: var(--fs-3xl); margin-bottom: var(--sp-4); }
.cta-band p {
  max-width: 46ch;
  margin: 0 auto var(--sp-6);
  color: var(--text-soft);
  font-size: var(--fs-lg);
}
.cta-actions {
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  justify-content: center;
}
@media (max-width: 560px) {
  /* Mismo criterio que .hero-actions: ver el comentario de esa regla. */
  .cta-actions { display: grid; }
  .cta-actions .btn { white-space: normal; text-align: center; }
}

/* ── Prosa (páginas de contenido / legales) ──────────────────── */
.prose { max-width: 68ch; }
.prose h2 { font-size: var(--fs-2xl); margin-top: var(--sp-7); margin-bottom: var(--sp-4); }
.prose h3 { font-size: var(--fs-xl); margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
.prose p, .prose li { color: var(--text-soft); }
.prose p + p { margin-top: var(--sp-4); }
.prose ul, .prose ol { margin: var(--sp-4) 0; padding-left: 1.35rem; display: grid; gap: var(--sp-2); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

/* Breadcrumbs visuales */
.breadcrumbs {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  margin-bottom: var(--sp-4);
}
.breadcrumbs ol {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  list-style: none; padding: 0;
}
.breadcrumbs li + li::before { content: '/'; margin-right: .5rem; color: var(--border-strong); }
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--primary-hi); }

/* Encabezado de página interna */
.page-head {
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 4vw, 3rem);
  background:
    radial-gradient(ellipse 60% 100% at 20% 0%, hsl(187 70% 18% / .45), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-head h1 { font-size: var(--fs-3xl); margin-bottom: var(--sp-4); }
.page-head .lead { font-size: var(--fs-lg); color: var(--text-soft); max-width: 60ch; }

/* ── Formulario ──────────────────────────────────────────────── */
.form { display: grid; gap: var(--sp-4); max-width: 34rem; }
.field { display: grid; gap: var(--sp-2); }
.field label { font-size: var(--fs-sm); font-weight: 500; }
.field .req { color: var(--primary-hi); }
.field input, .field textarea, .field select {
  padding: .75rem .9rem;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  width: 100%;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.field textarea { resize: vertical; min-height: 8rem; }
.field-hint { font-size: var(--fs-xs); color: var(--text-dim); }
.field-error { font-size: var(--fs-xs); color: hsl(0 85% 74%); font-weight: 500; }
.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'] { border-color: var(--red); }

/* Honeypot: invisible para humanos, presente para bots */
.hp-field {
  position: absolute !important;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.alert {
  padding: var(--sp-4);
  border-radius: var(--radius);
  border: 1px solid;
  font-size: var(--fs-sm);
}
.alert-ok  { background: hsl(152 60% 45% / .1); border-color: hsl(152 60% 45% / .35); color: hsl(152 70% 72%); }
.alert-err { background: hsl(0 76% 56% / .1);  border-color: hsl(0 76% 56% / .35);  color: hsl(0 85% 78%); }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  padding-block: var(--sp-8) var(--sp-5);
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: var(--sp-6);
  padding-bottom: var(--sp-6);
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: var(--sp-5); } }

.footer-brand .brand { margin-bottom: var(--sp-4); }
.footer-tagline { color: var(--text-soft); max-width: 34ch; margin-bottom: var(--sp-4); }
.footer-base {
  display: flex; align-items: flex-start; gap: .45rem;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.footer-base svg { margin-top: .28rem; flex-shrink: 0; color: var(--primary); }

.footer-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: var(--sp-4);
}
.footer-col ul { display: grid; gap: var(--sp-2); list-style: none; padding: 0; }
.footer-col a { color: var(--text-soft); text-decoration: none; }
.footer-col a:hover { color: var(--primary-hi); text-decoration: underline; text-underline-offset: 3px; }
.footer-areas { margin-top: var(--sp-4); font-size: var(--fs-xs); color: var(--text-dim); line-height: 1.7; }
.footer-areas strong { color: var(--text-soft); }

.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: var(--sp-3);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.footer-legal { display: flex; flex-wrap: wrap; gap: var(--sp-4); list-style: none; padding: 0; }
.footer-legal a { color: var(--text-dim); }
.footer-legal a:hover { color: var(--primary-hi); }

/* ── WhatsApp flotante ───────────────────────────────────────── */
.wa-float {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 90;
  display: grid; place-items: center;
  width: 3.25rem; height: 3.25rem;
  border-radius: 50%;
  background: #25d366;
  color: #04241a;
  box-shadow: 0 8px 24px -6px hsl(142 70% 30% / .6);
  transition: transform .2s var(--ease);
}
.wa-float:hover { transform: scale(1.08); }

/* ── Utilidades ──────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }
.muted { color: var(--text-dim); }
.small { font-size: var(--fs-xs); }

/* Aparición al scroll. Progresiva: sin JS todo queda visible. */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .wa-float, .cta-band { display: none; }
  body { background: #fff; color: #000; }
}
