/* menu-morph.css
 * Mobile hamburger button for the marketing homepage (index.php).
 *
 * The three lines are pure CSS so the icon never depends on an icon-library
 * swap, which previously left the button stuck on the X after the menu was
 * closed. Adding .is-open to .menu-morph-btn morphs the lines into an X.
 *
 * Line colour comes from `currentColor`, so it follows the button's
 * `text-slate-300` utility and its light-theme override in theme-toggle.css.
 */

.menu-morph-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    line-height: 0;
}

.menu-morph-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.55);
}

.menu-morph-box {
    position: relative;
    display: block;
    width: 24px;
    height: 18px;
}

.menu-morph-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background-color: currentColor;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease-out;
}

.menu-morph-line:nth-child(1) {
    top: 0;
}

.menu-morph-line:nth-child(2) {
    top: 8px;
}

.menu-morph-line:nth-child(3) {
    top: 16px;
}

.menu-morph-btn.is-open .menu-morph-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-morph-btn.is-open .menu-morph-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0.4);
}

.menu-morph-btn.is-open .menu-morph-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
    .menu-morph-line {
        transition: none;
    }
}