Generic binary black holes have spins that are misaligned with their orbital angular momentum. When the binary separation between the black holes is large compared to their gravitational radii, the timescale on which the spins precess is much shorter than the radiation-reaction time on which the orbital angular momentum decreases due to gravitational-wave emission. We use conservation of the total angular momentum and the projected effective spin on the precession time to derive an effective potential for BBH spin precession. This effective potential allows us to solve the orbit-averaged spin-precession equations analytically for arbitrary mass ratios and spins. These solutions are quasiperiodic functions of time: after a precessional period the spins return to their initial relative orientations. We classify black-hole spin precession into three distinct morphologies between which the black holes can transition during their inspiral. Our new solutions constitute fundamental progress in our understanding of black-hole spin precession and also have important applications to astrophysical black holes. We derive a precession-averaged evolution equation that can be numerically integrated on the radiation-reaction time, allowing us to statistically track black-hole spins from formation to merger. This will greatly help us predict the signatures of black-hole formation in the gravitational waves emitted near merger and the distributions of final spins and gravitational recoils.