Condensed Consolidated Statements of Changes in Redeemable Convertible Preferred Stock and Stockholders' Equity (Deficit) - USD ($) $ in Thousands | Total | Conversion of redeemable convertible preferred stock to common stock | Conversion of convertible notes with related parties to common stock | Conversion of Class B stock to Class A stock | Cumulative-effect of accounting change adopted as of January 1, 2020 | Common Stock | Treasury Stock | Additional Paid-in Capital | Additional Paid-in CapitalConversion of redeemable convertible preferred stock to common stock | Additional Paid-in CapitalConversion of convertible notes with related parties to common stock | Additional Paid-in CapitalCumulative-effect of accounting change adopted as of January 1, 2020 | Retained Earnings | Retained EarningsCumulative-effect of accounting change adopted as of January 1, 2020 | Series A Preferred Stock | Series B Preferred Stock | Common Class ACommon Stock | Common Class ACommon StockConversion of Class B stock to Class A stock | Common Class BCommon Stock | Common Class BCommon StockConversion of redeemable convertible preferred stock to common stock | Common Class BCommon StockConversion of convertible notes with related parties to common stock | Common Class BCommon StockConversion of Class B stock to Class A stock |
Beginning balance (in shares) at Dec. 31, 2019 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Beginning balance at Dec. 31, 2019 | | | | | | | | | | | | | | $ 83,375 | $ 49,598 | | | | | | |
Redeemable Convertible Preferred Stock | | | | | | | | | | | | | | | | | | | | | |
Accretion of redeemable convertible preferred stock | | | | | | | | | | | | | | $ 920 | $ 35 | | | | | | |
Ending balance (in shares) at Mar. 31, 2020 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Ending balance at Mar. 31, 2020 | | | | | | | | | | | | | | $ 84,295 | $ 49,633 | | | | | | |
Beginning balance (in shares) at Dec. 31, 2019 | | | | | | | (195,000) | | | | | | | | | 0 | | 79,583,000 | | | |
Beginning balance at Dec. 31, 2019 | $ (122,311) | | | | $ 0 | | $ (644) | $ 35,339 | | | $ 426 | $ (157,006) | $ (426) | | | $ 0 | | $ 0 | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | | | | | | | | | |
Accretion of redeemable convertible preferred stock | (955) | | | | | | | (955) | | | | | | | | | | | | | |
Issuance of common stock upon exercise of options (in shares) | | | | | | 572,000 | | | | | | | | | | | | | | | |
Issuance of common stock upon exercise of options | 305 | | | | | | | 305 | | | | | | | | | | | | | |
Stock-based compensation | 1,994 | | | | | | | 1,994 | | | | | | | | | | | | | |
Capital contribution (in shares) | | | | | | (213,000) | | | | | | | | | | | | | | | |
Net income (loss) | (11,082) | | | | | | | | | | | (11,082) | | | | | | | | | |
Ending balance at Mar. 31, 2020 | (132,049) | | | | | | $ (644) | 37,109 | | | | (168,514) | | | | $ 0 | | $ 0 | | | |
Ending balance (in shares) at Mar. 31, 2020 | | | | | | | (195,000) | | | | | | | | | 0 | | 79,942,000 | | | |
Beginning balance (in shares) at Dec. 31, 2019 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Beginning balance at Dec. 31, 2019 | | | | | | | | | | | | | | $ 83,375 | $ 49,598 | | | | | | |
Ending balance (in shares) at Jun. 30, 2020 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Ending balance at Jun. 30, 2020 | | | | | | | | | | | | | | $ 85,216 | $ 49,668 | | | | | | |
Beginning balance (in shares) at Dec. 31, 2019 | | | | | | | (195,000) | | | | | | | | | 0 | | 79,583,000 | | | |
Beginning balance at Dec. 31, 2019 | (122,311) | | | | $ 0 | | $ (644) | 35,339 | | | $ 426 | (157,006) | $ (426) | | | $ 0 | | $ 0 | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | | | | | | | | | |
Net income (loss) | 10,241 | | | | | | | | | | | | | | | | | | | | |
Ending balance at Jun. 30, 2020 | (109,597) | | | | | | $ (644) | 38,238 | | | | (147,191) | | | | $ 0 | | $ 0 | | | |
Ending balance (in shares) at Jun. 30, 2020 | | | | | | | (195,000) | | | | | | | | | 0 | | 80,401,000 | | | |
Beginning balance (in shares) at Mar. 31, 2020 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Beginning balance at Mar. 31, 2020 | | | | | | | | | | | | | | $ 84,295 | $ 49,633 | | | | | | |
Redeemable Convertible Preferred Stock | | | | | | | | | | | | | | | | | | | | | |
Accretion of redeemable convertible preferred stock | | | | | | | | | | | | | | $ 921 | $ 35 | | | | | | |
Ending balance (in shares) at Jun. 30, 2020 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Ending balance at Jun. 30, 2020 | | | | | | | | | | | | | | $ 85,216 | $ 49,668 | | | | | | |
Beginning balance (in shares) at Mar. 31, 2020 | | | | | | | (195,000) | | | | | | | | | 0 | | 79,942,000 | | | |
Beginning balance at Mar. 31, 2020 | (132,049) | | | | | | $ (644) | 37,109 | | | | (168,514) | | | | $ 0 | | $ 0 | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | | | | | | | | | |
Accretion of redeemable convertible preferred stock | (956) | | | | | | | (956) | | | | | | | | | | | | | |
Issuance of common stock upon exercise of options (in shares) | | | | | | 672,000 | | | | | | | | | | | | | | | |
Issuance of common stock upon exercise of options | 699 | | | | | | | 699 | | | | | | | | | | | | | |
Stock-based compensation | 1,386 | | | | | | | 1,386 | | | | | | | | | | | | | |
Capital contribution (in shares) | | | | | | (213,000) | | | | | | | | | | | | | | | |
Net income (loss) | 21,323 | | | | | | | | | | | 21,323 | | | | | | | | | |
Ending balance at Jun. 30, 2020 | (109,597) | | | | | | $ (644) | 38,238 | | | | (147,191) | | | | $ 0 | | $ 0 | | | |
Ending balance (in shares) at Jun. 30, 2020 | | | | | | | (195,000) | | | | | | | | | 0 | | 80,401,000 | | | |
Beginning balance (in shares) at Dec. 31, 2020 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Beginning balance at Dec. 31, 2020 | 136,856 | | | | | | | | | | | | | $ 87,118 | $ 49,738 | | | | | | |
Redeemable Convertible Preferred Stock | | | | | | | | | | | | | | | | | | | | | |
Accretion of redeemable convertible preferred stock | | | | | | | | | | | | | | $ 961 | $ 36 | | | | | | |
Ending balance (in shares) at Mar. 31, 2021 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Ending balance at Mar. 31, 2021 | | | | | | | | | | | | | | $ 88,079 | $ 49,774 | | | | | | |
Beginning balance (in shares) at Dec. 31, 2020 | | | | | | | (195,000) | | | | | | | | | 0 | | 78,283,000 | | | |
Beginning balance at Dec. 31, 2020 | (50,296) | | | | | | $ (644) | 21,732 | | | | (71,384) | | | | $ 0 | | $ 0 | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | | | | | | | | | |
Accretion of redeemable convertible preferred stock | (997) | | | | | | | (997) | | | | | | | | | | | | | |
Issuance of common stock upon exercise of options (in shares) | | | | | | | | | | | | | | | | | | 1,965,000 | | | |
Issuance of common stock upon exercise of options | 3,660 | | | | | | | 3,660 | | | | | | | | | | | | | |
Repurchase and retirement of common stock (in shares) | | | | | | | | | | | | | | | | | | (50,000) | | | |
Repurchase and retirement of common stock | (450) | | | | | | | (450) | | | | | | | | | | | | | |
Stock-based compensation | 1,290 | | | | | | | 1,290 | | | | | | | | | | | | | |
Net income (loss) | 13,398 | | | | | | | | | | | 13,398 | | | | | | | | | |
Ending balance at Mar. 31, 2021 | (33,395) | | | | | | $ (644) | 25,235 | | | | (57,986) | | | | $ 0 | | $ 0 | | | |
Ending balance (in shares) at Mar. 31, 2021 | | | | | | | (195,000) | | | | | | | | | 0 | | 80,198,000 | | | |
Beginning balance (in shares) at Dec. 31, 2020 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Beginning balance at Dec. 31, 2020 | 136,856 | | | | | | | | | | | | | $ 87,118 | $ 49,738 | | | | | | |
Ending balance (in shares) at Jun. 30, 2021 | | | | | | | | | | | | | | 0 | 0 | | | | | | |
Ending balance at Jun. 30, 2021 | 0 | | | | | | | | | | | | | $ 0 | $ 0 | | | | | | |
Beginning balance (in shares) at Dec. 31, 2020 | | | | | | | (195,000) | | | | | | | | | 0 | | 78,283,000 | | | |
Beginning balance at Dec. 31, 2020 | $ (50,296) | | | | | | $ (644) | 21,732 | | | | (71,384) | | | | $ 0 | | $ 0 | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | | | | | | | | | |
Issuance of common stock upon exercise of options (in shares) | 115,000 | | | | | | | | | | | | | | | | | | | | |
Net income (loss) | $ (39,449) | | | | | | | | | | | | | | | | | | | | |
Ending balance at Jun. 30, 2021 | 148,902 | | | | | | $ (644) | 260,378 | | | | (110,833) | | | | $ 1 | | $ 0 | | | |
Ending balance (in shares) at Jun. 30, 2021 | | | | | | | (195,000) | | | | | | | | | 82,714,000 | | 32,231,000 | | | |
Beginning balance (in shares) at Mar. 31, 2021 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Beginning balance at Mar. 31, 2021 | | | | | | | | | | | | | | $ 88,079 | $ 49,774 | | | | | | |
Redeemable Convertible Preferred Stock | | | | | | | | | | | | | | | | | | | | | |
Accretion of redeemable convertible preferred stock | | | | | | | | | | | | | | $ 466 | $ 17 | | | | | | |
Conversion of redeemable convertible preferred stock to common stock (in shares) | | | | | | | | | | | | | | (2,271,000) | (6,031,000) | | | | | | |
Conversion of redeemable convertible preferred stock to common stock | | | | | | | | | | | | | | $ (88,545) | $ (49,791) | | | | | | |
Ending balance (in shares) at Jun. 30, 2021 | | | | | | | | | | | | | | 0 | 0 | | | | | | |
Ending balance at Jun. 30, 2021 | 0 | | | | | | | | | | | | | $ 0 | $ 0 | | | | | | |
Beginning balance (in shares) at Mar. 31, 2021 | | | | | | | (195,000) | | | | | | | | | 0 | | 80,198,000 | | | |
Beginning balance at Mar. 31, 2021 | (33,395) | | | | | | $ (644) | 25,235 | | | | (57,986) | | | | $ 0 | | $ 0 | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | | | | | | | | | |
Accretion of redeemable convertible preferred stock | (483) | | | | | | | (483) | | | | | | | | | | | | | |
Conversion of shares (in shares) | | | | | | | | | | | | | | | | | 82,714,000 | | 24,202,000 | 3,085,000 | (82,714,000) |
Conversion of shares | | $ 138,336 | $ 25,653 | $ 0 | | | | | $ 138,335 | $ 25,653 | | | | | | | $ 1 | | $ 1 | | $ (1) |
Issuance of common stock upon exercise of options (in shares) | | | | | | | | | | | | | | | | | | 5,282,000 | | | |
Issuance of common stock upon exercise of options | 8,720 | | | | | | | 8,720 | | | | | | | | | | | | | |
Repurchase and retirement of common stock (in shares) | | | | | | | | | | | | | | | | | | (100,000) | | | |
Repurchase and retirement of common stock | (2,300) | | | | | | | (2,300) | | | | | | | | | | | | | |
Vesting of early exercised stock options | 97 | | | | | | | 97 | | | | | | | | | | | | | |
Issuance of common stock upon the vesting and settlement of restricted stock units (in shares) | | | | | | | | | | | | | | | | | | 2,278,000 | | | |
Stock-based compensation | 65,121 | | | | | | | 65,121 | | | | | | | | | | | | | |
Net income (loss) | (52,847) | | | | | | | | | | | (52,847) | | | | | | | | | |
Ending balance at Jun. 30, 2021 | $ 148,902 | | | | | | $ (644) | $ 260,378 | | | | $ (110,833) | | | | $ 1 | | $ 0 | | | |
Ending balance (in shares) at Jun. 30, 2021 | | | | | | | (195,000) | | | | | | | | | 82,714,000 | | 32,231,000 | | | |