/* The site header, shared by every page (index, terms, privacy, 404): the three-state bar, the phone menu and the
   desktop "Get started" QR card. Behaviour: assets/header.js. Moved here unchanged from index.html. */
.btn--sm{ height:35px; padding:16px; font-size:12px; }
.btn__stores{ width:31px; height:12px; flex:none; }
.btn--primary{ background:var(--primary); color:var(--white); } /* the phone menu's "Open on web" (the same as the home page's) */

/* ─────────────────────────────  NAV  ──────────────────────────────── */
/* Header — three states, animated like blackrail.xyz: the bar is a
   centred flex pill whose max-width springs between sizes while the links
   and wordmark fold away.
     top of page ......... transparent bar on the 1122 grid (Homepage frame)
     scrolling up ........ white 900.59 × 53 pill   (Figma 1904:942)
     scrolling down ...... compact mark + CTA pill  (Figma 1925:1655)   */
:root{ --spring:cubic-bezier(.16,1,.3,1); }
.nav-wrap{
  position:fixed; top:0; left:0; right:0; z-index:100;
  display:flex; justify-content:center;
  padding:29px var(--gutter) 0; pointer-events:none;
  transition:padding-top .5s var(--spring);
}
.nav-wrap.is-pill{ padding-top:16px; }
.nav{
  pointer-events:auto; position:relative;
  width:100%; max-width:var(--nav); padding:0;
  display:flex; align-items:center; justify-content:space-between;
  border-radius:100px; border:1px solid transparent;
  background:rgba(255,255,255,0); box-shadow:0 12px 32px -12px rgba(26,27,46,0);
  overflow:hidden;
  transition:max-width .5s var(--spring), padding .5s var(--spring),
             background-color .35s ease, border-color .35s ease, box-shadow .5s ease;
}
.nav-wrap:not(.is-pill):not(.is-menu) .nav{ overflow:visible; }   /* plain bar at the top: don't clip the logo against the rounded ends */
.nav-wrap.is-pill .nav{
  max-width:900.59px; padding:8px 8px 8px 11px;
  background:rgba(255,255,255,.92); border-color:var(--grey-brd);
  box-shadow:0 12px 32px -12px rgba(26,27,46,.18);
  -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px);
}
.nav-wrap.is-compact .nav{ max-width:214px; padding:8px 8px 8px 12px; }
.nav__menu{ max-width:420px; transition:opacity .3s ease, max-width .5s var(--spring); }
.nav-wrap.is-compact .nav__menu{ opacity:0; max-width:0; pointer-events:none; }
.brand__word{ transition:opacity .25s ease, width .5s var(--spring), margin .5s var(--spring); }
.nav-wrap.is-compact .brand__word{ opacity:0; width:0; margin-left:-9px; }
.nav .btn{ flex:none; }
.brand{ display:flex; align-items:center; gap:9px; flex:none; }
.brand__mark{ width:30px; height:30px; flex:none; }
.brand__word{ width:106.59px; height:24.338px; flex:none; }
.nav__menu{ display:flex; align-items:center; gap:32px; overflow:hidden; white-space:nowrap; }
.nav__menu a{ font-size:14px; font-weight:500; color:var(--black); white-space:nowrap; transition:opacity .15s; }
.nav__menu a:hover{ opacity:.6; }
.nav__burger{ display:none; }
.mobile-menu{ display:none; }

/* ── "Get started" QR card (desktop) — Figma 2176:1312 "Get started active".
      Opens under the button like expenseai.com: fade + grow from 95% +
      8px drop, about 0.18s; the button reads "Close" while it's open. ── */
.qr-pop{
  position:fixed; z-index:300; left:0; top:0;
  width:177px; padding:9px; border-radius:24px; background:var(--cloud);
  display:flex; flex-direction:column; align-items:center; gap:8px;
  box-shadow:0 24px 48px -20px rgba(26,27,46,.35);
  opacity:0; visibility:hidden; transform:translateY(-8px) scale(.95); transform-origin:50% 0;
  transition:opacity .15s ease, transform .18s cubic-bezier(.2,.7,.2,1), visibility 0s .18s;
}
.qr-pop.is-open{ opacity:1; visibility:visible; transform:none; transition:opacity .18s ease, transform .22s cubic-bezier(.2,.7,.2,1), visibility 0s; }
.qr-pop__label{
  width:146px; height:30px; border-radius:100px; background:var(--white);
  display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:500; color:var(--midnight);
}
.qr-pop__code{
  width:158px; height:158px; border-radius:20px; background:var(--white);
  display:flex; align-items:center; justify-content:center;
}
.qr-pop__code svg{ display:block; }
.qr-pop__web{
  width:158px; height:32px; border-radius:100px; background:var(--black); color:var(--white);
  display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:500;
  transition:filter .15s;
}
.qr-pop__web:hover{ filter:brightness(1.25); }
.btn.is-qr-open{ justify-content:center; }
@media (max-width:760px){ .qr-pop{ display:none; } }

@media (max-width:760px){
  .nav__menu{ display:none; }

  /* Phone header: logo + menu button. "Get started" lives in the menu.
     Scrolling down shrinks the pill to mark + button (sized so nothing clips). */
  .nav__cta{ display:none; }
  .brand{ gap:7px; }
  .brand__mark{ width:24px; height:24px; }
  .brand__word{ width:85.27px; height:19.47px; }   /* 80% of desktop */
  .nav-wrap.is-compact .brand__word{ margin-left:-7px; }
  .nav-wrap.is-compact .nav{ max-width:104px; }
  .nav__burger{
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
    width:38px; height:38px; border-radius:100px; flex:none;
    background:var(--black); cursor:pointer;
  }
  .nav__burger span{ display:block; width:15px; height:1.6px; border-radius:2px; background:var(--white); transition:transform .35s var(--spring); }
  .nav-wrap.is-menu .nav__burger span:first-child{ transform:translateY(3.3px) rotate(45deg); }
  .nav-wrap.is-menu .nav__burger span:last-child{ transform:translateY(-3.3px) rotate(-45deg); }
  /* while the menu is open the header is always the white pill with the full logo */
  .nav-wrap.is-menu .nav{
    max-width:100%; padding:8px 8px 8px 11px; background:rgba(255,255,255,.96); border-color:var(--grey-brd);
    box-shadow:0 12px 32px -12px rgba(26,27,46,.18);
  }
  .nav-wrap.is-menu .brand__word{ opacity:1; width:85.27px; margin-left:0; }

  .mobile-menu{
    display:flex; flex-direction:column; gap:2px;
    position:absolute; left:var(--gutter); right:var(--gutter); top:calc(100% + 8px);
    padding:8px; border-radius:24px; pointer-events:auto;
    background:var(--white); border:1px solid var(--grey-brd);
    box-shadow:0 24px 48px -20px rgba(26,27,46,.28);
    opacity:0; visibility:hidden; transform:translateY(-8px) scale(.98); transform-origin:50% 0;
    transition:opacity .25s ease, transform .4s var(--spring), visibility 0s .4s;
  }
  .nav-wrap.is-menu .mobile-menu{ opacity:1; visibility:visible; transform:none; transition:opacity .25s ease, transform .4s var(--spring), visibility 0s; }
  .mobile-menu > a:not(.btn){ padding:14px 16px; border-radius:16px; font-size:16px; font-weight:500; color:var(--black); }
  .mobile-menu > a:not(.btn):active{ background:var(--grey-bg); }
  .mobile-menu__cta{ margin-top:6px; width:100%; height:48px; }
}
