Foundations are provided for rank-dependent preferences within the popular twostage framework of Anscombe-Aumann, in which risk and ambiguity feature as distinct sources of uncertainty. We advance the study of attitudes towards ambiguity without imposing expected utility for risk. As a result, in our general model, ambiguity attitude can be captured by non-additive subjective probabilities as under Choquet expected utility or by a specific utility for ambiguity as in recursive expected utility or, if required, by both. The key property for preferences builds on (discrete) rates of substitution which are standardly applied in economics. By demanding consistency for these rates of substitution across events and within or across sources of uncertainty, we obtain a model that nests popular theories for risk and ambiguity. This way, new possibilities for theoretical and empirical analyses of these theories emerge.