| Marketable securities - Available-for-sale debt securities - Unrealized loss position (Details) $ in Thousands | Jun. 30, 2021  USD ($)  security | Dec. 31, 2020  USD ($) | 
|---|---|---|
| Marketable securities | ||
| Number of available-for-sale securities in an unrealized loss position for more than one year | security | 0 | |
| Corporate debt securities | Debt Securities | ||
| Marketable securities | ||
| Fair market value of investments in an unrealized loss position | $ 111,611 | $ 157,985 | 
| Number of investments in an unrealized loss position | 21 | 30 | 
| Unrealized losses | $ (153) | $ (158) | 
| X | ||||||||||
| 
- Definition Number of investments in debt securities measured at fair value with change in fair value recognized in other comprehensive income (available-for-sale), in continuous unrealized loss position for 12 months or longer, without an allowance for credit loss. Includes beneficial interest in securitized financial asset. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
 | 
| X | ||||||||||
| 
- Definition Amount of investment in debt security measured at fair value with change in fair value recognized in other comprehensive income (available-for-sale), in continuous unrealized loss position for less than 12 months, without allowance for credit loss. Includes beneficial interest in securitized financial asset. Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- Definition Amount of investment in debt security measured at fair value with change in fair value recognized in other comprehensive income (available-for-sale), in unrealized loss position without allowance for credit loss. Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- Definition Number of investments in debt securities measured at fair value with change in fair value recognized in other comprehensive income (available-for-sale), in unrealized loss position, without allowance for credit loss. Includes beneficial interest in securitized financial asset. Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- Definition Line items represent financial concepts included in a table. These concepts are used to disclose reportable information associated with domain members defined in one or many axes to the table. No definition available. 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 |