/* BlancoLab · sistema de diseño (Fase 6). Paleta B: tinta, azul, ámbar solo para lo importante. */
:root {
  --ink: #0f172a;
  --blue: #0369a1;
  --sky: #38bdf8;
  --amber: #f59e0b;
  --paper: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --link: #0369a1;
  --band: #0f172a;
  --band-text: #f1f5f9;
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 10px;
  --focus: #0f172a;
  --field-line: #64748b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f172a;
    --card: #162033;
    --line: #26334a;
    --text: #f1f5f9;
    --muted: #a3b1c6;
    --link: #38bdf8;
    --band: #0b1324;
    --focus: #f59e0b;
    --field-line: #94a3b8;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 17px/1.6 var(--body);
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.375rem; font-weight: 500; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.prose { max-width: 68ch; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--amber); color: var(--ink); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }

/* Botones */
.btn {
  display: inline-block; font-family: var(--display); font-weight: 700; font-size: 1rem;
  padding: 12px 18px; border-radius: var(--radius); text-decoration: none; border: 2px solid transparent;
  min-height: 48px; line-height: 1.4;
}
.btn-accent { background: var(--amber); color: var(--ink); }
.btn-accent:hover { background: #fbbf24; }
.btn-line { border-color: currentColor; color: var(--link); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 8px; }

/* Encabezado */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.4rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: var(--link); }
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { color: var(--link); text-decoration: underline; }
.site-nav .lang { font-family: var(--display); border: 1px solid var(--line); padding: 4px 8px; border-radius: 6px; }
.menu-toggle { display: none; font: 600 1rem var(--display); background: none; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; min-height: 44px; }
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 16px 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn):not(.lang) { padding: 10px 0; width: 100%; }
  .site-nav .lang { margin: 8px 0; }
}

/* Secciones */
section { padding: 72px 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { max-width: 68ch; margin-bottom: 32px; }

/* Portada con el gráfico de la brecha */
.hero { padding: 56px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.trust-line { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 0.95rem; }
.trust-line li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sky); margin-right: 8px; vertical-align: middle; }
.gap-chart { margin: 0; padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.gap-row { margin-bottom: 20px; }
.gap-label { display: flex; justify-content: space-between; font-family: var(--display); font-weight: 500; margin-bottom: 6px; }
.gap-track { position: relative; height: 22px; background: var(--line); border-radius: 6px; overflow: hidden; }
.gap-bar { position: absolute; inset: 0 auto 0 0; border-radius: 6px; animation: grow 1.1s ease-out both; }
.gap-bar.use { width: 86%; background: var(--blue); }
.gap-bar.gain { width: 28%; background: var(--ink); }
@media (prefers-color-scheme: dark) { .gap-bar.gain { background: var(--sky); } }
.gap-bar.gap {
  left: 28%; width: 58%; background: repeating-linear-gradient(135deg, var(--amber) 0 8px, #fcd34d 8px 14px);
  animation-delay: 0.9s;
}
.gap-note { display: flex; align-items: center; gap: 10px; margin: 8px 0 18px; font-weight: 600; }
.gap-note::before { content: ""; width: 22px; height: 12px; border-radius: 3px; background: var(--amber); flex: none; }
.gap-chart figcaption { color: var(--muted); font-size: 0.95rem; }
@keyframes grow { from { width: 0; } }

/* Logos */
.logos { padding: 32px 0; }
.logos p { color: var(--muted); margin-bottom: 16px; }
.logo-row { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.logo-row img { height: 72px; width: auto; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }

/* Servicios por grupo */
.groups { display: grid; gap: 0; }
.group { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.group h3 { margin: 0; }
.group p { margin: 0; max-width: 60ch; }

/* Casos como filas */
.cases { list-style: none; padding: 0; margin: 0; }
.case { display: grid; grid-template-columns: 280px 1fr auto; gap: 24px; align-items: baseline; padding: 24px 0; border-top: 1px solid var(--line); }
.case-name { font-family: var(--display); font-weight: 700; font-size: 1.375rem; margin: 0; }
.case-kind { display: block; font-family: var(--body); font-weight: 400; font-size: 0.95rem; color: var(--muted); }
.case p { margin: 0; max-width: 60ch; }
.case a.more { white-space: nowrap; font-weight: 600; }

/* Proceso numerado (es una secuencia real) */
.steps { list-style: none; counter-reset: paso; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.steps li { counter-increment: paso; }
.steps li::before { content: counter(paso); display: block; font: 700 2.5rem/1 var(--display); color: var(--blue); margin-bottom: 12px; }
@media (prefers-color-scheme: dark) { .steps li::before { color: var(--sky); } }
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); }

/* Banda de confianza */
.band { background: var(--band); color: var(--band-text); border: 0; }
section.band + section { border-top: 0; }
.band h2 { color: #fff; }
.band p { color: #cbd5e1; max-width: 64ch; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; max-width: 820px; }
.modes div { border-left: 3px solid var(--amber); padding-left: 16px; }
.modes h3 { color: #fff; margin-bottom: 4px; }

/* Quién está detrás */
.about { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; }

/* Preguntas frecuentes */
.faq details { border-top: 1px solid var(--line); padding: 16px 0; max-width: 800px; }
.faq summary { cursor: pointer; font-family: var(--display); font-weight: 500; font-size: 1.15rem; list-style-position: outside; }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* Contacto */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; }
form.contact { display: grid; gap: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--field-line); border-radius: 8px; padding: 12px; min-height: 48px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field .error { color: #b91c1c; font-size: 0.95rem; margin: 6px 0 0; }
@media (prefers-color-scheme: dark) { .field .error { color: #fca5a5; } }
.form-note { font-size: 0.95rem; color: var(--muted); }
.form-status { font-weight: 600; min-height: 1.6em; }
.hp { position: absolute; left: -9999px; }

/* Pie */
.site-footer { background: var(--band); color: #cbd5e1; padding: 56px 0 24px; margin-top: 0; }
.site-footer a { color: #e2e8f0; }
.site-footer h2 { font-size: 1rem; color: #fff; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.brand-footer { color: #fff; }
.brand-footer span { color: var(--sky); }
.site-footer .muted { color: #94a3b8; }
.legal { border-top: 1px solid #26334a; margin-top: 40px; padding-top: 20px; font-size: 0.85rem; color: #94a3b8; }

/* Botón flotante de WhatsApp: solo ícono (decisión de Pedro); el texto queda para lectores de pantalla */
.wa-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 9; display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%; background: var(--ink); color: #fff; text-decoration: none;
  font-size: 0; box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
}
.wa-icon { flex: none; width: 30px; height: 30px; }
@media (prefers-color-scheme: dark) { .wa-float { background: #1e293b; border: 1px solid #334155; } }

/* Teléfono */
@media (max-width: 900px) {
  section { padding: 56px 0; }
  .hero-grid, .contact-grid, .about { grid-template-columns: 1fr; gap: 32px; }
  .group { grid-template-columns: 1fr; gap: 8px; }
  .case { grid-template-columns: 1fr; gap: 6px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .modes { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* Movimiento: tiempos compartidos; el hover solo en dispositivos con puntero */
:root { --t-fast: 160ms; --t-med: 260ms; --ease-out: cubic-bezier(0.22, 1, 0.36, 1); }
.btn, .wa-float, .site-nav a, .case, .group, .logo-row img, .cases a.more {
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out),
              background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.btn:active { transform: translateY(0) scale(0.98); }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); }
  .btn-accent:hover { box-shadow: 0 8px 22px rgba(245, 158, 11, 0.35); }
  .btn-line:hover { background: color-mix(in srgb, var(--link) 10%, transparent); }
  .wa-float:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 10px 26px rgba(15, 23, 42, 0.35); }
  .site-nav a:not(.btn):not(.lang) { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size var(--t-med) var(--ease-out), color var(--t-fast) ease; }
  .site-nav a:not(.btn):not(.lang):hover { background-size: 100% 2px; text-decoration: none; }
  .case:hover { background: color-mix(in srgb, var(--link) 6%, transparent); }
  .case { padding-left: 12px; padding-right: 12px; margin: 0 -12px; border-radius: 8px; }
  .group { position: relative; }
  .group::before { content: ""; position: absolute; left: -16px; top: 28px; width: 3px; height: 0; background: var(--amber); border-radius: 2px; transition: height var(--t-med) var(--ease-out); }
  .group:hover::before { height: calc(100% - 56px); }
  .logo-row img:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12); }
}
/* Aparición al llegar a cada sección (solo si hay JS y no se pidió reducir movimiento) */
.js-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.js-reveal .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ===== Páginas internas (servicios, casos, laboratorio, formación) ===== */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.list-label { font-weight: 600; margin-bottom: 6px; }
.checks { padding-left: 1.2em; margin: 0 0 20px; max-width: 60ch; }
.checks li { margin-bottom: 6px; }
.note { font-size: 0.95rem; color: var(--muted); max-width: 64ch; }
.tag { display: inline-block; margin-top: 10px; font-size: 0.875rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; }

/* Servicios y opciones como filas, igual que los grupos de Inicio */
.svc { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 32px 0; border-top: 1px solid var(--line); }
.svc h3 { margin: 0; }
.svc p { max-width: 60ch; }
.modes-3 { grid-template-columns: repeat(3, 1fr); max-width: none; }
.band .band-note { margin: 32px 0 0; }

/* Casos */
.case-hero { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.case-logo { width: 168px; background: #fff; padding: 12px; border-radius: 14px; border: 1px solid var(--line); }
.story { max-width: 68ch; }
.story h2 { font-size: clamp(1.5rem, 2.8vw, 1.875rem); margin-top: 1.6em; }
.story h2:first-child { margin-top: 0; }
.result { border-left: 3px solid var(--blue); padding-left: 20px; margin-top: 2em; }
.result h2 { margin-top: 0; }
@media (prefers-color-scheme: dark) { .result { border-left-color: var(--sky); } }
.case-cta { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.related { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 32px; color: var(--muted); }

/* Laboratorio: antes y después */
.before-after { display: grid; grid-template-columns: 1fr 1.6fr; gap: 24px; align-items: start; margin: 8px 0 12px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.data-table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.data-table caption { text-align: left; font-family: var(--display); font-weight: 700; padding: 14px 16px 10px; }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 10px 16px; border-top: 1px solid var(--line); }
.data-table thead th { font-weight: 600; color: var(--muted); white-space: nowrap; }
.data-table tbody th { font-weight: 600; }
.data-table .raw td { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875rem; }

@media (max-width: 900px) {
  .svc { grid-template-columns: 1fr; gap: 8px; }
  .modes-3 { grid-template-columns: 1fr; }
  .case-hero { grid-template-columns: 1fr; gap: 24px; }
  .case-logo { width: 112px; }
  .before-after { grid-template-columns: 1fr; }
}

/* Blog y bitácora */
.post-meta { color: var(--muted); font-size: .9375rem; margin: 0 0 .4em; }
.log-entry + .log-entry { border-top: 1px solid var(--line); margin-top: 2.5em; padding-top: 2em; }
.story blockquote { border-left: 4px solid var(--amber); margin: 1.2em 0; padding: .2em 0 .2em 1em; }
.story pre { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1em; font: inherit; }
