/* ============================================================
   Kosmos Lab — sistema base (tokens, header, footer, botones)
   Cargado por TODAS las páginas. Lo específico de la landing
   vive en css/landing.css
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* El modo oscuro es la versión principal de la marca y vive en el :root
   sin atributo, pero el tema por defecto (sin preferencia guardada) sigue
   el del sistema — ver la detección en el <head> de cada página y en
   js/script.js. El claro existe completo y se elige en el selector. */
:root {
  /* superficies */
  --bg-page: #0B0D0E;   /* Negro Grafito — 60% */
  --bg-alt: #101315;
  --bg-card: #14171A;   /* Gris Carbón */
  --bg-soft: #1C1810;   /* tinte ámbar para bloques de acento */
  --bg-blur: rgba(11,13,14,.85);
  --bg-ink: #050607;

  /* bordes */
  --border: #262B33;    /* Gris Pizarra Oscuro */
  --border-strong: #333B45;
  --border-dashed: #333B45;

  /* texto */
  --text-heading: #F4F5F6;  /* Blanco Platino — 30% */
  --text-body: #A7B2BE;
  --text-muted: #94A3B8;    /* Gris Neutro Frío */
  --text-base: #E2E8F0;

  /* marca */
  --accent: #F59E0B;        /* Oro Ámbar Solar — 10% */
  --accent-dark: #FBBF24;   /* en oscuro el "fuerte" aclara, no oscurece */
  --accent-soft: #2A2313;
  --on-accent: #0B0D0E;     /* sobre relleno ámbar SIEMPRE texto grafito */
  --ok: #10B981;
  --phone-frame: #F4F5F6;

  /* sombras — sobre un fondo casi negro una sombra negra no se ve, así que
     la jerarquía la cargan los bordes y el "elevado" usa un halo ámbar */
  --sh-s: 0 1px 3px rgba(0,0,0,.5);
  --sh-m: 0 4px 20px rgba(0,0,0,.45);
  --sh-l: 0 12px 34px -10px rgba(245,158,11,.28);

  --r: 12px;
}

:root[data-theme="light"] {
  --bg-page: #FFFFFF;
  --bg-alt: #F6F7F8;
  --bg-card: #FFFFFF;
  --bg-soft: #FEF6E7;
  --bg-blur: rgba(255,255,255,.85);
  --bg-ink: #0B0D0E;

  --border: #E3E6EA;
  --border-strong: #CDD3DA;
  --border-dashed: #CDD3DA;

  --text-heading: #0B0D0E;
  --text-body: #4A5561;
  --text-muted: #6B7684;
  --text-base: #1B2027;

  --accent: #F59E0B;
  /* El ámbar puro no alcanza contraste AA como texto sobre blanco: en claro
     el acento de TEXTO baja a un ámbar quemado. El relleno del botón sigue
     siendo el ámbar de marca, con texto grafito encima. */
  --accent-dark: #A85F06;
  --accent-soft: #FDE9C2;
  --on-accent: #0B0D0E;
  --ok: #067A55;
  --phone-frame: #0B0D0E;

  --sh-s: 0 1px 3px rgba(11,13,14,.06);
  --sh-m: 0 4px 20px rgba(11,13,14,.08);
  --sh-l: 0 12px 34px -10px rgba(11,13,14,.16);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-base);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color .25s ease, color .25s ease;
}
section[id] { scroll-margin-top: 80px; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ============================================================
   BARRA DE PROGRESO DE SCROLL
   ============================================================ */
.scroll-bar {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0;
  background: var(--accent);
  z-index: 9999;
  transition: width .1s linear;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border-radius: 100px;
  font-family: inherit;
  font-weight: 700;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-p { background: var(--accent); color: var(--on-accent); }
.btn-p:hover { background: var(--accent-dark); box-shadow: var(--sh-m); }
.btn-s { background: var(--bg-card); color: var(--text-heading); border: 1px solid var(--border); }
.btn-s:hover { border-color: var(--accent); background: var(--bg-alt); color: var(--accent-dark); }

.btn-lg { padding: 14px 28px; font-size: .95rem; }

.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { background: #1FB855; }

/* ============================================================
   HEADER
   ============================================================ */
.hdr {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--bg-blur);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.hdr-in {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo-wrap { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
/* El isotipo no se recorta en círculo: el manual de marca lo prohíbe
   expresamente ("no recortarlo como si fuera una foto de perfil"). */
.logo-wrap img { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.logo-txt {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: 1.12rem;
  color: var(--text-heading);
  letter-spacing: .06em;
  white-space: nowrap;
}
/* "LAB" en un peso menor: el contraste estructural es parte del logotipo. */
.logo-txt-l { font-weight: 600; }

/* Último enlace del desplegable de servicios: lleva a la sección completa. */
.dd-all {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  color: var(--accent-dark) !important;
  font-weight: 700;
}
.dd-all:hover { background: var(--bg-alt); }

.nav-l { display: flex; align-items: center; gap: 26px; }
.nav-l > a { white-space: nowrap; }
.nav-l > a, .dd-trigger {
  font-family: inherit;
  font-size: .9rem; font-weight: 600;
  color: var(--text-body);
  background: none; border: none; padding: 0;
  cursor: pointer; position: relative;
  display: flex; align-items: center; gap: 4px;
  transition: color .2s;
}
.nav-l > a:hover, .dd-trigger:hover,
.nav-l > a.active, .dd-trigger.active { color: var(--accent-dark); }
.nav-l > a.active::after, .dd-trigger.active::after {
  content: ''; position: absolute; bottom: -6px; left: 0; right: 0;
  height: 2px; background: var(--accent); border-radius: 1px;
}

.dd { position: relative; }
.dd-trigger svg { width: 12px; height: 12px; transition: transform .2s; }
.dd.open .dd-trigger svg { transform: rotate(180deg); }
.dd-menu {
  position: absolute; top: calc(100% + 14px); left: -12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--sh-l);
  padding: 8px; min-width: 250px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, visibility .2s, transform .2s;
}
.dd.open .dd-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dd-menu a {
  display: block; padding: 10px 14px; border-radius: 9px;
  font-size: .9rem; font-weight: 600; color: var(--text-body);
  transition: background-color .15s, color .15s;
}
.dd-menu a:hover { background: var(--bg-alt); color: var(--accent-dark); }
.dd-menu a span {
  display: block; font-size: .78rem; font-weight: 500;
  color: var(--text-muted); margin-top: 1px;
}

.nav-r { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.menu-btn {
  display: none; background: none; border: none;
  color: var(--text-heading); cursor: pointer; padding: 8px;
}
.menu-btn svg { width: 22px; height: 22px; display: block; }

.mob-nav {
  display: none;
  position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
  background: var(--bg-page);
  z-index: 999; padding: 20px 24px 40px;
  flex-direction: column;
  overflow-y: auto;
}
.mob-nav.open { display: flex; }
.mob-nav > a {
  font-size: 1.05rem; font-weight: 600; color: var(--text-body);
  padding: 15px 0; border-bottom: 1px solid var(--border);
}
.mob-dd { border-bottom: 1px solid var(--border); padding: 15px 0; }
.mob-dd-title {
  font-size: 1.05rem; font-weight: 600; color: var(--text-body);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.mob-dd-title svg { width: 14px; height: 14px; transition: transform .2s; }
.mob-dd.open .mob-dd-title svg { transform: rotate(180deg); }
.mob-dd-list { display: none; padding: 6px 0 0 14px; }
.mob-dd.open .mob-dd-list { display: block; }
.mob-dd-list a {
  display: block; font-size: .95rem; font-weight: 600;
  color: var(--text-muted); padding: 10px 0;
}
.mob-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 22px;
}
.mob-foot .btn { flex: 1; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-page);
  border-top: 1px solid var(--border);
  padding: 56px 0 28px;
}
.ft-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 40px;
}
.ft-brand .logo-wrap { margin-bottom: 12px; }
.ft-brand p { font-size: .88rem; color: var(--text-muted); max-width: 270px; }
.ft-col h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--text-muted); margin-bottom: 14px;
}
.ft-col a {
  display: block; font-size: .9rem; font-weight: 500;
  color: var(--text-body); padding: 5px 0;
  transition: color .2s;
}
.ft-col a:hover { color: var(--accent-dark); }
.ft-bottom {
  padding-top: 26px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.ft-bottom p { font-size: .8rem; color: var(--text-muted); }
.ft-tools { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ft-social { display: flex; gap: 10px; }
.ft-social a {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-body);
  transition: border-color .2s, color .2s;
}
.ft-social a:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ============================================================
   REVEAL AL SCROLL
   ============================================================ */
[data-reveal] {
  opacity: 0; transform: translateY(20px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
[data-reveal].rv-in { opacity: 1; transform: none; }
.rv-d1 { transition-delay: .08s; }
.rv-d2 { transition-delay: .16s; }
.rv-d3 { transition-delay: .24s; }
.rv-d4 { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   CTA STICKY MÓVIL
   ============================================================ */
.mobile-sticky-cta { display: none; }

/* ============================================================
   CHIPS DE INTEGRACIÓN
   ============================================================ */
.integration-chip,
.integration-chip-more,
.integration-chip-primary {
  display: inline-block;
  font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; line-height: 1.2;
}
.integration-chip { background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-body); }
.integration-chip-more {
  background: transparent; border: 1px dashed var(--border-dashed);
  color: var(--text-muted); font-style: italic;
}
.integration-chip-primary {
  background: var(--bg-soft); border: 1px solid var(--accent);
  color: var(--accent-dark); font-weight: 700;
}
.integration-chip-logo,
.integration-chip-primary-logo {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  padding: 5px 12px 5px 8px; border-radius: 8px; line-height: 1.2;
  transition: border-color .2s;
}
.integration-chip-logo { background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-body); }
.integration-chip-logo:hover { border-color: var(--border-strong); }
.integration-chip-primary-logo {
  background: var(--bg-soft); border: 1px solid var(--accent);
  color: var(--accent-dark); font-weight: 700;
}
.integration-chip-logo img,
.integration-chip-primary-logo img {
  width: 15px; height: 15px; flex-shrink: 0; display: block;
}
.integration-chip-logo img.logo-wordmark,
.integration-chip-primary-logo img.logo-wordmark { width: auto; height: 11px; }
.integration-chip-logo img.logo-portrait,
.integration-chip-primary-logo img.logo-portrait { width: 11px; height: auto; }

/* Logos de terceros: sobre el grafito del tema oscuro sus colores propios
   desaparecen, asi que van en blanco e invertidos. En claro recuperan su
   color de marca. */
.wix-icon, .wompi-icon { flex-shrink: 0; display: block; color: #fff; }
img.invert-dark { filter: invert(1); }
:root[data-theme="light"] .wix-icon { color: #0C6EFC; }
:root[data-theme="light"] .wompi-icon { color: #2C2A29; }
:root[data-theme="light"] img.invert-dark { filter: none; }

.integration-subgroup-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 7px;
}

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 100px; padding: 3px; flex-shrink: 0;
}
.theme-toggle button {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: none; border-radius: 100px;
  background: transparent; color: var(--text-muted);
  cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.theme-toggle button svg { width: 14px; height: 14px; }
.theme-toggle button:hover { color: var(--accent-dark); }
.theme-toggle button.active {
  background: var(--bg-card); color: var(--accent-dark);
  box-shadow: var(--sh-s);
}

/* ============================================================
   COMPATIBILIDAD — clases usadas por páginas internas
   ============================================================ */
.hover-teal:hover { background: var(--accent-dark) !important; }
.hover-outline:hover { background: var(--accent) !important; color: var(--on-accent) !important; }
.hover-card:hover { border-color: var(--accent) !important; box-shadow: var(--sh-m) !important; }

.faq-answer { max-height: 0; overflow: hidden; transition: max-height .4s ease; }
.faq-item.open .faq-answer { max-height: 420px; }
.faq-plus { transition: transform .3s ease; }
.faq-item.open .faq-plus { transform: rotate(45deg); }

/* ============================================================
   RESPONSIVE GLOBAL
   ============================================================ */
@media (max-width: 1024px) {
  .nav-l { display: none; }
  .menu-btn { display: block; }
  /* El CTA del header compite con la hamburguesa en pantallas chicas y ya
     está disponible en .mob-foot (desplegable) y en .mobile-sticky-cta. */
  .nav-r .btn-p { display: none; }
  .ft-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 860px) {
  .mobile-sticky-cta.show {
    display: flex; justify-content: center;
    position: fixed; left: 0; right: 0;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 95; pointer-events: none;
  }
  .mobile-sticky-cta a {
    pointer-events: auto;
    background: var(--accent); color: var(--on-accent);
    font-weight: 700; font-size: 13px;
    padding: 10px 20px; border-radius: 100px;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
    transition: background .2s;
  }
  body { padding-bottom: 56px; }
}

@media (max-width: 640px) {
  .ft-grid { grid-template-columns: 1fr; gap: 22px; }
  .ft-bottom { flex-direction: column; gap: 14px; text-align: center; }
  .ft-tools { justify-content: center; }
  .logo-wrap img { width: 34px; height: 34px; }
  .logo-txt { font-size: 1.15rem; }
}

/* ============================================================
   ETIQUETA MONOESPACIADA
   Cifras, numeración y rótulos cortos. Es la voz técnica de la
   marca; reemplaza a los emoji, que el manual prohíbe en la web.
   ============================================================ */
.eyebrow-mono {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}
