/* ============================================================================
   CrewDeck — Shared PUBLIC marketing chrome (nav + mobile menu)
   ----------------------------------------------------------------------------
   ONE source of truth for the outward-facing marketing website's top nav. The
   markup is injected by js/marketing-nav.js so every public page (home, pricing,
   about, get-the-app, ...) carries an identical header + hamburger menu and a
   Login button that bridges into the app.

   Theming: these rules READ the host page's own design tokens (--nav-bg, --text,
   --muted, --line, --btn-bg, --btn-fg, --bg, --bg-soft, --accent, --gx, --cw) so
   the nav automatically follows whatever light/dark theme the page is already in.
   Every var() carries a dark fallback for pages that don't define the token.
   Class names are namespaced (.cd-mkt-*) so they never collide with a page's own
   inline nav CSS.
   ============================================================================ */

.cd-mkt-nav {
  position: sticky; top: 0; z-index: 1000; width: 100%; align-self: stretch;
  height: 72px; display: flex; align-items: center;
  padding-inline: var(--gx, clamp(22px, 6vw, 72px));
  background: var(--nav-bg, rgba(10,10,15,0.62));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}
.cd-mkt-nav *, .cd-mkt-mnav * { box-sizing: border-box; }

.cd-mkt-in {
  width: 100%; max-width: var(--cw, 1120px); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.cd-mkt-brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; text-decoration: none; color: var(--text, #f5f5f7); }
.cd-mkt-brand img { width: 30px; height: 30px; display: block; }
.cd-mkt-brand span { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.02em; }

.cd-mkt-r { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); min-width: 0; }
.cd-mkt-link { font-size: 0.92rem; font-weight: 500; color: var(--muted, #9b9ba8); text-decoration: none; white-space: nowrap; }
.cd-mkt-link:hover { color: var(--text, #f5f5f7); }
.cd-mkt-link[aria-current] { color: var(--text, #f5f5f7); }
.cd-mkt-login { font-size: 0.92rem; font-weight: 600; color: var(--text, #f5f5f7); text-decoration: none; white-space: nowrap; }
.cd-mkt-login:hover { opacity: 0.8; }
.cd-mkt-cta {
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; flex-shrink: 0; line-height: 1;
  font-size: 0.9rem; font-weight: 600; padding: 10px 18px; border-radius: 999px;
  background: var(--btn-bg, #ffffff); color: var(--btn-fg, #0a0a0f); text-decoration: none;
}
.cd-mkt-cta:hover { background: var(--btn-bg-h, #e7e7f3); }

/* Left header group + menu button — matches the logged-in header hamburger
   (rounded-square, subtle overlay bg, 3-line SVG icon), sitting on the LEFT to
   the left of the wordmark. Shown on mobile only (desktop shows inline links). */
.cd-mkt-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cd-menu-btn {
  display: none; width: 40px; height: 40px; flex: 0 0 auto;
  align-items: center; justify-content: center;
  border: none; border-radius: 12px; cursor: pointer;
  background: rgba(0,0,0,0.05); color: var(--text, #f5f5f7);
  -webkit-tap-highlight-color: transparent; transition: background .15s ease, transform .1s ease;
}
:root[data-theme="dark"] .cd-menu-btn { background: rgba(255,255,255,0.07); }
.cd-menu-btn:hover { background: rgba(0,0,0,0.09); }
:root[data-theme="dark"] .cd-menu-btn:hover { background: rgba(255,255,255,0.11); }
.cd-menu-btn:active { transform: scale(0.94); }
.cd-menu-btn svg { width: 22px; height: 22px; display: block; }

@media (max-width: 860px) {
  .cd-mkt-r .cd-mkt-link, .cd-mkt-r .cd-mkt-login, .cd-mkt-nav .cd-mkt-cta { display: none; }
  .cd-menu-btn { display: flex; }
  .cd-mkt-brand span { display: inline; }
}

/* Mobile drop menu */
.cd-mkt-mnav {
  position: fixed; left: 0; right: 0; top: 72px; z-index: 999;
  display: flex; flex-direction: column; gap: 3px;
  background: var(--bg, #0a0a0f); border-bottom: 1px solid var(--line, rgba(255,255,255,0.09));
  box-shadow: 0 26px 44px -30px rgba(0,0,0,0.55);
  padding: 12px max(5vw, env(safe-area-inset-left)) calc(16px + env(safe-area-inset-bottom)) max(5vw, env(safe-area-inset-right));
  opacity: 0; transform: translateY(-10px); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}
.cd-mkt-mnav.open { opacity: 1; transform: none; pointer-events: auto; }
.cd-mkt-mnav a { display: flex; align-items: center; min-height: 50px; padding: 10px 14px; border-radius: 12px; font-size: 1.06rem; font-weight: 600; color: var(--text, #f5f5f7); text-decoration: none; }
.cd-mkt-mnav a:hover { background: var(--bg-soft, #101017); }
.cd-mkt-mnav a[aria-current] { color: var(--accent, #8b84ff); }
.cd-mkt-mnav .cd-mkt-mnav-cta { margin-top: 8px; justify-content: center; background: var(--btn-bg, #fff); color: var(--btn-fg, #0a0a0f); }
