/* ════════════════════════════════════════════════════════════════
   NAV — single source of truth for all pages.
   Extracted from v111-homepage.css. Loaded globally via head.html
   before any per-page stylesheet, so these rules are the baseline
   every page inherits. Do not add nav rules to page-level CSS.
   ════════════════════════════════════════════════════════════════ */

/* NAVIGATION */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    pointer-events: none;
}

.nav-glass {
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid transparent;
    border-radius: 0;
    transition: none; /* driven by JS for smooth scroll-linked feel */
    pointer-events: auto;
    box-sizing: border-box;
}

/* Nav text colors: white on dark hero */
nav .logo {
    color: white;
    transition: color 0.4s var(--ease-smooth);
}
nav.nav-solid .logo {
    color: var(--text-primary);
}

nav .nav-link {
    color: #ffffff;
    transition: color 0.3s var(--ease-smooth);
}
nav.nav-solid .nav-link {
    color: var(--text-primary);
}
nav.nav-solid .nav-plus {
    color: var(--text-primary);
}
nav .nav-link:hover {
    color: #ffffff;
    opacity: 1;
}
nav.nav-solid .nav-link:hover {
    color: var(--text-primary);
    opacity: 1;
}

/* Mobile hamburger bars use currentColor — keep them on the nav theme:
   white over a dark hero, dark navy once the nav goes solid over light. */
nav .nav-toggle { color: #ffffff; }
nav.nav-solid .nav-toggle { color: var(--text-primary); }

nav .nav-cta {
    background: rgba(255, 255, 255, 0.20);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    color: #fff;
    padding: 10px 22px;
    text-decoration: none;
    isolation: isolate;
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
    backdrop-filter: blur(10px) saturate(1.2);
    transition:
        background 0.3s var(--ease-smooth),
        border-color 0.3s var(--ease-smooth),
        color 0.3s var(--ease-smooth),
        backdrop-filter 0.3s var(--ease-smooth),
        -webkit-backdrop-filter 0.3s var(--ease-smooth),
        opacity 0.3s var(--ease-smooth),
        transform 0.3s var(--spring);
}
nav .nav-cta:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.75);
    transform: translateY(-1px);
}
nav.nav-solid .nav-cta {
    background: #000000;
    border: 1px solid #000000;
    color: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
nav.nav-solid .nav-cta:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.nav-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    box-sizing: border-box;
}

.nav-container { position: relative; }
.nav-container .logo { flex: 0 0 auto; }
.nav-container .nav-links { position: absolute; left: 50%; transform: translateX(-50%); }
.nav-container .nav-cta { flex: 0 0 auto; margin-left: auto; }

.logo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    height: 36px;
    text-decoration: none;
    color: inherit;
}
a.logo:hover,
a.logo:focus,
a.logo:active {
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    position: relative;
    width: 48px;
    height: 36px;
    flex-shrink: 0;
}

.logo-icon svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 36px;
    /* New mark recolors via currentColor: white over dark sections, dark navy
       once the nav goes solid over a light section. */
    color: #FFFFFF;
}

nav.nav-solid .logo-icon svg { color: #10182E; }

.logo-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 14px;
    flex-shrink: 0;
}
nav.nav-solid .logo-divider {
    background: rgba(0, 0, 0, 0.15);
}

/* The wordmark — explicit font stack with !important guards against
   any page-level CSS (collections.css, v111-homepage.css redeclarations,
   global * resets) overriding the cascade. The nav must look identical
   on every page; this enforces it at the source. */
.logo-text,
.logo-text .logo-dot {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
}
.logo-text {
    font-size: 18px;
    white-space: nowrap;
}

.logo-dot {
    color: white;
}
nav.nav-solid .logo-dot {
    color: #0B0C0E;
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
nav.nav-solid .nav-links {
    background: transparent;
    box-shadow: none;
}

.nav-link {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 7px;
    transition: color 0.3s var(--ease-smooth),
                background 0.3s var(--ease-smooth);
}
nav .nav-links .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
}
nav.nav-solid .nav-links .nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-link.product-trigger {
    position: relative;
}

.nav-plus {
    display: inline-block;
    position: relative;
    width: 13px;
    height: 13px;
    margin-left: 7px;
    color: #ffffff;
    opacity: 1;
    transform: translate3d(0, -1px, 0);
    transform-origin: center;
    will-change: transform;
    transition: opacity 0.3s var(--ease-smooth),
                transform 0.3s var(--ease-smooth);
}
.nav-plus::before,
.nav-plus::after {
    content: '';
    position: absolute;
    background: currentColor;
}
.nav-plus::before {  /* vertical bar — 1×9, centered in 13×13 */
    top: 2px;
    left: 6px;
    width: 1px;
    height: 9px;
}
.nav-plus::after {   /* horizontal bar — 9×1, centered in 13×13 */
    top: 6px;
    left: 2px;
    width: 9px;
    height: 1px;
}
.nav-link:hover .nav-plus {
    opacity: 1;
    transform: translate3d(0, -1px, 0) rotate(45deg);
}

/* MEGA DROPDOWN — Compact floating card (Quartr-style) */
.mega-dropdown {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    /* 660px = two-column layout (cards + testimonial) while the Revenue
       Agents square is hidden. When that card is restored, widen back to
       960px and re-add its column to .mnav-panel below. */
    width: 660px;
    background: rgba(13, 13, 13, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    z-index: 999;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: opacity 0.25s var(--ease-smooth),
                transform 0.25s var(--ease-smooth),
                visibility 0s 0.25s;
}

.mega-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    transition: opacity 0.25s var(--ease-smooth),
                transform 0.25s var(--ease-smooth),
                visibility 0s 0s;
}

/* ── Compact card panel layout ── */
.mnav-panel {
    display: grid;
    /* cards | testimonial. While Revenue Agents is hidden there is no
       middle square column — restore it as `1fr 288px 180px` (and set
       .mega-dropdown width back to 960px) when the agent card returns. */
    grid-template-columns: 1fr 180px;
    gap: 12px;
    align-items: stretch;
}

/* ── Square "Revenue Agents" illustration card ── */
.mnav-square {
    position: relative;
    display: block;
    height: 288px;
    align-self: start;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    background: linear-gradient(160deg, #1b1f2e 0%, #0c0d12 100%);
    transition: transform 0.3s var(--ease-smooth);
}
.mnav-square:hover { transform: scale(1.015); }
.mnav-sq-illus { position: absolute; inset: 0 0 38px 0; display: flex; align-items: center; justify-content: center; }
.mnav-sq-illus svg { width: 60%; height: auto; }
.mnav-square .mnav-card-arrow { color: rgba(255, 255, 255, 0.4); }

/* ── Image cards (left column) ── */
.mnav-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mnav-card {
    position: relative;
    display: block;
    height: 140px;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s var(--ease-smooth);
}
.mnav-card:hover { transform: scale(1.015); }

.mnav-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.28) 55%,
        rgba(0, 0, 0, 0.10) 100%
    );
    transition: background 0.3s var(--ease-smooth);
}
.mnav-card:hover .mnav-card-overlay {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.80) 0%,
        rgba(0, 0, 0, 0.36) 55%,
        rgba(0, 0, 0, 0.14) 100%
    );
}

.mnav-card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 18px;
}

.mnav-card-title {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: white;
    letter-spacing: -0.01em;
    margin-bottom: 3px;
}

.mnav-card-desc {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.45;
}

.mnav-card-arrow {
    position: absolute;
    top: 14px;
    right: 16px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.mnav-card:hover .mnav-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ── Testimonial (right column) ── */
.mnav-testimonial {
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    padding-left: 16px;
}

.mnav-t-label {
    font-family: var(--font-ui);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.28);
    margin-bottom: 12px;
}

.mnav-t-img-wrap {
    width: 100%;
    height: 110px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.mnav-t-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    filter: brightness(0.88) contrast(1.04);
    transition: transform 0.5s var(--ease-smooth);
}
.mnav-testimonial:hover .mnav-t-img { transform: scale(1.04); }

.mnav-t-quote {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 400;
    font-style: italic;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    margin: 0 0 12px 0;
    padding: 0;
    border: none;
    flex: 1;
}

.mnav-t-name {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.mnav-t-role {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.32);
    margin-top: 2px;
    margin-bottom: 10px;
}

.mnav-t-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-cta {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 20px;
    border-radius: var(--radius-machine);
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

.nav-cta:hover {
    opacity: 0.6;
}

@media (max-width: 768px) {
    nav { padding: 0 var(--space-6); }
    .nav-links { gap: var(--space-6); }
    .nav-link { font-size: 11px; }
}


/* ── Adaptive theme: the mega-dropdown follows the section behind the nav.
   Dark (default, above) over dark sections; this LIGHT variant kicks in when
   common.js leaves body without .nav-bg-dark (i.e. over a light section like
   the homepage hero). The photo cards keep their dark overlays; only the panel
   chrome + testimonial text invert so the card reads as light, not a heavy
   slab over a bright background. (v46) ── */
body:not(.nav-bg-dark) .mega-dropdown {
    background: rgba(252, 252, 250, 0.97);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 24px 64px rgba(15, 18, 24, 0.18), 0 4px 16px rgba(15, 18, 24, 0.08);
}
body:not(.nav-bg-dark) .mnav-testimonial { border-left-color: rgba(0, 0, 0, 0.08); }
body:not(.nav-bg-dark) .mnav-t-label { color: rgba(0, 0, 0, 0.40); }
body:not(.nav-bg-dark) .mnav-t-quote { color: rgba(17, 19, 22, 0.62); }
body:not(.nav-bg-dark) .mnav-t-name  { color: #111316; }
body:not(.nav-bg-dark) .mnav-t-role  { color: rgba(0, 0, 0, 0.45); }
body:not(.nav-bg-dark) .mnav-t-logo img { filter: invert(1); }
