/* Sticky glass navigation. It sits above every page, so it stays deliberately
   quiet: no colour blocks, just a hairline and a blur that keeps the content
   underneath readable while the page scrolls. The current section gets a soft
   filled pill so people always know where they are. */

.homepage-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px clamp(16px, 4vw, 40px);
    min-height: 68px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(10, 16, 32, 0.07);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.logotype {
    width: 38px;
    height: 38px;
    transition: transform 0.3s var(--ease-out);
}

.brand:hover .logotype {
    transform: rotate(-6deg) scale(1.06);
}

.nav-links {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.main-links {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-inline: auto;
}

.link {
    color: var(--body);
    font-weight: 500;
    font-size: 0.92rem;
    text-decoration: none;
    padding: 8px 13px;
    border-radius: 999px;
    white-space: nowrap;
    transition: color 0.2s, background-color 0.2s;
}

.link:hover {
    color: var(--ink);
    background: rgba(10, 16, 32, 0.045);
}

.link.is-active {
    color: var(--teal-ink);
    background: var(--teal-wash);
    font-weight: 600;
}

.buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.buttons a {
    padding: 9px 18px;
    color: white;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s, color 0.2s;
}

.buttons a:hover {
    transform: translateY(-1px);
}

.buttons .sign-up {
    background: linear-gradient(120deg, var(--teal-ink), var(--teal));
    box-shadow: 0 8px 18px -10px rgba(15, 181, 166, 0.9);
}

.buttons .sign-up:hover {
    box-shadow: 0 12px 22px -10px rgba(15, 181, 166, 1);
}

.buttons .log-in {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 1px rgba(10, 16, 32, 0.10);
}

.buttons .log-in:hover {
    background: white;
    box-shadow: inset 0 0 0 1px rgba(10, 16, 32, 0.2);
}

.hamburger {
    display: none;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background-color: var(--ink);
    border-radius: 2px;
    transition: transform 0.3s var(--ease-out), opacity 0.2s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Six app sections plus the account button do not fit beside the brand on a
   tablet, so the menu collapses earlier than the usual phone breakpoint. */
@media (max-width: 960px) {
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        border-radius: 10px;
        cursor: pointer;
        padding: 10px 8px;
    }

    .hamburger:hover {
        background: rgba(10, 16, 32, 0.045);
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 16px 16px;
        border-bottom: 1px solid rgba(10, 16, 32, 0.07);
        box-shadow: 0 12px 24px -12px rgba(10, 16, 32, 0.18);
    }

    .nav-links.active {
        display: flex;
    }

    .main-links {
        flex-direction: column;
        align-items: stretch;
        margin: 0;
    }

    .link {
        display: block;
        padding: 12px 14px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .buttons {
        flex-direction: column;
        align-items: stretch;
        margin-top: 4px;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }

    .buttons a {
        text-align: center;
        padding: 12px 18px;
    }
}

@media (max-width: 380px) {
    .brand-name {
        display: none;
    }
}

/* Phones: a bottom tab bar replaces the menu for signed-in people, so the
   main sections are a thumb's reach away. Visitors keep the menu. */
.tab-bar {
    display: none;
}

@media (max-width: 640px) {
    .has-tab-bar .hamburger,
    .has-tab-bar .nav-links {
        display: none;
    }

    .has-tab-bar .homepage-navigation {
        min-height: 56px;
        padding-block: 8px;
    }

    .has-tab-bar .logotype {
        width: 32px;
        height: 32px;
    }

    .has-tab-bar {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    .tab-bar {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 110;
        padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(16px) saturate(180%);
        -webkit-backdrop-filter: blur(16px) saturate(180%);
        border-top: 1px solid rgba(10, 16, 32, 0.08);
    }

    .tab-bar-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 52px;
        padding: 4px 2px;
        border: 0;
        border-radius: 12px;
        background: none;
        color: var(--muted);
        font: inherit;
        font-size: 0.7rem;
        font-weight: 600;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .tab-bar-label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tab-bar-icon {
        display: grid;
        place-items: center;
        width: 52px;
        height: 28px;
        border-radius: 999px;
        transition: background-color 0.2s;
    }

    .tab-bar-icon .tab-icon {
        width: 24px;
        height: 24px;
    }

    .tab-bar-item.is-active {
        color: var(--teal-ink);
    }

    .tab-bar-item.is-active .tab-bar-icon {
        background: var(--teal-wash);
    }

    .tab-bar-item:active {
        background: rgba(10, 16, 32, 0.05);
    }
}
