@layer components {
    .site-header {
        height: var(--header-height);
        background: var(--clr-bureau-blue);
        border-bottom: 2px solid var(--color-secondary);
        position: sticky;
        top: 0;
        z-index: 1000;
        padding: 1rem 0;
        view-transition-name: site-header;
        transition: background-color 0.3s ease, border-color 0.3s ease;

        @media (max-width: 768px) {
            --header-height: 74px;
        }

        [data-theme="dark"] & {
            background: var(--clr-bureau-blue-dark);
        }

        & .site-header__container {
            max-width: var(--container-max-width);
            margin: 0 auto;
            padding: 0 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;

            @media (max-width: 768px) {
                padding: 0 1rem;
            }
        }

        & .site-header__hamburger {
            display: none;
            flex-direction: column;
            gap: 6px;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0.5rem;
            z-index: 1001;

            & span {
                display: block;
                width: 25px;
                height: 3px;
                background: white;
                transition: var(--transition);
            }

            @media (max-width: 768px) {
                display: flex;
            }
        }

        &[data-state="open"] {
            & .site-header__hamburger {
                & span:nth-child(1) {
                    transform: translateY(9px) rotate(45deg);
                }

                & span:nth-child(2) {
                    opacity: 0;
                }

                & span:nth-child(3) {
                    transform: translateY(-9px) rotate(-45deg);
                }
            }

            & .site-header__nav {
                transform: translateX(0);
            }
        }

        & .site-header__logo {
            display: flex;
            align-items: center;
            gap: 10px;
            font-family: var(--font-serif);
            font-weight: bold;
            font-size: 1.5rem;
            color: white;
            text-decoration: none;

            &:hover {
                filter: brightness(0.9);
            }
        }

        & .site-header__logo-snail {
            width: 40px;
            height: 40px;
            border: 2px solid white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
        }

        & .site-header__nav {
            @media (min-width: 768.1px) {
                margin-left: auto;
                display: flex;
                align-items: center;
                gap: 3rem;
            }

            @media (max-width: 768px) {
                position: fixed;
                top: 0;
                right: 0;
                bottom: 0;
                width: 80%;
                background: var(--color-surface);
                padding: 6rem 2rem 2rem;
                box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
                transform: translateX(100%);
                transition: transform 0.3s ease-in-out, background-color 0.3s ease;
                z-index: 1000;
                display: flex;
                flex-direction: column;
                gap: 2rem;
            }

            & .site-header__actions {
                display: flex;
                align-items: center;
                gap: 1.5rem;

                @media (max-width: 768px) {
                    flex-direction: column;
                    align-items: stretch;
                    margin-top: auto;
                }
            }

            & .site-header__theme-toggle,
            & .site-header__nav-icon {
                background: none;
                border: 2px solid rgba(255, 255, 255, 0.2);
                border-radius: 50%;
                width: 40px;
                height: 40px;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                transition: var(--transition);
                color: white;
                overflow: hidden;
                position: relative;
                text-decoration: none;

                &:hover {
                    border-color: white;
                    background: rgba(255, 255, 255, 0.1);
                    color: white;
                }

                & svg, & .icon {
                    width: 20px;
                    height: 20px;
                }
            }

            & .site-header__theme-toggle {
                font-size: 1.2rem;

                & .site-header__theme-icon-container {
                    position: relative;
                    width: 24px;
                    height: 24px;
                }

                & .site-header__theme-icon {
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
                }

                & .site-header__theme-icon--sun {
                    opacity: 0;
                    transform: translateY(30px) rotate(180deg);
                }

                & .site-header__theme-icon--moon {
                    opacity: 1;
                    transform: translateY(0) rotate(0);
                }

                /* Dark mode states */

                :root[data-theme="dark"] & {
                    & .site-header__theme-icon--sun {
                        opacity: 1;
                        transform: translateY(0) rotate(0);
                    }

                    & .site-header__theme-icon--moon {
                        opacity: 0;
                        transform: translateY(-30px) rotate(-180deg);
                    }
                }
            }

            & ul {
                display: flex;
                gap: 2rem;

                @media (max-width: 768px) {
                    flex-direction: column;
                    align-items: flex-start;
                    gap: 1.5rem;
                }

                & a:not(.site-header__nav-icon) {
                    font-weight: 500;
                    font-size: 0.9rem;
                    text-transform: uppercase;
                    letter-spacing: 1px;
                    transition: var(--transition);
                    white-space: nowrap;
                    color: rgba(255, 255, 255, 0.8);

                    @media (max-width: 768px) {
                        font-size: 1.2rem;
                        color: var(--color-on-surface);
                    }

                    &:hover {
                        color: white;
                    }
                }

                & .site-header__nav-icon {
                    @media (max-width: 768px) {
                        color: var(--color-on-surface);
                        border-color: var(--color-on-surface);
                        opacity: 0.6;

                        &:hover {
                            opacity: 1;
                            background: var(--color-surface-variant);
                            color: var(--color-on-surface);
                            border-color: var(--color-on-surface);
                        }
                    }
                }

                & li {
                    display: flex;
                    align-items: center;
                }
            }
        }

        & .site-header__cta {
            /* Redundant styles removed, handled by UI:Button */
            @media (max-width: 768px) {
                width: 100%;
                margin-top: auto;
            }
        }
    }
}
