Local dynamics in a hydrogen-bonded organic framework for adaptive guest accommodation with programmable luminescence