/* 🎬 "A day with Nail" (assets/js/nail-story.js): the section is tall; its inner part stays on screen (sticky) while
   the page scrolls through it, and the scroll picks the scene. Each scene is an SVG with its own sky, so it reads the
   same on the light and the dark page; the captions use the page's colours. */
.story { position: relative; height: calc(var(--n, 5) * 72vh + 100vh); margin: 34px 0 0; }
.story-sticky { position: sticky; top: 62px; height: calc(100vh - 62px); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 8px 16px 14px; }
.story-head { margin: 0; text-align: center; font-size: clamp(1.6rem, 4vw, 2.6rem); }
.story-stage { position: relative; width: min(100%, 900px, calc((100vh - 330px) * 800 / 480)); aspect-ratio: 800 / 480; flex: none; }
.story-scene { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: clamp(16px, 3vw, 28px); overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .22); opacity: 0; transform: translateY(22px) scale(.96);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .9, .3, 1.15); }
.story-scene.on { opacity: 1; transform: none; }
/* speech bubbles pop in when their scene starts */
.story-scene .pop { transform-box: fill-box; transform-origin: 50% 100%; }
.story-scene.on .pop { animation: story-pop .55s .3s both cubic-bezier(.3, 1.6, .5, 1); }
@keyframes story-pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.story-captions { display: grid; width: min(100%, 660px); min-height: 7.2em; text-align: center; }
.story-cap { grid-area: 1 / 1; opacity: 0; transform: translateY(12px); transition: opacity .4s ease, transform .4s ease; visibility: hidden; }
.story-cap.on { opacity: 1; transform: none; visibility: visible; }
.story-cap h3 { margin: 0 0 4px; color: var(--ink); font: 800 clamp(1.2rem, 2.6vw, 1.6rem)/1.2 var(--sans); }
.story-cap p { margin: 0; color: var(--muted); font-size: clamp(.98rem, 1.8vw, 1.1rem); }
.story-cap .story-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }

/* where you are in the story: a dot per scene beside the picture */
.story-dots { position: absolute; right: max(10px, calc(50% - 500px)); top: 50%; transform: translateY(-50%); display: grid; gap: 10px;
  margin: 0; padding: 0; list-style: none; }
.story-dots li { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); opacity: .35; transition: transform .3s, opacity .3s; }
.story-dots li.on { opacity: 1; transform: scale(1.35); background: var(--accent); }
@media (max-width: 720px) {
  .story-sticky { top: 56px; height: calc(100vh - 56px); }
  .story-stage { width: min(100%, calc((100vh - 360px) * 800 / 480)); }
  .story-dots { position: static; transform: none; display: flex; order: 3; }
}

/* less motion: the scenes one under the other, standing still */
.story.story-still { height: auto; }
.story-still .story-sticky { position: static; height: auto; display: block; }
.story-still .story-step { margin: 18px auto 30px; max-width: 900px; }
.story-still .story-scene { position: static; display: block; opacity: 1; transform: none; aspect-ratio: 800 / 480; height: auto; }
.story-still .story-cap { visibility: visible; opacity: 1; transform: none; margin-top: 12px; text-align: center; }
