How do I fade a procedural clouds on the edges of a bounding box? I have procedural clouds made following Default Cube's tutorial, the node group looks like this:

The whole thing is bounded by a large cube, and I want to fade the clouds near the edges so that they don't just cut off. Clouds are distributed using the Voronoi texture, so originally, I wanted to do this by adjusting the Voronoi texture using a Separate XYZ node and a color ramp, but it didn't work how I thought it would. How should I do it?
Here is the blend file:
Basically you can try it with this setup and tweak a bit the values to your needs:
What it does: a spherical gradient texture influences (multiplies) the value of the clouds so that they &quot;disappear&quot; to the edges of the sphere.
Of course you could do something similar with a box if you prefer box-like-clouds.

result: