<style> into your CSS file<script> into your JS file (load it with defer, or just before </body>)<a href="#">Home</a> and friends) with your real navigationAlways start the button at aria-expanded="false". That attribute doubles as the CSS selector and as the announcement to assistive technology, so leaving it out means the menu starts in the open state.
<button class="hb-cross" aria-label="Menu" aria-expanded="false">
<span></span><span></span><span></span>
</button>
The two tabs give you separate snippets, but they are designed to be mixed. Swap the button styles of an open pattern (the ◯◯__btn rules) for the icon morph you prefer.
span rules to override the button part◯◯__btn)<style> tag, the HTML, and three lines of JavaScript that handle the toggle. Paste it as-is first to confirm the animation, then move the <style> contents into your CSS file and the <script> contents into your JS file. On the HTML side, apply the same class names to the button and nav already in your header.aria-expanded between true and false. Every visual movement is pure CSS and no external library is loaded. A checkbox hack would remove the JavaScript entirely, but screen readers would no longer announce it as a button, so every effect here uses a real button element instead.aria-expanded is the attribute that tells screen readers whether the menu is open. Using it as the CSS selector too means the state lives in exactly one place, so what assistive technology announces can never drift from what is on screen. There is no need for a separate is-open class.transform, which makes it the reference for fixed positioning. The copied code keeps the real position: fixed for your site. Note that the same rule applies in reverse: if you place the menu inside a parent that has transform or filter, it will not cover the whole screen, so keep it high in the document, right under your header.grid-template-rows, the frosted glass drawer and glass button use backdrop-filter, and the circle reveal uses clip-path. All of these work in current Chrome, Edge, Safari and Firefox, but older browsers may skip the motion. Even then the menu still opens and closes, so nothing breaks functionally.