/*
 * knotAI — estilos reutilizables para artículos del blog.
 * Autocontenido (no depende de Tailwind). Respeta CLAUDE.md: paleta, tipografía,
 * radios (6/10px), espaciado en múltiplos de 8, sin gradientes ni glows.
 *
 * Para un artículo nuevo: copia /blog/ia-para-pymes-peru.html, cambia el
 * contenido y la metadata (title, description, OG, JSON-LD) y enlaza este CSS.
 */
:root {
  --niebla: #F8FAFC;
  --pizarra: #1E293B;
  --tinta: #0F172A;
  --slate: #334155;
  --ceniza: #D4D2D5;
  --cyan: #22D3EE;
  --cyan-deep: #06b6d4;
  --brasa: #F97316;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--niebla);
  color: var(--pizarra);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.65;
}
::selection { background: var(--cyan); color: var(--pizarra); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 2px; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(212,210,213,0.5);
}
.site-header .wrap {
  max-width: 880px; margin: 0 auto; height: 64px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.site-header img { height: 26px; display: block; }
.back-link {
  font-size: 14px; font-weight: 500; color: var(--slate);
  text-decoration: none; transition: color 120ms ease-out;
}
.back-link:hover { color: var(--pizarra); }

/* ---- Artículo ---- */
.article { max-width: 720px; margin: 0 auto; padding: 64px 24px 96px; }
.article-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--slate); margin-bottom: 16px;
}
.article h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700;
  font-size: clamp(32px, 5vw, 52px); line-height: 1.1; letter-spacing: -0.02em;
  color: var(--pizarra); margin-bottom: 16px; text-wrap: balance;
}
.article-lead { font-size: 19px; color: var(--slate); margin-bottom: 8px; }

.article-body { margin-top: 32px; }
.article-body h2 {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700;
  font-size: clamp(22px, 3vw, 30px); line-height: 1.2; letter-spacing: -0.01em;
  color: var(--pizarra); margin: 48px 0 16px; text-wrap: balance;
}
.article-body p { font-size: 17px; color: var(--slate); margin-bottom: 20px; max-width: 68ch; text-wrap: pretty; }
.article-body strong { color: var(--pizarra); font-weight: 600; }
.article-body em { font-style: italic; }
.article-body a {
  color: var(--pizarra); font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--ceniza); text-underline-offset: 3px;
  transition: color 120ms ease-out, text-decoration-color 120ms ease-out;
}
.article-body a:hover { color: var(--cyan-deep); text-decoration-color: var(--cyan-deep); }
.article-body ul { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 12px; max-width: 68ch; }
.article-body li { position: relative; padding-left: 24px; font-size: 17px; color: var(--slate); }
.article-body li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 6px; height: 6px; border-radius: 999px; background: var(--slate); }
.article-body hr { border: none; border-top: 1px solid var(--ceniza); margin: 48px 0; }
.article-sources { font-size: 14px; color: var(--slate); line-height: 1.6; }
.article-sources strong { color: var(--pizarra); }

/* Tira de estadísticas */
.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px; margin: 32px 0; padding: 28px;
  background: white; border: 1px solid var(--ceniza); border-radius: 10px;
}
.stat-num {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700;
  font-size: clamp(34px, 5vw, 48px); line-height: 1; letter-spacing: -0.02em; color: var(--tinta);
}
.stat-label { font-size: 14px; color: var(--slate); margin-top: 8px; line-height: 1.4; }

/* Frentes / pasos numerados */
.steps { display: flex; flex-direction: column; gap: 28px; margin: 24px 0 8px; }
.step { display: flex; gap: 18px; align-items: flex-start; }
.step .num {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700;
  font-size: clamp(36px, 6vw, 56px); line-height: 0.9; color: var(--ceniza);
  flex-shrink: 0; min-width: 1.5em; user-select: none;
}
.step .step-body h3 {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700;
  font-size: 19px; color: var(--pizarra); margin: 4px 0 6px;
}
.step .step-body p { margin-bottom: 0; }

/* Lista de "lo que NO" con marca × en brasa (rol de cancelar) */
.dont-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 14px; max-width: 68ch; }
.dont-list li { position: relative; padding-left: 30px; font-size: 17px; color: var(--slate); }
.dont-list li::before { content: "\00d7"; position: absolute; left: 4px; top: 0; font-weight: 700; font-size: 20px; line-height: 1.35; color: var(--brasa); }

/* Frase destacada */
.article-body p.pullquote {
  margin: 48px 0; max-width: none;
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700;
  font-size: clamp(24px, 4vw, 34px); line-height: 1.25; letter-spacing: -0.01em;
  color: var(--pizarra); text-wrap: balance;
}

/* ---- Efectos (dentro de CLAUDE.md: ≤300ms ease-out, sin bounce/glow) ---- */

/* Barra de progreso de lectura (cyan = estado/progreso) */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--cyan); z-index: 60; transition: width 90ms linear;
}

/* Header: leve sombra neutra al hacer scroll */
.site-header { transition: background-color 200ms ease-out, box-shadow 200ms ease-out; }
.site-header.scrolled { background: rgba(255,255,255,0.97); box-shadow: 0 8px 24px -18px rgba(15,23,42,0.25); }

/* Reveal en scroll (contenido visible por defecto; solo se oculta con JS activo) */
.js-reveal .reveal { opacity: 0; transform: translateY(16px); transition: opacity 280ms ease-out, transform 280ms ease-out; }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }
/* Stagger de hijos (p. ej. la tira de estadísticas) */
.js-reveal .stagger > * { opacity: 0; transform: translateY(16px); transition: opacity 280ms ease-out, transform 280ms ease-out; }
.js-reveal .stagger.is-visible > * { opacity: 1; transform: none; }
.js-reveal .stagger.is-visible > *:nth-child(2) { transition-delay: 80ms; }
.js-reveal .stagger.is-visible > *:nth-child(3) { transition-delay: 160ms; }

@media (prefers-reduced-motion: reduce) {
  .reading-progress { display: none; }
  .site-header { transition: none; }
  .js-reveal .reveal, .js-reveal .stagger > * { opacity: 1; transform: none; transition: none; }
}

/* CTA final del artículo */
.article-cta { margin-top: 56px; background: var(--tinta); border-radius: 10px; padding: 40px 32px; text-align: center; }
.article-cta h2 {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700;
  font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; color: var(--niebla); margin-bottom: 8px;
}
.article-cta p { color: var(--ceniza); margin-bottom: 24px; max-width: 46ch; margin-left: auto; margin-right: auto; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cyan); color: var(--pizarra);
  border-radius: 6px; padding: 12px 24px; font-weight: 600; font-size: 15px;
  border: none; cursor: pointer; text-decoration: none;
  transition: background 120ms ease-out;
}
.btn-primary:hover { background: var(--cyan-deep); }

/* ---- Listado del blog ---- */
.blog-intro { max-width: 720px; margin: 0 auto; padding: 64px 24px 24px; }
.blog-intro h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700;
  font-size: clamp(32px, 5vw, 48px); line-height: 1.1; letter-spacing: -0.02em; color: var(--pizarra); margin-bottom: 12px;
}
.blog-intro p { font-size: 18px; color: var(--slate); max-width: 60ch; }
.post-list { max-width: 720px; margin: 0 auto; padding: 16px 24px 96px; display: flex; flex-direction: column; gap: 16px; }
.post-card {
  display: block; background: white; border: 1px solid var(--ceniza); border-radius: 10px;
  padding: 24px; text-decoration: none; color: inherit;
  transition: transform 200ms ease-out, border-color 200ms ease-out;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--slate); }
.post-date {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate); margin-bottom: 8px;
}
.post-card h2 {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700;
  font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; color: var(--pizarra); margin-bottom: 8px;
}
.post-card p.post-excerpt { font-size: 15px; color: var(--slate); margin-bottom: 12px; }
.post-more { font-size: 14px; font-weight: 600; color: var(--cyan-deep); }

/* ---- Footer ---- */
.site-footer { background: var(--tinta); color: var(--niebla); padding: 48px 24px; }
.site-footer .wrap {
  max-width: 880px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
}
.site-footer img { height: 22px; }
.site-footer a { color: #94a3b8; text-decoration: none; font-size: 14px; transition: color 120ms ease-out; }
.site-footer a:hover { color: var(--niebla); }
.site-footer .copyright { color: #94a3b8; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .post-card { transition: none; }
  .post-card:hover { transform: none; }
}
