Scotland joins landmark Brexit legal case