html:has(.site-header) { scroll-padding-top: 130px; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: #fffdf8;
    border-bottom: 1px solid #e2d2b8;
    box-shadow: 0 5px 20px #3e2b1710;
}

.header-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0 22px;
    padding: 3px max(4%, calc((100% - 1320px) / 2));
    background: #37291d;
}

.header-contact a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    color: #fff2df;
    font-size: 12px;
    font-weight: 600;
}

.header-contact a:hover { text-decoration: underline; text-underline-offset: 3px; }
.header-contact svg { width: 14px; height: 14px; color: #e3be83; }

.site-header .header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "brand nav actions";
    align-items: center;
    width: min(1320px, 92%);
    height: 78px;
    gap: 16px;
    border: 0;
}

.site-header .brand { grid-area: brand; justify-self: start; margin: 0; }

.brand-window {
    position: relative;
    display: block;
    width: clamp(164px, 19vw, 225px);
    aspect-ratio: 4.2;
    overflow: hidden;
    border-radius: 10px;
}

.site-header .brand img {
    position: absolute;
    width: 128%;
    max-width: none;
    top: 50%;
    left: -14%;
    transform: translateY(-50%);
}

.site-header nav {
    grid-area: nav;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border: 1px solid #ebdfcb;
    border-radius: 24px;
    background: #f6efe3;
}

.site-header nav a {
    display: block;
    padding: 8px clamp(10px, 1.2vw, 17px);
    border-radius: 20px;
    color: #614c35;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}

.site-header nav a:hover,
.site-header nav a:focus-visible,
.site-header nav a[aria-current="location"] {
    background: #fffdf8;
    color: #362417;
    box-shadow: 0 1px 4px #3e2b1715;
}

.header-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.site-header .login-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 5px;
    color: #614c35;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}

.site-header .login-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-header .website-logout {
    white-space: nowrap;
    padding: 8px;
    color: #614c35;
    font-size: 13px;
    font-weight: 600;
}
.site-header .website-logout:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-header nav .mobile-logout { display: none; }
.login-link svg { width: 15px; height: 15px; }

.site-header .button.small {
    display: inline-flex;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #a77a42;
    border-radius: 8px;
    background: #ead1a7;
    color: #372515;
    white-space: nowrap;
    font-size: 12px;
}

.site-header .button.small:hover { background: #dfbc84; }
.site-header .menu { display: none; }

@media (max-width: 959px) {
    .site-header .website-logout { display: none; }
    .site-header nav .mobile-logout { display: block; }
    .header-contact { justify-content: center; }

    .site-header .header {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas: "brand actions menu";
        height: 68px;
        gap: 8px;
    }

    .brand-window { width: clamp(133px, 32vw, 200px); }

    .site-header .menu {
        grid-area: menu;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 40px;
        padding: 0 9px;
        border: 1px solid #d9c5a6;
        border-radius: 8px;
        background: #fbf5e9;
        color: #503a25;
        font-size: 12px;
        font-weight: 700;
    }

    .site-header .menu[aria-expanded="true"] { background: #ead9bc; }
    .menu-icon { width: 13px; height: 10px; border-block: 2px solid currentColor; }

    .site-header nav {
        display: none;
        position: absolute;
        top: calc(100% + 5px);
        right: 0;
        left: auto;
        width: min(100%, 320px);
        max-height: calc(100dvh - 120px);
        overflow: auto;
        padding: 8px;
        border-radius: 12px;
        background: #fffdf8;
        box-shadow: 0 12px 24px #3e2b1726;
    }

    .site-header nav.open { display: grid; }
    .site-header nav a { padding: 11px 12px; border-radius: 7px; }
    .site-header nav a[aria-current="location"],
    .site-header nav a:hover,
    .site-header nav a:focus-visible { background: #f3e7d2; }
}

@media (max-width: 540px) {
    html:has(.site-header) { scroll-padding-top: 162px; }

    .site-header .header {
        grid-template-areas: "brand login menu" "trial trial trial";
        height: auto;
        padding: 7px 0;
    }

    .site-header .header-actions { display: contents; }
    .site-header .login-link { grid-area: login; }
    .site-header .button.small { grid-area: trial; padding-block: 7px; }
    .site-header nav { max-height: calc(100dvh - 162px); }
}

@media (max-width: 350px) {
    .login-link svg { display: none; }
    .header-contact { column-gap: 10px; }
}
