/* ============================================================
   ANIMATIONS (transform / opacity only)
   ============================================================ */
/* titles + headings drop in */
.pg-title, .cover__title, .cover__head, .cover__credits, .cover__date,
.arch, .mini-box, .doodle-word, .note, .p4-card, .quiz {
  opacity: 0;
  transform: translateY(-24px);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.2,.9,.3,1.3);
}
.in-view .pg-title, .in-view .cover__title, .in-view .cover__head,
.in-view .cover__credits, .in-view .cover__date, .in-view .arch,
.in-view .mini-box, .in-view .doodle-word, .in-view .note,
.in-view .p4-card, .in-view .quiz {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}
/* keep the built-in rotations on the rotated titles/notes after entering */
.in-view .cover__title { transform: translateX(-50%) rotate(-3deg); }
.in-view .pg-title__display { transform: rotate(-3deg); }
.in-view .note { transform: rotate(-4deg); }
.in-view .doodle-word--ehhh { transform: rotate(-6deg); }
.in-view .doodle-word--what { transform: rotate(-4deg); }

/* price starburst pop */
.starburst { opacity: 0; transform: rotate(-8deg) scale(0.2); transition: opacity 0.4s ease, transform 0.6s cubic-bezier(.2,.9,.3,1.5); }
.in-view .starburst { opacity: 1; transform: rotate(-8deg) scale(1); }

/* characters float */
.in-view .sticker { animation: float 4s ease-in-out infinite; }
.sticker--book { animation-delay: 0.6s !important; }
.sticker--two { animation-delay: 0.3s !important; }
.sticker--pc { animation-delay: 0.9s !important; }

/* sparkles rotate/pulse */
.spark { animation: sparkle 6s linear infinite; }

/* swipe hint bob */
.swipe-hint { animation: bob 1.6s ease-in-out infinite; }

/* word cloud pop one by one */
.blob__word { opacity: 0; transform: scale(0.4); transition: opacity 0.4s ease, transform 0.5s cubic-bezier(.2,.9,.3,1.5); }
.in-view .blob__word { opacity: 1; transform: scale(1); }
.in-view .blob__word:nth-child(1) { transition-delay: 0.15s; }
.in-view .blob__word:nth-child(2) { transition-delay: 0.35s; }
.in-view .blob__word:nth-child(3) { transition-delay: 0.55s; }
.in-view .blob__word:nth-child(4) { transition-delay: 0.75s; }
.in-view .blob__word:nth-child(5) { transition-delay: 0.95s; }

.shake { animation: shake 0.4s ease; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes sparkle { 0% { transform: translateY(var(--py,0)) rotate(0deg) scale(1); } 50% { transform: translateY(var(--py,0)) rotate(180deg) scale(1.12); } 100% { transform: translateY(var(--py,0)) rotate(360deg) scale(1); } }
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes confetti { 0% { transform: translate(-50%,0) rotate(0); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), var(--dy)) rotate(var(--rot)); opacity: 0; } }

/* ============================================================
   ACCESSIBILITY — reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .pg-title, .cover__title, .cover__head, .cover__credits, .cover__date,
  .arch, .mini-box, .doodle-word, .note, .p4-card, .quiz,
  .starburst, .blob__word, .sticker, .spark {
    opacity: 1 !important;
    transform: none !important;
  }
  .in-view .cover__title { transform: translateX(-50%) rotate(-3deg) !important; }
  .in-view .note { transform: rotate(-4deg) !important; }
  .starburst { transform: rotate(-8deg) !important; }
  .swipe-hint { animation: none !important; }
  .confetti { display: none !important; }
}

/* focus visibility */
:focus-visible { outline: 3px solid #0a63ff; outline-offset: 2px; }

/* desktop: neutral backdrop already via body; add page framing */
@media (min-width: 460px) {
  body { padding: 0; display: block; }
}
