/* ==========================================================================
   Laniakea · landing de CMA
   Personaliza colores, tipografía y espaciado en las variables de :root.
   Regla de marca: --cta (ámbar) se usa SOLO en botones de acción.
   ========================================================================== */

:root {
  /* Colores de marca */
  --night: #0B1426;        /* fondo principal */
  --deep: #13254A;         /* secciones alternas y tarjetas */
  --deep-2: #1A3160;       /* bordes y superficies elevadas */
  --blue: #2F5D8A;         /* acento de marca: enlaces secundarios, bordes */
  --cyan: #4FD1C5;         /* destacados: íconos, cifras */
  --cta: #F5A524;          /* ÚNICO color de acción */
  --cta-hover: #FFB84A;
  --cta-ink: #0B1426;      /* texto sobre el CTA */
  --ink: #F7F6F2;          /* texto principal */
  --ink-2: #C9CDD6;        /* texto de párrafos */
  --ink-3: #9A968C;        /* texto secundario (aclarado para contraste AA) */
  --ok: #4FD1C5;
  --error: #FF8A7A;

  /* Tipografía */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-base: 1rem;         /* 16 px */
  --fs-lead: clamp(1.0625rem, 1rem + .4vw, 1.25rem);
  --fs-h1: clamp(2.1rem, 1.4rem + 3.2vw, 3.75rem);
  --fs-h2: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem);
  --fs-h3: 1.1875rem;

  /* Espaciado y forma */
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: clamp(4rem, 3rem + 4vw, 7rem);
  --radius: 14px;
  --radius-lg: 20px;
  --container: 1200px;
  --header-h: 68px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

/* ---------- Base ---------- */
*, *::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-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--night);
  overflow-x: hidden;
}
h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0 0 var(--space-2); letter-spacing: -.02em; }
h1 { font-size: var(--fs-h1); font-weight: 800; }
h2 { font-size: var(--fs-h2); font-weight: 800; }
h3 { font-size: var(--fs-h3); font-weight: 700; }
p { margin: 0 0 var(--space-2); }
a { color: var(--cyan); }
code, pre { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code { background: rgba(79, 209, 197, .1); color: var(--ink); padding: .1em .35em; border-radius: 6px; }
ul { margin: 0; padding: 0; }
img, svg { max-width: 100%; }

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

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.container--narrow { max-width: 820px; }
.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;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--night); padding: .75rem 1rem; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-family: var(--font-mono); font-size: .8125rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .12em; color: var(--cyan); margin-bottom: var(--space-2);
}
.hl { color: var(--cyan); }

/* ---------- CTA: el elemento principal ---------- */
.cta {
  --glow: rgba(245, 165, 36, .45);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 56px; padding: 0 1.75rem;
  font: 700 1.0625rem/1.2 var(--font-sans);
  color: var(--cta-ink); background: var(--cta);
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  box-shadow: 0 6px 24px var(--glow), 0 0 0 0 var(--glow);
  overflow: hidden; isolation: isolate;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
/* Brillo que cruza el botón al pasar el ratón */
.cta::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .6s ease;
}
.cta:hover { background: var(--cta-hover); transform: translateY(-2px) scale(1.02); box-shadow: 0 12px 34px var(--glow); }
.cta:hover::after { transform: translateX(120%); }
.cta:active { transform: translateY(0) scale(.98); box-shadow: 0 4px 14px var(--glow); }
.cta:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; border-radius: 999px; }
.cta svg { transition: transform .2s ease; }
.cta:hover svg { transform: translateX(3px); }
.cta--sm { min-height: 44px; padding: 0 1.15rem; font-size: .9375rem; }
.cta--block { width: 100%; }
/* Pulso sutil del glow */
.cta--pulse { animation: pulse 2.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 6px 24px var(--glow), 0 0 0 0 rgba(245, 165, 36, .35); }
  50% { box-shadow: 0 6px 24px var(--glow), 0 0 0 10px rgba(245, 165, 36, 0); }
}
.cta--pulse:hover { animation: none; }

.link-secondary {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 .25rem;
  color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 5px;
  text-decoration-color: var(--blue); text-decoration-thickness: 2px;
}
.link-secondary:hover { text-decoration-color: var(--cyan); }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  min-height: 52px; padding: 0 1.25rem; border-radius: 999px;
  border: 2px solid var(--blue); color: var(--ink); font-weight: 700; text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease;
}
.btn-outline:hover { border-color: var(--cyan); background: rgba(79, 209, 197, .08); }

/* ---------- 1. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 20, 38, .82);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--deep-2); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.logo-mark { color: var(--cyan); flex: none; }

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 48px; height: 48px; padding: 12px; background: none; border: 0; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Móvil: menú desplegable */
.nav {
  position: absolute; left: 0; right: 0; top: var(--header-h);
  background: var(--night); border-bottom: 1px solid var(--deep-2);
  padding: var(--space-2) 16px var(--space-3);
  display: none;
}
.nav.is-open { display: block; }
.nav ul { list-style: none; display: grid; gap: .25rem; margin-bottom: var(--space-2); }
.nav ul a { display: block; padding: .75rem .25rem; color: var(--ink); text-decoration: none; font-weight: 600; }
.nav ul a:hover { color: var(--cyan); }
.nav .cta { width: 100%; }

/* ---------- 2. Hero ---------- */
.hero { position: relative; padding: var(--space-5) 0 var(--space-6); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(circle, rgba(47, 93, 138, .45), transparent 65%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; gap: var(--space-5); align-items: center; }
.hero-copy { max-width: 640px; }
.lead { font-size: var(--fs-lead); color: var(--ink-2); max-width: 60ch; margin-bottom: var(--space-4); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.hero-actions .cta { width: 100%; }
.trust { margin-top: var(--space-2); font-size: .9375rem; color: var(--ink-3); }

.hero-visual { position: relative; max-width: 520px; width: 100%; margin: 0 auto; }
.flow { display: block; width: 100%; height: auto; }
.flow-lines path { stroke-dasharray: 8 10; animation: flow 6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -180; } }
.terminal {
  position: absolute; left: 0; bottom: -8px; width: min(310px, 78%);
  background: rgba(19, 37, 74, .94); border: 1px solid var(--deep-2);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: .5rem .75rem; border-bottom: 1px solid var(--deep-2); }
.terminal-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--deep-2); }
.terminal-bar span { margin-left: auto; font: 500 .75rem var(--font-mono); color: var(--ink-3); }
.terminal pre { margin: 0; padding: .85rem 1rem 1rem; font-size: .8rem; line-height: 1.7; color: var(--ink); white-space: pre; overflow-x: auto; }
.t-mute { color: var(--ink-3); }
.t-ok { color: var(--ok); }

/* ---------- 3. Prueba social ---------- */
.proof { border-top: 1px solid var(--deep-2); border-bottom: 1px solid var(--deep-2); background: rgba(19, 37, 74, .4); padding: var(--space-4) 0; }
.metrics { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.metrics li { display: flex; flex-direction: column; gap: .25rem; }
.metrics strong { font: 500 clamp(1.4rem, 1.1rem + 1.2vw, 2rem)/1.1 var(--font-mono); color: var(--cyan); }
.metrics span { font-size: .9375rem; color: var(--ink-2); }
.proof-note { margin: var(--space-3) 0 0; font-size: .875rem; color: var(--ink-3); }

/* ---------- Secciones ---------- */
.section { padding: var(--space-6) 0; }
.section--alt { background: var(--deep); }
.section-head { max-width: 680px; margin-bottom: var(--space-5); }

/* 4. Problema → solución */
.ps-grid { display: grid; gap: var(--space-3); }
.ps { padding: var(--space-3); border: 1px solid var(--deep-2); border-radius: var(--radius-lg); background: rgba(19, 37, 74, .5); }
.ps-problem { position: relative; padding-left: 1.75rem; color: var(--ink-3); }
.ps-problem::before { content: "✕"; position: absolute; left: 0; color: var(--error); font-weight: 700; }
.ps-solution { position: relative; padding-left: 1.75rem; margin: 0; color: var(--ink); font-weight: 600; }
.ps-solution::before { content: "✓"; position: absolute; left: 0; color: var(--cyan); font-weight: 700; }

/* 5. Beneficios */
.cards { display: grid; gap: var(--space-3); }
.card { padding: var(--space-3); border-radius: var(--radius-lg); background: var(--night); border: 1px solid var(--deep-2); transition: transform .2s ease, border-color .2s ease; }
.card:hover { transform: translateY(-3px); border-color: var(--blue); }
.card p { margin: 0; }
.icon { width: 44px; height: 44px; padding: 10px; margin-bottom: var(--space-2); border-radius: 12px; background: rgba(79, 209, 197, .12); fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.inline-cta { margin-top: var(--space-5); display: flex; justify-content: center; }

/* 6. Pasos */
.steps { list-style: none; display: grid; gap: var(--space-3); counter-reset: none; }
.step { position: relative; padding: var(--space-3); border-radius: var(--radius-lg); border: 1px solid var(--deep-2); }
.step-num {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: var(--space-2);
  border-radius: 50%; border: 2px solid var(--cyan); color: var(--cyan); font: 500 1.125rem var(--font-mono);
}
.code { margin: var(--space-2) 0 0; padding: .85rem 1rem; border-radius: 10px; background: var(--deep); color: var(--ink); font-size: .8125rem; line-height: 1.6; overflow-x: auto; }

/* 7. Testimonios */
.quotes { display: grid; gap: var(--space-3); }
.quote { position: relative; margin: 0; padding: var(--space-4) var(--space-3) var(--space-3); border-radius: var(--radius-lg); background: var(--night); border: 1px solid var(--deep-2); }
.quote blockquote { margin: 0 0 var(--space-3); }
.quote blockquote p { color: var(--ink); font-size: 1.0625rem; }
.quote figcaption { display: flex; align-items: center; gap: .85rem; font-size: .9375rem; color: var(--ink-3); }
.quote figcaption strong { color: var(--ink); }
.avatar { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--cyan)); color: var(--night); font-weight: 800; }
.badge { position: absolute; top: 14px; right: 14px; font: 500 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); border: 1px dashed var(--ink-3); border-radius: 999px; padding: .15rem .55rem; }

/* 8. Planes */
.plans { display: grid; gap: var(--space-3); align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; padding: var(--space-4) var(--space-3); border-radius: var(--radius-lg); border: 1px solid var(--deep-2); background: rgba(19, 37, 74, .5); }
.plan ul { list-style: none; display: grid; gap: .6rem; margin-bottom: var(--space-4); flex: 1; }
.plan li { position: relative; padding-left: 1.6rem; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--cyan); font-weight: 700; }
.price { font: 500 1.75rem var(--font-mono); color: var(--ink); }
.plan--featured { border: 2px solid var(--cyan); background: var(--deep); box-shadow: 0 0 0 6px rgba(79, 209, 197, .08); }
.plan-tag { position: absolute; top: -13px; left: var(--space-3); padding: .2rem .75rem; border-radius: 999px; background: var(--cyan); color: var(--night); font-size: .8125rem; font-weight: 700; }

/* 9. FAQ */
.faq { display: grid; gap: .75rem; }
.faq-item { border: 1px solid var(--deep-2); border-radius: var(--radius); background: var(--night); }
.faq-item h3 { margin: 0; font-size: 1.0625rem; }
.faq-item button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  min-height: 60px; padding: 1rem 1.25rem; background: none; border: 0; cursor: pointer;
  color: var(--ink); font: 600 1.0625rem/1.35 var(--font-sans); text-align: left;
}
.faq-item button::after { content: "+"; flex: none; font: 500 1.5rem/1 var(--font-mono); color: var(--cyan); transition: transform .2s ease; }
.faq-item button[aria-expanded="true"]::after { transform: rotate(45deg); }
.faq-panel { padding: 0 1.25rem 1.1rem; }
.faq-panel p { margin: 0; max-width: 70ch; }

/* ---------- 10. CTA final ---------- */
.final-cta {
  padding: var(--space-6) 0;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(79, 209, 197, .18), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(47, 93, 138, .55), transparent 60%),
    var(--night);
  border-top: 1px solid var(--deep-2);
}
.final-grid { display: grid; gap: var(--space-5); align-items: center; }
.final-copy p { font-size: var(--fs-lead); max-width: 55ch; }
.checks { list-style: none; display: grid; gap: .6rem; margin-top: var(--space-3); }
.checks li { position: relative; padding-left: 1.75rem; color: var(--ink); font-weight: 600; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--cyan); }

.form { padding: var(--space-4) var(--space-3); border-radius: var(--radius-lg); background: var(--deep); border: 1px solid var(--deep-2); box-shadow: var(--shadow); }
.field { margin-bottom: var(--space-2); }
.field label { display: block; margin-bottom: .35rem; color: var(--ink); font-weight: 600; }
.optional { color: var(--ink-3); font-weight: 400; }
.field input {
  width: 100%; min-height: 52px; padding: 0 1rem;
  font: 400 1rem var(--font-sans); color: var(--ink);
  background: var(--night); border: 1.5px solid var(--deep-2); border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:hover { border-color: var(--blue); }
.field input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(79, 209, 197, .25); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field input.is-valid { border-color: var(--cyan); }
.error { min-height: 1.25rem; margin: .3rem 0 0; font-size: .875rem; color: var(--error); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .cta { margin-top: var(--space-1); }
.form .cta[disabled] { opacity: .7; cursor: progress; transform: none; }
.form-status { min-height: 1.5rem; margin: var(--space-2) 0 0; font-weight: 600; }
.form-status.is-success { color: var(--ok); }
.form-status.is-error { color: var(--error); }
.form-note { margin: .5rem 0 0; font-size: .8125rem; color: var(--ink-3); }

/* ---------- 11. Footer ---------- */
.site-footer { padding: var(--space-5) 0 calc(var(--space-4) + 80px); border-top: 1px solid var(--deep-2); background: #080F1D; }
.footer-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, 1fr); }
.footer-grid > :first-child { grid-column: 1 / -1; }
.footer-tag { margin-top: var(--space-2); color: var(--ink-3); font-size: .9375rem; }
.footer-title { font-size: .8125rem; font-family: var(--font-mono); font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-bottom: var(--space-2); }
.site-footer ul { list-style: none; display: grid; gap: .5rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); text-decoration: underline; }
.social { display: flex !important; gap: .75rem !important; }
.social a { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--deep-2); }
.footer-bottom { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--deep-2); font-size: .875rem; color: var(--ink-3); }

/* ---------- Barra CTA fija en móvil ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: .75rem 16px calc(.75rem + env(safe-area-inset-bottom));
  background: rgba(11, 20, 38, .94); border-top: 1px solid var(--deep-2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transform: translateY(110%); transition: transform .3s ease;
}
.sticky-cta.is-visible { transform: translateY(0); }

/* ---------- Animación de entrada ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .container { padding: 0 24px; }
  .metrics { grid-template-columns: repeat(4, 1fr); }
  .hero-actions .cta { width: auto; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .quotes { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-grid > :first-child { grid-column: auto; }
}

/* ---------- Escritorio ---------- */
@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .nav { position: static; display: flex !important; align-items: center; gap: var(--space-4); padding: 0; background: none; border: 0; }
  .nav ul { display: flex; gap: var(--space-3); margin: 0; }
  .nav ul a { padding: .5rem 0; color: var(--ink-2); }
  .nav .cta { width: auto; }
  .hero { padding: var(--space-6) 0; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; }
  .hero-actions .cta { min-height: 60px; padding: 0 2rem; font-size: 1.125rem; }
  .ps-grid, .cards, .steps, .quotes, .plans { grid-template-columns: repeat(3, 1fr); }
  .plan--featured { transform: scale(1.03); }
  .final-grid { grid-template-columns: 1fr 1fr; }
  .sticky-cta { display: none; }
  .site-footer { padding-bottom: var(--space-4); }
}

/* ---------- Accesibilidad: menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .cta:hover, .card:hover { transform: none; }
}

/* Sin JavaScript: el menú se muestra abierto y el contenido sin animar */
@media (max-width: 959px) {
  .no-js .nav-toggle { display: none; }
  .no-js .nav { display: block; position: static; }
}

/* Páginas legales */
.legal h2 { font-size: 1.25rem; margin-top: var(--space-4); }
.legal p { max-width: 70ch; }
.legal-note { padding: .75rem 1rem; border: 1px dashed var(--ink-3); border-radius: 10px; color: var(--ink-3); font-size: .9375rem; }
