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 (in shares) at Mar. 31, 2020 | | | | | | | (195,000) | | | | | | | | | 0 | | 79,942,000 | | | |
Ending balance at Mar. 31, 2020 | (132,049) | | | | | | $ (644) | 37,109 | | | | (168,514) | | | | $ 0 | | $ 0 | | | |
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 Sep. 30, 2020 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Ending balance at Sep. 30, 2020 | | | | | | | | | | | | | | $ 86,156 | $ 49,703 | | | | | | |
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) | 33,347 | | | | | | | | | | | | | | | | | | | | |
Ending balance (in shares) at Sep. 30, 2020 | | | | | | | (195,000) | | | | | | | | | 0 | | 80,548,000 | | | |
Ending balance at Sep. 30, 2020 | (85,680) | | | | | | $ (644) | 39,049 | | | | (124,085) | | | | $ 0 | | $ 0 | | | |
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 (in shares) at Jun. 30, 2020 | | | | | | | (195,000) | | | | | | | | | 0 | | 80,401,000 | | | |
Ending balance at Jun. 30, 2020 | (109,597) | | | | | | $ (644) | 38,238 | | | | (147,191) | | | | $ 0 | | $ 0 | | | |
Redeemable Convertible Preferred Stock | | | | | | | | | | | | | | | | | | | | | |
Accretion of redeemable convertible preferred stock | | | | | | | | | | | | | | $ 940 | $ 35 | | | | | | |
Ending balance (in shares) at Sep. 30, 2020 | | | | | | | | | | | | | | 2,271,000 | 6,031,000 | | | | | | |
Ending balance at Sep. 30, 2020 | | | | | | | | | | | | | | $ 86,156 | $ 49,703 | | | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | | | | | | | | | |
Accretion of redeemable convertible preferred stock | (975) | | | | | | | (975) | | | | | | | | | | | | | |
Issuance of common stock upon exercise of options (in shares) | | | | | | 218,000 | | | | | | | | | | | | | | | |
Issuance of common stock upon exercise of options | 483 | | | | | | | 483 | | | | | | | | | | | | | |
Stock-based compensation | 1,303 | | | | | | | 1,303 | | | | | | | | | | | | | |
Capital contribution (in shares) | | | | | | (71,000) | | | | | | | | | | | | | | | |
Net income (loss) | 23,106 | | | | | | | | | | | 23,106 | | | | | | | | | |
Ending balance (in shares) at Sep. 30, 2020 | | | | | | | (195,000) | | | | | | | | | 0 | | 80,548,000 | | | |
Ending balance at Sep. 30, 2020 | (85,680) | | | | | | $ (644) | 39,049 | | | | (124,085) | | | | $ 0 | | $ 0 | | | |
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 (in shares) at Mar. 31, 2021 | | | | | | | (195,000) | | | | | | | | | 0 | | 80,198,000 | | | |
Ending balance at Mar. 31, 2021 | (33,395) | | | | | | $ (644) | 25,235 | | | | (57,986) | | | | $ 0 | | $ 0 | | | |
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 Sep. 30, 2021 | | | | | | | | | | | | | | 0 | 0 | | | | | | |
Ending balance at Sep. 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) | $ (17,389) | | | | | | | | | | | | | | | | | | | | |
Ending balance (in shares) at Sep. 30, 2021 | | | | | | | (195,000) | | | | | | | | | 84,864,000 | | 31,771,000 | | | |
Ending balance at Sep. 30, 2021 | 196,029 | | | | | | $ (644) | 285,445 | | | | (88,773) | | | | $ 1 | | $ 0 | | | |
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 | | | | | | |
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 (in shares) at Jun. 30, 2021 | | | | | | | (195,000) | | | | | | | | | 82,714,000 | | 32,231,000 | | | |
Ending balance at Jun. 30, 2021 | 148,902 | | | | | | $ (644) | 260,378 | | | | (110,833) | | | | $ 1 | | $ 0 | | | |
Ending balance (in shares) at Sep. 30, 2021 | | | | | | | | | | | | | | 0 | 0 | | | | | | |
Ending balance at Sep. 30, 2021 | 0 | | | | | | | | | | | | | $ 0 | $ 0 | | | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | | | | | | | | | |
Conversion of shares (in shares) | | | | | | | | | | | | | | | | | 2,038,000 | | | | (2,038,000) |
Issuance of common stock upon exercise of options (in shares) | | | | | | | | | | | | | | | | | | 1,036,000 | | | |
Issuance of common stock upon exercise of options | 2,461 | | | | | | | 2,461 | | | | | | | | | | | | | |
Vesting of early exercised stock options | 99 | | | | | | | 99 | | | | | | | | | | | | | |
Issuance of common stock upon the vesting and settlement of restricted stock units (in shares) | | | | | | | | | | | | | | | | 112,000 | | 542,000 | | | |
Stock-based compensation | 22,507 | | | | | | | 22,507 | | | | | | | | | | | | | |
Net income (loss) | 22,060 | | | | | | | | | | | 22,060 | | | | | | | | | |
Ending balance (in shares) at Sep. 30, 2021 | | | | | | | (195,000) | | | | | | | | | 84,864,000 | | 31,771,000 | | | |
Ending balance at Sep. 30, 2021 | $ 196,029 | | | | | | $ (644) | $ 285,445 | | | | $ (88,773) | | | | $ 1 | | $ 0 | | | |