/* ============================================
   NAVIGATION
============================================ */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    height: 100%;
    position: relative;
}

/* Left section - Logo (30%) */
.nav-left {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.5rem;
    width: 30%;
    position: relative;
}

.nav-left::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.8);
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: white;
    line-height: 1;
}

.logo-subtitle {
    font-family: var(--font-body);
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Center section - Nav Links (60%) */
.nav-center {
    display: flex;
    width: 60%;
    align-items: stretch;
    opacity: 1;
    transition: opacity 0.3s ease;
    position: relative;
}

.nav-center::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.8);
}

nav.scrolled .nav-center {
    opacity: 0;
    pointer-events: none;
}

.nav-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    list-style: none;
    margin: 0;
    padding: 0.4rem 0;
    width: 100%;
    align-content: center;
}

.nav-links li {
    display: flex;
    align-items: center;
    position: relative;
}

/* Column dividers */
.nav-links li:nth-child(1),
.nav-links li:nth-child(2),
.nav-links li:nth-child(3),
.nav-links li:nth-child(5),
.nav-links li:nth-child(6),
.nav-links li:nth-child(7) {
    border-right: 1px solid rgba(255, 255, 255, 0.8);
}

.nav-links a {
    font-family: var(--font-body);
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
}

.nav-links a:hover {
    color: white;
}

.nav-number {
    font-family: var(--font-display);
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Right section - Index button (10%) */
.nav-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    width: 10%;
}

.nav-index {
    font-family: var(--font-body);
    font-size: 0.6rem;
    color: white;
    text-decoration: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.nav-index:hover {
    opacity: 0.7;
}

.nav-index-icon {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* Scrolled state - Page info */
.nav-page-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    position: absolute;
    left: 30%;
    width: 60%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

nav.scrolled .nav-page-info {
    opacity: 1;
    pointer-events: auto;
}

.nav-page-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.5rem;
    height: 100%;
    position: relative;
}

.nav-page-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.8);
}

.nav-page-item:first-child {
    padding-right: 0.75rem;
}

.nav-page-item:last-child {
    padding-left: 0.75rem;
}

.nav-page-label {
    font-family: var(--font-body);
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.nav-page-value {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: white;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

nav.scrolled .nav-left {
    min-width: auto;
}

nav.scrolled .nav-left::after {
    display: none;
}

/* ============================================
   FULLSCREEN MENU
============================================ */

/* Menu overlay */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.menu-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Fullscreen menu panel */
.fullscreen-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #0a0a0a;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.fullscreen-menu.open {
    transform: translateY(0);
}

/* Menu header */
.menu-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 1.5rem;
    min-height: 80px;
    flex: 0 0 auto;
    background: #0a0a0a;
    position: relative;
    z-index: 100;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-logo {
    font-family: var(--font-display), -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 2.5rem;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.02em;
    display: inline-block;
    line-height: 1;
    font-weight: 500;
}

.menu-logo sup {
    font-size: 0.35em;
    font-weight: 400;
    margin-left: 0.05em;
    vertical-align: top;
    position: relative;
    top: 0.15em;
    opacity: 0.6;
}

.menu-close {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease;
    padding: 0;
}

.menu-close:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.menu-close svg {
    width: 16px;
    height: 16px;
}

/* Gradient bar */
.menu-gradient {
    height: 5px;
    min-height: 5px;
    background: linear-gradient(90deg,
        var(--color-blue) 0%,
        var(--color-purple) 50%,
        var(--color-coral) 100%
    );
    margin: 0 1.5rem 1rem;
    border-radius: 3px;
    flex: 0 0 auto;
    box-sizing: border-box;
    position: relative;
    z-index: 100;
}

/* Menu navigation */
.menu-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1.5rem 2rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.menu-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    text-decoration: none;
    color: white;
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    transition: opacity 0.2s ease;
}

.menu-link:last-child {
    border-bottom: none;
}

.menu-link:hover {
    opacity: 0.7;
}

.menu-arrow {
    width: 20px;
    height: 20px;
    opacity: 0.35;
    color: white;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* Expandable menu items */
.menu-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item .menu-link {
    border-bottom: none;
    position: relative;
}

.menu-expand {
    background: none;
    border: none;
    padding: 0.5rem;
    margin: -0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-expand:hover .menu-arrow {
    opacity: 0.7;
}

.menu-item:hover .menu-expand .menu-arrow,
.menu-item.expanded .menu-expand .menu-arrow {
    transform: rotate(90deg);
}

/* Section links container */
.menu-sections {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease 0.15s, opacity 0.4s ease 0.15s;
    padding-left: 1rem;
    opacity: 0;
}

.menu-item:hover .menu-sections,
.menu-item.expanded .menu-sections {
    max-height: 300px;
    opacity: 1;
    transition-delay: 0.2s;
}

.menu-section-link {
    display: block;
    padding: 0.6rem 0;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s ease;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 1rem;
}

.menu-section-link:hover {
    color: white;
}

.menu-section-link:last-child {
    margin-bottom: 0.5rem;
}

/* Desktop styles */
@media (min-width: 769px) {
    .fullscreen-menu {
        width: 35%;
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    .fullscreen-menu.open {
        transform: translateX(0);
    }

    .menu-header {
        padding: 2rem;
    }

    .menu-logo {
        font-size: 2.75rem;
    }

    .menu-close {
        right: 2rem;
    }

    .menu-gradient {
        margin: 0 2rem;
    }

    .menu-nav {
        padding: 1rem 2rem 2rem;
    }

    .menu-link {
        font-size: 1.5rem;
        padding: 1.1rem 0;
    }
}

/* ============================================
   TABLET/MOBILE NAVIGATION
============================================ */
@media (max-width: 900px) {
    .nav-center {
        display: none;
    }

    .nav-page-info {
        display: none;
    }

    .nav-left {
        width: auto;
        flex: 1;
    }

    .nav-left::after {
        display: none;
    }

    .nav-right {
        width: auto;
    }
}

@media (max-width: 768px) {
    .nav-inner {
        padding: 0;
    }

    .nav-left {
        padding: 0.7rem 1rem;
    }

    .logo {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .logo-subtitle {
        font-size: 0.5rem;
    }

    .nav-right {
        padding: 0 1rem;
    }

    .nav-index {
        font-size: 0.55rem;
    }

    .nav-index-icon {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
}
