/* ==========================================================================
   IntegroLabs — Landing Page Styles
   Mobile-first. No build step — plain CSS + a couple of CDN animation
   libraries (GSAP, ScrollTrigger, Lenis), loaded as plain <script> tags in
   index.html. No framework, no npm install required to edit this.

   DESIGN DIRECTION (v2, after feedback):
   - Zero rounded corners anywhere — sharp, editorial, "expensive agency"
     look instead of the generic soft-rounded "AI SaaS template" aesthetic.
   - Oversized display type, hairline borders instead of boxed cards,
     custom cursor, film-grain overlay, scroll-driven motion.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Surfaces */
  --bg: #050810;
  --bg-alt: #0a0e1a;
  --card-bg: rgba(16, 21, 34, 0.55);
  --fill-subtle: rgba(255, 255, 255, 0.04);
  --fill-subtle-strong: rgba(255, 255, 255, 0.09);

  /* Borders — hairlines, not boxes */
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(53, 168, 224, 0.55);

  /* Accent — blue gradient (single accent, used sparingly) */
  --color-accent: #35A8E0; /* ÚNICO acento del sitio: cambiar solo esta línea */
  --color-accent-strong: #2B94C8; /* hover del acento */

  /* Text */
  --text-primary: #f5f7fb;
  --text-secondary: rgba(245, 247, 251, 0.68);
  --text-tertiary: rgba(245, 247, 251, 0.42);

  /* Type */
  --font-sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;

  --container-max: 1280px;
  --section-pad-y: 88px;
  --section-pad-x: 24px;

  --radius: 0px; /* botones e inputs sin radio; comparador, chat y tarjetas de equipo llevan radio propio (sections.css) */
  --text-dim: rgba(245, 247, 251, 0.5);
  --danger: #ff9a9a;
}

@media (min-width: 900px) {
  :root {
    --section-pad-y: 160px;
    --section-pad-x: 56px;
  }
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; } /* Lenis drives smooth scroll; CSS smooth-scroll would fight it */
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: auto;
}
@media (hover: hover) and (pointer: fine) {
  body.cursor-ready { cursor: none; }
  body.cursor-ready a,
  body.cursor-ready button,
  body.cursor-ready input,
  body.cursor-ready label { cursor: none; }
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; color: inherit; }

h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

::selection { background: var(--color-accent-strong); color: #fff; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Film grain overlay ----------
   Cheap static SVG-noise texture, fixed over everything, very low opacity.
   This one detail does a lot of work for the "expensive editorial site"
   feel — flat dark UI otherwise reads a bit sterile. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--color-accent);
  z-index: 1000;
  transform-origin: left;
}

/* ---------- Custom cursor ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  border: 1px solid var(--text-primary);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 999;
  mix-blend-mode: difference;
  display: none;
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; }
}
.cursor.is-active { width: 54px; height: 54px; background: rgba(255, 255, 255, 0.08); }

/* ---------- Utility: eyebrow / label ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* ---------- Buttons — sharp, no radius ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 28px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  position: relative;
  will-change: transform;
}
.btn--primary {
  background: var(--color-accent);
  color: #04101f;
}
.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--line);
}
.btn--secondary:hover { border-color: var(--line-strong); }
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--line);
}
.btn--ghost:hover { color: var(--text-primary); border-color: var(--line-strong); }
.btn--ghost:disabled { opacity: 0.3; cursor: not-allowed; }
.btn--lg { padding: 20px 34px; font-size: 16px; }
.btn--whatsapp { width: 100%; justify-content: center; }

/* ---------- Nav: cápsula fija ---------- */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, calc(100% - 32px));
  z-index: 1000;
}
.nav__capsule {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: #F4F6F9;
  border: 1px solid #E3E7EE;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
}
.nav.is-scrolled .nav__capsule {
  background: rgba(244, 246, 249, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav__logo { display: flex; align-items: center; gap: 8px; flex: none; }
.nav__logo img { height: 28px; width: auto; display: block; }
.nav__logo-text { font-size: 14px; font-weight: 500; color: #1F2A50; }
.nav__links {
  display: flex; flex: 1; justify-content: center; align-items: center; gap: 22px;
  font-size: 13px; color: #4A5572;
}
.nav__links a { position: relative; padding: 4px 0; white-space: nowrap; transition: color 0.25s ease; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px;
  background: #35A8E0; transform: scaleX(0); transform-origin: left center;
  transition: transform 0.3s ease;
}
.nav__links a:hover { color: #1F2A50; }
.nav__links a.is-current { color: #1F2A50; font-weight: 500; }
.nav__links a.is-current::after { transform: scaleX(1); }
.nav__cta {
  flex: none; white-space: nowrap; background: #1F2A50; color: #F4F6F9;
  font-size: 12px; font-weight: 500; border-radius: 999px; padding: 9px 16px;
  transition: background 0.25s ease;
}
.nav__cta:hover { background: #35A8E0; }
.nav__toggle { display: none; width: 32px; height: 32px; color: #1F2A50; align-items: center; justify-content: center; }

.nav__panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #F4F6F9; border-radius: 16px; box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
  display: none; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}
.nav__panel a { padding: 14px 20px; font-size: 16px; color: #1F2A50; border-bottom: 0.5px solid #E3E7EE; }
.nav__panel a:last-child { border-bottom: none; }
.nav__panel a.is-current { font-weight: 500; box-shadow: inset 2px 0 0 #35A8E0; }
.nav__panel.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

@media (max-width: 767px) {
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; margin-left: auto; }
  .nav__panel { display: flex; }
}

/* ---------- Hero (compacto: ~50% de la primera pantalla) ---------- */
.hero {
  /* --weave-bg DEBE ser idéntico al fondo del hero: la animación lo usa
     para "recortar" el tejido, así que no cambiar uno sin el otro. */
  --weave-bg: #050810;
  --weave-line: #7f93b8;
  --weave-pulse: #9fdcf5;
  --weave-t1: #f5f7fb;
  --weave-t2: #35A8E0;
  --weave-t3: #2B86B5;
  --weave-t4: #a9b8d9;

  position: relative;
  overflow: hidden;
  background: var(--weave-bg);
  padding: 88px 24px 0;
  display: flex;
  flex-direction: column;
  min-height: clamp(380px, 50svh, 520px);
}
.hero-weave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero__body {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-bottom: 36px;
  flex: 1;
  display: flex;
  align-items: center;
}
/* Texto a la izquierda; la animación ocupa la mitad derecha */
.hero__content { width: 100%; max-width: 58%; }
.hero__hook { margin-top: 14px; }
.hero__subtitle {
  margin-top: 14px;
  font-size: clamp(14.5px, 1.2vw, 16.5px);
  color: var(--text-secondary);
  max-width: 54ch;
}
.hero__cta { margin-top: 22px; }
.microcopy {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* Hook: texto grande de sección, reutilizado en el hero */
.hook {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.12;
  font-size: clamp(24px, 2.2vw, 36px);
  margin-top: 14px;
  color: var(--text-primary);
}
.hook__l1, .hook__l2 { display: block; }
.hook__l2 { color: var(--color-accent); }
.hero__hook { font-size: clamp(22px, 2.15vw, 34px); }
@media (min-width: 900px) { .hero__hook { white-space: nowrap; } }

/* Móvil: el texto ocupa solo la mitad superior del hero; la animación
   se dibuja en la mitad inferior. Dos filas 1fr iguales = el hero mide
   el doble de la altura del texto, sin números mágicos. */
@media (max-width: 759px) {
  .hero { display: grid; grid-template-rows: 1fr 1fr; min-height: 0; padding-top: 88px; }
  .hero__body { grid-row: 1; align-items: flex-start; padding-bottom: 24px; }
  .hero__content { max-width: 100%; }
}

/* ---------- Sections (shared) ---------- */
.section { padding: var(--section-pad-y) var(--section-pad-x); }
.section--alt { background: var(--bg-alt); }
.section--bordered { border-top: 1px solid var(--line-soft); }
.section__inner { max-width: var(--container-max); margin: 0 auto; }
.section__inner--narrow { max-width: 760px; }

.section__head {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 64px;
  max-width: 780px;
}
.section__sub { color: var(--text-secondary); font-size: 17px; max-width: 56ch; }

@media (min-width: 900px) {
  .section__head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 40px; }
}

/* ---------- Wizard / Form ---------- */
.wizard {
  border: 1px solid var(--line);
  padding: 32px 22px 36px;
}
@media (min-width: 640px) { .wizard { padding: 56px 60px 60px; } }

.wizard__progress {
  height: 1px;
  background: var(--line);
  margin-bottom: 16px;
}
.wizard__progress-bar {
  display: block;
  height: 100%;
  width: 25%;
  background: var(--color-accent);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.wizard__step-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 28px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.wizard__step { border: none; display: none; }
.wizard__step.is-active { display: block; }

.wizard__step legend {
  font-family: var(--font-sans);
  font-size: clamp(20px, 3.4vw, 28px);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
  padding: 0;
}

.option-grid { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line-soft); }
@media (min-width: 560px) { .option-grid { grid-template-columns: 1fr 1fr; } }

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 4px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  font-size: 15px;
}
@media (min-width: 560px) {
  .option-card:nth-child(odd) { border-right: 1px solid var(--line-soft); padding-right: 20px; }
  .option-card:nth-child(even) { padding-left: 20px; }
}
.option-card input {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
  position: relative;
  margin-top: 3px;
}
.option-card input:checked { border-color: var(--color-accent); }
.option-card input:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--color-accent);
}

.field-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field span { font-size: 13px; color: var(--text-secondary); font-weight: 500; letter-spacing: 0.02em; }
.field input {
  padding: 12px 2px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
}
.field input:focus { outline: none; border-bottom-color: var(--color-accent); }
.field input::placeholder { color: var(--text-tertiary); }

.wizard__done { padding: 8px 0 4px; }
.wizard__done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  margin-bottom: 24px;
}
.wizard__done h3 { font-size: clamp(20px, 3vw, 26px); margin-bottom: 16px; }
.wizard__done p { color: var(--text-secondary); font-size: 15px; max-width: 480px; margin-bottom: 28px; }

.wizard__nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; }
#qualForm[data-current-step="4"] .wizard__nav { display: none; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 48px 24px; }
.footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.footer__brand img { display: block; height: 30px; width: auto; }
.footer__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-sans); font-weight: 500; font-size: 15px; }
.footer__contact { display: flex; flex-wrap: wrap; gap: 24px; font-size: 14px; color: var(--text-secondary); }
.footer__whatsapp { display: inline-flex; align-items: center; gap: 6px; }
.footer__whatsapp:hover, .footer__contact a:hover { color: var(--text-primary); }
.footer__copy { font-size: 12px; color: var(--text-tertiary); }

@media (min-width: 700px) {
  .footer__inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ---------- Reveal (fallback for browsers/without GSAP, and base state) ---------- */
.reveal { opacity: 0; transform: translateY(28px); }
.reveal.in-view { opacity: 1; transform: translateY(0); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
/* When GSAP drives these elements it sets inline styles directly and adds
   .gsap-driven so this CSS transition doesn't fight it. */
.reveal.gsap-driven { transition: none; }
