Deductions & credits

Long term capital gain is not added to your AGI.  It is taxed separately at its own rate.