  Deterministic enhancement of the superconducting (SC) critical temperature
$T_c$ is a long-standing goal in material science. One strategy is engineering
a material at the nanometer scale such that quantum confinement strengthens the
electron pairing, thus increasing the superconducting energy gap $\Delta$, as
was observed for individual nanoparticles. A true phase-coherent SC condensate,
however, can exist only on larger scales and requires a finite phase stiffness
$J$. In the case of coupled aluminium (Al) nanograins, $T_c$ can exceed that of
bulk Al by a factor of three, but despite several proposals the relevant
mechanism at play is not yet understood. Here we use optical spectroscopy on
granular Al to disentangle the evolution of the fundamental SC energy scales,
$\Delta$ and $J$, as a function of grain coupling. Starting from well-coupled
arrays, $\Delta$ grows with progressive grain decoupling, causing the
increasing of $T_c$. As the grain-coupling is further suppressed, $\Delta$
saturates while $T_c$ decreases, concomitantly with a sharp decline of $J$.
This crossover to a phase-driven SC transition is accompanied by an optical gap
persisting above $T_c$. These findings identify granular Al as an ideal
playground to test the basic mechanisms that enhance superconductivity by
nano-inhomogeneity.
