/* ============================================================
   TEKNOBOT — Sistema de Diseño (2026)
   Moderno, simple, accesible. Soporta modo oscuro automático.
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Color: Brand (azul profundo) */
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-900: #1e3a8a;

  /* Color: Neutrals (cálidos) */
  --bg:           #ffffff;
  --bg-subtle:    #fafaf9;
  --bg-muted:     #f5f5f4;
  --bg-elevated:  #ffffff;
  --border:       #e7e5e4;
  --border-strong:#d6d3d1;
  --text:         #0c0a09;
  --text-muted:   #57534e;
  --text-subtle:  #78716c;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r:    10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 999px;

  /* Sombras (suaves, multicapa) */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04);
  --shadow:    0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.04), 0 16px 48px rgba(0,0,0,0.08);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 200ms;
  --dur-slow: 400ms;

  /* Tipografía */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Layout */
  --container: 1200px;
}

/* ---------- Dark Mode (auto + toggle manual) ---------- */
:root[data-theme="dark"] {
  --bg:           #0a0a0a;
  --bg-subtle:    #111111;
  --bg-muted:     #171717;
  --bg-elevated:  #1a1a1a;
  --border:       #262626;
  --border-strong:#404040;
  --text:         #fafaf9;
  --text-muted:   #a8a29e;
  --text-subtle:  #78716c;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.3);
  --shadow:    0 1px 2px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.4);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.3), 0 16px 48px rgba(0,0,0,0.5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #0a0a0a;
    --bg-subtle:    #111111;
    --bg-muted:     #171717;
    --bg-elevated:  #1a1a1a;
    --border:       #262626;
    --border-strong:#404040;
    --text:         #fafaf9;
    --text-muted:   #a8a29e;
    --text-subtle:  #78716c;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.3);
    --shadow:    0 1px 2px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.4);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.3), 0 16px 48px rgba(0,0,0,0.5);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-subtle);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  padding-bottom: 80px; /* espacio para que el FAB de WhatsApp no tape el contenido final */
}
img { max-width: 100%; display: block; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); font-weight: 800; }
h3 { font-size: 1.125rem; font-weight: 700; }

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
section { padding: 80px 0; }
@media (max-width: 600px) { section { padding: 50px 0; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r);
  font-family: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-align: center;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.btn-primary {
  background: var(--text); color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-secondary {
  background: var(--bg); color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--text); }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover { box-shadow: var(--shadow); }
.card-interactive { cursor: pointer; }
.card-interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  background: var(--bg-muted); color: var(--text-muted);
}
.badge-brand { background: var(--brand-50); color: var(--brand-700); }
:where([data-theme="dark"]) .badge-brand { background: rgba(59,130,246,0.15); color: var(--brand-200); }

/* ---------- Inputs ---------- */
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: inherit; font-size: 14px;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Animaciones de scroll ----------
   Por defecto los elementos son visibles (no-JS safe).
   Solo cuando JS agrega .js-anim al <html> se ocultan y animan al entrar. */
.js-anim .fade-in {
  opacity: 0; transform: translateY(16px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}
.js-anim .fade-in.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .js-anim .fade-in { opacity: 1; transform: none; transition: none; }
}

/* ---------- Toggle Dark Mode ---------- */
.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--r);
  background: var(--bg-muted); color: var(--text);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--dur) var(--ease);
}
.theme-toggle:hover { background: var(--bg); border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:where([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
:where([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }

/* ---------- Utilidades ---------- */
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.surface { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); }
