/* ─── Shared top navbar ──────────────────────────────────────────────────
   Lifted verbatim from index.html so every page (home, legal, profile,
   signin, etc.) renders the same bar with the same color, hover-expand
   icon animation, dark-theme flip, and mobile burger drawer.

   To use on a page:
     1. In <head>, before any CSS parses, add the FOUC theme guard inline:

        <script>
          (function () {
            try {
              var c = localStorage.getItem('rb_theme') || 'auto';
              var mql = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)');
              var resolved = c === 'auto' ? (mql && mql.matches ? 'dark' : 'light') : c;
              document.documentElement.setAttribute('data-theme', resolved);
            } catch (_) {}
          })();
        </script>

     2. Load this stylesheet AND ionicons (the nav uses <ion-icon>).
     3. Paste the <header class="nav">…</header>, <div class="nav-scrim">,
        and <aside class="nav-drawer"> blocks from index.html (lines 1204–
        1248 as of 2026-10-05) at the top of <body>.
     4. Load assets/site-nav.js for burger + auth-state swap.

   Only theme variables actually referenced by the nav are declared here —
   pages that need the full palette already have their own :root. ------- */

:root {
  --accent:       #0071e3;
  --accent-hover: #0077ed;
  --radius-pill:  980px;
}

/* Reserve space for the fixed bar so page content doesn't tuck under it. */
body { padding-top: 54px; }

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 54px;
  padding: 6px 32px;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(29,29,31,0.72);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background-color 240ms ease, border-color 240ms ease;
}
html[data-theme="dark"] .nav {
  background: rgba(44,44,46,0.82);
  border-bottom-color: rgba(255,255,255,0.08);
}
.nav-brand { display: flex; align-items: center; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.nav-brand .brand-wordmark { height: 40px; width: auto; max-width: 100%; display: block; }
@media (max-width: 560px) {
  .nav-brand .brand-wordmark { height: 34px; }
}

.nav-right { display: flex; align-items: center; min-width: 0; gap: 24px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 400;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: color .15s;
}
.nav-link ion-icon {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  transition: color .15s;
}
.nav-link:hover { color: #fff; }
.nav-link:hover ion-icon { color: #fff; }
#invitesNavLink[hidden], #invitesDrawerLink[hidden] { display: none !important; }
#messagesNavLink[hidden], #messagesDrawerLink[hidden] { display: none !important; }

.nav-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap; flex: 0 0 auto; line-height: 1;
  font-size: 13px; font-weight: 500;
  padding: 7px 16px;
  background: var(--accent); color: #fff;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background .15s;
}
.nav-cta:hover { background: var(--accent-hover); }
.nav-cta ion-icon, .nav-post-mark { flex: 0 0 auto; }
.nav-post-mark { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; }
.nav-post-mark svg { display: block; width: 16px; height: 16px; }
.nav-post-plus { position: absolute; top: -3px; right: -4px; color: currentColor; font: 700 10px/10px system-ui, sans-serif; }
.nav-cta.nav-app-cta { background: #fff; color: #1d1d1f; }
.nav-cta.nav-app-cta:hover { background: #e5e5ea; }
.nav-play-cta ion-icon { color: #34a853; }
.nav-play-icon { display: block; width: 22px; height: 22px; flex: 0 0 auto; color: #34a853; }

@media (min-width: 721px) {
  .nav-right { gap: 8px; transition: gap 220ms ease; }
  .nav-link {
    width: auto; min-width: 36px; max-width: 36px; height: 36px; padding: 0; justify-content: center;
    gap: 0; border-radius: 999px; overflow: hidden;
    transition: max-width 220ms ease, padding 220ms ease, gap 220ms ease, color .15s;
  }
  .nav-link > span, .nav-cta > span:not(.nav-post-mark) {
    display: inline-block; flex: 0 1 auto;
    max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
    transition: max-width 220ms ease, opacity 150ms ease;
  }
  .nav-cta {
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; min-width: 36px; max-width: 36px; height: 36px; padding: 0; gap: 0; overflow: hidden;
    transition: max-width 220ms ease, padding 220ms ease, background 150ms ease;
  }
  .nav-cta ion-icon { font-size: 17px; flex: 0 0 auto; }

  .nav-link:hover, .nav-link:focus-visible {
    max-width: 150px; padding: 0 4px; gap: 6px;
  }

  .nav-cta:hover, .nav-cta:focus-visible {
    max-width: 160px; padding: 7px 14px; gap: 7px;
  }
  .nav-link:hover > span, .nav-link:focus-visible > span,
  .nav-cta:hover > span:not(.nav-post-mark), .nav-cta:focus-visible > span:not(.nav-post-mark) {
    max-width: 110px; opacity: 1;
  }
  .nav-link:hover { background: rgba(255,255,255,0.09); }
  @keyframes navIconShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-12deg); }
    50% { transform: rotate(10deg); }
    75% { transform: rotate(-6deg); }
  }
  .nav-link:hover ion-icon, .nav-link:focus-visible ion-icon,
  .nav-cta:not(.nav-app-cta):hover ion-icon, .nav-cta:not(.nav-app-cta):focus-visible ion-icon {
    animation: navIconShake 360ms ease-in-out;
  }
}
@media (min-width: 721px) and (max-width: 940px) {
  .nav { padding-left: 20px; padding-right: 20px; }
  .nav-right { gap: 6px; }
}
@media (hover: none) and (min-width: 721px) {
  .nav-right { gap: 14px; }
  .nav-link { max-width: none; width: auto; padding: 0 4px; gap: 6px; }
  .nav-link > span { max-width: 110px; opacity: 1; }
  .nav-cta { max-width: 36px; width: auto; height: 36px; padding: 0; gap: 0; }
}
@media (hover: none) and (min-width: 721px) and (max-width: 940px) {
  .nav-right { gap: 6px; }
  .nav-link { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-drawer { display: block; }
  .nav-cta.nav-app-cta { width: 36px; min-width: 36px; max-width: 36px; height: 36px; padding: 0; }
  .nav-cta.nav-app-cta span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
}

.nav-burger {
  display: none;
  width: 36px; height: 36px;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  background: transparent; border: 0; cursor: pointer;
  padding: 0; margin-left: 4px;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.nav-burger span {
  display: block;
  width: 20px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
  transform-origin: center;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-drawer {
  position: fixed;
  top: 54px;
  left: 0; right: 0;
  background: rgba(29,29,31,0.96);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transform: translateY(-110%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
  z-index: 49;
  padding: 8px 20px 20px;
  display: none;
}
.nav-drawer.open { transform: translateY(0); }
.nav-drawer-link {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 6px;
  font-size: 16px; font-weight: 500;
  color: rgba(255,255,255,0.95);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  letter-spacing: -0.2px;
}
.nav-drawer-link:last-child { border-bottom: 0; }
.nav-drawer-link ion-icon {
  font-size: 20px;
  color: rgba(255,255,255,0.72);
  flex-shrink: 0;
}
.nav-drawer-link:active { background: rgba(255,255,255,0.04); }
.nav-scrim {
  position: fixed;
  inset: 54px 0 0 0;
  background: rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 48;
}
.nav-scrim.open { opacity: 1; pointer-events: auto; }

@media (max-width: 720px) {
  body { padding-top: 48px; }
  .nav { height: 48px; padding: 6px 16px; gap: 10px; }
  .nav-drawer { top: 48px; }
  .nav-scrim { inset: 48px 0 0; }
  .nav-right { gap: 10px; min-width: 0; flex: 0 0 auto; }
  .nav-link { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-cta { width: 36px; min-width: 36px; height: 36px; padding: 0; gap: 0; }
  .nav-cta > span:not(.nav-post-mark) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .nav-cta ion-icon { font-size: 16px; }
  .nav-play-icon { width: 22px; height: 22px; }
  .nav-right { gap: 6px; }
  .nav-brand { min-width: 0; }
  .nav-brand .brand-wordmark { max-width: 88px; }
  .nav-drawer { display: block; }
}
@media (max-width: 380px) {
  .nav { padding-left: 10px; padding-right: 10px; gap: 4px; }
  .nav-right { gap: 4px; }
  .nav-cta { padding: 6px 7px; gap: 3px; font-size: 10px; }
  .nav-cta ion-icon { font-size: 14px; }
  .nav-app-cta span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .nav-app-cta { width: 32px; min-width: 32px; height: 32px; padding: 0; }
  .nav-brand .brand-wordmark { max-width: 74px; height: 26px; }
}
@media (min-width: 381px) and (max-width: 420px) {
  .nav-app-cta span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .nav-app-cta { width: 32px; min-width: 32px; height: 32px; padding: 0; }
}
