:root {
  --paper: #f6f1e7;
  --paper-2: #efe7d8;
  --page: #fbf8f1;
  --ink: #2a2520;
  --ink-2: #5d544a;
  --muted: #8b8074;
  --sun: #d49a1e;
  --sun-deep: #9a6510;
  --desk: #1d1915;
  --line: rgba(42, 37, 32, .14);
  --display: 'Cormorant Garamond', 'Garamond', Georgia, serif;
  --text: 'EB Garamond', 'Garamond', Georgia, serif;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .18  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper) var(--grain);
  color: var(--ink);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
em { font-style: italic; }

/* ------------------------------------------------------------ botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5em; min-height: 44px; padding: .55em 1.35em;
  border-radius: 999px; border: 1px solid var(--ink);
  font-family: var(--text); font-size: 1rem; letter-spacing: .02em;
  text-decoration: none; cursor: pointer; background: transparent;
  transition: background .25s, color .25s, transform .25s, border-color .25s;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--sun-deep); border-color: var(--sun-deep); }
.btn.ghost:hover { background: rgba(42, 37, 32, .06); }
.btn.small { min-height: 34px; padding: .3em 1em; font-size: .9rem; }
.btn:focus-visible, .icon-btn:focus-visible, .book-3d:focus-visible, .nav:focus-visible {
  outline: 2px solid var(--sun); outline-offset: 3px;
}

.kicker {
  margin: 0 0 .4rem; font-size: .82rem; letter-spacing: .28em; text-transform: uppercase; color: var(--muted);
}

/* ------------------------------------------------------------ landing */
.landing {
  --gap: clamp(16px, 2.2vw, 32px);
  height: 100vh; height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap); padding: var(--gap);
}

/* foto del autor: media pantalla, con el texto arriba a la derecha */
.author {
  position: relative; overflow: hidden; border-radius: 6px; min-height: 0; container-type: size;
  background: #0f0e0d; color: #f3ede2;
  box-shadow: 0 30px 60px -30px rgba(40, 25, 5, .55);
}
.portrait {
  position: absolute; left: 44%; bottom: 0; transform: translateX(-50%);
  width: max(min(100cqw, 88cqh), 70cqw); height: auto; aspect-ratio: 1; display: block;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%), linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to bottom, transparent 0, #000 16%), linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent);
          mask-composite: intersect;
}
.author::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 100% 0%, rgba(10, 8, 6, .72), transparent 70%),
    linear-gradient(to top, rgba(10, 8, 6, .55), transparent 28%);
}
.author-text {
  position: absolute; z-index: 1; top: clamp(20px, 4vh, 48px); right: clamp(20px, 3vw, 44px);
  width: min(35%, 330px); text-align: right;
}
.author .kicker { color: rgba(243, 237, 226, .7); }
h1 {
  font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 3vw, 3.6rem);
  line-height: .95; margin: 0 0 .9rem; letter-spacing: -.01em; color: #fbf7ef;
  text-shadow: 0 2px 20px rgba(0,0,0,.4);
}
h1 em { color: #e9b84a; font-weight: 400; }
.bio { margin: 0; font-size: clamp(.95rem, 1.05vw, 1.08rem); line-height: 1.5; color: rgba(243, 237, 226, .88); text-shadow: 0 1px 12px rgba(0,0,0,.5); }
.author-actions {
  position: absolute; z-index: 1; left: 50%; bottom: clamp(18px, 4vh, 40px); transform: translateX(-50%);
  display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100% - 32px);
}
.contact-btn {
  background: rgba(251, 247, 239, .94); color: var(--ink); border-color: transparent;
  padding: .65em 1.6em; white-space: nowrap; backdrop-filter: blur(4px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
}
.contact-btn:hover { transform: translateY(-1px); background: #fff; }
.tiktok-btn { background: rgba(20, 18, 16, .78); color: #fbf7ef; border-color: rgba(251, 247, 239, .35); }
.tiktok-btn:hover { background: #000; }
.contact-btn.tiktok-btn svg { color: #fbf7ef; }
.contact-btn svg { width: 1.15em; height: 1.15em; color: #c5221f; }

.actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.contact a { text-decoration: none; border-bottom: 1px solid var(--line); }

/* biblioteca */
.library { display: flex; flex-direction: column; min-height: 0; }
.lib-head { display: flex; align-items: center; gap: 1rem; padding: 6px 4px 0; }
.lib-head .section-label { flex: 1; }
.tiktok-link { font-size: .9rem; color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line); }
.section-label {
  font-family: var(--text); font-weight: 400; font-size: .82rem;
  letter-spacing: .28em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 1rem; margin: 0;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.shelf-grid {
  list-style: none; margin: 0; padding: clamp(18px, 3vh, 30px) 4px 24px;
  display: grid; grid-template-columns: repeat(3, minmax(0, var(--card-w))); justify-content: center; align-content: start;
  --card-w: calc((100svh - 2 * var(--gap) - 60px) / 2 * .52);
  gap: clamp(22px, 3.2vh, 40px) clamp(14px, 1.6vw, 26px);
  overflow-y: auto; min-height: 0; flex: 1;
  scrollbar-width: thin; scrollbar-color: rgba(42,37,32,.25) transparent;
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 28px), transparent);
}
.book-card { display: flex; flex-direction: column; min-width: 0; }
.book-card h3 {
  font-family: var(--display); font-weight: 500; font-size: clamp(1rem, 1.15vw, 1.2rem); line-height: 1.1;
  margin: .9em 0 .15em;
}
.book-sub { margin: 0 0 .7em; font-size: .82rem; color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; }
.card-actions .btn { flex: 1; min-width: 0; padding-left: .6em; padding-right: .6em; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; pointer-events: none; }

/* libro en 3D */
.book-3d {
  position: relative; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 0; background: none; cursor: pointer;
  perspective: 900px; display: block; container-type: inline-size;
}
.book-cover, .book-pages { position: absolute; inset: 0; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.book-cover {
  z-index: 2; border-radius: 2px 5px 5px 2px; overflow: hidden;
  background: var(--page) var(--grain);
  box-shadow: inset 5px 0 8px -5px rgba(0,0,0,.35), inset -1px 0 0 rgba(0,0,0,.06), 0 18px 30px -16px rgba(60, 35, 5, .55), 0 4px 10px -4px rgba(0,0,0,.25);
  transform-origin: left center; transform: rotateY(-10deg);
  display: block;
}
.book-pages {
  z-index: 1; left: 4px; right: -3px; top: 3px; bottom: 3px; border-radius: 2px 4px 4px 2px;
  background: repeating-linear-gradient(90deg, #f3eee2 0 2px, #e6dfcf 2px 3px);
  transform-origin: left center; transform: rotateY(-10deg) translateZ(-6px);
}
.book-3d:hover .book-cover { transform: rotateY(-22deg); }
.book-3d:hover .book-pages { transform: rotateY(-17deg) translateZ(-6px); }
.cover-splats { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* imagen original al 50 % bajo los splats: mismo rectángulo que en js (x 13 %, ancho 74 %) */
.cover-base { position: absolute; left: 13%; width: 74%; bottom: 7.5%; aspect-ratio: 3 / 4; height: auto; opacity: 1; mix-blend-mode: multiply; pointer-events: none; }
.cover-title {
  position: absolute; left: 0; right: 0; top: 7%; text-align: center; pointer-events: none; z-index: 3;
  font-family: var(--display); font-weight: 500; font-size: 9.5cqw; line-height: 1; color: var(--ink);
}
.cover-title em { display: block; font-weight: 400; color: var(--sun-deep); font-size: .62em; margin-top: .18em; line-height: 1.05; white-space: nowrap; }
.cover-author {
  position: absolute; left: 0; right: 0; bottom: 5.5%; text-align: center; pointer-events: none; z-index: 3;
  font-size: 4.3cqw; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-2);
}

/* próximos libros (deshabilitados) */
.book-card.soon { pointer-events: none; user-select: none; }
.book-card.soon .book-3d { cursor: default; }
.book-card.soon .book-cover {
  display: grid; place-items: center; text-align: center;
  background: linear-gradient(160deg, #efe8da, #e6ddcc) ;
  box-shadow: inset 5px 0 8px -5px rgba(0,0,0,.18), 0 10px 22px -16px rgba(60, 35, 5, .35);
}
.book-card.soon .book-cover span {
  font-family: var(--display); font-style: italic; font-size: 11cqw; color: rgba(42,37,32,.32); line-height: 1.1;
}
.book-card.soon .book-cover span small { display: block; font-style: normal; font-family: var(--text); font-size: .38em; letter-spacing: .3em; text-transform: uppercase; margin-top: .9em; }
.book-card.soon h3, .book-card.soon .book-sub { color: rgba(42,37,32,.38); }
.book-card.soon .book-pages { opacity: .5; }

/* capa de la explosión de splats al abrir el libro */
.burst-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 30; pointer-events: none; }

/* ------------------------------------------------------------ lector */
.reader {
  position: fixed; inset: 0; z-index: 10; display: grid; grid-template-rows: auto 1fr auto;
  background: radial-gradient(ellipse at 50% 45%, #3a322a 0%, var(--desk) 70%);
  color: #efe6d6; opacity: 0; transition: opacity .45s;
  touch-action: none;
}
.reader.show { opacity: 1; }
.reader[hidden] { display: none; }
.reader-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
.reader-title { flex: 1; margin: 0; text-align: center; font-family: var(--display); font-style: italic; font-size: 1.15rem; color: #d8ccb8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader .btn.primary { background: #efe6d6; color: var(--desk); border-color: #efe6d6; }
.reader .btn.primary:hover { background: var(--sun); border-color: var(--sun); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(239,230,214,.25); background: none; color: #efe6d6; font-size: 1.2rem; cursor: pointer; }
.icon-btn:hover { background: rgba(239,230,214,.08); }

.stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; }
.nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 48px; height: 72px; border: 0; background: none; color: rgba(239,230,214,.6);
  font-size: 3rem; line-height: 1; cursor: pointer; font-family: var(--display); transition: color .2s, opacity .3s;
}
.nav:hover { color: #fff; }
.nav.prev { left: 6px; } .nav.next { right: 6px; }
.nav[disabled] { opacity: 0; pointer-events: none; }

.book { position: relative; perspective: 2600px; transition: transform .9s cubic-bezier(.6,.05,.3,1); }

/* páginas */
.page {
  position: absolute; inset: 0; overflow: hidden;
  background: var(--page) var(--grain);
  color: var(--ink);
}
.page .inner { position: absolute; inset: 7% 9% 8.5%; }
.page .folio { position: absolute; bottom: 3.2%; left: 0; right: 0; text-align: center; font-size: calc(var(--pw) * .026); color: var(--muted); letter-spacing: .1em; }
.page canvas.splat-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }

/* modo libro abierto (escritorio) */
.book.spread .leaf {
  position: absolute; top: 0; left: 50%; width: 50%; height: 100%;
  transform-origin: left center; transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(.55,.06,.25,1);
}
.book.spread .leaf.flipped { transform: rotateY(-180deg); }
.book.spread .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.book.spread .face.back { transform: rotateY(180deg); }
.book.spread .face.front .page { border-radius: 0 3px 3px 0; }
.book.spread .face.back .page { border-radius: 3px 0 0 3px; }
.book.spread .face .page:not(.p-cover)::before {
  content: ''; position: absolute; top: 0; bottom: 0; width: 7%; pointer-events: none; z-index: 1;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0,0,0,.25) 18%, transparent 32%, transparent 68%, rgba(0,0,0,.25) 82%, #000 100%);
          mask-image: linear-gradient(to bottom, #000 0, rgba(0,0,0,.25) 18%, transparent 32%, transparent 68%, rgba(0,0,0,.25) 82%, #000 100%);
}
.book.spread .face.front .page:not(.p-cover)::before { left: 0; background: linear-gradient(90deg, rgba(60,40,10,.26), transparent); }
.book.spread .face.back .page:not(.p-cover)::before { right: 0; background: linear-gradient(270deg, rgba(60,40,10,.26), transparent); }
.book.spread::before {
  content: ''; position: absolute; inset: 0; border-radius: 4px; pointer-events: none;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 10px 30px -10px rgba(0,0,0,.6);
  transition: left .9s, right .9s;
}
.book.spread.closed-front::before { left: 50%; }
.book.spread.closed-back::before { right: 50%; }
.leaf .shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1s; z-index: 4; }
.leaf.turning .shade { opacity: 1; animation: shade 1s ease-in-out; }
.face.front .shade { background: linear-gradient(90deg, rgba(0,0,0,.25), rgba(0,0,0,0) 60%); }
.face.back .shade { background: linear-gradient(270deg, rgba(0,0,0,.25), rgba(0,0,0,0) 60%); }
@keyframes shade { 0% { opacity: 0 } 50% { opacity: 1 } 100% { opacity: 0 } }

/* modo una página (móvil) */
.book.single .mpage {
  position: absolute; inset: 0; transform-origin: left center;
  transition: transform .8s cubic-bezier(.55,.06,.25,1), box-shadow .8s;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 24px 50px -20px rgba(0,0,0,.7);
  border-radius: 2px 4px 4px 2px; overflow: hidden;
}
.book.single .mpage.gone { transform: rotateY(-178deg); }
.book.single .mpage .page { box-shadow: inset 10px 0 16px -12px rgba(60,40,10,.3); }

/* portada dentro del lector */
.p-cover .cover-title { font-size: calc(var(--pw) * .095); top: 7%; }
.p-cover .cover-author { font-size: calc(var(--pw) * .036); bottom: 6%; }
.p-cover .tap { position: absolute; left: 0; right: 0; bottom: 13%; text-align: center; font-style: italic; color: var(--muted); font-size: calc(var(--pw) * .032); z-index: 3; animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35 } }

.p-epigraph .inner { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.p-epigraph blockquote { margin: 0; font-family: var(--display); font-style: italic; font-size: calc(var(--pw) * .052); line-height: 1.3; color: var(--ink-2); }
/* la fuente del epígrafe: pequeña y discreta, para que no parezca un título */
.p-epigraph cite { display: block; margin-top: 1.6em; font-style: italic; font-size: calc(var(--pw) * .03); letter-spacing: .02em; color: var(--muted); }

.p-index h2 { font-family: var(--display); font-weight: 500; font-size: calc(var(--pw) * .07); margin: 8% 0 8%; text-align: center; }
.p-index ol { list-style: none; margin: 0; padding: 0; counter-reset: i; }
.p-index li { counter-increment: i; }
.p-index button {
  width: 100%; display: flex; align-items: baseline; gap: .6em; padding: .42em 0; border: 0; background: none; cursor: pointer;
  font-family: var(--text); font-size: calc(var(--pw) * .036); text-align: left; color: var(--ink);
}
.p-index button::before { content: counter(i, upper-roman) '.'; width: 2.2em; color: var(--muted); font-size: .85em; }
.p-index button .dots { flex: 1; border-bottom: 1px dotted rgba(42,37,32,.35); transform: translateY(-.25em); }
.p-index button:hover { color: var(--sun-deep); }

.p-end .inner { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1.2em; }
.p-end h2 { font-family: var(--display); font-weight: 500; font-style: italic; font-size: calc(var(--pw) * .08); margin: 0; line-height: 1; }
.p-end p { margin: 0; color: var(--ink-2); font-size: calc(var(--pw) * .036); max-width: 26ch; }
.p-end .btn { font-size: calc(var(--pw) * .034); }
.p-end .contact { display: flex; flex-direction: column; align-items: center; gap: .55em; margin-top: .3em; font-size: calc(var(--pw) * .032); }

/* oda */
.flow { position: absolute; inset: 0; font-size: var(--fs); line-height: 1.42; hyphens: manual; }
.flow .num { margin: 0; text-align: left; font-size: .72em; letter-spacing: .3em; color: var(--muted); }
.flow h2 { font-family: var(--display); font-weight: 500; font-style: italic; font-size: 1.75em; line-height: 1.05; margin: .15em 0 .9em; color: var(--ink); }
.flow .st { margin: 0 0 .85em; }
.flow .ln { padding-left: 0; text-indent: 0; text-align: left; hyphens: manual; }   /* versos: sin justificar */
.flow .pr { text-align: justify; text-indent: 0; padding-left: 0; hyphens: auto; }
/* sin sangría: los párrafos en prosa se separan con un poco de aire */
.flow .ln + .pr, .flow .pr + .ln { margin-top: .45em; }
.flow .pr.cont { margin-top: 0; }

.flow .spacer { float: right; width: 1px; }
.flow .art { float: right; clear: right; position: relative; margin-left: 1em; }
.flow .listen {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: .5em;
  border: 0; background: none; cursor: pointer; color: var(--ink-2); font-style: italic; font-size: .9em;
  transition: opacity .6s;
}
.flow .listen i {
  width: 3.2em; height: 3.2em; border-radius: 50%; border: 1px solid rgba(42,37,32,.35); display: grid; place-items: center;
  background: rgba(251,248,241,.6); backdrop-filter: blur(2px);
}
.flow .listen i::before { content: ''; border-left: .9em solid var(--ink); border-top: .55em solid transparent; border-bottom: .55em solid transparent; margin-left: .2em; }
.flow .listen:hover i { border-color: var(--sun-deep); }
.flow .listen.hide { opacity: 0; pointer-events: none; }
.art .art-base { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; max-width: none; mix-blend-mode: multiply; opacity: 1; pointer-events: none; }
.art .art-base.full { opacity: 1; }
.flow .art-mobile { float: none; margin: 0; }

/* reproductor */
.player {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  width: min(720px, calc(100% - 32px)); margin: 0 auto; padding: 10px 4px 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  transition: opacity .4s;
}
.player.off { opacity: .35; pointer-events: none; }
.play { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(239,230,214,.35); background: rgba(239,230,214,.06); cursor: pointer; display: grid; place-items: center; }
.play span { width: 0; height: 0; border-left: 13px solid #efe6d6; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 4px; }
.play.on span { width: 12px; height: 15px; border: 0; margin: 0; border-left: 4px solid #efe6d6; border-right: 4px solid #efe6d6; }
.play:hover { border-color: var(--sun); }
.track { min-width: 0; }
.now { margin: 0 0 6px; font-family: var(--display); font-style: italic; font-size: 1.05rem; color: #d8ccb8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { position: relative; height: 18px; cursor: pointer; touch-action: none; }
.bar::before { content: ''; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: rgba(239,230,214,.18); border-radius: 2px; }
.bar .fill { position: absolute; left: 0; top: 8px; height: 2px; width: 0; background: var(--sun); border-radius: 2px; }
.bar .fill::after { content: ''; position: absolute; right: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--sun); }
.bar .mark { position: absolute; left: 50%; top: 5px; width: 1px; height: 8px; background: rgba(239,230,214,.4); }
.time { margin: 0; font-variant-numeric: tabular-nums; font-size: .95rem; color: #bfb29e; min-width: 3.2em; text-align: right; }

/* ------------------------------------------------------------ lector: interfaz flotante */
.reader { display: block; }
.reader .stage { position: absolute; inset: 0; }
.reader-bar {
  position: absolute; z-index: 6; top: 0; left: 0; right: 0; pointer-events: none;
  justify-content: space-between; padding: 14px 18px; padding-top: max(14px, env(safe-area-inset-top));
}
.reader-bar > * { pointer-events: auto; }
.reader-title {
  flex: 0 1 auto; max-width: 52vw; padding: .32em 1.1em; border-radius: 999px; color: #fbf4e6;
  background: rgba(20, 17, 14, .74); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 230, 214, .1);
}
.icon-btn { background: rgba(20, 17, 14, .42); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.player {
  position: absolute; z-index: 6; left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(620px, calc(100% - 28px)); margin: 0;
  padding: 7px 20px 7px 7px; gap: 12px; border-radius: 999px;
  background: rgba(20, 17, 14, .55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(239, 230, 214, .12); box-shadow: 0 14px 36px -14px rgba(0, 0, 0, .7);
}
.player .play { width: 40px; height: 40px; }
.player .now { margin: 0 0 1px; font-size: .95rem; }
.reader-bar, .player, .nav { transition: opacity .6s ease; }
.reader.idle .reader-bar, .reader.idle .player, .reader.idle .nav { opacity: 0; }
.reader.idle .player.off { opacity: 0; }

/* ------------------------------------------------------------ lector: contraluz y flotación */
.reader { background: radial-gradient(ellipse at 50% 44%, #4b4133 0%, #2c261e 52%, #17140f 100%); }
.stage::before {
  content: ''; position: absolute; left: 50%; top: 46%; width: 125vmin; height: 125vmin;
  transform: translate(-50%, -50%); pointer-events: none; opacity: .8;
  background: radial-gradient(circle, rgba(255, 206, 120, .62) 0%, rgba(240, 156, 60, .26) 24%, rgba(160, 80, 25, .08) 42%, rgba(120, 60, 20, 0) 62%);
  transition: opacity 1.2s ease;
}
.stage.at-cover::before { opacity: 1; }
.stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: var(--grain), radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%);
  opacity: .9; mix-blend-mode: overlay;
}
.book-float { position: relative; z-index: 1; transition: scale 1.1s cubic-bezier(.4,.1,.2,1); }
.stage.at-cover .book-float { scale: .8; }
.book-float::after {
  content: ''; position: absolute; left: 50%; bottom: -54px; width: 44%; height: 40px;
  transform: translateX(-50%); pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .7), transparent 70%); filter: blur(8px);
  transition: opacity 1s ease;
}
.stage.at-cover .book-float { animation: float 7s ease-in-out infinite; }
.stage.at-cover .book-float::after { opacity: 1; animation: floor-shadow 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-.35deg); } 50% { transform: translateY(-14px) rotate(.35deg); } }
@keyframes floor-shadow { 0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; } 50% { transform: translateX(-50%) scale(.82); opacity: .6; } }
/* la portada iluminada desde atrás: borde que brilla, brillo que la cruza y bordes envejecidos */
.stage.at-cover .p-cover {
  box-shadow: 0 0 0 1px rgba(255, 226, 170, .6), 0 0 34px 4px rgba(255, 200, 110, .55), 0 0 110px 26px rgba(250, 160, 60, .32), 0 60px 90px -30px rgba(0, 0, 0, .85);
  transition: box-shadow 1.2s ease;
}
.p-cover::before {
  content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; mix-blend-mode: multiply;
  background: radial-gradient(ellipse at 50% 38%, transparent 52%, rgba(96, 58, 22, .26) 100%);
}
.p-cover::after {
  content: ''; position: absolute; inset: -20%; z-index: 4; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(112deg, transparent 38%, rgba(255, 238, 205, .55) 50%, transparent 62%);
  animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen { 0%, 100% { transform: translateX(-28%); opacity: .2; } 50% { transform: translateX(28%); opacity: .9; } }

/* ------------------------------------------------------------ lector: acuarela flotante */
.player.off { opacity: 0 !important; visibility: hidden; pointer-events: none; }
.flow .spacer.left { float: right; width: 1px; }
.flow .spacer.right { float: left; width: 1px; }
.flow .art-shape { shape-margin: 3em; }
.flow .art-shape.left { float: right; clear: right; }
.flow .art-shape.right { float: left; clear: left; }
.spread-art {
  position: absolute; z-index: 60; pointer-events: none; opacity: 0;
  mix-blend-mode: multiply;   /* lo casi blanco desaparece sobre el papel */
  transition: opacity .3s ease;
  animation: art-float 7s ease-in-out infinite;
  will-change: transform;
}
.spread-art.on { opacity: 1; transition: opacity .8s ease; }
/* la sombra la proyecta la silueta del dibujo, no un rectángulo */
.spread-art .art-base { position: absolute; opacity: 1; }
.spread-art canvas.splat-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes art-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* las páginas también reciben el contraluz (sin que el libro se mueva) */
.stage:not(.at-cover) .book.spread::before {
  box-shadow: 0 0 0 1px rgba(255, 222, 165, .28), 0 0 46px 6px rgba(255, 192, 104, .32),
              0 0 140px 34px rgba(240, 150, 60, .16), 0 40px 80px -30px rgba(0, 0, 0, .8);
}

/* contraportada: frase equilibrada, sin palabras sueltas */
.p-end .end-msg { max-width: 30ch; text-wrap: balance; }

/* licencia */
.license { margin: 14px 4px 0; font-size: .78rem; line-height: 1.45; color: var(--muted); }
.license a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.license a:hover { color: var(--ink); border-color: var(--sun); }
.p-end .license { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; font-size: calc(var(--pw) * .024); max-width: none; }

/* ------------------------------------------------------------ celular: lectura con scroll */
.reader.scrolling { touch-action: auto; }
.reader.scrolling .book-float { position: absolute; inset: 0; scale: none; animation: none; }
.reader.scrolling .book-float::after { display: none; }
.book.scroll {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  touch-action: pan-y; perspective: none;
}
.scroll-doc {
  max-width: 620px; margin: 0 auto; min-height: 100%;
  background: var(--page) var(--grain); color: var(--ink);
  padding: 76px 24px 130px; box-shadow: 0 0 60px rgba(0, 0, 0, .5);
}
.scroll-doc section { padding: 34px 0 46px; border-bottom: 1px solid var(--line); }
.scroll-doc section:last-child { border-bottom: 0; }
.s-cover { text-align: center; }
.s-cover h1 { color: var(--ink); text-shadow: none; font-size: 2.6rem; margin: 0 0 .4rem; }
.s-cover h1 em { display: block; font-size: .62em; color: var(--sun-deep); margin-top: .2em; }
.s-cover img { width: 78%; max-width: 360px; display: block; margin: 18px auto; mix-blend-mode: multiply; }
.s-by { letter-spacing: .3em; text-transform: uppercase; font-size: .78rem; color: var(--ink-2); margin: 0; }
.s-epigraph { text-align: center; }
.s-epigraph blockquote { margin: 0; font-family: var(--display); font-style: italic; font-size: 1.35rem; line-height: 1.35; color: var(--ink-2); }
.s-epigraph cite { display: block; margin-top: 1.1em; font-style: italic; font-size: .9rem; color: var(--muted); }
.s-index h2, .s-end h2 { font-family: var(--display); font-weight: 500; font-size: 1.9rem; text-align: center; margin: 0 0 1rem; }
.s-index ol { list-style: none; margin: 0; padding: 0; }
.s-index button { width: 100%; text-align: left; border: 0; background: none; padding: .55em 0; font-size: 1.05rem; color: var(--ink); cursor: pointer; border-bottom: 1px dotted var(--line); }
.s-index button span { display: inline-block; width: 2.6em; color: var(--muted); font-size: .85em; }
.s-poem .num { margin: 0; font-size: .75rem; letter-spacing: .3em; color: var(--muted); }
.s-poem h2 { font-family: var(--display); font-weight: 500; font-style: italic; font-size: 2rem; line-height: 1.05; margin: .2em 0 1em; }
.flow-s { font-size: 1.08rem; line-height: 1.55; }
.flow-s .st { margin: 0 0 1em; }
.flow-s .ln { text-align: left; }
.flow-s .pr { text-align: justify; hyphens: auto; }
.flow-s .ln + .pr, .flow-s .pr + .ln { margin-top: .5em; }
.s-poem figure { margin: 22px auto 0; max-width: 420px; }
.s-poem figure img { width: 100%; height: auto; display: block; mix-blend-mode: multiply; }
.s-end { text-align: center; }
.s-end p { color: var(--ink-2); max-width: 30ch; margin: 0 auto 1.2rem; text-wrap: balance; }
.s-end .contact { display: flex; justify-content: center; }
.s-end .contact a, .s-end .license a { color: inherit; }
.s-end .license { max-width: none; margin-top: 2rem; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 860px) {
  .landing { height: auto; grid-template-columns: 1fr; }
  .author { container-type: normal; display: flex; flex-direction: column; }
  .author-text { position: relative; top: auto; right: auto; width: auto; padding: 26px 22px 0; }
  .portrait { position: relative; left: auto; transform: none; width: 100%; margin-top: -24px; }
  .bio { max-width: 30ch; margin-left: auto; }
  .author-text { order: -1; }
  .author-actions { position: relative; left: auto; bottom: auto; transform: none; align-self: center; margin: -76px auto 22px; }
  h1 { font-size: 2.3rem; }
  .bio { font-size: .92rem; }
  .shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; mask-image: none; }
  .nav { display: none; }
  .reader-title { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01s !important; animation: none !important; }
}
