## 2 Sample Environment Components
### In Situ Spectral Reflectance Setup  
To complement the neutron scattering data on thin films, thickness measurement techniques are commonly applied, which enable the correlation of morphological and compositional changes within the film to the changes in film thickness. In order to realize this in situ, a spectral reflectance setup was connected to the lid of the humidity chamber. Spectral reflectance can probe film thickness in the nanometer-to-micrometer range and is well-suited to the typical film thicknesses investigated with neutron scattering techniques. Additionally, it provides information on the refractive index of a film, which contributes to the determination of film porosity or water content. Figure 6a schematically shows the spectral reflectance setup. Light from a light source (I) is directed through an optical fiber to a lens assembly (II) on top of the chamber lid. The light is reflected from the sample surface (III), and the thin film interference signal is detected by a spectrometer (IV) and analyzed on an external computer (V). Figure 5: Humidity (black) and temperature (red) evolution in the center of the humidity chamber during two step-wise increases of the flow rate of a water saturated gas flow mixed with a pure nitrogen flow at 20 and 50 \({}^{\circ}\)C. The flow rate of the water-saturated flow started at 0% and was increased in 20% steps to 100%, while the flow rate of the nitrogen stream started at 100% and was decreased accordingly to 0%—thus keeping the total flow at 100%, which was equivalent to a constant flow of 1 L min\({}^{-1}\). After each humidification cycle, the flow rates were switched back to 0% water and 100% nitrogen, drying the atmosphere. The highest reached humidity is 96% RH (20 \({}^{\circ}\)C) and 93% RH (50 \({}^{\circ}\)C). We use an LS-DT2 deuterium-tungsten light source with a remote-controlled shutter, together with the F20-UV thin film analyzer spectrometer and the LA-GL25-25-25-UV lens assembly in the KM-GL25 kinematic mount (all by Filmmetrics Europe GmbH, Unterhaching, Germany), which is fixed to the extrusion on the chamber lid (see Figure 1c). The LS-DT2 provides a wavelength band from 190 to 1050 nm and is able to probe films within a film thickness range from 1 nm to 40 \(\upmu\)m. The one-inch UV lens with a focal length of 25.4 mm is positioned within the lens assembly at a distance of 103 mm above the sample position. A calcium fluoride window installed in the lid of the chamber allows for light in the UV/Vis and NIR range to pass through a 1-cm-diameter hole in to chamber lid. Prior to measurements, a reference measurement of the pristine substrate reflectance is recorded and subtracted from the sample data. Recorded spectra are analyzed with the FILMeasure software using a vertical layer model and give live feedback of the thickness and refractive index during the neutron experiment independently of the collected neutron data. For exemplary measurements, we prepared a thin film of a poly(N-isopro pylacrylamide) (PNIPAM) microgel cross-linked with N,N'-methylenebisacrylamide on a silicon substrate. PNIPAM microgels are temperature-responsive and highly hygroscopic at temperatures below the volume phase transition temperature (VPPT) [47; 48; 49]. The film was placed in the humidity chamber at a temperature of 20 \({}^{\circ}\)C (well below the VPPT [38]) and humidified in 20% RH steps from a dry atmosphere at 0% RH to a humidity of 96% RH. The spectral reflectance setup continuously recorded a spectrum every 10 s. A simple two-layer model, SiO\({}_{2}\) and a generic polymer layer with a refractive index of 1.45, was used to model-fit the spectra. The extracted film thickness is shown in Figure 7 as a function of measurement time, together with the humidity within the chamber. The obtained thickness data correlates well with the humidity within the chamber. A good fit (goodness of fit >0.999) was achieved for all collected spectra, and a continuous thickness increase of the film with rising humidity is observed.