/* Safe viewport guard */
html, body { overflow-x: hidden; }

.jv-topnav {
    display: block;
    width: 100%;
    height: 72px;
    min-height: 72px;
    position: sticky;
    top: 0;
    z-index: 9999;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.jv-topnav *, .jv-topnav *::before, .jv-topnav *::after { box-sizing: border-box; }

/* ─── Navigation Container ─── */
.jv-topnav .site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 0 3rem;
    height: 72px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition:
            background 0.5s cubic-bezier(0.65, 0, 0.35, 1),
            box-shadow 0.5s cubic-bezier(0.65, 0, 0.35, 1),
            border-color 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    isolation: isolate;
}
.jv-topnav .site-nav.scrolled {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* ─── Logo Area ─── */
.jv-topnav .logo-area {
    grid-column: 2; grid-row: 1;
    display: flex; align-items: center; justify-content: center;
    min-width: 0;
    overflow: hidden;
}
.jv-topnav .brand-link {
    display: flex; align-items: center;
    text-decoration: none; color: #1a202c;
    transition: opacity 0.3s ease;
    min-width: 0;
    max-width: 100%;
}
.jv-topnav .brand-link:hover { opacity: 0.7; }
.jv-topnav .logo-text {
    display: flex; align-items: center; justify-content: center;
    gap: 0.3rem;
    font-size: 1.35rem;
    font-weight: 200;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jv-topnav .logo-light { font-weight: 200; color: #4a5568; }
.jv-topnav .logo-bold {
    font-weight: 700;
    background: linear-gradient(135deg, #1a2a6c, #3b6ef0, #6a8aff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.jv-topnav .logo-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #3b6ef0; display: inline-block; margin-left: 0.2rem;
    animation: jv-topnav-pulse 2.4s ease-in-out infinite;
}
@keyframes jv-topnav-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.2); }
}

/* ─── Desktop Navigation ─── */
.jv-topnav .nav-links {
    grid-column: 3; grid-row: 1; justify-self: end;
    display: flex; align-items: center; gap: 2.8rem;
    list-style: none; margin: 0; padding: 0;
}
.jv-topnav .nav-links .nav-link {
    position: relative;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #4a5568;
    transition: color 0.4s ease;
    padding: 0.25rem 0;
    background: none; border: none; cursor: pointer;
    font-family: inherit;
}
.jv-topnav .nav-links .nav-link::after {
    content: ''; position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 1.5px;
    background: linear-gradient(90deg, #3b6ef0, #6a8aff);
    transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    border-radius: 2px;
}
.jv-topnav .nav-links .nav-link:hover { color: #1a202c; }
.jv-topnav .nav-links .nav-link:hover::after,
.jv-topnav .nav-links .nav-link.active::after { width: 100%; }
.jv-topnav .nav-links .nav-link.active { color: #1a202c; }

/* ─── Hamburger / Mobile Search ─── */
.jv-topnav .hamburger {
    grid-column: 1; grid-row: 1; justify-self: start;
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer;
    padding: 0.4rem; z-index: 1001;
    align-items: center; justify-content: center;
    color: #1a202c;
    pointer-events: auto;
}
.jv-topnav .hamburger i {
    font-size: 1.3rem;
    transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.jv-topnav .hamburger.active i { transform: rotate(90deg); }

.jv-topnav .mobile-search {
    grid-column: 3; grid-row: 1; justify-self: end;
    display: none; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    padding: 0.4rem; z-index: 1001; color: #1a202c;
    pointer-events: auto;
}
.jv-topnav .mobile-search i {
    font-size: 1.3rem;
    transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}

/* ─── Overlay ─── */
.jv-topnav .overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1001;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition:
            opacity 0.4s cubic-bezier(0.65, 0, 0.35, 1),
            visibility 0s 0.4s;
}
.jv-topnav .overlay.show {
    opacity: 1; visibility: visible; pointer-events: all;
    transition:
            opacity 0.4s cubic-bezier(0.65, 0, 0.35, 1),
            visibility 0s 0s;
}

/* ─── Mobile Menu ─── */
.jv-topnav .mobile-menu {
    position: fixed; inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(40px) saturate(1.6);
    -webkit-backdrop-filter: blur(40px) saturate(1.6);
    z-index: 1002;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2.5rem;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition:
            opacity 0.5s cubic-bezier(0.65, 0, 0.35, 1),
            visibility 0s 0.5s;
    padding: 2rem;
    overflow: hidden;
}
.jv-topnav .mobile-menu.open {
    opacity: 1; visibility: visible; pointer-events: all;
    transition:
            opacity 0.5s cubic-bezier(0.65, 0, 0.35, 1),
            visibility 0s 0s;
}
.jv-topnav .mobile-menu .nav-link {
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #4a5568;
    transition: color 0.3s ease, transform 0.3s ease;
    position: relative;
    background: none; border: none; cursor: pointer;
    font-family: inherit; padding: 0.25rem 0;
    max-width: 100%;
    overflow-wrap: break-word;
    text-align: center;
}
.jv-topnav .mobile-menu .nav-link::after {
    content: ''; position: absolute;
    bottom: -4px; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 2px;
    background: linear-gradient(90deg, #3b6ef0, #6a8aff);
    transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    border-radius: 2px;
}
.jv-topnav .mobile-menu .nav-link:hover { color: #1a202c; transform: scale(1.02); }
.jv-topnav .mobile-menu .nav-link:hover::after,
.jv-topnav .mobile-menu .nav-link.active::after { width: 100%; }
.jv-topnav .mobile-menu .nav-link.active { color: #1a202c; }

/* ─── Site-nav when menu is open ─── */
.jv-topnav .site-nav.menu-open {
    z-index: 1003;
    background: transparent;
    border-bottom-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.jv-topnav .site-nav.menu-open .logo-area { opacity: 0; pointer-events: none; }
.jv-topnav .site-nav.menu-open .mobile-search { opacity: 0; pointer-events: none; }
.jv-topnav .site-nav.menu-open .nav-links { opacity: 0; pointer-events: none; }
.jv-topnav .site-nav.menu-open .hamburger { color: #1a202c; }

/* ─── Responsive ─── */
@media (max-width: 1120px) {
    .jv-topnav { height: 64px; min-height: 64px; margin-top: 0; }
    .jv-topnav .site-nav {
        padding: 0 1rem;
        height: 64px;
        margin-top: 0;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
    }
    .jv-topnav .nav-links { display: none; }
    .jv-topnav .hamburger { display: flex; }
    .jv-topnav .mobile-search { display: flex; }
    .jv-topnav .logo-text { font-size: 1.15rem; }
    .jv-topnav .mobile-menu .nav-link { font-size: 1.5rem; }
}
@media (max-width: 480px) {
    .jv-topnav { height: 58px; min-height: 58px; margin-top: 0; }
    .jv-topnav .site-nav { padding: 0 0.75rem; height: 58px; margin-top: 0; }
    .jv-topnav .mobile-search i { font-size: 1.15rem; }
    .jv-topnav .hamburger i { font-size: 1.15rem; }
    .jv-topnav .logo-text { font-size: 1rem; letter-spacing: 0.08em; }
    .jv-topnav .logo-dot { width: 4px; height: 4px; }
    .jv-topnav .mobile-menu .nav-link { font-size: 1.3rem; letter-spacing: 0.15em; }
}

/* ─── Utility ─── */
.jv-topnav .hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .jv-topnav *, .jv-topnav *::before, .jv-topnav *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── Page scroll lock while menu is open ─── */
body.jv-topnav-menu-open { overflow: hidden; }
html.jv-topnav-menu-open  { overflow: hidden; }

/* ─── Contact Modal ─── */
.jv-topnav .contact-modal {
    position: fixed;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    z-index: 2000;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition:
            opacity 0.25s ease,
            visibility 0s 0.25s;
}
.jv-topnav .contact-modal[hidden] { display: none; }
.jv-topnav .contact-modal.open {
    opacity: 1; visibility: visible; pointer-events: all;
    transition:
            opacity 0.25s ease,
            visibility 0s 0s;
}

.jv-topnav .contact-modal-panel {
    position: relative; z-index: 1;
    width: min(480px, 100%);
    max-height: 100%;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
    flex: 0 0 auto;
}
.jv-topnav .contact-modal-backdrop {
    position: absolute; inset: 0;
    background: linear-gradient(
            135deg,
            rgba(26, 42, 108, 0.72),
            rgba(59, 110, 240, 0.62),
            rgba(106, 138, 255, 0.58)
    );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.jv-topnav .contact-modal-content { padding: 2.5rem; text-align: center; }
.jv-topnav .contact-modal-close {
    position: absolute; top: 1rem; right: 1rem;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: transparent; color: #64748b;
    cursor: pointer; font-size: 1rem;
    transition: background 0.2s ease, color 0.2s ease;
}
.jv-topnav .contact-modal-close:hover { background: #f1f5f9; color: #172033; }
.jv-topnav .contact-modal-icon {
    width: 54px; height: 54px; margin: 0 auto 1.25rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #f1f5f9;
    color: #3b6ef0; font-size: 1.2rem;
}
.jv-topnav .contact-modal-title {
    margin: 0; color: #172033;
    font-size: 1.5rem; font-weight: 700; line-height: 1.25;
}
.jv-topnav .contact-modal-slogan {
    margin: 0.65rem 0 0; color: #64748b;
    font-size: 0.95rem; line-height: 1.5;
}
.jv-topnav .contact-modal-divider {
    width: 48px; height: 1px; margin: 1.5rem auto;
    background: #dbe3ec;
}
.jv-topnav .contact-modal-message { color: #64748b; font-size: 0.95rem; line-height: 1.6; }
.jv-topnav .contact-modal-message p { margin: 0; }
.jv-topnav .contact-modal-website {
    display: inline-flex; align-items: center; gap: 0.6rem;
    margin-top: 1rem; color: #3b6ef0;
    font-weight: 600; text-decoration: none;
    word-break: break-word;
}
.jv-topnav .contact-modal-website:hover { text-decoration: underline; }
.jv-topnav .contact-modal-website i { flex: 0 0 auto; }

@media (max-width: 480px) {
    .jv-topnav .contact-modal { padding: 1rem; }
    .jv-topnav .contact-modal-content { padding: 2rem 1.5rem; }
    .jv-topnav .contact-modal-title { font-size: 1.3rem; }
}