/* ============================================================
   Simplexia — landing de captación
   Sistema: Cobalt + papel neutro · Bricolage Grotesque + Instrument Sans
   Radios: pill = interactivos, 18px = tarjetas, 10px = inputs
   ============================================================ */

:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --ink: #17181c;
  --ink-soft: #50545c;
  --ink-faint: #8a8f98;
  --line: #e3e3de;
  --accent: #0c74a7;       /* azul del ovillo del logo */
  --accent-deep: #095a83;
  --accent-tint: #e8f2f8;
  --accent-ink: #0f2f4f;   /* navy del wordmark */
  --accent-soft: #5fb1dd;  /* azul claro para fondos oscuros */
  --wa: #1faa53;
  --wa-deep: #157a3c;
  --r-card: 18px;
  --r-input: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 24, 28, .05);
  --shadow-md: 0 14px 34px -12px rgba(23, 24, 28, .16);
  --font-head: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.08; letter-spacing: -0.015em; }

img { max-width: 100%; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: .85rem 1.6rem; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.25em; height: 1.25em; flex: none; }

.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 18px -6px rgba(12, 116, 167, .5);
}
.btn-primary:hover { background: var(--accent-deep); }

.btn-whatsapp { background: transparent; color: var(--wa-deep); border: 1.5px solid #a9dcbc; }
.btn-whatsapp:hover { background: #eefaf2; border-color: var(--wa); }

.btn-sm { padding: .55rem 1.15rem; font-size: .9rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; width: 100%; }
.btn-block { width: 100%; }

/* ===== Nav ===== */
.nav-wrap {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 246, 243, .88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 1180px; margin: 0 auto; padding: .7rem 1.25rem; height: 68px;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 42px; width: auto; display: block; }
.brand-logo.sm { height: 30px; }

.nav-links { display: flex; gap: 1.4rem; margin-left: auto; }
.nav-links a {
  text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: .95rem;
}
.nav-links a:hover { color: var(--ink); }

/* ===== Atmósfera (profundidad de fondo) ===== */
/* Grano fino sobre toda la página */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .05; mix-blend-mode: multiply;
}

/* ===== Hero ===== */
.hero {
  overflow: hidden; border-bottom: 1px solid var(--line); position: relative;
  background:
    radial-gradient(950px 560px at 88% -14%, rgba(12, 116, 167, .17), transparent 62%),
    radial-gradient(720px 480px at 106% 66%, rgba(95, 177, 221, .15), transparent 60%),
    radial-gradient(560px 420px at -10% 110%, rgba(9, 90, 131, .08), transparent 58%),
    var(--bg);
}
/* Retícula de puntos que se desvanece hacia el copy */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(23, 24, 28, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
  mask-image: radial-gradient(720px 520px at 74% 34%, #000 25%, transparent 78%);
}
/* Listones de gradiente ondulados */
.hero-waves {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.hero-inner {
  max-width: 1180px; margin: 0 auto; padding: 4.5rem 1.25rem 4.5rem;
  display: grid; grid-template-columns: 1.08fr .92fr; gap: 3.5rem; align-items: center;
  position: relative; z-index: 1;
}
.eyebrow {
  font-weight: 600; font-size: .85rem; color: var(--accent);
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.8rem); font-weight: 700; margin-bottom: 1.1rem;
}
.hero-sub { font-size: 1.14rem; color: var(--ink-soft); max-width: 30rem; margin-bottom: 2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .8rem; }

/* --- Mockup de chat (hero) --- */
.hero-visual { display: flex; justify-content: center; position: relative; }
.phone-card {
  width: min(375px, 100%); background: var(--surface); border-radius: 26px;
  border: 1px solid var(--line); box-shadow: var(--shadow-md); overflow: hidden;
  position: relative; z-index: 1;
}

/* --- Robot que sigue el cursor --- */
.robot-peek {
  position: absolute; width: 150px; top: -58px; left: 50%;
  margin-left: -298px; transform: rotate(-8deg); z-index: 0;
}
.pupil { transition: transform .12s ease-out; }
/* Mirada en reposo (móvil / antes de mover el cursor) */
.robot-eyes { animation: robot-idle 6s ease-in-out infinite; }
.robot-peek.awake .robot-eyes { animation: none; }
@keyframes robot-idle {
  0%, 24%   { transform: translate(0, 0); }
  30%, 46%  { transform: translate(5px, 1px); }
  52%, 72%  { transform: translate(-5px, 1px); }
  78%, 100% { transform: translate(0, 0); }
}
.phone-header {
  display: flex; align-items: center; gap: .7rem;
  background: var(--accent-ink); color: #fff; padding: .9rem 1.1rem;
}
.phone-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; flex: none;
}
.phone-avatar img { width: 26px; height: 26px; object-fit: contain; }
.phone-title { display: flex; flex-direction: column; line-height: 1.3; }
.phone-title strong { font-size: .95rem; font-weight: 600; }
.phone-title span { font-size: .75rem; opacity: .85; display: flex; align-items: center; gap: .35rem; }
.dot-online {
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80; display: inline-block;
}

.phone-chat {
  min-height: 330px; padding: 1rem .95rem; display: flex; flex-direction: column; gap: .55rem;
  background: #eef0ea;
}
.msg {
  max-width: 84%; padding: .55rem .8rem; border-radius: 13px; font-size: .875rem;
  line-height: 1.45; box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(8px);
  animation: msg-in .4s ease forwards;
}
@keyframes msg-in { to { opacity: 1; transform: none; } }
.msg.in { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.out { background: #d9efdd; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg .time { display: block; font-size: .64rem; color: var(--ink-faint); text-align: right; margin-top: .15rem; }
.msg.typing { display: flex; gap: 4px; padding: .7rem .9rem; }
.msg.typing i {
  width: 6px; height: 6px; border-radius: 50%; background: #9aa0a8; display: block;
  animation: bounce 1s infinite;
}
.msg.typing i:nth-child(2) { animation-delay: .15s; }
.msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 30% { transform: translateY(-4px); } }

.phone-footer { padding: .7rem 1rem; border-top: 1px solid var(--line); background: #fff; }
.phone-note { font-size: .8rem; color: var(--ink-soft); display: block; text-align: center; }

/* ===== Secciones ===== */
.section { max-width: 1180px; margin: 0 auto; padding: 5rem 1.25rem; }
.section-head { max-width: 620px; margin-bottom: 3rem; }
.section-head h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.35rem); font-weight: 700; margin-bottom: .8rem;
}
.section-sub { color: var(--ink-soft); font-size: 1.08rem; }

/* Aparición al hacer scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== Servicios (bento) ===== */
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }

.cell {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease;
}
.cell:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.cell-feature { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
.cell-feature .cell-body { flex: 1; align-self: center; padding: 2.4rem 2.6rem; }
.cell-feature .cell-visual { flex: 1.05; border-bottom: 0; border-left: 1px solid var(--line); }

.cell-visual {
  padding: 1.6rem; min-height: 215px; display: grid; place-items: center;
  background: #f1f2ee; border-bottom: 1px solid var(--line); order: -1;
}
.cell-feature .cell-visual { order: 1; background: var(--accent-tint); }
.cell-body { padding: 1.5rem 1.6rem 1.7rem; }
.cell-body h3 { font-size: 1.28rem; font-weight: 600; margin-bottom: .5rem; }
.cell-body p { color: var(--ink-soft); font-size: .97rem; max-width: 46ch; }

.cell-visual.tint { background: var(--accent-tint); }
.cell-visual.dark { background: #191c24; border-bottom-color: #191c24; }

/* --- visual: mini chat --- */
.mini-chat { width: 100%; max-width: 310px; display: flex; flex-direction: column; gap: .5rem; }
.mini-msg {
  font-size: .82rem; line-height: 1.4; padding: .48rem .75rem; border-radius: 12px;
  box-shadow: var(--shadow-sm); max-width: 88%;
}
.mini-msg.in { background: #fff; align-self: flex-start; border-bottom-left-radius: 3px; }
.mini-msg.out { background: #d9efdd; align-self: flex-end; border-bottom-right-radius: 3px; }

/* --- visual: flujo --- */
.flow { display: flex; align-items: center; gap: .35rem; width: 100%; justify-content: center; flex-wrap: wrap; }
.flow-node {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: .5rem .75rem; font-size: .78rem; font-weight: 600; text-align: center;
  box-shadow: var(--shadow-sm); line-height: 1.3;
}
.flow-node small { font-weight: 400; color: var(--ink-faint); font-size: .67rem; }
.flow-node.accent {
  background: var(--accent); color: #fff; border-color: var(--accent);
  font-family: var(--font-head); padding: .6rem .9rem;
}
.flow-node.sm { padding: .4rem .6rem; font-size: .73rem; }
.flow-link { width: 28px; height: 2px; background: #d5d6d0; position: relative; flex: none; }
.flow-link span {
  position: absolute; top: -2px; left: 0; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); animation: flow-dot 1.6s linear infinite;
}
@keyframes flow-dot { to { left: calc(100% - 6px); } }
.flow-split { display: flex; flex-direction: column; gap: .4rem; }

/* --- visual: docs --- */
.doc-search { width: 100%; max-width: 330px; display: flex; flex-direction: column; gap: .55rem; }
.doc-query {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-input);
  padding: .55rem .85rem; font-size: .84rem; box-shadow: var(--shadow-sm);
}
.doc-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.doc-chips span {
  background: var(--accent-tint); color: var(--accent-deep); border-radius: 999px;
  font-size: .7rem; padding: .18rem .6rem; font-weight: 500;
}
.doc-answer {
  background: #fff; border-left: 3px solid var(--accent); border-radius: 8px;
  padding: .6rem .85rem; font-size: .82rem; color: var(--ink-soft); box-shadow: var(--shadow-sm);
}

/* --- visual: visión --- */
.vision-frame {
  position: relative; width: 100%; max-width: 310px; aspect-ratio: 16 / 10;
  background: linear-gradient(150deg, #23262f, #30343f); border-radius: 12px; overflow: hidden;
}
.vision-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 24px 24px;
}
.vbox { position: absolute; border: 2px solid var(--accent-soft); border-radius: 4px; }
.vbox label {
  position: absolute; top: -1.3rem; left: -2px; background: var(--accent-soft); color: #0f2f4f;
  font-size: .63rem; font-weight: 700; padding: .05rem .4rem; border-radius: 3px;
  white-space: nowrap;
}
.vbox.warn { border-color: #e8b93c; }
.vbox.warn label { background: #e8b93c; color: #3d2f05; }
.vb-1 { left: 10%; top: 30%; width: 26%; height: 40%; }
.vb-2 { left: 44%; top: 42%; width: 22%; height: 34%; }
.vb-3 { left: 73%; top: 26%; width: 17%; height: 28%; }
.vision-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  animation: scan 3.2s ease-in-out infinite alternate;
}
@keyframes scan { to { top: calc(100% - 2px); } }

/* --- visual: roadmap --- */
.roadmap { display: flex; flex-direction: column; width: 100%; max-width: 345px; }
.rm-step {
  position: relative; padding: 0 0 1.1rem 1.5rem; font-size: .86rem; color: var(--ink-soft);
  display: flex; flex-direction: column;
}
.rm-step strong { font-size: .74rem; color: var(--ink-faint); font-weight: 600; }
.rm-step::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: -4px; width: 2px; background: var(--line);
}
.rm-step:last-child::before { display: none; }
.rm-dot {
  position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line);
}
.rm-step.done .rm-dot { background: var(--accent); border-color: var(--accent); }
.rm-step.active .rm-dot { border-color: var(--accent); }
.rm-step.active { color: var(--ink); }

/* ===== Proceso (línea de tiempo) ===== */
.section-proceso {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background:
    radial-gradient(760px 380px at 8% 0%, rgba(12, 116, 167, .05), transparent 60%),
    var(--surface);
}
.section-proceso .inner { max-width: 1180px; margin: 0 auto; padding: 5rem 1.25rem; }

.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; list-style: none; }
.tl-item { border-top: 2px solid var(--line); padding-top: 1.3rem; position: relative; }
.tl-item::before {
  content: ""; position: absolute; top: -2px; left: 0; width: 44px; height: 2px;
  background: var(--accent);
}
.tl-item h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: .5rem; }
.tl-item p { color: var(--ink-soft); font-size: .93rem; margin-bottom: .8rem; }
.tl-tag { font-size: .8rem; font-weight: 600; color: var(--accent-deep); }

/* ===== Contacto ===== */
#contacto { position: relative; }
#contacto::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 100vw; margin-left: -50vw; z-index: -1; pointer-events: none;
  background:
    radial-gradient(880px 480px at 78% 16%, rgba(12, 116, 167, .09), transparent 62%),
    radial-gradient(640px 400px at 12% 96%, rgba(95, 177, 221, .08), transparent 58%);
}
.contact-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 2.2rem; align-items: start; }

.lead-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 2rem; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 1.2rem;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; border: 0; }
.field label, .field legend { font-weight: 600; font-size: .89rem; padding: 0; }
.field input, .field textarea {
  font: inherit; font-size: .96rem; padding: .7rem .9rem; border-radius: var(--r-input);
  border: 1.5px solid #d4d5cf; background: #fff; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease; width: 100%;
}
.field input::placeholder, .field textarea::placeholder { color: #8a8f98; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(12, 116, 167, .14);
}
.field textarea { resize: vertical; }
fieldset.field { margin-top: .2rem; }
fieldset.field legend { margin-bottom: .55rem; }

.chip-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { cursor: pointer; position: relative; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: .5rem .95rem; border-radius: 999px; font-size: .87rem;
  font-weight: 500; border: 1.5px solid #d4d5cf; background: #fff; color: var(--ink-soft);
  transition: all .15s ease; user-select: none;
}
.chip:hover span { border-color: var(--ink-faint); }
.chip input:checked + span {
  background: var(--accent-tint); border-color: var(--accent); color: var(--accent-deep);
  font-weight: 600;
}
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(12, 116, 167, .25); }

.form-error {
  background: #fdf1f1; color: #a52626; border: 1px solid #f0c9c9; border-radius: var(--r-input);
  padding: .7rem 1rem; font-size: .9rem;
}
.form-fine { font-size: .8rem; color: var(--ink-faint); text-align: center; }

.expect {
  background: var(--accent-ink); color: #dde3f5;
  border-radius: var(--r-card); padding: 2rem; box-shadow: var(--shadow-md);
  position: sticky; top: 92px;
}
.expect h3 { font-size: 1.2rem; margin-bottom: 1.1rem; color: #fff; }
.expect ul { list-style: none; display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1.7rem; }
.expect li { padding-left: 1.7rem; position: relative; font-size: .94rem; color: #b9c3e4; }
.expect li strong { color: #fff; font-weight: 600; }
.expect li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent-soft); font-weight: 700;
}
.expect-alt { border-top: 1px solid rgba(255,255,255,.14); padding-top: 1.3rem; }
.expect-alt p { font-size: .9rem; margin-bottom: .7rem; color: #b9c3e4; }
.expect .btn-whatsapp { background: rgba(255,255,255,.06); border-color: rgba(74,222,128,.35); color: #7fe0a4; }
.expect .btn-whatsapp:hover { background: rgba(255,255,255,.12); }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 2.2rem 1.25rem; text-align: center; }
.footer-inner p { color: var(--ink-soft); font-size: .9rem; margin-top: .3rem; }
.footer-copy { color: var(--ink-faint); font-size: .8rem !important; }

/* ===== WhatsApp flotante ===== */
.wa-float {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%; background: var(--wa); color: #fff;
  display: grid; place-items: center; box-shadow: 0 10px 24px -6px rgba(31, 170, 83, .55);
  transition: transform .15s ease;
}
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 30px; height: 30px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 3rem; gap: 2.5rem; }
  .hero h1 { max-width: none; }
  .bento { grid-template-columns: 1fr; }
  .cell-feature { flex-direction: column; }
  .cell-feature .cell-visual { border-left: 0; border-bottom: 1px solid var(--line); order: -1; }
  .cell-feature .cell-body { padding: 1.5rem 1.6rem 1.7rem; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .expect { position: static; }
  .nav-links { display: none; }
}

@media (max-width: 540px) {
  .robot-peek { width: 118px; top: -52px; margin-left: -178px; }
  .timeline { grid-template-columns: 1fr; gap: 1.6rem; }
  .field-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.85rem; }
  .btn-lg { font-size: 1rem; }
  .section { padding: 3.4rem 1.1rem; }
  .section-proceso .inner { padding: 3.4rem 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
