/* Sticky wrapper so blur spans full viewport width */
.nav-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    /* Warm-tinted glass — matches --bg-color (#fdfbf7) instead of cold white */
    background: rgba(253, 251, 247, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(253, 251, 247, 0.5);
    border-radius: 0 0 20px 20px;
    box-shadow: var(--shadow-soft);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 10%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    position: relative;
}

.logo::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: rgba(255, 183, 178, 0.55);
    position: absolute;
    bottom: -5px;
    border-radius: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.3s, transform 0.3s var(--ease-soft);
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-pink);
    transform: translateY(-1px);
}

.nav-links a.active {
    color: var(--text-main);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-pink);
    border-radius: 2px;
}

/* Per-page representative gradients — Home / Gallery / About */
.nav-links a:nth-child(1).active::after {
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-yellow));
}
.nav-links a:nth-child(2).active::after {
    background: linear-gradient(90deg, var(--accent-blue), #a8d8ea);
}
.nav-links a:nth-child(3).active::after {
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
}

/* Hamburger menu button */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    /* 44×44 minimum tap target per Apple/Google HIG */
    width: 44px;
    height: 44px;
    padding: 10px;
    z-index: 1001;
    border: none;
    background: none;
    border-radius: 10px;
    transition: background 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    align-items: center;
    justify-content: center;
}

.nav-hamburger:hover { background: rgba(0,0,0,0.04); }
.nav-hamburger:active { background: rgba(0,0,0,0.08); }

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s;
    pointer-events: none;
}

/* When menu is open, hide hamburger (close btn is inside nav-mobile) */
.nav-hamburger.open {
    opacity: 0;
    pointer-events: none;
}

/* Mobile overlay */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none; /* don't intercept taps when invisible */
}

.nav-overlay.visible {
    opacity: 1;
    pointer-events: auto; /* allow tap-to-close only when menu is open */
}

/* Mobile slide-down menu */
.nav-mobile {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1.2rem 2rem 1.5rem;
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 0 24px 24px;
}

.nav-mobile.open {
    transform: translateY(0);
}

.nav-mobile a {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 0 0.8rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 1.15rem;
    border-bottom: 1px solid #f5f5f5;
    transition: color 0.2s, background 0.2s;
    border-radius: 10px;
    margin: 0 -0.5rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-mobile a:last-child { border: none; }

.nav-mobile a:active { background: #fff5f5; color: var(--accent-pink); }

.nav-mobile a:hover,
.nav-mobile a.active {
    color: var(--accent-pink);
}


@media (max-width: 768px) {
    nav {
        padding: 0.8rem 5%;
    }

    .nav-links {
        display: none;
    }

    .nav-hamburger {
        display: flex;
    }

    .nav-overlay,
    .nav-mobile {
        display: block;
    }
}
