/* Profile polaroid reactions (profile-shock.js): tap = shocked, drag = dizzy.
   `translate`/`rotate`/`scale` compose with the physics transform. */
.shock-face { position: absolute; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; opacity: 0; transition: opacity 0.16s ease; pointer-events: none; }
.shock-face.is-on { opacity: 1; transition: none; }

/* Effects box = the card itself (desktop) or the card inside the exported mobile image. */
.shock-fx { position: absolute; inset: 0; pointer-events: none; z-index: 2; --r: 128px; }
.m-st .shock-fx { inset: 9% 15% 16% 13%; --r: 74px; }

.shock-line {
  position: absolute; left: 50%; top: 43%; width: 26px; height: 7px; margin-top: -3.5px; box-sizing: border-box;
  border-radius: 4px; background: #C9F24D; border: 2px solid #0D0D0F;
  transform-origin: 0 50%; transform: rotate(var(--a)) translateX(var(--r)) scaleX(0); opacity: 0;
}
.m-st .shock-line { width: 18px; height: 6px; margin-top: -3px; }

.shock-pop {
  position: absolute; display: grid; place-items: center; box-sizing: border-box;
  font: 800 13px/1 "Geist", system-ui, sans-serif; color: #0D0D0F;
  border: 2px solid #0D0D0F; border-radius: 999px; box-shadow: 0 3px 0 #0D0D0F;
  opacity: 0; transform: translateX(var(--tx, 0)) rotate(var(--rot, 0deg)) scale(0.2);
}
.shock-bang { right: -20px; top: 7%; width: 38px; height: 38px; font-size: 24px; background: #C9F24D; --rot: 12deg; }
.shock-q { left: -18px; top: 3%; width: 32px; height: 32px; font-size: 19px; background: #FFFFFF; color: #2547E8; --rot: -14deg; }
.shock-eh { left: 50%; top: -34px; padding: 6px 11px; background: #2547E8; color: #FFFFFF; letter-spacing: -0.01em; --tx: -50%; --rot: -6deg; }
.m-st .shock-bang { right: -16px; width: 30px; height: 30px; font-size: 19px; }
.m-st .shock-q { left: -14px; width: 26px; height: 26px; font-size: 15px; }
.m-st .shock-eh { top: -26px; padding: 5px 9px; font-size: 11px; }

.is-shocked { animation: shock-shake 0.46s cubic-bezier(.36, .07, .19, .97); }
.is-shocked .shock-line { animation: shock-line 0.62s cubic-bezier(.2, .9, .3, 1) var(--d) both; }
.is-shocked .shock-pop { animation: shock-pop 1.3s cubic-bezier(.3, 1.6, .5, 1) both; }
.is-shocked .shock-q { animation-delay: 70ms; }
.is-shocked .shock-eh { animation-delay: 130ms; }
/* The "About me ↗" hover pill would collide with the pop-ups. */
.is-shocked[data-pencil-name="Sticker · Profile Photo"]::after { opacity: 0 !important; transition: none; }

@keyframes shock-shake {
  0% { translate: 0 0; rotate: 0deg; }
  12% { translate: -6px -3px; rotate: -2deg; }
  26% { translate: 6px 1px; rotate: 2deg; }
  40% { translate: -5px 0; rotate: -1.5deg; }
  56% { translate: 4px 0; rotate: 1deg; }
  72% { translate: -2px 0; rotate: -0.5deg; }
  100% { translate: 0 0; rotate: 0deg; }
}
@keyframes shock-line {
  0% { opacity: 1; transform: rotate(var(--a)) translateX(var(--r)) scaleX(0); }
  30% { opacity: 1; transform: rotate(var(--a)) translateX(var(--r)) scaleX(1); }
  65% { opacity: 1; transform: rotate(var(--a)) translateX(calc(var(--r) + 8px)) scaleX(0.9); }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(calc(var(--r) + 20px)) scaleX(0.3); }
}
@keyframes shock-pop {
  0% { opacity: 0; transform: translateX(var(--tx, 0)) rotate(calc(var(--rot, 0deg) - 25deg)) scale(0.2); }
  22% { opacity: 1; transform: translateX(var(--tx, 0)) rotate(var(--rot, 0deg)) scale(1.15); }
  36% { transform: translateX(var(--tx, 0)) rotate(var(--rot, 0deg)) scale(1); }
  80% { opacity: 1; transform: translateX(var(--tx, 0)) rotate(var(--rot, 0deg)) scale(1); }
  100% { opacity: 0; transform: translateX(var(--tx, 0)) translateY(-8px) rotate(var(--rot, 0deg)) scale(0.9); }
}
@keyframes shock-fade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* Drag: dizzy. Stars orbit above the head on a flattened ellipse, the card wobbles like jelly
   and its shadow grows as if it's lifted off the page. */
.dizzy-ring { position: absolute; left: 50%; top: 17%; width: 0; height: 0; opacity: 0; transition: opacity 0.2s ease; }
.dizzy-star { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; animation: dizzy-orbit 0.9s linear infinite; animation-delay: calc(var(--i) * -0.3s); animation-play-state: paused; }
.dizzy-star svg { display: block; width: 100%; height: 100%; }
.m-st .dizzy-star { width: 12px; height: 12px; margin: -6px 0 0 -6px; }
.is-dizzy .dizzy-ring { opacity: 1; }
.is-dizzy .dizzy-star { animation-play-state: running; }
.is-dizzy { animation: dizzy-jelly 0.42s ease-in-out infinite; }
[data-pencil-name="Sticker · Profile Photo"].is-dizzy { filter: drop-shadow(0 44px 30px rgba(5, 10, 50, 0.5)) drop-shadow(0 8px 10px rgba(5, 10, 50, 0.3)) !important; transition: filter 0.3s ease; }
.is-dizzy[data-pencil-name="Sticker · Profile Photo"]::after { opacity: 0 !important; transition: none; }

@keyframes dizzy-orbit {
  0% { transform: translate(46px, 0) scale(0.8); }
  12.5% { transform: translate(32.5px, 8.5px) scale(0.98); }
  25% { transform: translate(0, 12px) scale(1.05) rotate(90deg); }
  37.5% { transform: translate(-32.5px, 8.5px) scale(0.98); }
  50% { transform: translate(-46px, 0) scale(0.8) rotate(180deg); }
  62.5% { transform: translate(-32.5px, -8.5px) scale(0.62); }
  75% { transform: translate(0, -12px) scale(0.55) rotate(270deg); }
  87.5% { transform: translate(32.5px, -8.5px) scale(0.62); }
  100% { transform: translate(46px, 0) scale(0.8) rotate(360deg); }
}
.m-st .dizzy-star { animation-name: dizzy-orbit-sm; }
@keyframes dizzy-orbit-sm {
  0% { transform: translate(30px, 0) scale(0.8); }
  25% { transform: translate(0, 8px) scale(1.05) rotate(90deg); }
  50% { transform: translate(-30px, 0) scale(0.8) rotate(180deg); }
  75% { transform: translate(0, -8px) scale(0.55) rotate(270deg); }
  100% { transform: translate(30px, 0) scale(0.8) rotate(360deg); }
}
@keyframes dizzy-jelly {
  0%, 100% { scale: 1.03 0.97; }
  50% { scale: 0.97 1.03; }
}

@media (prefers-reduced-motion: reduce) {
  .is-shocked, .is-dizzy { animation: none; }
  .dizzy-star { animation: none; transform: translate(calc((var(--i) - 1) * 26px), 0); }
  .is-shocked .shock-line { animation: shock-fade 0.7s linear both; transform: rotate(var(--a)) translateX(var(--r)); }
  .is-shocked .shock-pop { animation: shock-fade 1.3s linear both; transform: translateX(var(--tx, 0)) rotate(var(--rot, 0deg)); }
}
