:root {
  --background: oklch(98.5% .01 85);
  --foreground: oklch(12.9% .042 264.695);
  --card: oklch(100% 0 0);
  --primary: oklch(65% .2 40);
  --primary-foreground: oklch(99% 0 0);
  --muted-foreground: oklch(55.4% .046 257.417);
  --border: oklch(92.9% .013 255.508);
  --destructive: oklch(57.7% .245 27.325);
  --stage: oklch(12% 0 0);
  --stage-foreground: oklch(97% 0 0);
  --stage-muted: oklch(65% 0 0);
  --gradient-headline: linear-gradient(180deg, oklch(99% 0 0), oklch(70% 0 0));
  --gradient-accent: linear-gradient(90deg, var(--primary), oklch(75% .15 60));
  --bar-1: oklch(62% .1 180);
  --bar-2: oklch(55% .1 240);
  --bar-3: oklch(77% .14 70);
  --bar-4: oklch(63% .18 38);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Lora", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; -webkit-text-size-adjust: 100%; }
body {
  background: var(--stage);
  color: var(--stage-foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 600; }

/* ---------- utilidades ---------- */
.container { margin-inline: auto; padding-inline: 1.5rem; }
.w-3xl { max-width: 48rem; } .w-4xl { max-width: 56rem; } .w-5xl { max-width: 64rem; } .w-6xl { max-width: 72rem; }
.center { text-align: center; }
.eyebrow { font-size: .875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .3em; color: var(--primary); }
.text-gradient { background: var(--gradient-headline); -webkit-background-clip: text; background-clip: text; color: transparent; }
.text-gradient-accent { background: var(--gradient-accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.display { font-family: var(--font-display); }
.h-xl { font-size: 3rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.05; }
.lead { font-size: 1.25rem; max-width: 36rem; margin-top: 1.5rem; }
.muted-stage { color: var(--stage-muted); }
.muted { color: var(--muted-foreground); }
.light { background: var(--background); color: var(--foreground); position: relative; overflow: hidden; }
@media (min-width: 768px) { .h-xl { font-size: 4.5rem; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--primary); color: var(--primary-foreground);
  padding: 1rem 2rem; font-size: 1rem; font-weight: 600; border: 0; cursor: pointer;
  transition: transform .3s; font-family: inherit;
}
.btn:hover { transform: scale(1.05); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }

.bars-strip { display: flex; width: 100%; height: .5rem; }
.bars-strip > div { flex: 1; }
.bars-strip.thin { height: 2px; }
.bg-bar-1 { background: var(--bar-1); } .bg-bar-2 { background: var(--bar-2); }
.bg-bar-3 { background: var(--bar-3); } .bg-bar-4 { background: var(--bar-4); }

/* ---------- revelado al hacer scroll ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s, transform 1s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { transition-duration: .4s; transform: none; } }

/* ---------- cabecera ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: color-mix(in oklch, var(--stage) 70%, transparent);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid color-mix(in oklch, var(--stage-foreground) 10%, transparent);
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 3rem; font-size: .75rem; max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }
.brand { font-size: .875rem; font-weight: 600; white-space: nowrap; }
.brand span { color: var(--primary); }
.site-nav { display: none; gap: 2rem; color: color-mix(in oklch, var(--stage-foreground) 80%, transparent); }
.site-nav a:hover { color: var(--stage-foreground); }
.pill { border-radius: 999px; background: var(--primary); color: var(--primary-foreground); padding: .25rem .75rem; font-weight: 500; }
@media (min-width: 640px) { .site-nav { display: flex; } }

/* ---------- hero ---------- */
.hero { position: relative; height: 200vh; }
.hero-sticky {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 1.5rem 0; text-align: center;
}
.hero h1 { margin-top: 1rem; font-family: var(--font-display); font-size: 3.75rem; font-weight: 800; letter-spacing: -.025em; line-height: 1; }
.hero .tagline { margin-top: 1.25rem; font-size: 1.5rem; font-weight: 600; }
.chip {
  position: absolute; border-radius: 999px; padding: .5rem 1rem; font-size: .875rem;
  border: 1px solid color-mix(in oklch, var(--stage-foreground) 15%, transparent);
  background: color-mix(in oklch, var(--stage-foreground) 5%, transparent);
  color: color-mix(in oklch, var(--stage-foreground) 80%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.hero-book { margin-top: 3rem; perspective: 1000px; will-change: transform; transform: rotateX(20deg) rotateZ(3deg) scale(.85); }
.hero-book img { width: 16rem; border-radius: 0 .375rem .375rem 0; box-shadow: 0 40px 120px -20px var(--bar-4); }
@media (min-width: 768px) {
  .hero h1 { font-size: 6rem; }
  .hero .tagline { font-size: 1.875rem; }
  .hero-book img { width: 20rem; }
}
@media (max-height: 760px) { .hero-book img { width: 12rem; } }

/* ---------- frase grande ---------- */
.statement { padding-block: 8rem; }
.statement p.big { font-size: 2.25rem; font-weight: 700; line-height: 1.15; letter-spacing: -.025em; }
.statement .cta { margin-top: 3rem; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.statement .cta small { font-size: .875rem; color: var(--stage-muted); }
@media (min-width: 768px) { .statement p.big { font-size: 3.75rem; } }

/* ---------- el libro ---------- */
.section-pad { padding-block: 8rem; }
.ghost-number {
  position: absolute; inset: 0 0 auto 0; text-align: center; font-family: var(--font-display);
  font-size: 16vw; font-weight: 800; line-height: 1; pointer-events: none; user-select: none;
  color: color-mix(in oklch, var(--foreground) 4%, transparent); will-change: transform;
}
.figures { position: relative; margin: 0 auto 7rem; max-width: 64rem; padding: 0 1.5rem; text-align: center; }
.figures .eyebrow { color: var(--bar-2); }
.figures .huge { margin-top: 1rem; font-family: var(--font-display); font-size: 7rem; font-weight: 800; line-height: 1; letter-spacing: -.05em; color: var(--bar-4); }
.figures .sub { margin-top: .5rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -.025em; }
.stat-grid { margin-top: 4rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.card { background: var(--card); border-radius: 1.5rem; box-shadow: 0 1px 3px rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .08); }
.stat { padding: 1.5rem; }
.stat .tick { margin: 0 auto 1rem; height: .375rem; width: 2.5rem; border-radius: 999px; }
.stat .n { font-size: 3rem; font-weight: 800; letter-spacing: -.025em; line-height: 1; }
.stat .l { margin-top: .5rem; font-size: .875rem; color: var(--muted-foreground); }
.contents { position: relative; max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }
.contents .lead { color: var(--muted-foreground); }
.contents ul { list-style: none; margin-top: 4rem; display: grid; gap: 1rem; }
.contents li { display: flex; align-items: baseline; gap: 1.25rem; padding: 1.75rem; font-size: 1.125rem; }
.contents li .mark { margin-top: .25rem; height: 1.5rem; width: .375rem; flex-shrink: 0; border-radius: 999px; align-self: flex-start; }
@media (min-width: 640px) { .contents ul { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) {
  .figures .huge { font-size: 12rem; }
  .figures .sub { font-size: 2.25rem; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- niveles ---------- */
.levels { display: flex; align-items: flex-end; gap: .5rem; height: 28rem; margin-top: 4rem; }
.levels > div { flex: 1; padding: 1rem; color: var(--stage-foreground); }
.levels .num { font-size: 2.25rem; line-height: 1; }
.levels p { margin-top: .5rem; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .2em; }
@media (min-width: 768px) {
  .levels { gap: .75rem; }
  .levels > div { padding: 1.5rem; }
  .levels .num { font-size: 3rem; }
  .levels p { font-size: .75rem; }
}

/* ---------- autor ---------- */
.author { position: relative; overflow: hidden; padding-block: 10rem; }
.author .glow { position: absolute; left: 50%; top: 50%; width: 40rem; height: 40rem; transform: translate(-50%, -50%); border-radius: 999px; background: color-mix(in oklch, var(--bar-2) 25%, transparent); filter: blur(64px); pointer-events: none; }
.author .side { position: absolute; bottom: 0; display: none; height: 100%; width: 10rem; align-items: flex-end; gap: .5rem; pointer-events: none; }
.author .side > div { flex: 1; opacity: .8; }
.author .side.left { left: 0; } .author .side.right { right: 0; }
.author h2 { margin-top: 1rem; }
.author .bio { margin-top: 2.5rem; font-size: 1.25rem; line-height: 1.625; color: var(--stage-muted); }
@media (min-width: 768px) { .author .bio { font-size: 1.5rem; } }
@media (min-width: 1024px) { .author .side { display: flex; } }

/* ---------- tips ---------- */
.ghost-q { position: absolute; right: -2.5rem; top: 0; font-family: var(--font-display); font-size: 20rem; font-weight: 800; line-height: 1; pointer-events: none; user-select: none; color: color-mix(in oklch, var(--foreground) 4%, transparent); }
.tips-grid { margin-top: 4rem; display: grid; gap: 1.25rem; }
.tip { padding: 2rem; transition: transform .5s, opacity 1s; }
.tip:hover { transform: translateY(-4px); }
.tip .k { font-size: .875rem; font-weight: 600; color: var(--primary); }
.tip h3 { margin-top: .75rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -.025em; }
.tip p { margin-top: .75rem; color: var(--muted-foreground); }
@media (min-width: 640px) { .tips-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tips-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- erratas ---------- */
.errata-wrap { display: grid; gap: 3rem; margin-top: 3rem; }
.errata-form { padding: 2rem; display: grid; gap: 1.25rem; }
.field { display: grid; gap: .375rem; }
.field label { font-size: .875rem; font-weight: 600; }
.field label small { font-weight: 400; color: var(--muted-foreground); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--foreground);
  background: var(--background); border: 1px solid var(--border); border-radius: .75rem;
  padding: .75rem 1rem; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 7rem; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 20%, transparent); }
.row-2 { display: grid; gap: 1.25rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { font-size: .9375rem; border-radius: .75rem; padding: .875rem 1rem; display: none; }
.form-msg.ok { display: block; background: color-mix(in oklch, var(--bar-1) 15%, transparent); color: oklch(35% .08 180); }
.form-msg.err { display: block; background: color-mix(in oklch, var(--destructive) 12%, transparent); color: oklch(42% .18 27); }
.errata-aside h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.025em; }
.errata-aside ul { margin-top: 1rem; padding-left: 1.1rem; color: var(--muted-foreground); display: grid; gap: .5rem; }
.errata-aside .note { margin-top: 1.5rem; font-size: .875rem; color: var(--muted-foreground); }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .errata-wrap { grid-template-columns: 1.4fr 1fr; align-items: start; } }

/* ---------- cierre ---------- */
.closing { position: relative; overflow: hidden; padding: 8rem 1.5rem 0; text-align: center; }
.closing h2 { font-size: 3.75rem; font-weight: 800; letter-spacing: -.025em; line-height: 1; }
.closing .stage { position: relative; margin: 5rem auto 0; display: flex; height: 26rem; max-width: 64rem; align-items: flex-end; justify-content: center; }
.closing .stage .bars { position: absolute; inset: auto 0 0 0; display: flex; height: 100%; align-items: flex-end; gap: .5rem; }
.closing .stage .bars > div { flex: 1; }
.closing .stage img { position: relative; z-index: 10; margin-bottom: 2.5rem; width: 13rem; border-radius: 0 .375rem .375rem 0; box-shadow: 0 25px 50px -12px rgb(0 0 0 / .5); }
@media (min-width: 768px) { .closing h2 { font-size: 6rem; } .closing .stage img { width: 15rem; } }

footer { padding-block: 2rem; text-align: center; font-size: .75rem; color: var(--stage-muted); }
footer nav { margin-top: .5rem; display: flex; justify-content: center; gap: 1.25rem; }
footer a:hover { color: var(--stage-foreground); }

/* ---------- página de erratas ---------- */
.page-top { padding-top: 7rem; }

/* ---------- enlaces y extras (v2) ---------- */
.light a:not(.btn):not(.card), .guide a:not(.btn) { color: oklch(45% .12 240); text-decoration: underline; text-underline-offset: 2px; }
.tip p a { font-weight: 600; }
.site-nav { gap: 1.5rem; }
.fit { margin-top: 2rem; padding: 1.75rem; }
.fit p:last-child { margin-top: .5rem; font-size: 1.0625rem; }
.btn-ghost { background: transparent; color: var(--stage-foreground); border: 1px solid color-mix(in oklch, var(--stage-foreground) 35%, transparent); }
.btn-ghost:hover { background: color-mix(in oklch, var(--stage-foreground) 8%, transparent); }
footer nav { flex-wrap: wrap; margin: 0 0 .75rem; font-size: .8125rem; }
footer .fine { margin-top: .5rem; opacity: .75; max-width: 40rem; margin-inline: auto; padding-inline: 1.5rem; }

/* clases */
.classes { position: relative; overflow: hidden; }
.classes::before { content: ""; position: absolute; right: -10rem; top: -10rem; width: 30rem; height: 30rem; border-radius: 999px; background: color-mix(in oklch, var(--bar-4) 22%, transparent); filter: blur(70px); pointer-events: none; }
.classes-grid { position: relative; display: grid; gap: 2.5rem; align-items: center; }
.classes h2 { margin-top: 1rem; }
.classes-text { font-size: 1.125rem; line-height: 1.65; color: var(--stage-muted); margin-bottom: 1rem; }
.classes-text strong { color: var(--stage-foreground); }
.classes .btn { margin-top: .75rem; }
@media (min-width: 860px) { .classes-grid { grid-template-columns: 1fr 1fr; gap: 4rem; } }

/* guías: tarjetas */
.guides-grid { margin-top: 3rem; display: grid; gap: 1rem; }
.guide-card { display: block; padding: 1.75rem; color: var(--foreground); transition: transform .3s, box-shadow .3s; }
.guide-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px -12px rgb(0 0 0 / .18); }
.guide-card .k { font-size: .75rem; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; }
.guide-card h3 { margin-top: .5rem; font-size: 1.1875rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.guide-card p { margin-top: .5rem; font-size: .9375rem; color: var(--muted-foreground); }
@media (min-width: 640px) { .guides-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .guides-grid { grid-template-columns: repeat(3, 1fr); } }

/* descargas */
.download-band { display: grid; gap: 3rem; align-items: center; }
.dl-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.link-light { color: var(--stage-foreground); opacity: .85; font-weight: 500; }
.link-light:hover { opacity: 1; }
.sheet-thumb { display: block; justify-self: center; max-width: 18rem; transform: rotate(-3deg); transition: transform .4s; }
.sheet-thumb img { border-radius: .25rem; box-shadow: 0 30px 80px -20px var(--bar-2); background: #fff; }
.sheet-thumb:hover { transform: rotate(0) scale(1.02); }
.light-thumb { transform: none; max-width: 16rem; }
.light-thumb img { box-shadow: 0 12px 40px -12px rgb(0 0 0 / .3); border: 1px solid var(--border); }
.download-card { margin-top: 3rem; padding: 2rem; display: grid; gap: 2rem; align-items: start; }
.download-card .k { font-size: .8125rem; font-weight: 600; color: var(--primary); }
.download-card h2 { margin-top: .5rem; font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.download-card h3 { margin-top: 1.5rem; font-size: 1.125rem; font-weight: 700; }
.download-card p { margin-top: .75rem; color: var(--muted-foreground); line-height: 1.65; }
.download-card ul { margin: .75rem 0 1.75rem; padding-left: 1.2rem; color: var(--muted-foreground); display: grid; gap: .4rem; line-height: 1.6; }
@media (min-width: 860px) {
  .download-band { grid-template-columns: 1.3fr 1fr; }
  .download-card { grid-template-columns: 16rem 1fr; }
}

/* ---------- página de guía ---------- */
.guide-page { padding: 6.5rem 1.5rem 5rem; min-height: 100vh; }
.guide { max-width: 44rem; margin: 0 auto; }
.crumbs { font-size: .8125rem; color: var(--muted-foreground); }
.crumbs a { color: inherit !important; }
.guide h1 { margin-top: 1rem; font-size: clamp(2rem, 5vw, 2.875rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.1; text-wrap: balance; }
.guide-lead { margin-top: 1rem; font-size: 1.1875rem; line-height: 1.6; color: var(--muted-foreground); }
.guide-body { margin-top: 2.5rem; font-size: 1.0625rem; line-height: 1.7; }
.guide-body > p, .guide-body > ul, .guide-body > ol, .guide-body > table, .guide-body > div { margin-top: 1.1rem; }
.guide-body h2 { margin-top: 2.75rem; font-size: 1.625rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.guide-body h3 { margin-top: 1.75rem; font-size: 1.1875rem; font-weight: 700; }
.guide-body ul, .guide-body ol { padding-left: 1.3rem; display: grid; gap: .45rem; }
.guide-body code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .95em; background: color-mix(in oklch, var(--bar-2) 10%, transparent); padding: .1em .35em; border-radius: .3em; white-space: nowrap; }
.steps li::marker { font-weight: 700; color: var(--primary); }
.ex { background: var(--card); border-radius: 1rem; padding: 1.25rem 1.5rem; border-left: 4px solid var(--bar-1); box-shadow: 0 1px 3px rgb(0 0 0 / .06); }
.ex .ex-t { font-weight: 700; font-size: 1rem; }
.ex ol { margin-top: .6rem; padding-left: 1.2rem; display: grid; gap: .35rem; font-size: 1rem; }
.ex .ex-r { margin-top: .75rem; font-weight: 700; color: oklch(40% .09 180); }
.tip-box { background: color-mix(in oklch, var(--bar-3) 16%, var(--card)); border-radius: 1rem; padding: 1.1rem 1.4rem; font-size: 1rem; border-top: 3px solid var(--bar-3); }
.formula { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; text-align: center; padding: 1rem; background: var(--card); border-radius: 1rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9375rem; background: var(--card); border-radius: 1rem; overflow: hidden; display: block; overflow-x: auto; }
.tbl th, .tbl td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th { font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); }
.g-faq { margin-top: 3rem; }
.g-faq h2 { font-size: 1.625rem; font-weight: 800; letter-spacing: -.02em; }
.g-faq details { margin-top: .75rem; background: var(--card); border-radius: .9rem; padding: 1rem 1.25rem; }
.g-faq summary { font-weight: 600; cursor: pointer; }
.g-faq details p { margin-top: .6rem; color: var(--muted-foreground); line-height: 1.6; }
.book-cta { margin-top: 3.5rem; display: grid; grid-template-columns: 6rem 1fr; gap: 1.5rem; align-items: center; background: var(--stage); color: var(--stage-foreground); border-radius: 1.5rem; padding: 1.75rem; }
.book-cta img { border-radius: 0 .25rem .25rem 0; box-shadow: 0 16px 40px -12px var(--bar-4); }
.book-cta .k { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); }
.book-cta .t { margin-top: .25rem; font-size: 1.25rem; font-weight: 700; }
.book-cta p { margin-top: .4rem; color: var(--stage-muted); font-size: .9375rem; line-height: 1.55; }
.book-cta .btn { margin-top: 1rem; padding: .75rem 1.5rem; font-size: .9375rem; }
.next { margin-top: 2rem; font-weight: 600; }
@media (max-width: 520px) { .book-cta { grid-template-columns: 1fr; } .book-cta img { width: 6rem; } }

/* nav en móvil: segunda fila desplazable */
@media (max-width: 639px) {
  .site-header .bar { flex-wrap: wrap; height: auto; min-height: 3rem; padding-top: .5rem; row-gap: .4rem; }
  .site-nav { display: flex; order: 3; width: 100%; overflow-x: auto; gap: 1.25rem; padding-bottom: .55rem; font-size: .8125rem; white-space: nowrap; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .guide-page { padding-top: 7.5rem; }
}

/* =====================================================================
   LÍNEA GRÁFICA DEL LIBRO (páginas de contenido: guías, descargas,
   erratas, legales). Crema de la cubierta, Lora + Inter, paneles de
   «Truco», «Ejemplo resuelto» con pasos en círculo y aperturas de capítulo.
   ===================================================================== */
:root {
  --papel: #f5f1e8;          /* crema de la cubierta */
  --tinta: #111;
  --tinta-70: #4d4d4d;
  --tinta-60: #666;
  --gris-40: #999;
  --gris-12: #e9e6de;
  --naranja: #e2572e;        /* «OPOSICIONES» de la cubierta */
  --azul: #3b78a8;
  --c1: #2a9d8f; --c2: #3b78a8; --c3: #e9a23b; --c4: #e2572e;
  --serif: "Lora", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}
body.book { background: var(--papel); color: var(--tinta); }
body.book .site-header { background: color-mix(in oklch, var(--papel) 88%, transparent); border-bottom: 1px solid var(--tinta); color: var(--tinta); }
body.book .site-nav { color: var(--tinta-70); }
body.book .site-nav a:hover { color: var(--tinta); }
body.book .brand { color: var(--tinta); }
body.book .brand span, body.book .eyebrow { color: var(--naranja); }
body.book .pill, body.book .btn { background: var(--naranja); }
body.book .bars-strip .bg-bar-1, .book-page .bg-bar-1 { background: var(--c1); }
body.book .bars-strip .bg-bar-2 { background: var(--c2); }
body.book .bars-strip .bg-bar-3 { background: var(--c3); }
body.book .bars-strip .bg-bar-4 { background: var(--c4); }
body.book footer { background: var(--papel); color: var(--tinta-60); border-top: 1px solid var(--tinta); }
body.book footer a:hover { color: var(--tinta); }
body.book .light, body.book main.light { background: transparent; color: var(--tinta); }
body.book h1, body.book .h-xl { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
body.book .lead, body.book .muted { color: var(--tinta-70); }
body.book .card { background: #fff; box-shadow: none; border: 1px solid var(--gris-12); border-radius: 0; }
body.book a:not(.btn):not(.card):not(.pill):not(.brand) { color: var(--azul); }

.book-page { padding: 6.5rem 1.5rem 5rem; min-height: 100vh; }
.guide, .doc { max-width: 46rem; margin: 0 auto; }
.crumbs { font-size: .8125rem; color: var(--tinta-60); }

/* apertura de capítulo: número grande gris con trama de puntos */
.apertura { display: grid; grid-template-columns: minmax(6.5rem, max-content) 1fr; align-items: end; gap: 0 1.25rem; padding-bottom: 1rem; border-bottom: 2px solid var(--tinta); margin-top: 1.25rem; }
.ap-num { font: 400 clamp(5rem, 14vw, 8.5rem)/.85 var(--serif); color: #c4c4c4; padding: 1.25rem .75rem 0 0;
  background-image: radial-gradient(#d4d4d4 1.6px, transparent 1.8px); background-size: 16px 16px; }
.ap-etq { font: 600 .6875rem/1 var(--font-sans); letter-spacing: .3em; text-transform: uppercase; color: var(--tinta-70); margin-bottom: .9rem; }
.apertura h1 { font: 400 clamp(1.6rem, 4vw, 2.35rem)/1.15 var(--serif); margin: 0; text-wrap: balance; }
.entrada { margin-top: 1.5rem; font: 400 1.25rem/1.6 var(--serif); color: var(--tinta); }
.doc-fecha { margin-top: 1rem; font: italic 400 .9375rem/1 var(--serif); color: var(--tinta-60); }

/* hoja de ruta */
.ruta { margin: 2rem 0 0; border-bottom: 2px solid var(--tinta); padding-bottom: .5rem; }
.ruta .lbl { font: 600 .6875rem/1 var(--font-sans); letter-spacing: .3em; text-transform: uppercase; margin-bottom: .6rem; }
.ruta ol { list-style: none; padding: 0; margin: 0; display: grid; column-gap: 2.5rem; }
.ruta li a { display: flex; gap: .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--gris-40); font-size: .9375rem; color: var(--tinta) !important; text-decoration: none !important; }
.ruta li a span { font-family: var(--serif); color: var(--tinta-60); min-width: 2.2rem; }
.ruta li a:hover { color: var(--naranja) !important; }
@media (min-width: 720px) { .ruta ol { grid-template-columns: 1fr 1fr; } }

/* cuerpo */
.book-page .guide-body, .doc { font-size: 1.0625rem; line-height: 1.7; }
.book-page .guide-body { margin-top: 1rem; }
.book-page .guide-body h2, .doc h2 { display: flex; align-items: baseline; gap: .7rem; font: 600 1.45rem/1.25 var(--serif); letter-spacing: 0; margin-top: 2.75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--gris-40); scroll-margin-top: 5rem; }
.h2n { font-weight: 400; color: var(--tinta-60); font-size: .9em; }
.book-page .guide-body h3 { font: 700 1.1rem/1.3 var(--serif); margin-top: 1.75rem; }
.doc h2 + p, .doc p, .doc ul, .doc table { margin-top: 1rem; }
.doc ul { padding-left: 1.3rem; display: grid; gap: .45rem; }
.book-page .guide-body code { background: var(--gris-12); font-family: var(--mono); }
.book-page .steps li::marker { color: var(--naranja); font-family: var(--serif); }

/* EJEMPLO RESUELTO: doble filete arriba, pasos en círculo */
.book-page .ex { background: transparent; border: 0; border-top: 5px double var(--tinta); border-bottom: 1px solid var(--tinta); border-radius: 0; box-shadow: none; padding: .9rem 0 1rem; margin-top: 1.75rem !important; }
.ex-cab { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; align-items: baseline; padding-bottom: .75rem; border-bottom: 1px dashed var(--gris-40); }
.ex-cab .lbl, .ex-r .lbl, .truco-cab .lbl, .k-lbl { font: 600 .6875rem/1 var(--font-sans); letter-spacing: .28em; text-transform: uppercase; white-space: nowrap; }
.ex-cab .lbl i, .truco-cab i { font: italic 400 1.3rem/1 var(--serif); letter-spacing: 0; text-transform: none; margin-left: .25rem; }
.ex-cab .enun { font: 600 1rem/1.45 var(--font-sans); }
@media (max-width: 560px) { .ex-cab { grid-template-columns: 1fr; } }
.book-page .ex ol { list-style: none; counter-reset: p; padding: 0; margin-top: .8rem; display: grid; gap: .55rem; }
.book-page .ex ol li { counter-increment: p; display: grid; grid-template-columns: 2.1rem 1fr; font-size: 1rem; line-height: 1.55; }
.book-page .ex ol li::before { content: counter(p); width: 1.45rem; height: 1.45rem; border: 1px solid var(--tinta); border-radius: 50%; font: italic 400 .9rem/1.4rem var(--serif); text-align: center; margin-top: .05rem; }
.book-page .ex-r { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; margin-top: .9rem; color: var(--tinta); }
.ex-r .v { font: 700 1rem/1.3 var(--mono); border-bottom: 2px solid var(--tinta); padding: 0 .3rem .25rem; }

/* TRUCO: panel gris con filete superior negro */
.truco { background: var(--gris-12); border-top: 3px solid var(--tinta); padding: .9rem 1.25rem 1rem; margin-top: 1.75rem !important; }
.truco-cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: .55rem; margin-bottom: .35rem; }
.truco-cab .tit { font: 700 1.02rem/1.3 var(--serif); }
.truco p:last-child { font-size: 1rem; line-height: 1.6; }

/* tablas al estilo libro */
.book-page .tbl { background: transparent; border-radius: 0; border-top: 2px solid var(--tinta); border-bottom: 2px solid var(--tinta); }
.book-page .tbl th { color: var(--tinta-70); font-weight: 600; letter-spacing: .14em; font-size: .6875rem; border-bottom: 1px solid var(--tinta); }
.book-page .tbl td { border-bottom: 1px dashed var(--gris-40); }

/* preguntas frecuentes y llamada al libro */
.book-page .g-faq h2 { font: 600 1.45rem/1.25 var(--serif); border-bottom: 1px solid var(--gris-40); padding-bottom: .5rem; }
.book-page .g-faq details { background: transparent; border-radius: 0; border-bottom: 1px dashed var(--gris-40); padding: .9rem 0; margin: 0; }
.book-page .g-faq summary { font-family: var(--serif); font-weight: 600; }
.book-page .book-cta { background: #fff; color: var(--tinta); border-radius: 0; border-top: 3px solid var(--tinta); border-bottom: 1px solid var(--tinta); }
.book-page .book-cta img { box-shadow: 0 10px 24px -10px rgb(0 0 0 / .35); }
.book-page .book-cta .k { color: var(--naranja); }
.book-page .book-cta .t { font-family: var(--serif); font-weight: 600; }
.book-page .book-cta p { color: var(--tinta-70); }

/* datos del titular (legales) */
.datos { list-style: none; padding: 0 !important; border-top: 2px solid var(--tinta); border-bottom: 2px solid var(--tinta); gap: 0 !important; }
.datos li { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: .65rem 0; border-bottom: 1px dashed var(--gris-40); }
.datos li:last-child { border-bottom: 0; }
.datos span { font: 600 .6875rem/1.8 var(--font-sans); letter-spacing: .2em; text-transform: uppercase; color: var(--tinta-70); }
@media (max-width: 560px) { .datos li { grid-template-columns: 1fr; gap: .15rem; } }

/* tarjetas de guías en estilo libro */
body.book .guide-card, #guias .guide-card { border-top: 3px solid var(--tinta); }
.guide-card .k b { font: 400 1.5rem/1 var(--serif); color: #b9b9b9; margin-right: .35rem; letter-spacing: 0; vertical-align: -.15em; }
body.book .guide-card h3, #guias .guide-card h3 { font-family: var(--serif); font-weight: 600; }

/* formulario de erratas: consentimiento */
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .9375rem; line-height: 1.5; cursor: pointer; }
.consent input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; accent-color: var(--naranja); flex: none; }
.rgpd { font-size: .8125rem; line-height: 1.5; color: var(--muted-foreground); }
body.book .field input, body.book .field textarea { background: var(--papel); border-radius: 0; border-color: var(--gris-40); }
body.book .errata-form { border-top: 3px solid var(--tinta); }
footer .legal-links { margin-top: .75rem; font-size: .75rem; gap: 1rem; }

/* Palabras flotantes del hero (rediseño): texto limpio, sin aspecto de botón */
.chip {
  border: 0; background: none; padding: 0; border-radius: 0;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  font-family: var(--font-display); font-weight: 400; font-style: italic;
  font-size: clamp(1.05rem, 2.1vw, 1.65rem); letter-spacing: -.01em;
  color: color-mix(in oklch, var(--stage-foreground) 72%, transparent);
  display: inline-flex; align-items: center; gap: .55em; white-space: nowrap;
  will-change: transform, opacity, filter;
}
.chip::before { content: ""; width: .42em; height: .42em; border-radius: 50%; background: var(--chip-c, var(--bar-4)); box-shadow: 0 0 18px 2px var(--chip-c, var(--bar-4)); }
.chip:nth-of-type(1) { --chip-c: var(--bar-1); }
.chip:nth-of-type(2) { --chip-c: var(--bar-2); }
.chip:nth-of-type(3) { --chip-c: var(--bar-3); }
.chip:nth-of-type(4) { --chip-c: var(--bar-4); }
.chip:nth-of-type(5) { --chip-c: var(--bar-1); }
.chip:nth-of-type(6) { --chip-c: var(--bar-2); }
@media (max-width: 640px) { .chip { font-size: 1rem; } }
body.book .site-nav a, body.book footer a, body.book .crumbs a { color: inherit !important; text-decoration: none !important; }
.book-page .ex ol li { display: block; position: relative; padding-left: 2.1rem; }
.book-page .ex ol li::before { position: absolute; left: 0; top: .08rem; }

/* ---------- CTA en el hero ---------- */
.hero-cta { margin-top: 1.75rem; display: flex; gap: 1.5rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn { padding: .85rem 1.6rem; }

/* ---------- Mira dentro ---------- */
.peek { overflow: hidden; }
.peek-track { margin-top: 3rem; display: flex; gap: 1.5rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 1rem max(1.5rem, calc((100vw - 72rem) / 2)) 2rem; scrollbar-width: none; }
.peek-track::-webkit-scrollbar { display: none; }
.peek-page { flex: 0 0 auto; width: min(72vw, 19rem); scroll-snap-align: center; margin: 0; }
.peek-page button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: .25rem; overflow: hidden; box-shadow: 0 30px 60px -25px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .06); transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.peek-page button:hover { transform: translateY(-6px) scale(1.015); }
.peek-page img { width: 100%; background: #fff; }
.peek-page figcaption { margin-top: .9rem; font-size: .875rem; color: var(--stage-muted); text-align: center; }

/* ---------- ¿Es para ti? ---------- */
.fit-grid { margin-top: 3rem; display: grid; gap: 1.25rem; }
.fit-col { border-radius: 1.5rem; padding: 2rem; background: color-mix(in oklch, var(--stage-foreground) 5%, transparent); border: 1px solid color-mix(in oklch, var(--stage-foreground) 10%, transparent); }
.fit-col h3 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.fit-col ul { list-style: none; margin-top: 1.25rem; display: grid; gap: .9rem; }
.fit-col li { position: relative; padding-left: 2rem; color: color-mix(in oklch, var(--stage-foreground) 85%, transparent); line-height: 1.55; }
.fit-col li::before { position: absolute; left: 0; top: .05rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.fit-col.yes li::before { content: "✓"; background: var(--bar-1); color: #fff; }
.fit-col.no li::before { content: "–"; background: color-mix(in oklch, var(--stage-foreground) 20%, transparent); color: #fff; }
.fit-note { margin-top: 1.5rem; font-size: .9375rem; color: var(--stage-muted); }
@media (min-width: 860px) { .fit-grid { grid-template-columns: 1.15fr 1fr; } }

/* ---------- FAQ portada ---------- */
.faq-list { margin-top: 2.5rem; border-top: 1px solid var(--border); }
.faq-list details { border-bottom: 1px solid var(--border); padding: 1.15rem 0; }
.faq-list summary { cursor: pointer; font-size: 1.1875rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--primary); transition: transform .3s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { margin-top: .75rem; color: var(--muted-foreground); line-height: 1.65; max-width: 44rem; }

/* ---------- Barra fija de compra (móvil) ---------- */
.sticky-buy { position: fixed; left: .75rem; right: .75rem; bottom: .75rem; z-index: 60; display: none; align-items: center; gap: .75rem; padding: .6rem .6rem .6rem .75rem; border-radius: 1.1rem;
  background: color-mix(in oklch, var(--stage) 82%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid color-mix(in oklch, var(--stage-foreground) 12%, transparent); color: var(--stage-foreground);
  transform: translateY(140%); transition: transform .5s cubic-bezier(.2,.7,.2,1); box-shadow: 0 20px 40px -15px rgb(0 0 0 / .6); }
.sticky-buy img { width: 2.4rem; border-radius: 0 .15rem .15rem 0; }
.sticky-buy div { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.sticky-buy strong { font-size: .875rem; }
.sticky-buy span { font-size: .75rem; color: var(--stage-muted); }
.sticky-buy .btn { padding: .65rem 1.1rem; font-size: .9375rem; }
.sticky-buy.show { transform: none; }
@media (max-width: 800px) { .sticky-buy { display: flex; } footer { padding-bottom: 6rem; } }

/* Evita desbordamiento horizontal en móvil (barras y brillos decorativos) */
html, body { overflow-x: clip; }
.sticky-buy strong, .sticky-buy span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Visor universal: todo lo que se abre en grande, centrado ---------- */
.viewer { position: fixed; inset: 0; margin: auto; padding: 0; border: 0; background: transparent; width: 100vw; height: 100dvh; max-width: none; max-height: none; overflow: hidden; }
.viewer[open] { display: grid; place-items: center; }
.viewer::backdrop { background: rgb(0 0 0 / .86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.viewer-stage { display: grid; justify-items: center; gap: 1rem; max-width: 94vw; max-height: 94dvh; }
.viewer img { display: block; max-width: min(94vw, 900px); max-height: calc(94dvh - 4.5rem); width: auto; height: auto; margin: 0 auto; background: #fff; border-radius: .25rem; box-shadow: 0 30px 80px -20px rgb(0 0 0 / .8); }
.viewer iframe { display: block; width: min(94vw, 900px); height: calc(94dvh - 4.5rem); border: 0; border-radius: .25rem; background: #fff; }
.viewer-actions { display: flex; gap: 1rem; justify-content: center; align-items: center; }
.viewer-actions .btn { padding: .7rem 1.4rem; font-size: .9375rem; }
.viewer-actions:empty { display: none; }
.viewer-close { position: fixed; top: max(1rem, env(safe-area-inset-top)); right: 1rem; width: 2.75rem; height: 2.75rem; border-radius: 999px; border: 0; background: rgb(255 255 255 / .16); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; z-index: 2; }
.viewer-close:hover { background: rgb(255 255 255 / .28); }
.viewer img:not(.only) { cursor: zoom-out; }
[data-view] { cursor: zoom-in; }
html:has(.viewer[open]) { overflow: hidden; }

/* ---------- Precio y notas de compra ---------- */
.hero-price { margin-top: 1rem; font-size: .875rem; color: var(--stage-muted); letter-spacing: .02em; }
.closing-note { margin-top: 1rem; font-size: .875rem; color: var(--stage-muted); }
.cta-alt { margin-top: .9rem !important; font-size: .875rem !important; }
.cta-alt a { color: var(--stage-foreground); text-decoration: underline; text-underline-offset: 3px; }
.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; }

/* ---------- Muestra gratuita ---------- */
.lead-card { margin-top: 3.5rem; display: grid; gap: 2rem; padding: 2rem; border-radius: 1.75rem; background: linear-gradient(135deg, color-mix(in oklch, var(--bar-4) 22%, var(--stage)), color-mix(in oklch, var(--bar-2) 18%, var(--stage))); border: 1px solid color-mix(in oklch, var(--stage-foreground) 12%, transparent); }
.lead-copy h3 { margin-top: .75rem; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.lead-copy p:not(.eyebrow) { margin-top: .75rem; color: color-mix(in oklch, var(--stage-foreground) 78%, transparent); line-height: 1.6; }
.lead-form { display: grid; gap: .9rem; align-content: center; }
.lead-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.lead-row input { flex: 1 1 14rem; min-width: 0; padding: .9rem 1.1rem; border-radius: 999px; border: 1px solid color-mix(in oklch, var(--stage-foreground) 25%, transparent); background: rgb(0 0 0 / .35); color: var(--stage-foreground); font: inherit; font-size: 1rem; }
.lead-row input:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.lead-row .btn { flex: 0 0 auto; }
.lead-form .consent { font-size: .875rem; color: color-mix(in oklch, var(--stage-foreground) 80%, transparent); }
.lead-form .consent a { color: inherit; text-decoration: underline; }
.lead-form .form-msg.ok { background: rgb(42 157 143 / .2); color: #bff0e8; }
.lead-form .form-msg.err { background: rgb(226 87 46 / .2); color: #ffd2c4; }
@media (min-width: 900px) { .lead-card { grid-template-columns: 1fr 1fr; padding: 2.75rem; align-items: center; } }

/* ---------- Opiniones ---------- */
.reviews-cta { padding: 1rem 0 6rem; }
.reviews-cta .h-lg { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.btn-dark { background: #111; color: #fff; }
.link-dark { color: inherit; font-weight: 500; opacity: .8; }
.link-dark:hover { opacity: 1; }
