/* Start page: white screen, menu centered, logo in the middle */
.gate {
    min-height: 100vh;
    min-height: 100dvh;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.gate-nav {
    display: grid;
    grid-template-areas: "home services logo portfolio contacts";
    grid-template-columns: auto auto auto auto auto;
    align-items: center;
    column-gap: clamp(22px, 3.6vw, 64px);
}

.gate-nav a {
    color: #142033;
    text-decoration: none;
    font-weight: 500;
    font-size: clamp(17px, 1.35vw, 22px);
    letter-spacing: 0.01em;
    line-height: 1;
    transition: color 0.2s ease;
}

.gate-nav a:hover,
.gate-nav a:focus-visible {
    color: #1570d6;
}

.gate-nav a.menu-item,
.topbar-nav a.menu-item {
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.gate-nav a.menu-item {
    padding: 0.55em 1.15em;
}

.gate-nav a.menu-item.is-active,
.topbar-nav a.menu-item.is-active {
    background: #d7e8fb;
    color: #142033;
    box-shadow: 0 8px 16px rgba(110, 158, 206, 0.28);
}

.gate-nav a.menu-item.is-active:hover,
.gate-nav a.menu-item.is-active:focus-visible,
.topbar-nav a.menu-item.is-active:hover,
.topbar-nav a.menu-item.is-active:focus-visible {
    color: #142033;
}

.gate-home { grid-area: home; }
.gate-services { grid-area: services; }
.gate-logo-link { grid-area: logo; line-height: 0; }
.gate-portfolio { grid-area: portfolio; }
.gate-contact { grid-area: contacts; }

.gate-logo {
    width: clamp(108px, 13vw, 168px);
    height: auto;
    display: block;
    filter: drop-shadow(0 16px 14px rgba(41, 104, 184, 0.34)) drop-shadow(0 4px 6px rgba(36, 86, 160, 0.16));
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid #e8eaee;
    overflow: visible;
    transform: translateY(calc(-100% - 90px));
    transition: transform 0.25s ease;
}

.topbar.is-visible {
    transform: translateY(0);
}

.topbar-nav {
    max-width: 1100px;
    margin: 0 auto;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 3vw, 40px);
    padding: 8px 16px;
}

.topbar-nav a {
    color: #142033;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
}

.topbar-nav a:hover,
.topbar-nav a:focus-visible {
    color: #1570d6;
}

.topbar-nav a.menu-item {
    padding: 0.4em 0.75em;
}

.topbar-logo-link {
    position: relative;
    z-index: 2;
    display: flex;
    line-height: 0;
}

.topbar-logo {
    width: 138px;
    height: 138px;
    display: block;
    margin: -36px 0;
    transform: translateY(36px);
    filter: drop-shadow(0 12px 14px rgba(41, 104, 184, 0.32));
}

@media (max-width: 760px) {
    .gate-nav {
        grid-template-areas:
            "home"
            "services"
            "logo"
            "portfolio"
            "contacts";
        grid-template-columns: auto;
        justify-items: center;
        row-gap: 22px;
        text-align: center;
    }

    .gate-logo {
        width: 148px;
    }

    .topbar-nav {
        gap: 12px;
        flex-wrap: wrap;
        padding: 10px 12px;
    }

    .topbar-nav a {
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    .topbar-nav {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 2px;
    }

    .topbar-logo-link {
        order: -1;
        flex-basis: 100%;
        justify-content: center;
    }

    .topbar-logo {
        margin: 0 0 -8px;
        transform: none;
    }
}
