| Income taxes - Reconciliation of Deferred Tax Assets and Liabilities (Details) - USD ($) $ in Thousands | Dec. 31, 2024 | Dec. 31, 2023 | Dec. 31, 2022 | 
|---|---|---|---|
| Deferred tax liabilities | |||
| Property, plant and equipment | $ (1,010) | $ (4,954) | |
| Operating lease right-of-use assets | (1,964) | (1,780) | |
| Other | (637) | (365) | |
| Total | (3,611) | (7,099) | |
| Deferred tax assets | |||
| Share-based compensation expense | 15,773 | 15,039 | |
| Property, plant and equipment | 183 | 391 | |
| Intangibles | 1,372 | 1,392 | |
| Operating lease liabilities | 2,658 | 2,556 | |
| Net operating loss and tax credit carryforwards | 248,582 | 241,337 | |
| Capitalized research and development expenditure | 41,805 | 37,699 | |
| Other | 2,726 | 3,605 | |
| Total | 313,099 | 302,019 | |
| Valuation allowance | (309,488) | (294,920) | $ (160,512) | 
| Deferred tax assets, net | $ 3,611 | $ 7,099 | 
| 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://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| 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 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. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
 | 
| 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 
 |