/* Haddy Follows You — interactive portrait (Book 1, page 2).
   Three stacked copies of the same artwork: the head layer and the two eye
   layers are masked cut-outs of the original image that drift toward the
   visitor's pointer. No artwork is redrawn; if JS is off, the plain
   picture shows. Honors prefers-reduced-motion. */
.haddy-follow {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 20px;
  background: #eef3e4;
  box-shadow: 0 10px 30px rgba(27, 67, 50, .18);
  -webkit-tap-highlight-color: transparent;
}
.haddy-follow .hf-base {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.haddy-follow .hf-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  will-change: transform;
}
/* Head: feathered ellipse around Haddy's head, pivoting at the neck base. */
.haddy-follow .hf-head {
  -webkit-mask-image: radial-gradient(ellipse 36% 33% at 50% 26%, #000 58%, transparent 76%);
  mask-image: radial-gradient(ellipse 36% 33% at 50% 26%, #000 58%, transparent 76%);
  transform-origin: 50.8% 52.2%;
}
/* Eyes: feathered ellipses exactly over the painted eyes. */
.haddy-follow .hf-eye-l {
  -webkit-mask-image: radial-gradient(ellipse 8% 9.5% at 37.4% 26.2%, #000 52%, transparent 76%);
  mask-image: radial-gradient(ellipse 8% 9.5% at 37.4% 26.2%, #000 52%, transparent 76%);
  transform-origin: 37.4% 26.2%;
}
.haddy-follow .hf-eye-r {
  -webkit-mask-image: radial-gradient(ellipse 8% 9.5% at 62.3% 23.7%, #000 52%, transparent 76%);
  mask-image: radial-gradient(ellipse 8% 9.5% at 62.3% 23.7%, #000 52%, transparent 76%);
  transform-origin: 62.3% 23.7%;
}
.haddy-follow figcaption {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(27, 67, 50, .88);
  color: #fff8ea;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
}
/* Sizes where the component is placed */
.haddy-follow.hf-in-band {
  width: min(300px, 78vw);
  margin-top: 16px;
}
.haddy-follow.hf-in-kids {
  width: min(340px, 82vw);
  margin: 10px auto 4px;
}
@media (prefers-reduced-motion: reduce) {
  .haddy-follow .hf-layer { display: none; }
}
