/* Textu · sitio público (textu.io). Tokens de DESIGN.md v1.0, dirección A "Mostrador".
   Claro por defecto; oscuro sigue al sistema (aquí no hay botón ni almacenamiento: el sitio no guarda nada). */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/onest-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: #F5F4F1;
  --surface: #FCFCFA;
  --surface-2: #EDECE7;
  --line: #DEDCD5;
  --line-strong: #C6C3BA;
  --text: #1C1D21;
  --text-2: #4F5057;
  --text-3: #66676E;
  --accent: #2E43C0;
  --accent-fill: #2E43C0;
  --accent-ink: #F8F8F5;
  --accent-soft: #E5E8F8;
  --bot: #8A5300;
  --bot-soft: #F7EAD2;
  --ok: #1D6B45;
  --ok-soft: #DFF0E6;
  --focus: #2E43C0;
  --shadow-float: 0 8px 24px -10px rgb(28 29 33 / .22), 0 2px 6px -2px rgb(28 29 33 / .10);
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Escala tipográfica del sitio: la del app (12 a 18) más tamaños de lectura y display con clamp(). */
  --fs-12: 0.75rem;
  --fs-13: 0.8125rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-20: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --fs-28: clamp(1.5rem, 1.2rem + 1.2vw, 1.75rem);
  --fs-40: clamp(1.875rem, 1.4rem + 2vw, 2.5rem);
  --fs-64: clamp(2.375rem, 1.5rem + 3.9vw, 4rem);

  /* Escala de espaciado: 4, 8, 12, 16, 24, 32, 48, 64, 96, 128 */
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141519; --surface: #1B1C21; --surface-2: #101115; --line: #2B2D34; --line-strong: #3A3D46;
    --text: #ECEBE6; --text-2: #B6B6BA; --text-3: #92939A;
    --accent: #93A2F5; --accent-fill: #4A5FD9; --accent-soft: #22274A;
    --bot: #E8B060; --bot-soft: #33270F;
    --ok: #7ACB9C; --ok-soft: #14301F; --focus: #93A2F5;
    --shadow-float: 0 8px 24px -10px rgb(0 0 0 / .5), 0 2px 6px -2px rgb(0 0 0 / .3);
  }
}

@media (min-width: 720px) { :root { --gutter: 32px; } }
@media (min-width: 1100px) { :root { --gutter: 48px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Onest", ui-sans-serif, sans-serif;
  font-size: var(--fs-16);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
svg { flex-shrink: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip { position: absolute; left: 16px; top: -64px; z-index: 10; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 700; font-size: var(--fs-18); letter-spacing: -0.01em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 15px; font-weight: 700; line-height: 1; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 6px;
  font: inherit; font-size: var(--fs-14); font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
.btn-primary { background: var(--accent-fill); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent-fill) 88%, var(--text)); }
.btn-quiet { border: 1px solid var(--line-strong); color: var(--text); background: var(--surface); }
.btn-quiet:hover { border-color: var(--text-3); }
.btn-lg { min-height: 48px; padding: 0 24px; font-size: var(--fs-16); }

/* ---------- Encabezado ---------- */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.site-nav { display: none; gap: 24px; margin-left: 24px; }
.site-nav a { color: var(--text-2); text-decoration: none; font-size: var(--fs-14); font-weight: 500; }
.site-nav a:hover { color: var(--text); }
.site-head .btn { margin-left: auto; min-height: 40px; }
@media (max-width: 719px) { .site-head .btn { min-height: 44px; } }
@media (min-width: 860px) { .site-nav { display: flex; } }

/* ---------- Hero ---------- */
.hero { padding-block: 48px 64px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero h1 { font-size: var(--fs-64); font-weight: 700; letter-spacing: -0.03em; line-height: 1.04; max-width: 12ch; }
.hero .lede { margin-top: 24px; font-size: var(--fs-20); color: var(--text-2); max-width: 36rem; line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 32px; }
.hero-actions .alt { color: var(--text-2); font-size: var(--fs-14); }
.hero-note { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--fs-13); max-width: 36rem; }
@media (min-width: 1000px) {
  .hero { padding-block: 96px 128px; }
  .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 64px; }
}

/* ---------- Muestra de conversación (hero) ---------- */
.stage { position: relative; margin: 0; }
.stage-bg {
  position: absolute; inset: -24px -16px; border-radius: 16px; z-index: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 16px 16px;
}
.thread {
  position: relative; z-index: 1;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-float);
  font-size: var(--fs-14); line-height: 1.45;
  overflow: hidden;
}
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: var(--fs-12); font-weight: 600; }
.who { min-width: 0; }
.who b { display: block; font-weight: 600; font-size: var(--fs-14); }
.who span { display: block; color: var(--text-3); font-size: var(--fs-12); }

.owner { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; margin-left: auto; padding: 2px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-2); font-size: var(--fs-12); font-weight: 600; }
.owner > .sr-only { position: absolute; }
.owner span:not(.sr-only) { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 10px; color: var(--text-3); }
.owner::before {
  content: ""; position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px);
  border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgb(28 29 33 / .12);
  transform: translateX(100%);
}
.owner .o-person { color: var(--accent); }

.msgs { display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 24px; background: var(--bg); }
.msg { max-width: 84%; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.msg p + .meta { margin-top: 4px; }
.msg .meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--text-3); font-size: var(--fs-12); }
.msg.out { align-self: flex-end; }
.msg.bot { background: var(--bot-soft); border-color: transparent; }
.msg.bot .tag { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--bot); font-size: var(--fs-12); font-weight: 600; }
.msg.person { background: var(--accent-soft); border-color: transparent; }
.msg.person .tag { margin-bottom: 4px; color: var(--accent); font-size: var(--fs-12); font-weight: 600; }
.msg .read { color: var(--accent); }
.msg.bot .meta, .msg.person .meta { color: var(--text-2); }
.msg .phone { display: inline-flex; align-items: center; gap: 4px; margin-right: auto; }
.event { align-self: center; color: var(--text-3); font-size: var(--fs-12); }

.thread-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--fs-12); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-12); font-weight: 500; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-ok::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.stage figcaption { position: relative; z-index: 1; margin-top: 16px; color: var(--text-3); font-size: var(--fs-13); }

/* Momento de movimiento: el chat se arma solo y el interruptor pasa de Bot a Persona. Solo transform y opacity. */
@media (prefers-reduced-motion: no-preference) {
  .msgs > * { opacity: 0; transform: translateY(6px); animation: rise 220ms var(--ease) forwards; }
  .msgs > :nth-child(1) { animation-delay: 300ms; }
  .msgs > :nth-child(2) { animation-delay: 800ms; }
  .msgs > :nth-child(3) { animation-delay: 1400ms; }
  .msgs > :nth-child(4) { animation-delay: 1900ms; }
  .msgs > :nth-child(5) { animation-delay: 2500ms; }
  .owner::before { transform: translateX(0); animation: handoff 220ms var(--ease) 1900ms forwards; }
  .owner .o-bot { color: var(--bot); animation: dim 1ms linear 1900ms forwards; }
  .owner .o-person { color: var(--text-3); animation: lit 1ms linear 1900ms forwards; }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes handoff { to { transform: translateX(100%); } }
@keyframes dim { to { color: var(--text-3); } }
@keyframes lit { to { color: var(--accent); } }

/* ---------- Secciones ---------- */
.section { padding-block: 64px; border-top: 1px solid var(--line); }
.section h2 { font-size: var(--fs-40); font-weight: 700; letter-spacing: -0.02em; max-width: 18ch; }
.section .intro { margin-top: 16px; color: var(--text-2); font-size: var(--fs-18); max-width: 36rem; }
@media (min-width: 1000px) { .section { padding-block: 96px; } }

/* Qué hace: filas con línea, sin tarjetas. Título a la izquierda, texto y detalle a la derecha. */
.features { list-style: none; margin: 48px 0 0; padding: 0; }
.feature { display: grid; gap: 12px; padding-block: 32px; border-top: 1px solid var(--line); }
.feature:last-child { border-bottom: 1px solid var(--line); }
.feature h3 { font-size: var(--fs-28); font-weight: 600; letter-spacing: -0.015em; max-width: 16ch; }
.feature p { color: var(--text-2); max-width: 38rem; }
.feature .detail { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-3); font-size: var(--fs-14); }
.feature .detail span { display: inline-flex; align-items: center; gap: 6px; }
.feature .detail svg { color: var(--text-2); }
@media (min-width: 900px) {
  .feature { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; padding-block: 48px; }
  .feature .body { padding-top: 4px; }
}

/* Para quién: dos columnas de texto. */
.audience { display: grid; gap: 32px; margin-top: 48px; }
.audience h3 { font-size: var(--fs-20); font-weight: 600; }
.audience p { margin-top: 8px; color: var(--text-2); max-width: 34rem; }
@media (min-width: 900px) { .audience { grid-template-columns: 1fr 1fr; gap: 64px; } }

/* Cómo empiezas: lista de pasos con puntos unidos por una línea (componente de conexión del app). */
.split { display: grid; gap: 48px; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; } }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; padding: 0 0 32px 40px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 999px;
  border: 2px solid var(--accent); background: var(--surface);
}
.steps li::after { content: ""; position: absolute; left: 10px; top: 28px; bottom: 6px; width: 1px; background: var(--line-strong); }
.steps li:last-child::after { display: none; }
.steps h3 { font-size: var(--fs-18); font-weight: 600; line-height: 1.35; }
.steps p { margin-top: 4px; color: var(--text-2); max-width: 34rem; }

/* Precios y contacto */
.closing { display: grid; gap: 48px; }
.closing h2 { max-width: 14ch; }
.closing .label { font-size: var(--fs-18); font-weight: 600; }
.closing .mail { display: inline-block; margin-top: 24px; font-size: var(--fs-28); font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.closing .fine { margin-top: 12px; color: var(--text-3); font-size: var(--fs-14); }
@media (min-width: 900px) { .closing { grid-template-columns: 1fr 1fr; gap: 64px; } }

/* ---------- Pie ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--surface-2); padding-block: 48px 32px; font-size: var(--fs-14); }
.foot-grid { display: grid; gap: 32px; }
.foot-grid h2 { font-size: var(--fs-13); font-weight: 600; color: var(--text-3); margin-bottom: 12px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.foot-grid a { color: var(--text); text-decoration: none; display: inline-block; padding-block: 6px; }
.foot-grid a:hover { color: var(--accent); text-decoration: underline; }
.foot-grid a.brand { display: inline-flex; padding-block: 0; }
.foot-grid a.brand:hover { color: var(--text); text-decoration: none; }
.foot-about a:not(.brand) { color: var(--accent); }
.foot-about p { margin-top: 12px; color: var(--text-2); max-width: 28rem; }
.foot-base { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--text-3); font-size: var(--fs-13); }
.foot-grid { grid-template-columns: 1fr 1fr; }
.foot-about { grid-column: 1 / -1; }
@media (min-width: 720px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } .foot-about { grid-column: auto; } }

/* ---------- Páginas legales ---------- */
.doc { padding-block: 48px 96px; }
.doc-grid { display: grid; gap: 32px; }
.doc-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-14); text-decoration: none; }
.doc-back:hover { color: var(--text); }
.doc-head h1 { margin-top: 16px; font-size: var(--fs-40); font-weight: 700; letter-spacing: -0.02em; max-width: 22ch; }
.doc-head .updated { margin-top: 12px; color: var(--text-3); font-size: var(--fs-14); }
.doc-alt { margin-top: 12px; font-size: var(--fs-14); color: var(--text-2); }
.prose { max-width: 70ch; font-size: var(--fs-16); line-height: 1.65; }
.prose > * + * { margin-top: 16px; }
.prose h2 { margin-top: 48px; font-size: var(--fs-28); font-weight: 600; letter-spacing: -0.01em; scroll-margin-top: 24px; }
.prose h3 { margin-top: 32px; font-size: var(--fs-20); font-weight: 600; scroll-margin-top: 24px; }
.prose h4 { margin-top: 24px; font-size: var(--fs-16); font-weight: 600; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 6px; }
.prose li > ul, .prose li > ol { margin-top: 6px; }
.prose blockquote { margin-inline: 0; padding: 12px 16px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 32px; }
.prose code { font-family: ui-monospace, "JetBrains Mono", monospace; font-size: 0.875em; padding: 1px 4px; border-radius: 4px; background: var(--surface-2); }
.prose .table { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.pending { max-width: 70ch; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pending h2 { font-size: var(--fs-20); font-weight: 600; }
.pending p { margin-top: 8px; color: var(--text-2); }
.toc { font-size: var(--fs-14); }
.toc h2 { font-size: var(--fs-13); font-weight: 600; color: var(--text-3); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: inline-block; padding-block: 4px; color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--accent); }
@media (max-width: 1099px) { .toc { display: none; } }
@media (min-width: 1100px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr) 240px; gap: 64px; }
  .toc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.prose .a-center { text-align: center; }
.prose .a-right { text-align: right; }
