:root {
  --shadow: #050b16;
  --panel: #0b1524;
  --light: #5db4e2;
  --red: #d0131f;
  --bone: #f3efe7;
  --muted: #9fb0c2;
  --lead: #dce3ea;
  --rule: rgba(159, 176, 194, .2);
  --display: "Antonio", "Arial Narrow", Impact, sans-serif;
  --font: "Rubik", Arial, sans-serif;
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --gutter: clamp(20px, 5.56vw, 80px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--shadow); }
body { margin: 0; background: var(--shadow); color: var(--bone); font: 400 16px/1.5 var(--font); overflow-x: clip; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--light); outline-offset: 3px; border-radius: 2px; }
section[id] { scroll-margin-top: 24px; }
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 16px; border-radius: 4px;
  background: var(--bone); color: var(--shadow); font-weight: 500; transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
h2 { font-family: var(--display); font-weight: 700; font-size: clamp(44px, 5.14vw, 74px); line-height: 1.1; }
.eyebrow { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 2px; color: var(--light); }

.shader { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.veil { display: none; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(5, 11, 22, .85), rgba(5, 11, 22, .44)); }

/* Hero */
.hero { position: relative; min-height: 900px; overflow: hidden; background: var(--shadow); }
.nav {
  position: relative; z-index: 3; height: 56px; margin: 28px var(--gutter) 0;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: 1px; line-height: 1; }
.brand span { color: var(--red); letter-spacing: 0; }
.nav ul { display: flex; align-items: center; gap: 32px; font-size: 15px; }
.nav li a { position: relative; transition: color .2s ease; }
.nav li a:not(.home-link)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--red);
  transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.home-link { color: var(--light); text-decoration: underline; text-underline-offset: 3px; }

.hero-grid {
  position: relative; z-index: 2; margin: 0 var(--gutter); padding-top: 54px;
  display: grid; grid-template-columns: minmax(0, 1fr) 420px; column-gap: 40px; align-items: start;
  grid-template-areas: "kicker book" "title book" "rest book"; grid-template-rows: auto auto 1fr;
}
.kicker { grid-area: kicker; display: flex; align-items: center; gap: 12px; font-weight: 500; letter-spacing: .4px; }
.kicker i { width: 40px; height: 2px; background: var(--red); }
h1 { grid-area: title; margin-top: 26px; font-family: var(--display); font-weight: 700; font-size: clamp(38px, 5.83vw, 84px); line-height: 1.08; }

/* C3 · Línea a línea */
.mask { display: block; overflow: hidden; padding-top: .04em; margin-bottom: 6px; }
.line { display: inline-block; }
.js .line { animation: line-up .6s var(--ease-out) both; animation-delay: calc(var(--l) * 120ms + 120ms); }
.line-red { color: var(--red); margin-left: .18em; }
.js .line-red { animation: line-up .6s var(--ease-out) both, flicker .7s linear both; animation-delay: 480ms, 1040ms; }
@keyframes line-up { from { transform: translateY(112%); } }
@keyframes flicker {
  0%, 18%, 40%, 58%, 100% { opacity: 1; text-shadow: 0 0 22px rgba(208, 19, 31, .55); }
  10%, 48% { opacity: .22; text-shadow: none; }
}

.hero-rest { grid-area: rest; margin-top: 26px; }
.js .kicker, .js .hero-rest { animation: fade-up .6s var(--ease-out) both; }
.js .hero-rest { animation-delay: .75s; }
@keyframes fade-up { from { opacity: 0; translate: 0 16px; } }
.lead { max-width: 620px; font-size: clamp(17px, 1.46vw, 21px); line-height: 1.55; color: var(--lead); }
.cta-row { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }

/* C6 · Compra */
.buy {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 20px 32px; border-radius: 4px;
  background: var(--red); color: #fff; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 1px; line-height: 1.2;
  box-shadow: 0 14px 40px rgba(208, 19, 31, .33);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.buy-arrow { display: block; width: 24px; height: 24px; overflow: hidden; }
.sample { font-size: 17px; text-decoration: underline; text-underline-offset: 3px; transition: color .2s ease; }
.note { margin-top: 26px; font-size: 14px; color: var(--muted); }

/* C2 · Portada 3D */
.book { grid-area: book; position: relative; width: 420px; aspect-ratio: 2 / 3; margin-top: -2px; perspective: 1400px; }
.book-glow {
  position: absolute; inset: -60px -50px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(93, 180, 226, .36), rgba(93, 180, 226, 0));
}
.book-float { position: absolute; inset: 0; transform-style: preserve-3d; animation: book-in .9s var(--ease-out) .2s backwards; }
@keyframes book-in { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.book-3d {
  --rx: 0deg; --ry: 0deg; --sx: 0px; --sy: 0px; --thick: 24px;
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotate(4deg) rotateX(var(--rx)) rotateY(calc(var(--ry) - 6deg));
}
.book-front, .book-back, .book-spine, .book-pages, .book-shadow { position: absolute; display: block; }
.book-front { inset: 0; transform: translateZ(calc(var(--thick) / 2)); border-radius: 2px 3px 3px 2px; overflow: hidden; }
.book-front img { width: 100%; height: 100%; object-fit: cover; }
.book-back { inset: 0; transform: translateZ(calc(var(--thick) / -2)); background: #02050b; border-radius: 3px; }
.book-spine {
  top: 0; bottom: 0; left: calc(var(--thick) / -2); width: var(--thick); background: linear-gradient(90deg, #02050b, #0b1524 60%, #050b16);
  transform: rotateY(-90deg);
}
.book-pages {
  top: 3px; bottom: 3px; right: calc(var(--thick) / -2); width: var(--thick);
  background: repeating-linear-gradient(90deg, #d8d2c5 0 1px, #efe9dc 1px 3px);
  transform: rotateY(90deg);
}
.book-shadow {
  inset: 6% 2% -3% 4%; background: rgba(0, 0, 0, .85); filter: blur(34px);
  transform: translate3d(var(--sx), var(--sy), calc(var(--thick) * -2));
}

/* Ticker · C5 */
.ticker { overflow: hidden; padding: 16px 0; background: var(--red); }
.marquee-track { display: flex; width: max-content; }
.ticker.is-running .marquee-track { animation: marquee var(--marquee-duration, 40s) linear infinite; }
.ticker.is-running:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; flex: none; align-items: center; }
.marquee-group li {
  display: flex; align-items: center; white-space: nowrap;
  font-family: var(--display); font-weight: 700; font-size: 27px; line-height: 1.3; letter-spacing: 1px; color: #fff;
}
.marquee-group li::after { content: ""; width: 9px; height: 9px; margin: 0 44px; background: #fff; transform: rotate(45deg); }
@keyframes marquee { to { transform: translate3d(calc(-1 * var(--marquee-shift, 50%)), 0, 0); } }

/* Confesiones · C4 */
.discover { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 80px; padding: 130px var(--gutter); }
.discover-head { position: sticky; top: 90px; align-self: start; }
.discover-head h2 { margin-top: 22px; }
.discover-lead { margin-top: 22px; font-size: 19px; line-height: 1.6; color: var(--muted); }
.confessions li {
  display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 30px; padding: 26px 0;
  border-top: 1px solid var(--rule); transition: opacity .35s ease;
}
.confessions li:last-child { border-bottom: 1px solid var(--rule); }
.confessions span { font-family: var(--display); font-weight: 700; font-size: 46px; line-height: 1; color: var(--light); transition: color .3s ease; }
.confessions .is-red span { color: var(--red); }
.confessions p { font-size: 25px; font-weight: 500; line-height: 1.35; transition: color .3s ease; }
.confessions.is-tracking li:not(.is-active) { opacity: .4; }
.confessions li.is-active span { color: var(--red); }

/* Para quién */
.who { background: var(--panel); padding: 110px var(--gutter); }
.audience { margin-top: 56px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.audience > div { padding: 4px 44px; border-right: 1px solid var(--rule); }
.audience > div:first-child { padding-left: 0; }
.audience > div:last-child { border-right: 0; }
.audience svg { color: var(--light); }
.audience h3 { margin-top: 18px; font-size: 24px; font-weight: 600; line-height: 1.3; }
.audience p { margin-top: 18px; font-size: 20px; line-height: 1.5; color: var(--muted); }

/* Autor */
.author { display: grid; grid-template-columns: 480px minmax(0, 1fr); gap: 80px; align-items: center; padding: 120px var(--gutter); }
.portrait { position: relative; overflow: hidden; border-radius: 4px; }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.portrait::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 21, 36, 0) 45%, rgba(5, 11, 22, .9)); }
.portrait figcaption { position: absolute; z-index: 1; left: 24px; bottom: 18px; font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: 1px; }
.author-copy h2 { margin-top: 24px; }
.bio { margin-top: 24px; font-size: clamp(17px, 1.46vw, 21px); line-height: 1.6; color: var(--lead); }
.stats { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 20px 50px; }
.stats > div { display: flex; flex-direction: column-reverse; gap: 2px; }
.stats dd { font-family: var(--display); font-weight: 700; font-size: 58px; line-height: 1.1; }
.stats dt { font-size: 15px; color: var(--muted); }
.apps-link { display: inline-block; margin-top: 34px; font-size: 18px; font-weight: 500; color: var(--light); text-decoration: underline; text-underline-offset: 3px; }

/* CTA final */
.final { position: relative; overflow: hidden; background: var(--shadow); }
.final-inner { position: relative; z-index: 1; padding: 90px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 40px; min-height: 620px; }
.final h2 { font-size: clamp(57px, 8.33vw, 120px); line-height: 1.05; }
.final .buy { margin-top: 28px; }
.final-cover { width: min(293px, 24vw); rotate: -4deg; margin-right: 67px; border-radius: 3px; box-shadow: 0 24px 60px rgba(0, 0, 0, .8); }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 28px var(--gutter); font-size: 15px; color: var(--muted); border-top: 1px solid var(--rule); }
.footer nav { display: flex; gap: 26px; }
.footer a { transition: color .2s ease; }

/* M6 reutilizado */
.js [data-reveal]:not(.is-in) { opacity: 0; }
[data-reveal].is-in { animation: slide-in .5s var(--ease-out) backwards; animation-delay: var(--stagger, 0ms); }
@keyframes slide-in { from { opacity: 0; translate: 0 24px; } }

@media (hover: hover) {
  .nav li a:not(.home-link):hover::after { transform: scaleX(1); }
  .home-link:hover, .sample:hover, .apps-link:hover { color: var(--bone); }
  .footer a:hover { color: var(--bone); }
  .buy:hover { transform: translateY(-2px); background: #e0152a; box-shadow: 0 18px 56px rgba(208, 19, 31, .62); }
  .buy:hover .buy-arrow svg { animation: arrow-out-in .45s var(--ease-out); }
}
.buy:focus-visible .buy-arrow svg { animation: arrow-out-in .45s var(--ease-out); }
@keyframes arrow-out-in {
  0% { transform: none; }
  49% { transform: translate(26px, -26px); }
  50% { transform: translate(-26px, 26px); }
  100% { transform: none; }
}
/* C2 en pantallas táctiles: la portada flota */
@media (hover: none), (pointer: coarse) {
  .book-3d { animation: book-touch 5s ease-in-out infinite alternate; }
}
@keyframes book-touch {
  from { transform: rotate(4deg) rotateX(2deg) rotateY(-10deg) translateY(6px); }
  to { transform: rotate(4deg) rotateX(-2deg) rotateY(-2deg) translateY(-6px); }
}

@media (max-width: 1240px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .book { width: 340px; }
  .book-3d { --thick: 20px; }
  .discover { grid-template-columns: 340px minmax(0, 1fr); gap: 50px; }
  .author { grid-template-columns: 400px minmax(0, 1fr); gap: 50px; }
  .audience > div { padding-inline: 28px; }
}
@media (max-width: 960px) {
  .hero { min-height: 0; }
  .veil { display: block; }
  .nav { margin-top: 12px; }
  .nav ul li:not(:last-child) { display: none; }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: none; padding: 14px 0 40px;
    grid-template-areas: "kicker" "title" "book" "rest";
  }
  .book { width: min(300px, 62vw); margin: 34px auto 26px; }
  .book-3d { --thick: 16px; }
  h1 { font-size: clamp(29px, 9.2vw, 76px); margin-top: 16px; }
  .hero-rest { margin-top: 10px; }
  .cta-row { gap: 16px; }
  .note { margin-top: 18px; }

  .discover { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 56px var(--gutter); }
  .discover-head { position: static; }
  .confessions li { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 16px 0; }
  .confessions span { font-size: 30px; }
  .confessions p { font-size: 17px; line-height: 1.4; }
  .who { padding: 56px var(--gutter); }
  .audience { grid-template-columns: minmax(0, 1fr); margin-top: 24px; gap: 26px; }
  .audience > div { padding: 0; border-right: 0; }
  .audience svg { display: none; }
  .audience h3 { margin-top: 0; font-size: 18px; line-height: 1.35; }
  .audience p { margin-top: 4px; font-size: 16px; }
  .author { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 56px var(--gutter); }
  .stats { gap: 16px 30px; }
  .stats dd { font-size: 44px; }
  .final-inner { display: block; min-height: 0; padding: 56px var(--gutter); }
  .final-cover { display: none; }
}
@media (max-width: 640px) {
  .buy { width: 100%; padding: 17px 20px; font-size: 21px; }
  .sample { width: 100%; text-align: center; }
  .ticker { padding: 11px 0; }
  .marquee-group li { font-size: 19px; letter-spacing: .5px; }
  .marquee-group li::after { margin: 0 22px; width: 7px; height: 7px; }
  .brand { font-size: 22px; }
}

html:not(.js) .marquee-track { width: auto; justify-content: center; }
html:not(.js) .marquee-group { flex-wrap: wrap; justify-content: center; gap: 4px 0; padding: 0 16px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal]:not(.is-in) { opacity: 1; }
  .marquee-track { width: auto; justify-content: center; }
  .marquee-group { flex-wrap: wrap; justify-content: center; gap: 4px 0; padding: 0 16px; }
  .confessions.is-tracking li:not(.is-active) { opacity: 1; }
}
@media print {
  .js [data-reveal]:not(.is-in) { opacity: 1; }
  .shader, .veil, .skip-link { display: none; }
}
