/* ============================================================
   GREENFIELD SITE NAV — global component
   ------------------------------------------------------------
   Markup: components/nav.js (one source for every page).
   Styles: this file. Loaded by every page on the main site and
   by /comps/, straight after styles.css (or on /comps/, in its
   place), so these rules keep the cascade position they had
   when they lived in styles.css.

   Covers: the nav bar, mobile menu, the Follow Us newsletter
   popup (follow-popup.js) and the media-kit popup on the logo
   (media-kit-menu.js).

   Uses the site tokens from styles.css :root (--white, --font,
   --container-pad …) so it follows the same responsive token
   overrides as the rest of the site. A page that cannot load
   styles.css — /comps/ — puts class="gf-standalone" on <body>
   and gets the token block below instead.
   ============================================================ */

/* ── Standalone hosts (/comps/) ──────────────────────────────
   Pins the tokens on the component roots so they cannot collide
   with the host page's own token block. Main-site pages never
   carry .gf-standalone, so this does nothing there. */
.gf-standalone .nav, .gf-standalone .mobile-menu,
.gf-standalone .mk-popup, .gf-standalone .fu-popup {
    --white: #ffffff;
    --gray-200: #c4c4d0;
    --accent-blue: #4a90d9;
    --accent-green: #3dcf8e;
    --font: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --container-pad: clamp(20px, 4vw, 80px);
    --container-max: 1400px;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font);
}

/* ── Element resets these rules assume ───────────────────────
   styles.css sets these globally; standalone hosts may not (the
   comps page lacked the `button` one, which rendered the
   hamburger as a browser-default box). :where() pins each to
   (0,0,1), exactly the specificity of styles.css's bare element
   rules, so component classes still win and main pages are
   unchanged. */
:where(.nav, .mobile-menu, .mk-popup, .fu-popup) a { text-decoration: none; }
:where(.nav, .mobile-menu, .mk-popup, .fu-popup) button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font);
}


/* ---------- NAVIGATION ---------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 var(--container-pad);
    height: 80px;
    display: flex;
    align-items: center;
    transition: background 0.5s, backdrop-filter 0.5s, box-shadow 0.5s, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav.scrolled {
    background: rgba(1, 17, 50, 0.97);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-hidden {
    transform: translateY(-100%);
}

.nav-inner {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.nav-logo svg {
    width: 156px;
    height: 32px;
    transition: opacity 0.3s;
}

.nav-logo:hover svg {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--gray-200);
    position: relative;
    padding: 4px 0;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-blue);
    transition: width 0.4s var(--ease-out-expo);
}

.nav-link:hover {
    color: var(--white);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link-active {
    color: var(--white) !important;
    opacity: 1 !important;
}

.nav-link-active::after {
    width: 100% !important;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* CTA Button */
.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--white);
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.btn-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.15), rgba(74, 144, 217, 0.05));
    opacity: 0;
    transition: opacity 0.4s;
    border-radius: 100px;
}

.btn-cta:hover {
    border-color: rgba(74, 144, 217, 0.4);
    transform: translateY(-1px);
}

.btn-cta:hover::before {
    opacity: 1;
}

.btn-cta-icon {
    display: flex;
    transition: transform 0.4s var(--ease-out-expo);
}

.btn-cta:hover .btn-cta-icon {
    transform: translate(2px, -2px);
}

/* ===== Reusable nav promo styling: "NEW" badge + optional pill ==========
   .nav-new-badge     — green "NEW" badge for a DESKTOP nav item
   .nav-pill          — optional accent-blue pill (promoted button look)
   .mobile-new-badge  — green "NEW" chip for a MOBILE menu item
   Parent must be position:relative — .nav-pill and .nav-has-badge both do that.
   Was .nav-d60 / .mobile-d60, named after Disruptors 60; generalised 23 Aug 2026
   when the badge moved to Market Insights and D60 went back to a plain link.
   ======================================================================= */

/* Optional: promoted pill treatment for a desktop nav item */
.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    line-height: 1;
    border-radius: 100px;
    border: 1px solid rgba(74, 144, 217, 0.45);
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.18), rgba(74, 144, 217, 0.05));
    color: var(--white) !important;
    position: relative;
    overflow: visible;
    transition: border-color 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-expo);
}

.nav-pill::after { display: none; } /* no hover underline on a pill */

.nav-pill:hover {
    border-color: rgba(74, 144, 217, 0.75);
    transform: translateY(-1px);
}

/* Anchor for the badge when the item is NOT a pill (plain text link + badge) */
.nav-has-badge { position: relative; overflow: visible; }

.nav-new-badge {
    /* Sits just AFTER the label like an exponent (x²), not on top of it. The
       nav gap is only 32px (24px under 1200px) and the pill is ~30px, so it
       necessarily reaches into that gap — which is fine because the badge
       floats ABOVE the nav text line and never crosses the neighbour's glyph
       box. Measured: text overlap 24px -> 2px; badge band 19-31 vs Careers
       glyphs 32-48. Do not widen the pill without re-measuring both. */
    position: absolute;
    top: -9px;
    right: -28px;
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #04140b;
    background: var(--accent-green);
    border-radius: 100px;
    padding: 2px 5px;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* Mobile menu: the green "NEW" chip floats to the RIGHT of the label, OUT OF
   FLOW, so the link stays only as wide as its text — which keeps the label
   centred with the other menu items and lets the chip hang off to the right. */
.mobile-has-badge { position: relative; }
.mobile-new-badge {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 14px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #04140b;
    background: var(--accent-green);
    border-radius: 100px;
    padding: 3px 8px;
    line-height: 1;
    white-space: nowrap;
}

/* Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    z-index: 1001;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--white);
    transition: all 0.4s var(--ease-out-expo);
    transform-origin: center;
}

.nav-hamburger.active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-hamburger.active span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: #000a1f;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
    will-change: opacity;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transition: opacity 0.35s ease, visibility 0s linear 0s;
}

.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.mobile-menu-link {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    letter-spacing: -0.01em;
    color: var(--gray-200);
    transform: translateY(20px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s var(--ease-out-expo), color 0.3s;
    will-change: transform, opacity;
}

.mobile-menu.active .mobile-menu-link {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu-link:hover {
    color: var(--white);
}

.mobile-cta {
    margin-top: 20px;
    transform: translateY(20px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s var(--ease-out-expo), color 0.3s;
    will-change: transform, opacity;
}

.mobile-cta-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    vertical-align: middle;
}

.mobile-menu.active .mobile-cta {
    transform: translateY(0);
    opacity: 1;
}

/* Stagger mobile links — open only */
.mobile-menu.active .mobile-menu-link:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.active .mobile-menu-link:nth-child(2) { transition-delay: 0.08s; }
.mobile-menu.active .mobile-menu-link:nth-child(3) { transition-delay: 0.11s; }
.mobile-menu.active .mobile-menu-link:nth-child(4) { transition-delay: 0.14s; }
.mobile-menu.active .mobile-menu-link:nth-child(5) { transition-delay: 0.17s; }
.mobile-menu.active .mobile-menu-link:nth-child(6) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-menu-link:nth-child(7) { transition-delay: 0.23s; }
.mobile-menu.active .mobile-cta { transition-delay: 0.26s; }
@keyframes mc-spin { to { transform: rotate(360deg); } }

@media (max-width: 1200px) {
    .nav-links { gap: 24px; }
    .nav-link { font-size: 0.75rem; }
}

@media (max-width: 1024px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
}

@media (max-width: 768px) {
    .btn-cta { display: none; }
}


/* ========== MEDIA KIT CONTEXT MENU POPUP ========== */
.mk-popup {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px) scale(0.96);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.mk-popup.mk-popup-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.mk-popup-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 12px;
    background: rgba(1, 17, 50, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(6, 196, 162, 0.2);
    color: var(--white);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(6, 196, 162, 0.08);
}

.mk-popup-link:hover {
    border-color: rgba(6, 196, 162, 0.4);
    background: rgba(1, 17, 50, 1);
}

.mk-popup-icon {
    flex-shrink: 0;
    color: rgba(6, 196, 162, 0.8);
}

/* ========== FOLLOW US NEWSLETTER POPUP ========== */
.fu-popup {
    position: fixed;
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px) scale(0.96);
    transition: opacity 0.18s ease, transform 0.18s ease;
    width: 300px;
}

.fu-popup.fu-popup-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fu-popup-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    border-radius: 12px;
    background: rgba(1, 17, 50, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(6, 196, 162, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(6, 196, 162, 0.08);
}

.fu-popup-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1.3;
    margin: 0;
}

.fu-popup-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fu-popup-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    font-family: var(--font);
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.fu-popup-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.fu-popup-input:focus { border-color: rgba(6, 196, 162, 0.5); }

.fu-popup-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(6, 196, 162, 0.15);
    color: var(--accent-green);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.fu-popup-submit:hover { background: rgba(6, 196, 162, 0.25); }

/* Loading state */
.fu-popup-form.is-loading .fu-popup-input,
.fu-popup-form.is-loading .fu-popup-submit {
    opacity: 0.5;
    pointer-events: none;
}

.fu-popup-form.is-loading .fu-popup-submit {
    color: transparent;
    position: relative;
}

.fu-popup-form.is-loading .fu-popup-submit::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(6, 196, 162, 0.3);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: mc-spin 0.6s linear infinite;
}

.fu-popup-feedback {
    display: none;
    font-size: 0.78rem;
    line-height: 1.4;
}

.fu-popup-feedback.fu-feedback-success {
    display: block;
    color: var(--accent-green);
    font-weight: 500;
}

.fu-popup-feedback.fu-feedback-error {
    display: block;
    color: #e8735a;
}

.fu-popup-input:disabled,
.fu-popup-submit:disabled { cursor: not-allowed; }
@media (max-width: 600px) {
    .fu-popup { width: calc(100vw - 40px); max-width: 320px; }
}


/* ── Variant: always-solid nav (data-variant="nav-solid") ─────
   For light pages with no dark hero underneath: a transparent nav
   would leave a white logo and links on a near-white page. Used by
   /comps/. (knowledge.css gives the blog the same look its own way.) */
.nav.nav-solid,
.nav.nav-solid.scrolled {
    background: rgba(1, 17, 50, 0.97);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Once the mobile menu opens, the solid band would stay painted
   across the top of the full-screen #000a1f overlay and the close
   icon would read as sitting in a box. nav-scroll.js already
   toggles body.menu-open. */
body.menu-open .nav.nav-solid,
body.menu-open .nav.nav-solid.scrolled {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
}

/* ========== ANTI-SPAM HONEYPOT ==========
   The Follow Us popup's spam-trap input. Also in footer.css, which
   uses it for the footer form: both components must be complete on
   their own, and the homepage loads nav.css without footer.css —
   without this copy the trap renders as a visible text box there. */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
