/* ============================================================
   VSynap GlobalNav — shared navigation bar for every page.
   Ported from the React app (GlobalNav.css). Self-contained
   colours; theme-aware via body.dark-mode. Fixed at the top.
   ============================================================ */
.gnav {
    --gn-blue: #2563eb;
    --gn-cyan: #06b6d4;
    --gn-bg: rgba(247, 249, 252, 0.82);
    --gn-text: #0b1b30;
    --gn-text-secondary: #4c596e;
    /* was #8b96a8 — too faint against the light nav surface */
    --gn-text-dim: #667488;
    --gn-border: rgba(7, 26, 47, 0.09);
    --gn-glass: rgba(7, 26, 47, 0.035);
    --gn-glass-hover: rgba(7, 26, 47, 0.06);
    --gn-menu-bg: rgba(255, 255, 255, 0.96);

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
    font-family: "Space Grotesk", "Plus Jakarta Sans", system-ui, sans-serif;
}

body.dark-mode .gnav {
    --gn-bg: rgba(10, 20, 34, 0.82);
    --gn-text: #ffffff;
    --gn-text-secondary: #a6b2c8;
    --gn-text-dim: #5e6c87;
    --gn-border: rgba(255, 255, 255, 0.09);
    --gn-glass: rgba(255, 255, 255, 0.045);
    --gn-glass-hover: rgba(255, 255, 255, 0.08);
    --gn-menu-bg: rgba(12, 20, 34, 0.97);
}

/* Pages that are not the landing keep a solid bar from the start
   so the nav never floats over their own light backgrounds. */
.gnav.gnav--solid,
.gnav.scrolled {
    background: var(--gn-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--gn-border);
}

/* a soft lift once the page has scrolled under the bar */
.gnav.scrolled {
    box-shadow: 0 6px 24px rgba(9, 20, 40, .07);
}

body.dark-mode .gnav.scrolled {
    box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

/* the bar itself eases in on first paint */
@keyframes gnav-drop {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.gnav {
    animation: gnav-drop .5s cubic-bezier(.16, 1, .3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .gnav {
        animation: none;
    }
}

/* shared line-icon sizing inside the nav */
.gnav svg.vs-ico,
.gnav__drawer svg.vs-ico {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
    display: block;
}

.gnav__theme svg.vs-ico {
    width: 17px;
    height: 17px;
}

.gnav__wrap {
    max-width: 1240px;
    margin: 0 auto;
    height: 72px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    gap: 18px;
}

/* brand */
.gnav__logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.gnav__logo:hover {
    transform: translateY(-1px);
    opacity: 0.85;
}

.gnav__logo img {
    height: 40px;
    width: auto;
    display: block;
}

/* desktop links */
.gnav__links {
    display: flex;
    align-items: center;
    gap: 28px;
    margin: 0 auto;
}

.gnav__link {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--gn-text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.gnav__link:hover {
    color: var(--gn-text);
}

.gnav__link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--gn-blue), var(--gn-cyan));
    transition: width 0.25s ease;
}

.gnav__link:hover::after {
    width: 100%;
}

.gnav__link.active {
    color: var(--gn-text);
}

/* products dropdown */
.gnav__dropdown {
    position: relative;
}

.gnav__dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.gnav__dropdown-trigger svg {
    transition: transform 0.25s ease;
}

.gnav__dropdown:hover .gnav__dropdown-trigger svg {
    transform: rotate(180deg);
}

.gnav__dropdown::after {
    /* hover bridge so the menu doesn't close in the gap */
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 22px;
}

.gnav__menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    margin-top: 16px;
    min-width: 264px;
    padding: 8px;
    background: var(--gn-menu-bg);
    border: 1px solid var(--gn-border);
    border-radius: 16px;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.gnav__dropdown:hover .gnav__menu,
.gnav__dropdown:focus-within .gnav__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.gnav__menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 12px;
    border: none;
    background: none;
    border-radius: 11px;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    color: var(--gn-text);
    transition: background 0.18s ease;
}

.gnav__menu-item:hover {
    background: var(--gn-glass-hover);
}

.gnav__menu-item::after {
    display: none;
}

.gmi-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--gn-glass);
    border: 1px solid var(--gn-border);
}

/* real app marks bring their own artwork, so drop the glass tile */
.gmi-icon--logo {
    background: none;
    border: none;
    overflow: hidden;
    padding: 0;
}

.gmi-icon--logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 9px;
    display: block;
}

.gnav__drawer-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 5px;
    flex-shrink: 0;
    display: block;
}

.gmi-text {
    display: flex;
    flex-direction: column;
}

.gmi-label {
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.2;
}

.gmi-tag {
    font-size: 11px;
    color: var(--gn-text-dim);
}

/* right side */
.gnav__right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.gnav__theme {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--gn-border);
    background: var(--gn-glass);
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.gnav__theme:hover {
    background: var(--gn-glass-hover);
    transform: translateY(-1px);
}

.gnav__cta {
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    background: #ffffff;
    border: 1px solid rgba(37, 99, 235, 0.28);
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(9, 20, 40, 0.08);
    transition: box-shadow 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

.gnav__cta:hover {
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.28);
    border-color: rgba(37, 99, 235, 0.6);
    transform: translateY(-1px);
}

/* ---- support icon: matches the blue label ---- */
.gnav__cta-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    flex-shrink: 0;
}

/* the drawer sits on a light surface, so the white icon gets a
   gradient chip behind it to stay legible in both themes */
.gnav__drawer-support {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* literal colours: the drawer is a sibling of .gnav, so the
   --gn-* tokens defined on .gnav do not reach it */
.gnav__drawer-support .gnav__cta-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(100deg, #2563eb, #06b6d4);
}

.gnav__cta-ico svg.vs-ico {
    width: 18px;
    height: 18px;
    stroke: #2563eb;
    stroke-width: 1.8;
    fill: none;
    /* gentle attention pulse while idle */
    animation: gnav-support-pulse 2.6s ease-in-out infinite;
    transform-origin: 50% 50%;
    filter: drop-shadow(0 0 0 rgba(37, 99, 235, 0));
    transition: filter 0.3s ease;
}

/* the drawer chip keeps its gradient fill, so that icon stays white */
.gnav__drawer-support .gnav__cta-ico svg.vs-ico {
    stroke: #ffffff;
}

@keyframes gnav-support-pulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.92;
    }

    40% {
        transform: scale(1.14) rotate(-8deg);
        opacity: 1;
    }

    70% {
        transform: scale(1.04) rotate(6deg);
        opacity: 1;
    }
}

/* on hover the icon spins once and glows */
.gnav__cta:hover .gnav__cta-ico svg.vs-ico {
    animation: gnav-support-spin 0.9s cubic-bezier(.16, 1, .3, 1);
    filter: drop-shadow(0 0 7px rgba(37, 99, 235, 0.55));
}

.gnav__drawer-support:hover .gnav__cta-ico svg.vs-ico {
    animation: gnav-support-spin 0.9s cubic-bezier(.16, 1, .3, 1);
    filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.85));
}

@keyframes gnav-support-spin {
    from {
        transform: rotate(0deg) scale(1);
    }

    60% {
        transform: rotate(220deg) scale(1.18);
    }

    to {
        transform: rotate(360deg) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {

    .gnav__cta-ico svg.vs-ico,
    .gnav__cta:hover .gnav__cta-ico svg.vs-ico,
    .gnav__drawer-support:hover .gnav__cta-ico svg.vs-ico {
        animation: none;
        transform: none;
        opacity: 1;
    }
}

/* hamburger */
.gnav__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0 9px;
    background: var(--gn-glass);
    border: 1px solid var(--gn-border);
    border-radius: 11px;
    cursor: pointer;
}

.gnav__burger span {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: var(--gn-text);
    transition: transform 0.28s ease, opacity 0.2s ease;
}

.gnav__burger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.gnav__burger.is-open span:nth-child(2) {
    opacity: 0;
}

.gnav__burger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* mobile drawer */
.gnav__overlay {
    position: fixed;
    inset: 0;
    z-index: 1900;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.gnav__overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.gnav__drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1950;
    height: 100dvh;
    width: min(80vw, 310px);
    padding: 84px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--gn-menu-bg, #fff);
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.18);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: "Space Grotesk", "Plus Jakarta Sans", system-ui, sans-serif;
    overflow-y: auto;
}

body.dark-mode .gnav__drawer {
    background: #0c1422;
}

.gnav__drawer.open {
    transform: translateX(0);
}

.gnav__drawer-link {
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--gn-text, #0b1b30);
    padding: 13px 14px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

body.dark-mode .gnav__drawer-link {
    color: #e6e9f5;
}

.gnav__drawer-link:hover {
    background: rgba(37, 99, 235, 0.12);
    color: var(--gn-blue);
}

.gnav__drawer-group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gn-text-dim, #667488);
    padding: 16px 14px 6px;
    font-weight: 700;
}

.gnav__drawer-sub {
    padding-left: 22px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* drawer items slide in one after another when the menu opens */
.gnav__drawer .gnav__drawer-link,
.gnav__drawer .gnav__drawer-group-label {
    opacity: 0;
    transform: translateX(18px);
    transition: opacity .3s ease, transform .35s cubic-bezier(.16, 1, .3, 1);
}

.gnav__drawer.open .gnav__drawer-link,
.gnav__drawer.open .gnav__drawer-group-label {
    opacity: 1;
    transform: none;
}

.gnav__drawer.open> :nth-child(1) {
    transition-delay: .06s;
}

.gnav__drawer.open> :nth-child(2) {
    transition-delay: .10s;
}

.gnav__drawer.open> :nth-child(3) {
    transition-delay: .14s;
}

.gnav__drawer.open> :nth-child(4) {
    transition-delay: .18s;
}

.gnav__drawer.open> :nth-child(5) {
    transition-delay: .22s;
}

.gnav__drawer.open> :nth-child(6) {
    transition-delay: .26s;
}

.gnav__drawer.open> :nth-child(7) {
    transition-delay: .30s;
}

.gnav__drawer.open> :nth-child(8) {
    transition-delay: .34s;
}

@media (prefers-reduced-motion: reduce) {

    .gnav__drawer .gnav__drawer-link,
    .gnav__drawer .gnav__drawer-group-label {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

@media (max-width: 900px) {

    .gnav__links,
    .gnav__cta {
        display: none;
    }

    .gnav__burger {
        display: flex;
    }

    .gnav__wrap {
        padding: 0 16px;
    }
}

@media (min-width: 901px) {

    .gnav__overlay,
    .gnav__drawer {
        display: none;
    }
}
