| Income taxes - Reconciliation of Deferred Tax Assets and Liabilities (Details) - USD ($) $ in Thousands | Dec. 31, 2023 | Dec. 31, 2022 | Dec. 31, 2021 | 
|---|---|---|---|
| Deferred tax liabilities | |||
| Property, plant and equipment | $ (4,954) | $ (3,486) | |
| Operating lease right-of-use assets | (1,780) | (1,529) | |
| Other | (365) | (251) | |
| Total | (7,099) | (5,266) | |
| Deferred tax assets | |||
| Share-based compensation expense | 15,039 | 16,963 | |
| Property, plant and equipment | 391 | ||
| Intangibles | 1,392 | 1,324 | |
| Operating lease liabilities | 2,556 | 1,958 | |
| Net operating loss and expenditure credit carryforwards | 241,337 | 136,592 | |
| Capitalized research and development expenditure | 37,699 | 8,409 | |
| Other | 3,605 | 532 | |
| Total | 302,019 | 165,778 | |
| Valuation allowance | (294,920) | (160,512) | $ (132,443) | 
| Deferred tax assets, net | 7,099 | $ 5,266 | |
| Net deferred tax asset (liability) | $ 0 | 
| X | ||||||||||
| 
- Definition Amount of deferred tax asset attributable to deductible temporary differences from research and development costs. No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount before allocation of valuation allowances of deferred tax asset attributable to deductible temporary differences from intangible assets. No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount before allocation of valuation allowances of deferred tax asset attributable to deductible temporary differences from operating lease liability. No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount before allocation of valuation allowances of deferred tax asset attributable to deductible operating loss carryforwards and deductible tax credit carryforwards. No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred tax liability attributable to taxable temporary differences. Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- Definition Amount before allocation of valuation allowances of deferred tax asset attributable to deductible temporary differences and carryforwards. Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- Definition Amount, after allocation of valuation allowances and deferred tax liability, of deferred tax asset attributable to deductible differences and carryforwards, without jurisdictional netting. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
 | 
| X | ||||||||||
| 
- Definition Amount after allocation of valuation allowances of deferred tax asset attributable to deductible temporary differences and carryforwards. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount before allocation of valuation allowances of deferred tax asset attributable to deductible temporary differences from property, plant, and equipment. No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount before allocation of valuation allowances of deferred tax asset attributable to deductible temporary differences from share-based compensation. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
 | 
| X | ||||||||||
| 
- Definition Amount, before allocation of valuation allowance, of deferred tax asset attributable to deductible temporary differences from reserves and accruals, classified as other. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred tax assets for which it is more likely than not that a tax benefit will not be realized. Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred tax liability attributable to taxable temporary differences from leasing arrangements. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred tax liability attributable to taxable temporary differences classified as other. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred tax liability attributable to taxable temporary differences from property, plant, and equipment. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
 |