/* The Midway Goes Still — fairy lights throughout the full reading experience.
   Decorative only: no pointer interaction, flashing, or obstructed captions. */
.hero,.entrance,.folklore-plates,.storybook-section,.after-turn-archive,.interlude,
.gallery-section,.soundtrack-section,.creator-note,.end-section{
  position:relative;isolation:isolate;
}
.midway-ambient-glimmers{
  position:absolute;inset:0;pointer-events:none!important;overflow:hidden;
  z-index:4;isolation:isolate;
}
.midway-ambient-glimmer{
  position:absolute;left:var(--mx);top:var(--my);
  width:var(--ms);height:var(--ms);border-radius:50%;
  background:radial-gradient(circle at 37% 30%,#fffdf2 0 18%,#fff1c6 42%,#f1bd74 71%,#a87535 100%);
  box-shadow:0 0 7px 3px rgba(255,235,180,.70),0 0 20px 8px rgba(239,172,85,.33),0 0 34px 12px rgba(225,148,56,.12);
  opacity:.83;transform:scale(.9);
  animation:midway-ambient-breathe var(--mt,10s) ease-in-out var(--md,0s) infinite alternate;
}
.midway-ambient-glimmer--bright{
  box-shadow:0 0 8px 4px rgba(255,241,202,.85),0 0 24px 10px rgba(250,187,97,.44),0 0 46px 15px rgba(226,151,68,.15);
  opacity:.94;
}
@keyframes midway-ambient-breathe{
  0%,100%{opacity:.65;transform:translateY(0) scale(.92)}
  55%{opacity:.99;transform:translateY(-3px) scale(1.12)}
}
/* The fair's little wires appear at several different points down the page. */
.midway-fairy-strand{position:absolute;right:4%;top:20px;width:clamp(150px,25vw,315px);height:80px;z-index:4;pointer-events:none!important;transform:rotate(-2deg)}
.midway-fairy-strand__cord{position:absolute;left:0;top:-28px;width:100%;height:84px;border-bottom:1px solid rgba(217,181,128,.45);border-radius:0 0 50% 50%}
.midway-fairy-strand__bulb{position:absolute;left:var(--bx);top:30px;width:8px;height:10px;border-radius:45% 45% 58% 58%;background:radial-gradient(ellipse at 38% 24%,#fffef5 0 25%,#ffe2a2 52%,#d79645 100%);box-shadow:0 0 6px 2px rgba(255,234,182,.8),0 0 17px 7px rgba(242,168,78,.4);opacity:.85;animation:midway-ambient-breathe 9.5s ease-in-out var(--bd) infinite alternate}
/* Keep the book spread's sparks at the photograph's edges, not on the parchment. */
.book-spread__picture{position:relative}
.midway-picture-glimmers{position:absolute;inset:0;z-index:3;pointer-events:none!important;overflow:hidden}
.midway-picture-glimmer{position:absolute;left:var(--px);top:var(--py);width:4px;height:4px;border-radius:50%;background:#ffebbc;box-shadow:0 0 7px 3px rgba(255,232,176,.75),0 0 21px 7px rgba(244,171,77,.31);opacity:.72;animation:midway-ambient-breathe 11s ease-in-out var(--pd) infinite alternate}
/* Gentle embedded light glints on photographs, without covering faces or written captions. */
.gallery-item::before,.gallery-item::after{content:"";position:absolute;z-index:2;pointer-events:none;width:5px;height:5px;border-radius:50%;background:#ffe4a7;box-shadow:0 0 6px 2px rgba(253,227,173,.73),0 0 18px 6px rgba(245,180,91,.29);opacity:.68;animation:midway-ambient-breathe 10.5s ease-in-out -3s infinite alternate}
.gallery-item::before{left:6%;top:12%}.gallery-item::after{right:6%;top:24%;animation-delay:-7s}
.gallery-item:nth-child(even)::before{top:29%;left:9%}.gallery-item:nth-child(3n)::after{top:7%;right:13%}
/* Prevent the fairy strand from sitting on the centre of a phone-width paragraph. */
@media (max-width:650px){
  .midway-ambient-glimmers{z-index:3}
  .midway-fairy-strand{right:2%;top:9px;width:37%;height:55px;opacity:.85}
  .midway-fairy-strand__cord{height:52px;top:-22px}
  .midway-fairy-strand__bulb{width:6px;height:8px;top:19px}
  .midway-ambient-glimmer{box-shadow:0 0 7px 2px rgba(255,233,177,.68),0 0 17px 6px rgba(238,170,80,.29)}
  .gallery-item::before,.gallery-item::after{width:4px;height:4px}
}
/* Still glows for people who prefer reduced motion; no flashing. */
@media (prefers-reduced-motion:reduce){
  .midway-ambient-glimmer,.midway-fairy-strand__bulb,.midway-picture-glimmer,.gallery-item::before,.gallery-item::after{animation:none!important;transform:none!important;opacity:.8!important}
}
@media (prefers-reduced-data:reduce){
  .midway-ambient-glimmer,.midway-fairy-strand__bulb,.midway-picture-glimmer,.gallery-item::before,.gallery-item::after{animation:none!important}
}
