/* ══════════════════════════════════════════════════════════════════
   LeanNodes · Mejora continua — hoja de estilos
   Cambia la identidad visual editando solo los tokens de :root.
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* Marca */
  /* Paleta tomada del logo LeanNodes */
  --brand:        #0d6f7c;   /* turquesa profundo: confianza, tecnología */
  --brand-strong: #0a5862;
  --brand-soft:   #e1f3f5;
  --accent:       #f7892f;   /* naranja del pico: acción, crecimiento */
  --accent-soft:  #fff0e3;
  --magenta:      #d6336c;
  --blue:         #2f6fd6;
  --grad-warm:    linear-gradient(100deg, #f7892f 0%, #d6336c 100%);
  --grad-cool:    linear-gradient(100deg, #14a3b3 0%, #2f6fd6 100%);

  /* Neutros */
  --ink:      #1b2440;   /* azul marino del texto del logo */
  --ink-2:    #4a5470;
  --ink-3:    #6c7590;
  --line:     #e1e5ee;
  --bg:       #ffffff;
  --bg-tint:  #f6f7fb;
  --bg-dark:  #121a2e;

  /* Estados */
  --danger: #b42318;

  /* Tipografía y ritmo */
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(27, 36, 64, .06), 0 8px 24px rgba(27, 36, 64, .06);
  --shadow-lg: 0 2px 4px rgba(27, 36, 64, .06), 0 18px 40px rgba(27, 36, 64, .10);
  --container: 1140px;
  --header-h: 72px;
}

/* ── Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--brand); }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.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-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 8px;
  text-decoration: none; font-weight: 600; transition: top .2s;
}
.skip-link:focus { top: 12px; }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.container-narrow { --container: 780px; }

/* ── Botones ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 24px;
  border: 2px solid transparent; border-radius: 999px;
  font: 700 1rem/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(13, 111, 124, .25); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-light { background: var(--accent); color: var(--ink); }
.btn-light:hover { background: #f9a25c; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: .9375rem; }
.btn-block { width: 100%; }

/* ── Encabezado ───────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 4px 20px rgba(27, 36, 64, .05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em;
}
.brand-mark { width: 36px; height: 36px; }
.brand-2 { background: var(--grad-cool); -webkit-background-clip: text; background-clip: text; color: transparent; }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav ul { display: flex; gap: 26px; }
.main-nav ul a {
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .9375rem;
  padding: 6px 0; position: relative;
}
.main-nav ul a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .2s;
}
.main-nav ul a:hover, .main-nav ul a.is-active { color: var(--ink); }
.main-nav ul a:hover::after, .main-nav ul a.is-active::after { transform: scaleX(1); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  border-radius: 10px; position: relative;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 11px; width: 22px; height: 2px; background: var(--ink);
  border-radius: 2px; transition: transform .25s, opacity .2s;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { content: ""; top: -7px; left: 0; }
.nav-toggle-bar::after { content: ""; top: 7px; left: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px);
  background:
    radial-gradient(60% 60% at 85% 20%, var(--brand-soft) 0%, transparent 70%),
    radial-gradient(40% 40% at 10% 90%, var(--accent-soft) 0%, transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-block; margin-bottom: 14px;
  font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand);
}
.hl { background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 24px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink-2); font-size: .9375rem; font-weight: 500; }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points li::before {
  content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d6f7c' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.hero-visual { margin: 0; justify-self: center; width: min(100%, 420px); }
.hero-visual svg { width: 100%; height: auto; overflow: visible; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 18; }
.seg { fill: none; stroke-width: 18; stroke-linecap: round; }
.seg-1 { stroke: var(--accent); }
.seg-2 { stroke: var(--magenta); }
.seg-3 { stroke: #14a3b3; }
.seg-4 { stroke: var(--blue); }
.seg { stroke-dasharray: 236; stroke-dashoffset: 236; animation: draw .7s ease-out forwards; }
.seg-2 { animation-delay: .25s; }
.seg-3 { animation-delay: .5s; }
.seg-4 { animation-delay: .75s; }
.node { fill: #fff; stroke: var(--line); stroke-width: 2; filter: drop-shadow(0 6px 12px rgba(27,36,64,.10)); }
.ring-labels text { text-anchor: middle; font-family: var(--font); font-weight: 800; font-size: 22px; fill: var(--brand); }
.ring-labels text.sm { font-size: 12px; font-weight: 600; fill: var(--ink-2); }
.center-t { text-anchor: middle; font-family: var(--font); font-weight: 800; font-size: 24px; fill: var(--ink); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ── Secciones ────────────────────────────────────────────────────── */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-tint { background: var(--bg-tint); }
.section-head { max-width: 680px; margin: 0 auto 48px; text-align: center; }
.section-sub { color: var(--ink-2); font-size: 1.1rem; margin: 0; }

/* Problemas */
.pain-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.pain {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px;
}
.pain-ico {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px;
  border-radius: 12px; background: var(--accent-soft); color: #b4501a; font-size: 1.3rem; font-weight: 700;
}
.pain p { color: var(--ink-2); font-size: .975rem; margin: 0; }

/* Servicios */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-ico {
  width: 52px; height: 52px; margin-bottom: 20px; border-radius: 14px;
  display: grid; place-items: center; background: var(--brand-soft);
}
.card-ico svg {
  width: 26px; height: 26px; fill: none; stroke: var(--brand);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.card p { color: var(--ink-2); }
.card-out {
  margin: auto 0 0; padding-top: 16px; border-top: 1px dashed var(--line);
  font-size: .9375rem;
}
.card-out strong { color: var(--ink); }

/* Tecnología */
.section-dark { background: var(--bg-dark); color: #e7eaf3; }
.section-dark h2, .section-dark h3 { color: #fff; }
.eyebrow-light { color: var(--accent); }
.lead-light { font-size: 1.15rem; color: #b8c0d6; margin-bottom: 28px; }
.lead-light strong { color: #fff; }
.tec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.tec-list { display: grid; gap: 14px; }
.tec-list li {
  padding: 20px 22px 20px 58px; position: relative;
  border: 1px solid rgba(255, 255, 255, .10); border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
}
.tec-list li::before {
  content: ""; position: absolute; left: 22px; top: 24px; width: 20px; height: 20px; border-radius: 6px;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314211d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.tec-list h3 { font-size: 1.05rem; margin-bottom: 4px; }
.tec-list p { margin: 0; color: #b8c0d6; font-size: .975rem; }

/* Método */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; position: relative; }
.steps::before {
  content: ""; position: absolute; top: 27px; left: 12%; right: 12%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 14px);
}
.step { position: relative; text-align: center; padding: 0 8px; }
.step-num {
  position: relative; display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 18px;
  border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 1.25rem;
  box-shadow: 0 0 0 8px var(--bg);
}
.step p { color: var(--ink-2); font-size: .975rem; }

/* Por qué */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.why-grid li { padding: 24px; border-left: 3px solid var(--brand); background: var(--bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.why-grid p { margin: 0; color: var(--ink-2); font-size: .975rem; }

/* Preguntas */
.faq { display: grid; gap: 12px; }
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
}
.faq details[open] { border-color: var(--brand); box-shadow: var(--shadow); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 56px 20px 22px; position: relative;
  font-weight: 700; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-size: 1.2rem; font-weight: 700; transition: transform .2s;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 22px 20px; margin: 0; color: var(--ink-2); }

/* Contacto */
.section-cta { background: linear-gradient(180deg, var(--bg-tint), var(--brand-soft)); }
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.contact-copy p { color: var(--ink-2); font-size: 1.1rem; }
.contact-alt { display: grid; gap: 10px; margin-top: 24px; }
.contact-alt a { font-weight: 700; text-decoration: none; }
.contact-alt a:hover { text-decoration: underline; }
.contact-alt a::before { content: "→ "; }

.contact-form {
  background: var(--bg); border-radius: 20px; padding: clamp(24px, 4vw, 36px);
  box-shadow: var(--shadow-lg); display: grid; gap: 18px;
}
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9375rem; }
.opt { color: var(--ink-3); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #c5d1cc; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(13, 111, 124, .14);
}
.field.has-error input { border-color: var(--danger); }
.field-error { margin: 0; min-height: 0; color: var(--danger); font-size: .875rem; font-weight: 500; }
.field-error:empty { display: none; }
.form-note { margin: -4px 0 0; text-align: center; color: var(--ink-3); font-size: .875rem; }
.form-status { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: .9375rem; }
.form-status.is-ok { background: #e6f6ec; color: #17633a; }
.form-status.is-error { background: #fdecea; color: var(--danger); }
.btn:disabled { opacity: .7; cursor: progress; transform: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink-2); cursor: pointer; line-height: 1.5; }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; margin: 2px 0 0; accent-color: var(--brand); cursor: pointer; }
.field-check.has-error .check { color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Pie */
.site-footer { background: var(--bg-dark); color: #b8c0d6; padding: 48px 0 32px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 24px 48px; align-items: center; }
.brand-footer { color: #fff; }
.brand-footer .brand-2 { background: none; color: #5cc8d4; }
.footer-tag { margin: 8px 0 0; font-size: .9375rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a { color: #e7eaf3; text-decoration: none; font-weight: 600; font-size: .9375rem; }
.footer-nav a:hover { color: var(--accent); }
.copy { grid-column: 1 / -1; margin: 16px 0 0; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); font-size: .875rem; }

/* ── Aparición al hacer scroll ────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .pain-grid, .why-grid { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .steps::before { display: none; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 12px 16px 20px; background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(27, 36, 64, .08);
    display: none;
  }
  .main-nav.is-open { display: flex; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav ul a { display: block; padding: 14px 4px; border-bottom: 1px solid var(--line); }
  .main-nav ul a::after { display: none; }
  .main-nav .btn { margin-top: 8px; min-height: 48px; }

  .hero-grid, .tec-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-visual { width: min(80%, 300px); }
  .tec-grid, .contact-grid { gap: 36px; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .pain-grid, .why-grid, .cards, .steps { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .section-head { text-align: left; margin-bottom: 32px; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .seg { stroke-dashoffset: 0; }
}

/* ── Páginas legales ──────────────────────────────────────────────── */
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.legal h2 { font-size: 1.25rem; margin: 2.2em 0 .6em; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { list-style: disc; padding-left: 1.3em; margin: 0 0 1em; display: grid; gap: 6px; }
.legal-meta { font-size: .9375rem; color: var(--ink-3); padding-bottom: 24px; border-bottom: 1px solid var(--line); }
