/* ============================================================
   Kai Strategy Lab — hoja de estilos corporativa
   Sistema visual "Kai claro": fondo slate-50 con gradientes
   radiales teal/azul, tarjetas blancas, acento teal-700.
   CSS propio (sin frameworks) para carga rápida y CWV altos.
   ============================================================ */

:root {
  /* Fondos */
  --bg-page: #f8fafc;
  --bg-section: #f1f5f9;
  --bg-card: #ffffff;
  --bg-accent-soft: #f0fdfa;

  /* Texto */
  --text-heading: #020617;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-soft: #94a3b8;

  /* Bordes */
  --border-soft: #e2e8f0;
  --border-subtle: #f1f5f9;

  /* Primario teal */
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #14b8a6;
  --primary-soft: #ccfbf1;
  --primary-bg: #f0fdfa;

  /* Acentos */
  --accent-blue: #2563eb;
  --accent-blue-soft: #dbeafe;
  --accent-green: #059669;
  --accent-green-soft: #d1fae5;
  --accent-amber: #d97706;
  --accent-amber-soft: #fef3c7;

  /* Footer oscuro */
  --dark: #0f172a;
  --dark-2: #1e293b;

  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, 0.14);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.10), transparent 28%),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 26%),
    var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

::selection { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- Accesibilidad ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--primary); color: #fff; padding: 10px 18px;
  border-radius: 0 0 12px 0; font-weight: 600; font-size: 0.9rem;
}
.skip-link:focus { left: 0; color: #fff; }

:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Tipografía ---------- */
h1, h2, h3, .display { font-family: var(--font-display); color: var(--text-heading); }

h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--text-main);
  text-wrap: balance;
}

h3 {
  font-size: 1.2rem;
  line-height: 1.3;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.01em;
}

p { color: var(--text-secondary); text-wrap: pretty; }

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--text-secondary);
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary);
  margin-bottom: 14px;
}

.accent { color: var(--primary); }

/* ---------- Layout ---------- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 72px 0; }
.section-tight { padding: 56px 0; }

.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head p { margin-top: 14px; font-size: 1.06rem; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

/* La cabecera respira más ancho que el cuerpo (el nav trilingüe no cabe en 1180px) */
.site-header .container { max-width: 1400px; }

.nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 20px;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.06rem; letter-spacing: -0.02em;
  color: var(--text-main);
  white-space: nowrap;
}
.brand:hover { color: var(--text-main); }
.brand svg { width: 32px; height: 32px; flex-shrink: 0; }

.nav-links { display: flex; align-items: center; gap: 15px; list-style: none; }
.nav-links a {
  font-size: 0.88rem; font-weight: 500; color: var(--text-secondary);
  transition: color 0.2s ease;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--primary); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff !important;
  padding: 9px 15px; border-radius: 12px;
  font-size: 0.88rem; font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}
.nav-cta:hover { background: var(--primary-dark); transform: translateY(-1px); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 8px; cursor: pointer; color: var(--text-main);
}

/* ---------- Selector de idioma (bandera actual + desplegable) ---------- */
.lang-switch { position: relative; display: flex; align-items: center; }
.lang-current {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--border-soft); background: #fff;
  font-family: var(--font-body); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--text-secondary); cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.lang-current:hover { color: var(--primary-dark); border-color: var(--primary-light); }
.lang-current svg:not(.chev), .lang-menu svg {
  width: 20px; height: 13.5px; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.10);
  flex-shrink: 0;
}
.lang-current .chev { width: 13px; height: 13px; color: var(--text-soft); transition: transform 0.2s ease; }
.lang-current[aria-expanded="true"] .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--border-soft); border-radius: 12px;
  box-shadow: var(--shadow-md); min-width: 200px;
  display: grid; gap: 2px;
}
.lang-menu[hidden] { display: none; }
.lang-menu li { border: none; }
.lang-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 0.88rem; font-weight: 500; color: var(--text-main); white-space: nowrap;
}
.lang-menu a:hover { background: var(--primary-bg); color: var(--primary-dark); }

@media (max-width: 1240px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border-soft);
    padding: 10px 24px 18px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border-subtle); }
  .nav-links li:last-child { border-bottom: none; padding-top: 12px; }
  .nav-links a { display: block; padding: 13px 2px; font-size: 1rem; }
  .nav-cta { justify-content: center; }
  /* Dentro del menú móvil el desplegable de idioma se expande en línea */
  .nav-links .lang-switch { border-bottom: none; padding: 14px 0 4px; display: block; }
  .nav-links .lang-current { padding: 8px 12px; font-size: 0.8rem; }
  .nav-links .lang-menu {
    position: static; box-shadow: none; margin-top: 8px;
    border-color: var(--border-subtle); min-width: 0;
  }
  .nav-links .lang-menu a { display: flex; padding: 11px 12px; font-size: 0.95rem; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border-radius: 13px;
  font-family: var(--font-body); font-size: 0.97rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn svg { width: 17px; height: 17px; transition: transform 0.2s ease; }
.btn:hover svg { transform: translateX(3px); }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 18px -8px rgba(15, 118, 110, 0.55); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }

.btn-ghost { background: #fff; color: var(--text-main); border-color: var(--border-soft); }
.btn-ghost:hover { border-color: var(--primary-light); color: var(--primary-dark); transform: translateY(-1px); }

.btn-light { background: #fff; color: var(--primary-dark); }
.btn-light:hover { background: var(--primary-bg); color: var(--primary-dark); transform: translateY(-1px); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 12px;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em;
}
.badge-teal { background: var(--primary-bg); color: var(--primary); border: 1px solid #99f6e4; }
.badge-green { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-slate { background: #f1f5f9; color: #475569; border: 1px solid var(--border-soft); }
.badge-amber { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

.dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.card-lg { border-radius: var(--radius-lg); padding: 36px; border-color: var(--border-soft); }

.card-hover { transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease; }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #cbd5e1; }

.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.95rem; }

.icon-tile {
  width: 42px; height: 42px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px; flex-shrink: 0;
}
.icon-tile svg { width: 21px; height: 21px; }
.tile-teal { background: var(--primary-bg); color: var(--primary); }
.tile-blue { background: #eff6ff; color: var(--accent-blue); }
.tile-green { background: #ecfdf5; color: var(--accent-green); }
.tile-amber { background: #fffbeb; color: var(--accent-amber); }
.tile-slate { background: #f1f5f9; color: var(--text-secondary); }

.num {
  font-family: var(--font-display);
  font-size: 0.85rem; font-weight: 800; letter-spacing: 0.08em;
  color: var(--primary);
}

/* ---------- Hero ---------- */
.hero { padding: 84px 0 72px; position: relative; overflow: hidden; }
.hero-inner { max-width: 830px; position: relative; }
.hero h1 { margin: 18px 0 22px; }
.hero .lead { max-width: 640px; }

.hero-tags {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  margin: 26px 0 30px;
  font-size: 0.9rem; font-weight: 600; color: var(--text-muted);
}
.hero-tags span { display: inline-flex; align-items: center; gap: 8px; }
.hero-tags .dot { background: var(--primary-light); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.hero-note { font-size: 0.9rem; color: var(--text-muted); max-width: 560px; }

.hero-orbit {
  position: absolute; right: -140px; top: -60px;
  width: 520px; height: 520px; opacity: 0.55; pointer-events: none;
}
@media (max-width: 1080px) { .hero-orbit { display: none; } }

/* ---------- Panel / bloques ---------- */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 40px;
}
@media (max-width: 640px) { .panel { padding: 26px; } .card { padding: 22px; } .card-lg { padding: 26px; } }

.check-row { display: flex; gap: 14px; align-items: flex-start; }
.check-row svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; margin-top: 3px; }
.check-row h3 { font-size: 1.02rem; margin-bottom: 4px; }
.check-row p { font-size: 0.92rem; }

/* ---------- Chips de portafolio ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #f8fafc; border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  border-radius: 999px; padding: 6px 13px;
  font-size: 0.83rem; font-weight: 500;
}
.chip strong { color: var(--text-main); font-weight: 600; }

/* ---------- Banda CTA ---------- */
.cta-band {
  background: linear-gradient(120deg, #0f766e 0%, #0d9488 55%, #115e59 100%);
  border-radius: var(--radius-lg);
  padding: 52px 48px;
  color: #fff;
  position: relative; overflow: hidden;
}
.cta-band::after {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 340px; height: 340px; border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 65%);
}
.cta-band h2 { color: #fff; max-width: 720px; position: relative; }
.cta-band p { color: #ccfbf1; margin-top: 14px; max-width: 640px; position: relative; }
.cta-band .actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; position: relative; }
.cta-band .note { font-size: 0.88rem; color: #99f6e4; }
.cta-band a.mail { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .cta-band { padding: 34px 26px; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dark);
  color: #cbd5e1;
  margin-top: 88px;
  padding: 56px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
@media (max-width: 920px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand .brand { color: #f8fafc; margin-bottom: 14px; }
.footer-brand p { color: #94a3b8; font-size: 0.9rem; max-width: 300px; }

.site-footer h4 {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: #5eead4; margin-bottom: 16px;
}
.site-footer ul { list-style: none; display: grid; gap: 10px; }
.site-footer ul a { color: #cbd5e1; font-size: 0.92rem; }
.site-footer ul a:hover { color: #5eead4; }

.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px; padding-top: 26px;
  font-size: 0.85rem; color: #94a3b8;
}
.footer-bottom a { color: #94a3b8; }
.footer-bottom a:hover { color: #5eead4; }
.footer-motto { font-weight: 600; color: #e2e8f0; letter-spacing: 0.01em; }

/* ---------- Página legal ---------- */
.legal-main { max-width: 780px; margin: 0 auto; padding: 56px 24px 40px; }
.legal-main h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin: 10px 0 8px; }
.legal-updated { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 34px; }
.legal-courtesy {
  font-size: 0.9rem; color: var(--text-muted); font-style: italic;
  background: var(--bg-section); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 10px 16px; margin: -20px 0 30px;
}
.legal-main h2 { font-size: 1.25rem; margin: 34px 0 10px; }
.legal-main p, .legal-main li { font-size: 0.98rem; color: var(--text-secondary); margin-bottom: 12px; }
.legal-main ul { padding-left: 22px; }
.legal-nav {
  margin: 48px auto 0; max-width: 780px; padding: 22px 24px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 0.9rem; color: var(--text-muted);
}
.legal-nav p { margin-bottom: 10px; }

/* ---------- Animaciones ---------- */
.fade-in { opacity: 0; transform: translateY(10px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; transition: none; }
  .btn, .card-hover, .nav-cta { transition: none; }
}

/* ---------- Utilidades ----------
   Con !important: las páginas de herramientas cargan Tailwind CDN después de esta
   hoja y define clases homónimas (.mt-2, .mb-3…) con otros valores. */
.mt-1 { margin-top: 8px !important; } .mt-2 { margin-top: 16px !important; } .mt-3 { margin-top: 24px !important; } .mt-4 { margin-top: 36px !important; }
.mb-2 { margin-bottom: 16px !important; } .mb-3 { margin-bottom: 24px !important; }
.small { font-size: 0.88rem; color: var(--text-muted); }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border-soft), transparent); margin: 8px 0; }
.arrow-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 0.95rem; color: var(--primary);
}
.arrow-link svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.arrow-link:hover svg { transform: translateX(3px); }
