/* =========================================================================
   Shared site chrome — the identity header (top-left) and the section nav
   (top-right, bottom bar on mobile). Used by BOTH the nebula landing and the
   essays pages so the whole site has one consolidated navbar.
   Requires the tokens in theme.css.
   ========================================================================= */

#header-container {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

#home-link {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.3s;
}

#home-link:hover {
    opacity: 1;
}

#header-subtitle {
    font-size: 0.8rem;
    color: var(--ink-soft);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    pointer-events: none;
}

#footer-credit {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-family: var(--font-serif);
    z-index: 1000;
    opacity: 0.7;
}

/* Section navigation */
#main-nav {
    position: fixed;
    top: 2rem;
    right: 4rem;
    z-index: 1000;
}

#main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

#main-nav a {
    position: relative;
    text-decoration: none;
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 6px;
}

/* underline that wipes in left-to-right on hover (ported from the essays nav) */
#main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 0;
    height: 1px;
    background: currentColor;
    transition: right 0.28s var(--ease-out);
}

#main-nav a:hover,
#main-nav a.active {
    color: var(--blue-700);
}

#main-nav a:hover::after,
#main-nav a.active::after {
    right: 0;
}

.nav-icon {
    display: none;
    /* Hidden on desktop */
}

.nav-text {
    display: block;
}

/* Mobile: identity shrinks, nav becomes a bottom bar */
@media (max-width: 768px) {
    #header-container {
        top: 1.5rem;
        left: 1.5rem;
    }

    #footer-credit {
        display: none;
    }

    #main-nav {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        background: rgba(250, 246, 238, 0.95);
        border-top: 1px solid var(--blue-100);
        padding: 1rem 0;
        display: flex;
        justify-content: center;
    }

    #main-nav ul {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        gap: 0;
    }

    #main-nav li {
        margin: 0;
    }

    #main-nav a {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .nav-icon {
        display: block;
        font-size: 1.5rem;
        font-weight: normal;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .nav-text {
        display: none;
    }
}
