/* Touch reactions are brief; the existing native buttons still own their actions. */
body.mobile-touch-mode :is(#halloween-toggle, #footer-light-switch, #footer-go-button) {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* A tapped button can keep native focus or sticky hover without looping its face. */
body.mobile-touch-mode #contact #halloween-toggle .halloween-pumpkin {
  animation: none;
  rotate: 0deg;
  translate: 0 0;
  scale: 1;
  filter: drop-shadow(0 2px 3px #0008);
}

body.mobile-touch-mode.halloween-mode #contact #halloween-toggle .halloween-pumpkin {
  filter: drop-shadow(0 2px 3px #0008) drop-shadow(0 0 7px #dc883d66);
}

body.mobile-touch-mode #contact #halloween-toggle :is(.pumpkin-eye-left, .pumpkin-eye-right, .pumpkin-pupil-left, .pumpkin-pupil-right, .pumpkin-brows, .pumpkin-mouth, .pumpkin-stem) {
  animation: none;
  rotate: 0deg;
  translate: 0 0;
  scale: 1;
}

body.mobile-touch-mode #contact #halloween-toggle .pumpkin-pupils {
  translate: 0 0;
  transition: translate 150ms ease-out;
}

body.mobile-touch-mode #contact #halloween-toggle .pumpkin-mouth-smile { opacity: .24; }

body.mobile-touch-mode #contact #halloween-toggle.is-touch-reacting .halloween-pumpkin {
  rotate: -2deg;
  scale: 1.04;
  filter: drop-shadow(0 2px 3px #0008) drop-shadow(0 0 7px #dc883d70);
  transition: rotate 160ms ease-out, scale 160ms ease-out, filter 160ms ease-out;
}

body.mobile-touch-mode #contact #halloween-toggle.is-touch-reacting .pumpkin-eye-left { rotate: -8deg; scale: 1.10 1.08; }
body.mobile-touch-mode #contact #halloween-toggle.is-touch-reacting .pumpkin-eye-right { rotate: 8deg; scale: 1.10 1.08; }
body.mobile-touch-mode #contact #halloween-toggle.is-touch-reacting .pumpkin-pupils {
  translate: var(--pumpkin-touch-look-x, 0px) var(--pumpkin-touch-look-y, -3px);
}
body.mobile-touch-mode #contact #halloween-toggle.is-touch-reacting .pumpkin-brows { translate: 0 -5px; rotate: -3deg; }
body.mobile-touch-mode #contact #halloween-toggle.is-touch-reacting .pumpkin-mouth { scale: 1.13 1.17; }
body.mobile-touch-mode #contact #halloween-toggle.is-touch-reacting .pumpkin-mouth-smile { opacity: .6; }

body.mobile-touch-mode #contact #halloween-toggle.is-touch-winking :is(.pumpkin-eye-left, .pumpkin-pupil-left) {
  animation: mobile-pumpkin-touch-wink 580ms ease-in-out 1;
}

body.mobile-touch-mode #footer-light-switch.is-touch-pressed .footer-wall-switch {
  filter: brightness(1.16);
}
body.mobile-touch-mode #footer-go-button.is-touch-pressed {
  outline: 1px solid #e4ad6b;
  outline-offset: 2px;
  background: #e4ad6b12;
}

@keyframes mobile-pumpkin-touch-wink {
  0%, 22%, 100% { scale: 1.08 1.06; }
  46% { scale: 1.08 .16; }
  68% { scale: 1.08 .75; }
}

@media (prefers-reduced-motion: reduce) {
  body.mobile-touch-mode #contact #halloween-toggle * {
    animation: none !important;
    transition: none !important;
  }
  body.mobile-touch-mode #contact #halloween-toggle.is-touch-reacting .halloween-pumpkin {
    rotate: 0deg;
    scale: 1;
  }
}
