/* The site's one header, on every page (markup: web/pages/_header.html; script: nav.js).
   A bar: the brand, three links (Connectors, Security, Pricing), then theme, Log in and the one action, all the
   component library's (ui.css): the wordmark and quiet buttons, the page you're on glass, and the glass Request access.
   No dropdowns: the site has a handful of pages, and the landing page is the product. At the top it spans the page and
   sits flat on it; once you scroll it pulls in to a floating pane of the library's glass, and eases back out at the
   top. Below 1001px the links fold into a full-height sheet under the bar, with Log in at the end. */
:root {
  --hx-h: 68px;
  --hx-in: 8px;   /* how far the pulled-in bar floats from the top and, below 1001px, the sides */
  --hx-pill: 880px;   /* its width on a wide screen */
  --hx-pull: .36s var(--ease);
  /* under the glass, a veil of the page's ground, so the links read over anything that scrolls behind them */
  --hx-veil: color-mix(in srgb, var(--bg) 62%, transparent);
}

.hx-top { display: flow-root; position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid transparent; transition: background-color .2s, border-color .2s; }
/* the phone sheet is open: the header takes the page's ground and a line, one sheet of paper with the menu under it.
   Pulled in, the bar floats on that ground and the line goes */
.hx-top.hx-active { background: var(--bg); border-bottom-color: var(--line); }
.hx-top.hx-active.hx-scrolled { border-bottom-color: transparent; }

/* the bar. At the top it spans the page and its padding holds what's in it to the page's column. Pulled in, it narrows
   and its margins grow by what its height loses, so the header keeps --hx-h and nothing under it moves (the header is a
   flow root, so the top margin stays inside it). Width, inset, height, padding, corners and glass all ease together */
.hx-cap {
  position: relative; display: flex; align-items: center; gap: 28px;
  max-width: 100%; height: var(--hx-h); margin: 0 auto;
  padding-inline: max(calc(var(--pad) - 8px), calc((100% - var(--wrap)) / 2 + var(--pad) - 8px)) max(var(--pad), calc((100% - var(--wrap)) / 2 + var(--pad)));
  transition: max-width var(--hx-pull), height var(--hx-pull), margin var(--hx-pull), padding var(--hx-pull);
}
.hx-top.hx-scrolled .hx-cap { max-width: var(--hx-pill); height: calc(var(--hx-h) - 2 * var(--hx-in)); margin-block: var(--hx-in); padding-inline: 8px 10px; }
/* the glass is the bar's ::before, the glass button's sheen, tint, bevel and rim over the veil. It isn't on the bar
   itself: a backdrop-filter there would trap the phone sheet (position: fixed) inside the bar. Its corners follow the
   library's nesting rule, the buttons' radius plus the 10px round them */
.hx-cap::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 0; opacity: 0; pointer-events: none;
  background: var(--glass-sheen), linear-gradient(var(--glass-tint), var(--glass-tint)), var(--hx-veil);
  box-shadow: var(--glass-bevel), inset 0 0 0 1px var(--glass-rim);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  transition: opacity var(--hx-pull), border-radius var(--hx-pull);
}
.hx-top.hx-scrolled .hx-cap::before { opacity: 1; border-radius: calc(var(--r-m) + 10px); }

/* the links: the library's quiet buttons, the page you're on glass */
.hx-list { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.hx-sheet-only { display: none; }

/* theme, Log in (quiet: most visitors aren't users yet), the one action, and the menu button on narrow screens */
.hx-act { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.hx-cta { margin-left: 4px; }
.hx-act .hx-menu { display: none; }
.hx-menu[aria-expanded="true"] { color: var(--ink); }
html.hx-locked { overflow: hidden; }

@media (max-width: 1000px) {
  .hx-top.hx-scrolled .hx-cap { max-width: calc(100% - 2 * var(--hx-in)); }
  .hx-act .hx-menu { display: inline-flex; }
  .hx-login { display: none; }
  .hx-sheet-only { display: block; }
  .hx-nav { display: none; position: fixed; left: 0; right: 0; bottom: 0; top: calc(var(--hx-h) + 1px + env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain; padding: 4px var(--pad) 40px; background: var(--bg); }
  .hx-nav.open { display: block; }
  /* in the sheet the links are the library's Row buttons (nav.js adds .row while it's open), the page you're on glass */
  .hx-list { flex-direction: column; align-items: stretch; gap: 4px; }
}
@media (max-width: 560px) {
  .hx-cap { gap: 8px; }
  .hx-top.hx-scrolled .hx-cap { padding-inline: 4px 8px; }
  .hx-act { gap: 0; }
}
@media (max-width: 359px) { #hx-theme { display: none; } }
/* reduced motion: the bar switches between its two states without travelling */
@media (prefers-reduced-motion: reduce) { .hx-top, .hx-cap, .hx-cap::before { transition: none; } }
