Wash and pat dry the basil leaves to remove any moisture.
Toast the pine nuts in a small skillet over medium heat for 3–4 minutes, stirring often, until golden and fragrant.
In a food processor, combine basil, toasted nuts, garlic, and Parmesan. Pulse until finely chopped.
With the processor running, slowly stream in olive oil until the mixture becomes smooth and creamy. Scrape down the sides as needed.
Add lemon juice (if using), then season with salt and pepper to taste. Blend once more.
Serve immediately or transfer to a jar. Pour a thin layer of olive oil on top before refrigerating to keep the pesto vibrant.