God of wisdom, writing, knowledge, mathematics, and the measurement of time. Commonly depicted as a man with the head of an ibis or as a baboon, he was the divine scribe who recorded judgments and maintained cosmic balance. He was closely associated with the invention of hieroglyphic writing and the workings of divine law.