/* Navigation Styles */

/* Section 1: Navigation (fixed height) */
nav {
    position: sticky;
    top: 0;
    width: 100%;
    background: transparent;
    z-index: 100;
    padding: 25px 0;
    flex-shrink: 0;
}

.nav-container {
    width: 100%;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Home button container */
.nav-home {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Home button (@fleetingbits) */
.nav-home a:first-child {
    position: relative;
    display: inline-block;
    font-family: var(--font-nav);
    font-size: 15px;
    font-weight: 500;
    padding: 8px 16px;
    border: 2px solid var(--black);
    border-radius: 16px;
    text-decoration: none;
    z-index: 0;
    
    /* Text is always page background color */
    color: var(--page-bg);
    transition: color var(--transition-fast);  /* Fast by default */
}

/* Base fill: solid black rectangle under text */
.nav-home a:first-child::after {
    content: "";
    position: absolute;
    inset: -1px;
    background: var(--black);
    z-index: -2;
    border-radius: inherit;
    transition: background var(--transition-theme);
}

/* Hover fill: page background, hidden by default */
.nav-home a:first-child::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--page-bg);
    opacity: 0;
    z-index: -1;
    border-radius: 14px; /* 16px - 2px border = 14px for inner curve */
    transition: opacity var(--transition-fast),
                background var(--transition-theme);
}

/* Hover state: invert colors */
.nav-home a:first-child:hover,
.nav-home a:first-child:focus-visible {
    color: var(--black);
    transition: color var(--transition-fast);
}

.nav-home a:first-child:hover::before,
.nav-home a:first-child:focus-visible::before {
    opacity: 1;
}

/* Active state */
.nav-home a:first-child.active {
    font-weight: 600;
}

/* Active hover maintains quick transition */
.nav-home a:first-child.active:hover,
.nav-home a:first-child.active:focus-visible {
    color: var(--black);
    transition: color var(--transition-fast);
}

/* Dao character link (道) - Way of Code */
.nav-dao {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--black);
    text-decoration: none;
    padding: 4px 8px;
    margin-left: 12px;
    transition: opacity var(--transition-fast);
    line-height: 1;
}

.nav-dao:hover,
.nav-dao:focus-visible {
    opacity: 0.6;
}

.nav-dao.active {
    font-weight: 600;
}

/* Navigation links */
.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    position: relative;
    display: inline-block;
    font-family: var(--font-nav);
    font-size: 15px;
    font-weight: 500;
    padding: 8px 16px;
    border: 2px solid var(--black);
    border-radius: 16px;
    text-decoration: none;
    z-index: 0;
    
    /* Text is always page background color */
    color: var(--page-bg);
    transition: color var(--transition-fast);  /* Fast by default */
}

/* Base fill: solid black rectangle under text */
.nav-links a::after {
    content: "";
    position: absolute;
    inset: -1px;
    background: var(--black);
    z-index: -2;
    border-radius: inherit;
    transition: background var(--transition-theme);
}

/* Hover fill: page background, hidden by default */
.nav-links a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--page-bg);
    opacity: 0;
    z-index: -1;
    border-radius: 14px; /* 16px - 2px border = 14px for inner curve */
    transition: opacity var(--transition-fast),
                background var(--transition-theme);
}

/* Hover state: invert colors */
.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--black);
    transition: color var(--transition-fast);
}

.nav-links a:hover::before,
.nav-links a:focus-visible::before {
    opacity: 1;
}

/* Active state */
.nav-links a.active {
    font-weight: 600;
}

/* Active hover maintains quick transition */
.nav-links a.active:hover,
.nav-links a.active:focus-visible {
    color: var(--black);
    transition: color var(--transition-fast);
}

/* Theme fade overrides - slow transitions only during theme changes */
body.theme-fade .nav-home a:first-child,
body.theme-fade .nav-links a {
    transition: color var(--transition-theme);  /* 2s during theme change */
}

/* Mobile hamburger menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--color-text);
    transition: 0.3s;
}

