/* Código Propio · estilos
   Dirección: cuaderno de bitácora. Papel cálido, titulares serif, un único acento (naranja tostado). */

:root {
  --bg: #f7f4ee;
  --bg-2: #efeae1;
  --surface: #fffdf9;
  --ink: #1f1b16;
  --ink-2: #4a433a;
  --muted: #7a7166;
  --line: #e2dbcf;
  --accent: #c8501c;
  --accent-hover: #b34515;
  --accent-ink: #fffaf5;
  --accent-soft: #f6e4d8;
  --ok: #2f7d4f;
  --shadow: 0 1px 2px rgba(74, 52, 30, .06), 0 8px 24px -12px rgba(74, 52, 30, .18);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 760px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f;
    --bg-2: #1c1914;
    --surface: #211d18;
    --ink: #f2ede4;
    --ink-2: #cfc7ba;
    --muted: #9b9184;
    --line: #322d26;
    --accent: #e0703c;
    --accent-hover: #ec8152;
    --accent-ink: #15130f;
    --accent-soft: #2e2119;
    --ok: #5cbf84;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "ss01";
}

/* Grano sutil para quitar la sensación de "plano digital" */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent-soft); color: var(--ink); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  background: var(--ink); color: var(--bg);
  padding: 8px 14px; border-radius: var(--r-sm); text-decoration: none;
}
.skip:focus { top: 12px; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; position: relative; z-index: 2; }

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- Cabecera ---------- */
header.top { padding: 18px 0; }
header.top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.logo {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.logo .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--ink); color: var(--bg);
  display: inline-grid; place-items: center;
  font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: -0.02em;
}
header.top a.small { color: var(--muted); font-size: 15px; text-decoration: none; font-weight: 500; }

/* ---------- Tipografía ---------- */
h1, h2, h3 { text-wrap: balance; color: var(--ink); }
p, li { text-wrap: pretty; }

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7.4vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
}
h1 em { font-style: italic; color: var(--accent); }
h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
h3 { font-size: 17px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.005em; }

.prose p, section p { max-width: 62ch; }
.lead { font-size: 20px; line-height: 1.55; color: var(--ink-2); margin: 0 0 30px; max-width: 34em; }
.lead strong { color: var(--ink); font-weight: 600; }

.label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  margin-bottom: 20px;
}
.label::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.num { font-variant-numeric: tabular-nums; }

/* ---------- Secciones ---------- */
section { padding: 64px 0 72px; }
section + section { border-top: 1px solid var(--line); }
.hero { padding: 44px 0 64px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 17px/1 var(--sans);
  text-decoration: none;
  padding: 17px 26px;
  border-radius: var(--r-md);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -8px rgba(200, 80, 28, .7);
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.btn .price-tag { font-weight: 500; opacity: .85; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); }
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
  .btn:hover:active { transform: scale(0.97); }
  .textlink:hover { color: var(--ink); }
}
.textlink {
  color: var(--ink-2); font-weight: 500; text-decoration: none;
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
  transition: color 160ms var(--ease-out);
  touch-action: manipulation;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
.cta-note { font-size: 14px; color: var(--muted); margin-top: 14px; }

/* ---------- Libro de cuentas (cifras del experimento) ---------- */
.ledger {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.ledger div { padding: 14px 16px 16px 0; }
.ledger div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.ledger b {
  display: block;
  font-family: var(--serif); font-weight: 400;
  font-size: 34px; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ledger small { color: var(--muted); font-size: 14px; }

/* ---------- Diario ---------- */
.log { list-style: none; margin: 26px 0 0; padding: 0; position: relative; }
.log::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.log li { position: relative; padding: 0 0 22px 30px; }
.log li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--muted);
}
.log li.now::before { border-color: var(--accent); background: var(--accent); }
.log time { display: block; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.log p { margin: 2px 0 0; color: var(--ink-2); }

/* ---------- Capítulos ---------- */
.chapters { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: cap; }
.chapters li {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.chapters li:first-child { border-top: 1px solid var(--line); }
.chapters .n { font-family: var(--serif); font-size: 26px; color: var(--muted); line-height: 1; font-variant-numeric: tabular-nums; }
.chapters .t { font-weight: 500; }
.tag { font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--muted); }
.tag.ok { color: var(--ok); }
.chapters li.ready .n { color: var(--accent); }

/* ---------- Para quién ---------- */
.fit { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.fit ul { list-style: none; margin: 0; padding: 0; }
.fit li { padding: 9px 0 9px 28px; position: relative; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.fit li::before { position: absolute; left: 0; top: 9px; font-weight: 700; }
.fit .yes li::before { content: "✓"; color: var(--ok); }
.fit .no li::before { content: "✕"; color: var(--muted); }

/* ---------- Precio ---------- */
.price-box {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 34px 30px 30px;
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 20px 32px; align-items: center;
}
.price-box .label { margin-bottom: 8px; }
.price { font-family: var(--serif); font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; }
.price s { font-family: var(--sans); font-size: 20px; color: var(--muted); margin-left: 10px; vertical-align: middle; }
.price-box p { margin: 10px 0 0; color: var(--ink-2); }
.price-box .cta-note { grid-column: 1 / -1; margin: 0; }

/* ---------- Preguntas ---------- */
.faq { display: grid; grid-template-columns: 1fr; margin-top: 24px; }
.faq div { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.faq dt { font-weight: 600; }
.faq dd { margin: 0; color: var(--ink-2); }

/* ---------- Pie ---------- */
footer { padding: 36px 0 52px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); position: relative; z-index: 2; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer a { color: var(--muted); }
footer .links { display: flex; flex-wrap: wrap; gap: 18px; }

/* ---------- Páginas de texto ---------- */
.prose h1 { font-size: clamp(36px, 6vw, 52px); }
.prose h2 { font-size: 28px; margin-top: 40px; }
.prose li { color: var(--ink-2); margin: 6px 0; }
.back { display: inline-block; margin-bottom: 24px; color: var(--muted); text-decoration: none; font-size: 15px; }

/* ---------- Entrada suave (solo una vez, solo si el usuario no pidió menos movimiento) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero > .wrap > * { animation: rise 600ms var(--ease-out) both; }
  .hero > .wrap > *:nth-child(2) { animation-delay: 60ms; }
  .hero > .wrap > *:nth-child(3) { animation-delay: 120ms; }
  .hero > .wrap > *:nth-child(4) { animation-delay: 180ms; }
  .hero > .wrap > *:nth-child(5) { animation-delay: 240ms; }
  .hero > .wrap > *:nth-child(6) { animation-delay: 300ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* ---------- Móvil ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .lead { font-size: 18px; }
  section { padding: 52px 0 56px; }
  .ledger { grid-template-columns: 1fr 1fr; }
  .ledger div:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .ledger div:nth-child(2) { padding-left: 0; border-left: 0; }
  .chapters li { grid-template-columns: 34px 1fr; }
  .chapters .tag { grid-column: 2; margin-top: -8px; }
  .fit { grid-template-columns: 1fr; gap: 28px; }
  .price-box { grid-template-columns: 1fr; padding: 28px 22px 24px; }
  .faq div { grid-template-columns: 1fr; gap: 6px; }
  .btn { width: 100%; }
  .cta-row { gap: 16px; }
}

/* Pasos en la página de gracias */
.step { margin-top: 44px; font-size: 30px; }

/* ---------- Blog ---------- */
.post-meta { color: var(--muted); font-size: 14px; margin: -6px 0 28px; font-variant-numeric: tabular-nums; }
.prose h3 { font-size: 19px; margin-top: 28px; }
.prose p, .prose li { max-width: 66ch; }
.prose blockquote { margin: 20px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.prose pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; }
.prose table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px 10px 0; text-align: left; vertical-align: top; }
.prose th { font-weight: 600; }
.cta-box { margin: 48px 0 8px; padding: 26px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.cta-box h2 { margin: 0 0 8px; font-size: 26px; }
.cta-box p { margin: 0 0 18px; color: var(--ink-2); }
.cta-box .cta-row { gap: 18px; }
.post-list { list-style: none; padding: 0; margin: 28px 0 0; }
.post-list li { padding: 20px 0; border-top: 1px solid var(--line); max-width: none; }
.post-list a { text-decoration: none; }
.post-list a:hover .post-title { color: var(--accent); }
.post-list .post-title { display: block; font-weight: 600; font-size: 19px; color: var(--ink); transition: color 160ms var(--ease-out); }
.post-list small { color: var(--muted); font-size: 14px; }
.post-list p { margin: 6px 0 0; color: var(--ink-2); }
@media (hover: none) { .post-list a:hover .post-title { color: var(--ink); } }
.nav-links { display: flex; gap: 18px; }
