/* 強制的にナビゲーションを非表示にする */
/* ===================================
   Part: Header Navigation
   ================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    /* Glassmorphism base */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100vw;
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    transition: none;
}

.nav.scrolled .nav-container {
    padding: 0.8rem 2rem;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    margin-left: -16px;
    padding: 0;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-dark);
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1002;
}

/* Menu Wrapper (Desktop Default) */
.nav-menu-wrapper {
    /* 右端寄せ */
    margin-left: auto;
    margin-right: -16px !important;
    padding: 0;
    display: flex;
    align-items: center;
}

/* Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-dark);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    position: relative;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

/* Hover Effect - Underline expands from center */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nav-link:hover,
.nav-link.active {
    opacity: 1;
    color: var(--color-dark);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* CTA Button in Nav */
.nav-link-cta {
    background: var(--color-primary);
    color: var(--color-light) !important;
    padding: 0.6rem 1.4rem;
    border-radius: 4px;
    opacity: 1;
    box-shadow: 0 4px 10px rgba(10, 193, 223, 0.3);
    transition: all 0.3s ease;
}

.nav-link-cta::after {
    display: none;
}

.nav-link-cta:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(10, 193, 223, 0.4);
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
}

.nav-toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--color-dark);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-radius: 2px;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .nav-toggle {
        display: flex;
    }

    /* Wrapper becomes the fullscreen overlay */
    .nav-menu-wrapper {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100dvh;
        /* Use dvh to adapt to address bar changes */
        min-height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);

        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-top: var(--nav-height);
        padding-bottom: 2rem;

        transform: translateX(100%);
        transition: transform 0.5s cubic-bezier(0.77, 0, 0.18, 1);
        z-index: 1001;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Menu inside wrapper */
    .nav-menu {
        flex-direction: column;
        justify-content: flex-start;
        gap: 1rem;
        width: 100%;
        padding-top: 0;
        padding-bottom: 4rem;
    }

    /* Active State (Toggle Class on Wrapper) */
    .nav-menu-wrapper.active {
        transform: translateX(0);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    }

    /* Support legacy 'active' on nav-menu if JS adds it there too (UI components likely adds to #nav-menu)
       Actually, ui-components.js toggles class on 'menu' (getElementById('nav-menu')).
       So we need to make sure the sliding effect works.
       Current JS: menu.classList.toggle('active'); -> toggles on ul#nav-menu
       
       We need to adjust CSS so .nav-menu.active triggers the wrapper slide, OR update JS.
       Updating JS is cleaner layout-wise, but updating CSS to react to child class is impossible (parent selector).
       
       Wait, let's look at ui-components.js logic:
       const menu = document.getElementById('nav-menu');
       
       We should change JS to toggle class on wrapper #nav-menu-wrapper instead.
    */

    .nav-link {
        font-size: 1.3rem;
        color: var(--color-dark);
        opacity: 0;
        /* Hidden initially for stagger */
        transform: translateY(20px);
        transition: all 0.4s ease;
    }

    /* When wrapper is active (conceptually), show links.
       Since we'll update JS to toggle wrapper, this will be:
       .nav-menu-wrapper.active .nav-link
    */
    .nav-menu-wrapper.active .nav-link {
        opacity: 1;
        transform: translateY(0);
    }

    /* Toggle Animation */
    .nav-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
        background: var(--color-primary);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }

    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
        background: var(--color-primary);
    }
}