/* ============================================================
   AIMOQ | Sistema de diseño compartido
   Tokens, base, navegación, botones, secciones, cierre y footer.
   Lo usan todas las páginas; lo específico va en home.css / page.css.
   ============================================================ */

:root {
  /* Fondos (tema oscuro técnico) */
  --bg:      #FFFFFF;
  --bg-2:    #F6F8FC;
  --bg-3:    #EEF2F9;
  --card:    #FFFFFF;
  --card-h:  #F9FBFF;

  /* Líneas */
  --line:    rgba(14, 22, 48, 0.08);
  --line-2:  rgba(14, 22, 48, 0.13);
  --line-3:  rgba(14, 22, 48, 0.22);

  /* Tinta */
  --ink:     #0E1630;
  --ink-2:   #3E4865;
  --ink-3:   #5A6482;

  /* Marca */
  --brand:    #4260C4;
  --brand-2:  #3753B5;
  --brand-hi: #3554C0;
  --sky:      #2E9BEA;
  --ok:       #15803D;
  --warn:     #F5B84A;

  /* Superficie clara (secciones "paper") */
  --paper:    #F1F4F9;
  --paper-2:  #FFFFFF;
  --p-ink:    #0E1630;
  --p-ink-2:  #3B4562;
  --p-ink-3:  #545E7A;
  --p-line:   #DCE2EF;

  /* Tipografía */
  --f-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --t-h1:    clamp(46px, 8.6vw, 132px);
  --t-h2:    clamp(32px, 4.1vw, 58px);
  --t-h2-xl: clamp(34px, 5.4vw, 80px);
  --t-h3:    clamp(19px, 1.5vw, 22px);
  --t-lead:  clamp(17px, 1.35vw, 20px);
  --t-body:  16px;
  --t-small: 14px;
  --t-label: 13px;

  /* Ritmo */
  --nav:  72px;
  --padt: clamp(96px, 10vw, 144px);
  --padb: clamp(88px, 9vw, 136px);
  --gut:  80px;
  --wrap: 1280px;

  /* Radios */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-btn: 999px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

@media (max-width: 1023px) { :root { --gut: 48px; } }
@media (max-width: 639px)  { :root { --gut: 24px; --nav: 64px; } }

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--nav);
  background: var(--bg);
}
body {
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
h2 { font-size: var(--t-h2); letter-spacing: -0.035em; line-height: 1.04; hyphens: manual; }
h3 { font-size: var(--t-h3); letter-spacing: -0.015em; line-height: 1.25; }
p { text-wrap: pretty; }
::selection { background: #C9D5FF; color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brand-hi);
  outline-offset: 3px;
  border-radius: 4px;
}
.section--paper :focus-visible { outline-color: var(--brand); }

.wrap {
  width: min(100% - 2 * var(--gut), var(--wrap));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.skip-link {
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-sm);
  font-size: 14px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
}
.skip-link:focus-visible { opacity: 1; pointer-events: auto; }

/* ── Etiquetas y texto auxiliar ── */
.label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  margin-bottom: 20px;
}
.label span {
  color: var(--brand-hi);
  padding-right: 10px;
  border-right: 1px solid var(--line-3);
}
.label--light { color: rgba(255,255,255,.86); }
.label--light span { color: #fff; border-color: rgba(255,255,255,.35); }
.section--paper .label { color: var(--p-ink-2); }
.section--paper .label span { color: var(--brand); border-color: var(--p-line); }

.show-sm { display: none; }
@media (max-width: 479px) { .hide-sm { display: none; } .show-sm { display: inline; } }

.mono-note { font-family: var(--f-mono); font-size: var(--t-label); color: var(--ink-3); }
.dim { color: var(--ink-3); }

.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-hi);
  font-weight: 500;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .35s var(--ease);
  padding-bottom: 2px;
}
.link svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.link:hover { background-size: 100% 1px; }
.link:hover svg { transform: translateX(3px); }
.section--paper .link { color: var(--brand); }

.pulse-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}
.pulse-dot::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ok);
  opacity: 0;
  animation: pulse-ring 2.8s var(--ease) infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(.5); opacity: .8; }
  80%, 100% { transform: scale(1.6); opacity: 0; }
}

/* ── Botones ── */
.btn {
  --btn-h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--btn-h);
  padding: 0 24px;
  border-radius: var(--r-btn);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .3s var(--ease);
  will-change: transform;
}
.btn--sm { --btn-h: 44px; padding: 0 20px; font-size: 14px; }
.btn--lg { --btn-h: 56px; padding: 0 28px; font-size: 16px; }
.btn--block { width: 100%; }
.btn__arrow { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .08s; }

.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 16px -8px rgba(0, 0, 0, .55);
}
.btn--primary:hover {
  background: #4c6ad4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 10px 22px -10px rgba(0, 0, 0, .6);
}
.btn--secondary {
  background: rgba(14,22,48,.04);
  color: var(--ink);
  border-color: var(--line-3);
}
.btn--secondary:hover { background: rgba(14,22,48,.08); border-color: rgba(14,22,48,.4); }
.section--paper .btn--secondary { color: var(--p-ink); border-color: var(--p-line); background: #fff; }
.section--paper .btn--secondary:hover { border-color: var(--p-ink-3); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Chips ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(14,22,48,.025);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip__icon { width: 14px; height: 14px; }

/* ── Navegación ── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav);
  z-index: 50;
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
}
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav__logo { display: flex; align-items: center; flex-shrink: 0; }
.nav__logo img { height: 30px; width: auto; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav__link {
  position: relative;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 8px;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav__link:hover { color: var(--ink); background: rgba(14,22,48,.04); }
.nav__link.active,
.nav__link[aria-current="page"] { color: var(--ink); }
.nav__link.active::after,
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-hi);
}
.nav__actions { display: flex; align-items: center; gap: 12px; }

.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line-3);
  position: relative;
}
.nav__toggle span {
  position: absolute;
  left: 13px; right: 13px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.nav__toggle span:first-child { top: 17px; }
.nav__toggle span:last-child  { top: 25px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child  { top: 21px; transform: rotate(-45deg); }

.nav-sheet {
  position: fixed;
  inset: var(--nav) 0 0 0;
  z-index: 49;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px var(--gut) calc(32px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.nav-sheet[hidden] { display: none; }
.nav-sheet.is-open { animation: sheet-in .35s var(--ease-out); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-8px); } }
.nav-sheet__links { display: flex; flex-direction: column; }
.nav-sheet__links a {
  display: flex;
  align-items: center;
  min-height: 60px;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
}
.nav-sheet__foot { display: grid; gap: 16px; padding-top: 32px; }
.nav-sheet__foot .mono-note { text-align: center; }

@media (max-width: 1100px) {
  .nav__links { gap: 0; }
  .nav__link { padding: 10px 10px; }
}
@media (max-width: 1023px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .nav__actions { margin-left: auto; }
}
@media (max-width: 479px) {
  .nav__actions .btn { display: none; }
}

/* ── Secciones ── */
main { display: block; }
.section {
  position: relative;
  padding: var(--padt) 0 var(--padb);
  background: var(--bg);
  overflow: hidden;
}
.section--alt { background: var(--bg-2); }
.section--paper { background: var(--paper); color: var(--p-ink); }
.section--paper .head__lead,
.section--paper p { color: var(--p-ink-2); }
.section--paper h2, .section--paper h3 { color: var(--p-ink); }
.section--paper .dim { color: var(--p-ink-3); }

.head { margin-bottom: clamp(48px, 6vw, 72px); }
.head--split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: start;
}
@media (min-width: 1024px) { .head--split > .head__lead { padding-top: 42px; } }
.head--split > div { grid-column: 1 / span 7; }
.head--split > .head__lead { grid-column: 8 / span 5; }
.head__lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34em;
}
.head h2 { max-width: 14em; }
.h2-xl { font-size: var(--t-h2-xl); letter-spacing: -0.04em; line-height: 1.02; max-width: 16em; }

@media (max-width: 1023px) {
  .head--split { display: block; }
  .head--split > .head__lead { margin-top: 20px; }
}

/* Glows decorativos */
.glow {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
  z-index: 0;
}

/* ── Cierre + footer ── */
.closing {
  position: relative;
  background: var(--bg);
  padding: clamp(48px, 6vw, 96px) 0 96px;
  overflow: hidden;
}
.closing__glow {
  position: absolute;
  left: 50%; top: -30%;
  width: 1200px; height: 700px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(66, 96, 196, .16), rgba(66, 96, 196, 0) 70%);
  pointer-events: none;
}
.closing__cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(36px, 6vw, 88px);
  border-radius: 32px;
  color: #fff;
  background:
    radial-gradient(800px 420px at 90% 0%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(150deg, #4766CF 0%, #3552B4 55%, #2B4499 100%);
  box-shadow: 0 50px 100px -60px rgba(43, 68, 153, .8);
}
.closing__cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 60% 80% at 85% 20%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 85% 20%, #000 10%, transparent 70%);
}
.closing__cta .label { color: rgba(255,255,255,.86); }
.closing__cta .label span { color: #fff; border-color: rgba(255,255,255,.35); }
.closing__cta .closing__lead { color: rgba(255,255,255,.88); }
.closing__cta .closing__mail { color: rgba(255,255,255,.85); }
.closing__cta .link { color: #fff; }
.closing__cta .btn--primary { background: #fff; color: var(--brand); box-shadow: 0 10px 24px -12px rgba(0,0,0,.4); }
.closing__cta .btn--primary:hover { background: #F1F4FF; }
.closing__cta .btn--secondary { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.4); }
@media (min-width: 1024px) {
  .closing__cta .closing__lead { grid-column: 1 / span 6; }
  .closing__cta .closing__row .btn-row { grid-column: 7 / span 6; }
}
.closing__cta .btn--secondary:hover { background: rgba(255,255,255,.16); border-color: #fff; }
.closing__title {
  font-size: clamp(40px, 6.4vw, 96px);
  letter-spacing: -0.045em;
  line-height: .98;
  max-width: 12em;
}
.closing__row {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: center;
  row-gap: 24px;
}
.closing__lead { grid-column: 1 / span 6; font-size: var(--t-lead); color: var(--ink-2); max-width: 32em; }
.closing__row .btn-row { grid-column: 8 / span 5; justify-content: flex-end; }
.closing__mail { margin-top: 32px; font-size: 15px; color: var(--ink-2); }

.footer {
  margin-top: clamp(80px, 10vw, 128px);
  padding-top: 48px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 40px;
}
.footer__brand { grid-column: 1 / span 5; }
.footer__brand img { height: 34px; width: auto; }
.footer__brand p { margin-top: 20px; color: var(--ink-2); font-size: 15px; max-width: 26em; }
.footer__social { display: flex; gap: 8px; margin-top: 24px; }
.footer__social a {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.footer__social a:hover { color: var(--ink); border-color: var(--line-3); transform: translateY(-2px); }
.footer__social svg { width: 17px; height: 17px; }
.footer__col:nth-of-type(2) { grid-column: 7 / span 2; }
.footer__col:nth-of-type(3) { grid-column: 9 / span 2; }
.footer__col:nth-of-type(4) { grid-column: 11 / span 2; }
.footer__col h3 {
  font-family: var(--f-mono);
  font-size: var(--t-label);
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.footer__col ul { display: grid; gap: 2px; }
.footer__col a, .footer__col span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 14px;
  color: var(--ink-2);
  transition: color .2s var(--ease);
}
.footer__col a:hover { color: var(--ink); }
.footer__legal {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-3);
}
.footer__slogan { font-family: var(--f-mono); color: var(--ink-2); }

@media (max-width: 1023px) {
  .closing__lead { grid-column: 1 / -1; }
  .closing__row .btn-row { grid-column: 1 / -1; justify-content: flex-start; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__col:nth-of-type(2) { grid-column: 1 / span 4; }
  .footer__col:nth-of-type(3) { grid-column: 5 / span 4; }
  .footer__col:nth-of-type(4) { grid-column: 9 / span 4; }
}
@media (max-width: 639px) {
  .footer { grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .footer__col:nth-of-type(2) { grid-column: 1; }
  .footer__col:nth-of-type(3) { grid-column: 2; }
  .footer__col:nth-of-type(4) { grid-column: 1 / -1; }
  .closing__row .btn-row .btn { width: 100%; }
}

/* ── WhatsApp flotante ── */
.wa-float {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 40;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #25D366;
  color: #fff;
  box-shadow: 0 10px 28px -8px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.25);
  transition: transform .25s var(--ease), opacity .3s var(--ease), background-color .2s var(--ease);
}
.wa-float::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #25D366;
  opacity: 0;
  animation: wa-ring 3.2s var(--ease) infinite;
}
@keyframes wa-ring {
  0% { transform: scale(1); opacity: .6; }
  70%, 100% { transform: scale(1.45); opacity: 0; }
}
.wa-float svg { width: 30px; height: 30px; }
.wa-float:hover { transform: translateY(-2px) scale(1.04); background: #2ee374; }
.wa-float:active { transform: scale(.96); }
.wa-float__label {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: #0E1630;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,.5);
  opacity: 0;
  transform: translate(6px, -50%);
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.wa-float:hover .wa-float__label,
.wa-float:focus-visible .wa-float__label { opacity: 1; transform: translate(0, -50%); }
.wa-float.is-away { opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; visibility: hidden; transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s; }
@media (max-width: 639px) {
  .wa-float { width: 56px; height: 56px; right: 16px; bottom: 16px; }
  .wa-float svg { width: 28px; height: 28px; }
  .wa-float__label { display: none; }
}

/* ── Animaciones de entrada al hacer scroll ──
   Solo con JavaScript activo (clase .js en <html>). Si el script falla,
   .reveal-all muestra todo; con "reducir movimiento" no hay desplazamiento. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 110ms);
}
.js [data-reveal].is-in,
.reveal-all [data-reveal] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ── Entrada del hero (una vez, al cargar) ── */
[data-enter] {
  animation: enter .9s var(--ease-out) both;
  animation-delay: calc(var(--enter-step, 0) * 90ms + 80ms);
}
[data-enter="1"] { --enter-step: 0; }
[data-enter="2"] { --enter-step: 1; }
[data-enter="3"] { --enter-step: 2; }
[data-enter="4"] { --enter-step: 3; }
[data-enter="5"] { --enter-step: 5; }
@keyframes enter {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-enter] { animation: none; }
}
