/* "Cuento ilustrado": ink-and-watercolour storybook forest behind the hero.
   Text zones are cleared inside the painting itself; the mask only fades the bottom edge.
   .hero-anim is the light overlay (rays, pollen, a falling leaf), drawn by painter.js;
   it fades its own bottom edge, so it needs no CSS mask (cheaper to composite). */
.hero-paint, .hero-anim{
  position:absolute;top:0;left:0;width:100%;height:0;
  pointer-events:none;
  opacity:0;
}
.hero-paint{
  z-index:0;transition:opacity 1s ease;
  -webkit-mask-image:linear-gradient(to bottom, #000 calc(100% - 110px), transparent);
  mask-image:linear-gradient(to bottom, #000 calc(100% - 110px), transparent);
}
.hero-anim{z-index:1;transition:opacity 1.8s ease}
.hero-paint.is-on, .hero-anim.is-on{opacity:1}
@media (prefers-reduced-motion: reduce){
  .hero-paint, .hero-anim{transition:none}
}
/* Deeper into the forest: below the hero the world is painted in lazy pieces on three planes
   (misty far trees, the forest itself, a few fronds in front), moved by painter.js while
   scrolling; light shafts breathe on the compositor; .deep-anim is the living layer
   (leaves, fireflies, pollen, a butterfly, peeking Boskis) and fades near every word. */
/* each plane lives in a page-sized, clipped host: nothing moved by parallax can grow the page */
.deep-host{position:absolute;left:0;top:0;width:100%;height:0;pointer-events:none;overflow:hidden;overflow:clip}
.deep-piece{position:absolute;pointer-events:none;z-index:0}
.deep-piece:not(.deep-ray){animation:deep-in .9s ease both}
@keyframes deep-in{from{opacity:0}}
@keyframes deep-out{to{opacity:0}}
.deep-far, .deep-fg{will-change:transform}
.deep-fg{z-index:3}
.deep-ray{transform-origin:50% 0;animation:deep-ray-sway 11s ease-in-out infinite alternate}
.deep-ray .ray-c{display:block;width:100%;height:100%;animation:deep-ray-breathe 4s ease-in-out infinite alternate}
@keyframes deep-ray-sway{from{transform:rotate(-1.4deg)}to{transform:rotate(1.4deg)}}
@keyframes deep-ray-breathe{0%{opacity:.18}38%{opacity:1}58%{opacity:.55}100%{opacity:1}}
.deep-anim{position:absolute;left:0;top:0;width:100%;pointer-events:none;z-index:3}
@media (prefers-reduced-motion: reduce){
  .deep-piece:not(.deep-ray){animation:none}
  .deep-ray, .deep-ray .ray-c{animation:none}
  .deep-ray .ray-c{opacity:.8}
}
