Electron--phonon interactions, d resonances, and superconductivity in transition metals