/* Header logo: large when the page loads, compact after a short scroll.
   Page padding below stays fixed so the shrink does not shift layout. */
#nav > a:first-child {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 0 1 auto;
    line-height: 0;
}
#nav .nav-logo {
    height: 118px;
    width: auto;
    max-width: min(220px, 34vw);
    object-fit: contain;
    flex-shrink: 1;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#nav.scrolled .nav-logo {
    height: 48px;
    max-width: 132px;
}
#nav .hamburger {
    flex-shrink: 0;
    margin-left: 0.75rem;
    position: relative;
    z-index: 2;
}

.page-hero,
.article-wrap {
    padding-top: 12rem;
}
#hero {
    padding-top: 10rem;
}

@media (max-width: 1100px) {
    #nav .nav-logo {
        height: 88px;
        max-width: min(180px, 36vw);
    }
    #nav.scrolled .nav-logo {
        height: 46px;
    }
    .page-hero,
    .article-wrap {
        padding-top: 10rem;
    }
    #hero {
        padding-top: 8.5rem;
    }
}

@media (max-width: 768px) {
    #nav .nav-logo {
        height: 78px;
        max-width: min(148px, 46vw);
    }
    #nav.scrolled .nav-logo {
        height: 44px;
        max-width: 108px;
    }
    /* Follow the bar height so a taller logo never sits on the menu button. */
    #nav .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1;
    }
    .page-hero,
    .article-wrap {
        padding-top: 8.75rem;
    }
    #hero {
        padding-top: 7.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    #nav .nav-logo {
        transition: none;
    }
}
