Cook the pasta: Bring a large pot of salted water to a rolling boil. Add pasta and cook until just al dente.
Reserve 1/4 cup pasta water, then drain well.
Cool slightly: Spread the hot pasta on a sheet pan for 5 minutes to steam off excess moisture. You want it warm, not hot, so the pesto loosens but the cheese doesn’t fully melt.
Toast the nuts: In a dry skillet over medium heat, toast pine nuts for 2–3 minutes until golden and fragrant. Shake the pan often to prevent burning.
Transfer to a plate to cool.
Prep mix-ins: Slice the sun-dried tomatoes, halve the cherry tomatoes, and thinly slice the red onion. Dice or tear the mozzarella if not using pearls.
Dress the pasta: In a large bowl, whisk pesto with 1–2 tablespoons olive oil and a splash of the warm pasta water. Add warm pasta and toss to coat.
Adjust with more olive oil or pasta water for a silky texture.
Layer flavor: Add sun-dried tomatoes, cherry tomatoes, red onion, capers (if using), and half the Parmesan. Toss gently. Season with salt and pepper.
Brighten and balance: Add lemon zest and 1 tablespoon lemon juice.
Taste. If it needs more lift, add another tablespoon of lemon juice or a pinch of salt.
Add cheese and crunch: Fold in mozzarella and most of the toasted pine nuts. Save a few for the top.
Finish and serve: Top with remaining Parmesan, pine nuts, and torn basil.
Serve slightly warm or chill for at least 30 minutes for a colder salad.