I found an answer with CSS container queries
MDN container queries
With this HTML
<body>
<div id="outer">
<div id="in">
<div id="inner">
<div id="nested">
<p style="font-size: 2rem;">Hello!</p>
</div>
</div>
</div>
</div>
</body>
and this CSS
body {
background-color: #2C2C2C;
}
div {
box-sizing: border-box;
position: absolute;
}
#outer {
left: 10px;
top: 10px;
height: 100px;
width: 80%;
container-type: inline-size;
container-name: bar;
border: 1px dotted red;
}
#in {
background-color: rgb(202, 243, 161);
top: 0;
bottom: 1px;
left: 10px;
width: 20%;
overflow: visible;
}
#inner {
background-color: rgb(221, 175, 114);
top: 0;
bottom: 1px;
left: 50px;
width: 20%;
overflow: visible;
}
#nested {
background-color: rgb(37, 231, 167);
top: 0;
left: 0;
bottom: 25%;
height: 75%;
}
@container bar (min-width: 1px) {
#nested {
width: 50cqw;
}
}
the width of #nested is responsive at 50% of the width of #outer (and not of its immediate parent.) I still need to do a bunch of testing, and to work out the appropriate value to use in @container but I'm well on the way.