/* =========================================================
   Text2DB — Landing
   Sistema de diseño replicado de la app original
   (src/renderer/global.css, Logo.tsx, icon-light.svg)
   ========================================================= */

:root {
  /* Paleta de marca Text2DB (idéntica al repo) */
  --ink: #1b1e24;
  --ink-soft: #2b2f37;
  --dark: #16181c;
  --soft: #6f7884;
  --line: #d2d6db;
  --paper: #f5f6f7;
  --paper-2: #eceef1;
  --bg: #fafbfc;

  /* Neutros de UI usados en los componentes */
  --white: #ffffff;
  --n-50: #f9fafb;
  --n-100: #f3f4f6;
  --n-200: #e5e7eb;
  --n-300: #d1d5db;
  --n-400: #9ca3af;
  --n-500: #6b7280;
  --n-700: #374151;
  --n-800: #1f2937;

  /* Estados */
  --ok: #22c55e;
  --err: #dc2626;

  /* Code block (idéntico a Chat.tsx) */
  --code-bg: #1e1e2e;
  --code-fg: #cdd6f4;

  /* Sombras (las dos únicas del repo) */
  --sh-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --sh-lg: 0 10px 40px rgba(0, 0, 0, 0.2);

  --radius: 8px;
  --radius-sm: 6px;
  --maxw: 1120px;

  --font: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ----------------------- Brand / Wordmark ----------------------- */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand__tile {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
}
.wordmark {
  font-family: var(--font);
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
}
.wm-1 { font-weight: 500; }
.wm-2 { font-weight: 400; color: var(--soft); margin: 0 0.01em; }
.wm-3 { font-weight: 700; }

/* ----------------------- Buttons ----------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font); font-weight: 600; font-size: 0.9375rem;
  padding: 0.6rem 1.25rem; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn--sm { padding: 0.45rem 0.9rem; font-size: 0.875rem; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--ink-soft); box-shadow: var(--sh-sm); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--paper); }
.btn:active { transform: translateY(1px); }

/* ----------------------- Nav ----------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 251, 252, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--sh-sm); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.nav__links { display: flex; gap: 1.5rem; }
.nav__links a {
  font-size: 0.9rem; font-weight: 500; color: var(--n-500);
  transition: color 0.15s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__actions { display: flex; align-items: center; gap: 0.75rem; }

.lang-toggle {
  display: inline-flex; background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px; gap: 2px;
}
.lang-btn {
  font-family: var(--font); font-size: 0.78rem; font-weight: 600; color: var(--soft);
  background: transparent; border: none; cursor: pointer;
  padding: 0.25rem 0.6rem; border-radius: 999px; transition: all 0.15s ease;
}
.lang-btn.is-active { background: var(--ink); color: #fff; }

/* ----------------------- Hero ----------------------- */
.hero { padding: 4.5rem 0 3.5rem; }
.hero__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
.eyebrow {
  display: inline-block; font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--soft);
  background: var(--paper); border: 1px solid var(--line);
  padding: 0.25rem 0.6rem; border-radius: 999px; margin-bottom: 1.25rem;
}
.hero__copy h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.1rem); font-weight: 700; line-height: 1.08;
  letter-spacing: -0.02em; margin: 0 0 1rem;
}
.lead { font-size: 1.125rem; color: var(--n-700); margin: 0 0 1.75rem; max-width: 32ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero__note { margin-top: 1.25rem; font-size: 0.85rem; color: var(--soft); }

/* Mockup ventana de chat */
.mock {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--sh-lg); overflow: hidden;
}
.mock__bar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 0.9rem; background: var(--paper); border-bottom: 1px solid var(--line);
}
.dot { width: 10px; height: 10px; border-radius: 999px; background: var(--n-300); }
.mock__title {
  margin-left: 0.5rem; display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; color: var(--soft);
}
.mock__body { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.75rem; }

.badge {
  font-size: 0.66rem; font-weight: 600; color: #fff; padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
.badge--pg { background: #336791; }

.bubble {
  max-width: 88%; padding: 0.75rem 1rem; font-size: 0.9rem; line-height: 1.5;
  box-shadow: var(--sh-sm);
}
.bubble p { margin: 0 0 0.5rem; }
.bubble p:last-child { margin-bottom: 0; }
.bubble--user {
  align-self: flex-end; background: var(--ink); color: #fff;
  border-radius: 12px 12px 4px 12px;
}
.bubble--bot {
  align-self: flex-start; background: #fff; color: var(--n-800);
  border: 1px solid var(--n-200); border-radius: 12px 12px 12px 4px;
}

.steps { display: flex; gap: 0.4rem; align-self: flex-start; }
.step {
  font-family: var(--mono); font-size: 0.68rem; padding: 0.2rem 0.55rem;
  border-radius: 999px; background: var(--n-100); color: var(--n-400);
  border: 1px solid var(--n-200);
}
.step.is-done { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.step.is-active { background: var(--ink); color: #fff; border-color: var(--ink); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.sql {
  background: var(--code-bg); color: var(--code-fg); margin: 0.2rem 0 0.6rem;
  padding: 0.75rem; border-radius: var(--radius-sm); overflow-x: auto;
  font-family: var(--mono); font-size: 0.74rem; line-height: 1.45;
}
.sql code { font-family: inherit; }

.restable { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.restable th, .restable td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--n-200); }
.restable th { color: var(--soft); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; }
.restable td:last-child { font-family: var(--mono); }
.usage { margin-top: 0.6rem; font-family: var(--mono); font-size: 0.66rem; color: var(--n-400); }

/* ----------------------- Sections ----------------------- */
.section { padding: 5rem 0; }
.section--alt { background: var(--paper); }
.section__head { text-align: center; max-width: 46ch; margin: 0 auto 3rem; }
.section__head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
.section__head p { color: var(--n-500); font-size: 1.05rem; margin: 0; }
.section__head--light h2 { color: #fff; }
.section__head--light p { color: var(--n-400); }

.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

/* Feature cards */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--sh-sm); border-color: var(--n-300); }
.card__icon {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 1.1rem; color: var(--ink); margin-bottom: 1rem;
  font-family: var(--mono);
}
.card h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.4rem; }
.card p { color: var(--n-500); font-size: 0.92rem; margin: 0; }

/* How it works */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.stepcard {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem;
}
.stepcard__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px; background: var(--ink); color: #fff;
  font-weight: 700; font-size: 1rem; margin-bottom: 1rem;
}
.stepcard h3 { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.5rem; }
.stepcard p { color: var(--n-500); font-size: 0.95rem; margin: 0; }

/* Compatibility */
.compat {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem;
}
.compat__col h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--soft); margin: 0 0 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 500;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.85rem;
}
.chip__dot { width: 9px; height: 9px; border-radius: 999px; }

/* Security (dark) */
.section--dark { background: var(--dark); color: var(--paper); }
.seccard {
  background: var(--ink-soft); border: 1px solid #34383f; border-radius: var(--radius); padding: 1.5rem;
}
.seccard h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.5rem; color: #fff; }
.seccard p { color: #aab2bd; font-size: 0.92rem; margin: 0; }
.sec__privacy {
  text-align: center; margin: 2.5rem auto 0; max-width: 52ch; color: #cdd6f4;
  font-family: var(--mono); font-size: 0.95rem;
}

/* Download CTA */
.section--cta { background: var(--paper); text-align: center; }
.downloads { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.dlbtn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
  background: var(--ink); color: #fff; border-radius: var(--radius);
  padding: 1rem 1.5rem; min-width: 200px; text-align: left;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.dlbtn:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }
.dlbtn__os { font-weight: 700; font-size: 1.05rem; }
.dlbtn__file { font-family: var(--mono); font-size: 0.72rem; color: #aab2bd; }
.downloads__soon { margin-top: 1.5rem; color: var(--soft); font-size: 0.85rem; }

/* ----------------------- Footer ----------------------- */
.footer { background: var(--bg); border-top: 1px solid var(--line); padding: 2.5rem 0; }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; }
.footer__tag { color: var(--n-500); font-size: 0.95rem; margin: 0.25rem 0; }
.footer__legal { color: var(--soft); font-size: 0.82rem; margin: 0; }

/* ----------------------- Reveal on scroll ----------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ----------------------- Responsive ----------------------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .lead { max-width: none; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .nav__links { display: none; }
}

@media (max-width: 600px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .compat { grid-template-columns: 1fr; gap: 1.5rem; }
  .section { padding: 3.5rem 0; }
  .dlbtn { min-width: 100%; }
  .nav__actions { gap: 0.5rem; }
  .container { padding: 0 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .step.is-active { animation: none; }
}
