Fermi-surface collapse and dynamical scaling near a quantum-critical point