Use CSS variables and calculations to adjust shadows dynamically based on element size.
Source Code
:root {
--element-size: 100px;
}
.dynamic-shadow {
width: var(--element-size);
height: var(--element-size);
box-shadow: calc(var(--element-size) / 10) calc(var(--element-size) / 10) calc(var(--element-size) / 5) rgba(0,0,0,0.2);
}