Investments and fair value measurements - Summary of Held-to-Maturity Debt Securities (Details) - USD ($)
$ in Thousands
Mar. 31, 2022
Dec. 31, 2021
Schedule of Held-to-maturity Securities [Line Items]    
Amortized Cost $ 62,798 $ 67,164
Unrealized Gains 42 459
Unrealized Losses (1,004) (223)
Fair Value 61,836 67,400
Corporate debt securities    
Schedule of Held-to-maturity Securities [Line Items]    
Amortized Cost 55,727 62,078
Unrealized Gains 42 459
Unrealized Losses (906) (207)
Fair Value 54,863 62,330
U.S. Treasury securities    
Schedule of Held-to-maturity Securities [Line Items]    
Amortized Cost 6,834 4,849
Unrealized Gains 0 0
Unrealized Losses (98) (16)
Fair Value 6,736 4,833
Certificates of deposit    
Schedule of Held-to-maturity Securities [Line Items]    
Amortized Cost 237 237
Unrealized Gains 0 0
Unrealized Losses 0 0
Fair Value $ 237 $ 237