/* ── Burger toggle ─────────────────────────────────────────── */
.burger-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.burger-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    transition: transform 0.35s cubic-bezier(.65, 0, .35, 1), opacity 0.25s ease;
}

.burger-toggle:hover {
    opacity: 0.7;
}

.burger-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 6px;
}

/* Closing X sits above the open overlay (see z-index below), so it switches
   to the overlay's own text color (#fff) instead of inheriting whatever the
   page's text color happens to be — keeps it visible on the dark backdrop. */
.burger-toggle[aria-expanded="true"] {
    color: #fff;
}

.burger-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.burger-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Dimming overlay ───────────────────────────────────────── */
/* Full-viewport scrim that dims the page behind the menu. GSAP wipes it in
   from the right (same direction as the panel) and holds it at
   rgba(0,0,0,0.4) — 50% of the panel's own opacity (#000c = 0.8). It sits
   just below the panel (9000) and above page content. pointer-events:none so
   it never eats clicks; the initial translateX(100%) parks it off-screen to
   the right until the timeline plays. */
.burger-dim {
    position: fixed;
    inset: 0;
    z-index: 8990;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    transform: translateX(100%);
    will-change: transform;
}

/* ── Dialog overlay ────────────────────────────────────────── */
dialog.burger-overlay {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    position: fixed;
    inset: 0;
    inset-inline-start: auto;
    width: min(40ch, 30em);
    /* width: 100%; */
    height: 100svh;
    max-width: 100%;
    max-height: 100svh;
    margin: 0;
    border: none;
    padding-block: 5svh;
    border-left: 2px solid #fff3;
    /* padding-inline: 5svw; */
    overflow: hidden;
    /* panel itself never scrolls */
    will-change: transform;
    /* GSAP slides it in from the right */
    background: #000c;
    /* Below the toggle (9999): the JS opens this with dialog.show(), not
       showModal(), specifically so it stays out of the top layer and this
       z-index actually applies — the burger/X button must stay clickable
       on top of it. */
    z-index: 9000;
}

dialog.burger-overlay:not([open]) {
    display: none;
}

dialog.burger-overlay::backdrop {
    background: transparent;
}

/* ── Menu layout: fill the viewport, evenly split rows ─────── */
.burger-overlay nav,
.burger-overlay .menu {
    height: 100%;
}

.burger-overlay .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    /* .5em vertical space between entries */
    box-sizing: border-box;
}

.burger-overlay .menu-item {
    flex: 1 1 0;
    /* every entry takes an equal slice of 100svh */
    min-height: 0;
    display: flex;
    align-items: center;
}

.burger-overlay .menu-item+.menu-item {
    border-top: 2px solid #fff3;

}

.burger-overlay .menu-item>.burger-clip {
    width: 100%;
    height: 80%;
    /* height: 2em; */
    /* anchors get 80% of the row height */
    overflow: clip;
    /* hides the letters until they slide up */
    container-type: size;
    /* lets the text size itself to this box */
    display: flex;
    align-items: center;
}

.burger-overlay .menu-item a {
    display: block;
    font-size: 100cqh;
    /* letter height maxed to the clip box (80% of the row) */
    line-height: 1;
    padding-inline: 1.5ch;
    white-space: nowrap;
    text-decoration: none;
    color: #fff;
}


.burger-overlay .menu-item a:focus {
    outline: none;
}


/* ── Scroll lock ───────────────────────────────────────────── */
body.burger-open {
    overflow: hidden;
}