The value of X is determined only as you perform the third mode while Inscription of Insight is resolving. Once that happens, the value of X won't change even if the number of cards in the player's hand changes.