The base is the native <details> element, which already handles keyboard access, screen-reader semantics, and even "find in page" for closed content in modern browsers. If the script never loads, everything still opens and closes.
The script only adds the smoothness: it stops the instant toggle (preventDefault), then uses the Web Animations API to animate the body's height between 0 and its real scrollHeight. When closing, open is removed after the animation ends, so the content doesn't vanish mid-slide.
Add data-single-open to the wrapper to close other items when one opens. With reduced motion on, items open and close in a quick 120ms.