The impact of a large-scale background wind and valley depth on passive tracer accumulation in a valley during nighttime stable boundary layer (SBL) regimes is investigated using idealized three-dimensional large-eddy simulations (LES). The simulations, representative of the Beromünster area in the Swiss Midlands, are initialized approximately two hours before sunset, with a constant passive tracer flux emitted at the surface. The reference simulation assumes a background wind speed of 5 ms \(^{-1}\) oblique to the valley axis. The results show that stronger background winds (10 ms \(^{-1}\) ) enhance vertical mixing and reduce nighttime tracer accumulation, while weaker winds (2.5 ms \(^{-1}\) ) lead to higher peak mixing ratios near the surface due to weaker dilution and trapping within the stable layer. Additionally, the along-valley wind component accelerates tracer export by enhancing anabatic transport. Sensitivity to valley depth reveals that, surprisingly, shallower valleys form deeper cold-air pools (CAPs) relative to their size and with more uniform tracer distributions, whereas deeper valleys develop stronger local circulations that enhance vertical mixing. The dimensionless valley depth parameter effectively captures these trends, with higher values indicating increased potential for CAP formation and tracer entrapment. The results emphasize the critical role of CAP breakup time in determining tracer depletion, as earlier inversion breakup leads to more efficient tracer export. The passive tracer in this study is intended to represent CO \(_2\) , providing insights into how CO \(_2\) accumulates and disperses under stable boundary conditions in complex terrain.