/* The App Store bar at the top of every page, above the site header (markup and head script:
   tools/build_home.py). It is hidden unless the head's script shows it before first paint, by
   adding html.show-app-banner: never in Safari on iPhone and iPad, where Apple's own Smart App
   Banner offers the app, and never again once closed. It sits in the page's flow, so it pushes
   the page down instead of covering the header, and the fixed bars at the bottom stay clear.
   Fonts are the ones every page already declares (Bricolage Grotesque 600, Be Vietnam Pro 400/500). */
.app-banner{display:none}
html.show-app-banner .app-banner{display:block}
.app-banner,.app-banner *{box-sizing:border-box}   /* the legal pages don't set it globally */

/* Desktop: a slim frosted bar across the top, its content centred, a hairline underneath. */
.app-banner{position:relative;z-index:50;color:#f5f1ea;font:400 13px/1.3 "Be Vietnam Pro",ui-sans-serif,system-ui,-apple-system,sans-serif;
  background:rgba(33,30,28,.96);border-bottom:1px solid rgba(255,255,255,.08);
  -webkit-backdrop-filter:saturate(160%) blur(18px);backdrop-filter:saturate(160%) blur(18px)}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){ .app-banner{background:#211e1c} }
.app-banner-link{display:flex;align-items:center;justify-content:center;gap:12px;min-height:52px;padding:8px 64px;color:inherit;text-decoration:none}
.app-banner-link img{flex:none;width:36px;height:36px;border-radius:22.5%;background:none;
  box-shadow:0 0 0 .5px rgba(255,255,255,.16),0 2px 10px rgba(0,0,0,.45)}
.app-banner-text{display:grid;gap:1px;min-width:0}
.app-banner-text b{font:600 16px/1.2 "Bricolage Grotesque",ui-sans-serif,system-ui,sans-serif;letter-spacing:-.01em;color:#f5f1ea}
.app-banner-text span{font-size:12.5px;color:#a39b90}
.app-banner-get{flex:none;display:inline-flex;align-items:center;justify-content:center;min-width:64px;min-height:30px;margin-left:14px;padding:0 16px;
  border-radius:999px;background:#e1ad66;color:#1a1612;font:500 14px/1 "Be Vietnam Pro",ui-sans-serif,system-ui,-apple-system,sans-serif;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.28),0 1px 2px rgba(0,0,0,.35)}
.app-banner-link:hover .app-banner-get{background:#ebbd7e}
.app-banner-link:active .app-banner-get{background:#d49c55}
/* Inset, so the ring is not cut off by the top of the window. */
.app-banner-link:focus-visible{outline:2px solid #e1ad66;outline-offset:-4px;border-radius:10px}
.app-banner-close{position:absolute;top:50%;right:14px;translate:0 -50%;display:grid;place-items:center;width:32px;height:32px;padding:0;
  border:0;border-radius:50%;background:rgba(255,255,255,.07);color:#a39b90;cursor:pointer}
.app-banner-close:hover{background:rgba(255,255,255,.14);color:#f5f1ea}
.app-banner-close:focus-visible{outline:2px solid #e1ad66;outline-offset:2px}
.app-banner-close svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}

/* Phones: a card floating a few px in from the edges, like a notification, so it doesn't read as
   a second header stacked on the real one. The bar's box stays edge to edge (the legal pages pull
   it outside their padding) and pads the card in; the close sits inside the card's right edge. */
@media (max-width:640px){
  .app-banner{padding:8px 8px 0;background:none;border:0;-webkit-backdrop-filter:none;backdrop-filter:none}
  .app-banner-link{justify-content:flex-start;gap:10px;min-height:52px;padding:8px 44px 8px 8px;border-radius:16px;
    background:rgba(42,39,36,.95);border:1px solid rgba(255,255,255,.09);box-shadow:0 8px 24px rgba(0,0,0,.28);
    -webkit-backdrop-filter:saturate(160%) blur(18px);backdrop-filter:saturate(160%) blur(18px)}
  .app-banner-link img{width:34px;height:34px}
  .app-banner-text b{font-size:clamp(14px,3.9vw,16px)}   /* one line down to a 360-px phone */
  .app-banner-get{min-width:56px;margin-left:auto;padding:0 14px}
  .app-banner-close{right:16px;top:calc(50% + 4px);width:28px;height:28px}
  .app-banner-link:focus-visible{outline-offset:-3px;border-radius:16px}
}
@media (max-width:340px){ .app-banner-link img{display:none} .app-banner-link{padding-left:12px} }

/* Hover and press ease only when motion is welcome; with Reduce Motion they change at once, and the press doesn't shrink. */
@media (prefers-reduced-motion:no-preference){
  .app-banner-get{transition:background-color .15s ease,transform .12s ease}
  .app-banner-link:active .app-banner-get{transform:scale(.96)}
  .app-banner-close{transition:background-color .15s ease,color .15s ease}
}
