Direct democracy doesn't mean everyone votes on everything.
At the extreme you could do something like localized e-voting: citizens vote on issues that affect a given geographic radius of where they live. Because the boundaries are purely distance-based, gerrymandering is impossible.
Maybe we could have a decaying distance boundary by some measurement like population density or something like it?