A first-principles approach to the optimization of neutron-focusing guide design and development