Fair value of financial instruments (Details) - USD ($) $ in Thousands | Dec. 31, 2023 | Dec. 31, 2022 |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | $ 1,361,936 | $ 1,611,063 |
Marketable securities | 1,149,148 | 1,087,164 |
Corporate bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 427,957 | 363,075 |
Corporate bonds | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 427,957 | 363,075 |
Corporate bonds | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
Corporate bonds | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 427,957 | 363,075 |
Corporate bonds | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
Commercial paper | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 201,145 | 241,192 |
Commercial paper | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 201,145 | 241,192 |
Commercial paper | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
Commercial paper | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 201,145 | 241,192 |
Commercial paper | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
U.S. treasury securities | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 336,356 | 242,916 |
U.S. treasury securities | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 336,356 | 242,916 |
U.S. treasury securities | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 336,356 | 242,916 |
U.S. treasury securities | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
U.S. treasury securities | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
Certificates of deposit | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 132,457 | 158,246 |
Certificates of deposit | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 132,457 | 158,246 |
Prepaid expenses and other current assets | 2,542 | 1,067 |
Restricted cash | 4,054 | 5,530 |
Certificates of deposit | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
Prepaid expenses and other current assets | 0 | 0 |
Restricted cash | 0 | 0 |
Certificates of deposit | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 132,457 | 158,246 |
Prepaid expenses and other current assets | 2,542 | 1,067 |
Restricted cash | 4,054 | 5,530 |
Certificates of deposit | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
Prepaid expenses and other current assets | 0 | 0 |
Restricted cash | 0 | 0 |
Municipal securities | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | | 27,449 |
Municipal securities | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | | 27,449 |
Municipal securities | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | | 0 |
Municipal securities | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | | 27,449 |
Municipal securities | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | | 0 |
Non-U.S. government and supranational bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 8,983 | 22,599 |
Non-U.S. government and supranational bonds | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 8,983 | 22,599 |
Non-U.S. government and supranational bonds | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
Non-U.S. government and supranational bonds | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 8,983 | 22,599 |
Non-U.S. government and supranational bonds | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
U.S. agency bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 42,250 | 31,687 |
U.S. agency bonds | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 42,250 | 31,687 |
U.S. agency bonds | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
U.S. agency bonds | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 42,250 | 31,687 |
U.S. agency bonds | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Marketable securities | 0 | 0 |
Money market funds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 1,032,675 | 1,017,191 |
Money market funds | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 1,032,675 | 1,017,191 |
Money market funds | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 1,032,675 | 1,017,191 |
Money market funds | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 0 | 0 |
Money market funds | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 0 | 0 |
Commercial paper | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 106,268 | 111,975 |
Commercial paper | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 106,268 | 111,975 |
Commercial paper | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 0 | 0 |
Commercial paper | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 106,268 | 111,975 |
Commercial paper | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 0 | 0 |
Certificates of deposit | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 1,551 | |
Certificates of deposit | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 1,551 | |
Certificates of deposit | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 0 | |
Certificates of deposit | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 1,551 | |
Certificates of deposit | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 0 | |
Corporate bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 859 | 1,542 |
Corporate bonds | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 859 | 1,542 |
Corporate bonds | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 0 | 0 |
Corporate bonds | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 859 | 1,542 |
Corporate bonds | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | $ 0 | 0 |
U.S. treasury securities | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | | 5,990 |
U.S. treasury securities | Recurring | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | | 5,990 |
U.S. treasury securities | Recurring | Level 1 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | | 5,990 |
U.S. treasury securities | Recurring | Level 2 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | | 0 |
U.S. treasury securities | Recurring | Level 3 | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | | $ 0 |