.Menu {
    position: sticky;
    top: 0; left: 0; right: 0;
    z-index: 2;

    background: var(--color-backdrop);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    color: var(--color-text);

    border-bottom: solid var(--color-border-subtle) 1px;

    > nav {
        margin: 0 auto;
        padding: 0 32px;
        box-sizing: border-box;
        max-width: min(calc(var(--base-content-width) + 64px), 100%);
        min-height: var(--menu-height);

        display: flex;
        align-items: center;
        gap: 28px;

        > .logo {
            margin-right: 12px;
            display: flex;
            align-items: center;
            gap: 12px;
            color: var(--color-text-strong);

            > .image {
                width: 30px;
                height: 30px;
                background-color: currentColor;
                mask-size: contain;
                mask-repeat: no-repeat;
                filter: drop-shadow(0 0 10px var(--color-accent-glow));
            }

            > .title {
                font-family: var(--font-family-logo);
                font-size: 20px;
                font-weight: 700;
                text-transform: uppercase;
            }
        }

        > .option {
            position: relative;

            font-size: 15px;
            line-height: 1em;
            white-space: nowrap;
            color: var(--color-text-muted);

            display: flex;
            gap: 4px;
            align-items: center;
            align-self: stretch;

            cursor: pointer;

            &:hover {
                color: var(--color-text-strong);
            }

            &.logo,
            &.logo:hover {
                color: var(--color-text-strong);
            }

            > .chevron {
                width: 14px;
                height: 14px;
            }
        }

        > a.option {
            text-decoration: none;
        }

        > .option:has(.dropdown) {

            > .dropdown {
                position: absolute;
                left: -24px;

                opacity: 0;
                pointer-events: none;

                transition: all var(--transition-animation-ms);

                top: 80%;
                background: var(--color-surface);
                border: solid var(--color-border) 1px;
                border-radius: var(--border-radius);
                box-shadow: 0 30px 60px -20px var(--color-shadow);

                display: flex;
                flex-direction: column;
                gap: 4px;

                padding: 10px;

                color: var(--color-text);

                max-width: calc(100vw - 2em);
                box-sizing: border-box;

                > .option {
                    padding: 12px 14px;
                    border-radius: var(--border-radius-small);

                    cursor: pointer;
                    text-decoration: none;

                    display: grid;
                    width: max-content;
                    grid-template-columns: 30px 320px;

                    grid-template-areas:
                        "icon title"
                        ". subTitle";

                    &:hover {
                        background: var(--color-surface-raised);
                        color: var(--color-text-strong);
                    }

                    > svg {
                        grid-area: icon;
                        width: 18px;
                        height: 18px;
                        color: var(--color-accent-text);
                    }

                    > .title {
                        grid-area: title;
                        font-weight: 600;
                        white-space: nowrap;
                    }

                    > .subTitle {
                        margin-top: 4px;
                        grid-area: subTitle;
                        white-space: wrap;
                        font-size: 14px;
                        line-height: 1.35;
                        color: var(--color-text-muted);
                    }
                }
            }

            &:hover > .dropdown,
            &:focus-within > .dropdown {
                opacity: 1;
                pointer-events: all;
                top: 100%;
            }
        }

        > .actions {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 10px;

            > .themeToggle,
            > .login {
                box-sizing: border-box;
                height: 44px;
                border: solid var(--color-border-strong) 1px;
                border-radius: var(--border-radius-pill);
                background: transparent;
                color: var(--color-text);
                transition: border-color var(--transition-animation-ms), color var(--transition-animation-ms);

                &:hover {
                    border-color: var(--color-text-muted);
                    color: var(--color-text-strong);
                }
            }

            > .themeToggle {
                width: 44px;
                padding: 0;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;

                svg {
                    width: 18px;
                    height: 18px;
                }
            }

            > .login {
                display: flex;
                align-items: center;
                padding: 0 18px;
                font-size: 15px;
                font-weight: 500;
                text-decoration: none;
                white-space: nowrap;
            }
        }
    }

    /* The toggle shows the theme it switches to */
    [data-theme="light"] & .themeToggle > .iconLight,
    [data-theme="dark"] & .themeToggle > .iconDark {
        display: none;
    }

    @media all and (max-width: 900px) {
        nav {
            flex-wrap: wrap;
            gap: 4px 20px;
            padding: 14px 20px;

            > .logo {
                margin-right: auto;
            }

            > .option:not(.logo) {
                align-self: auto;
                padding: 8px 0;
            }

            > .actions {
                order: -1;
                margin-left: 0;
            }

            > .logo {
                order: -2;
            }

            > .option:has(.dropdown) {
                > .dropdown {
                    text-align: left;
                    z-index: 1;
                    position: fixed;
                    top: auto;
                    /* Between both screen edges: started from the option's left edge, even hidden, it widened every page */
                    left: 1em;
                    right: 1em;
                    max-width: none;

                    > .option {
                        width: auto;
                        grid-template-columns: 30px minmax(0, 1fr);

                        > .title {
                            white-space: normal;
                        }
                    }
                }

                &:hover > .dropdown,
                &:focus-within > .dropdown {
                    top: auto;
                }
            }
        }
    }
}
