/* The navigation drawer opens over the page, under the bar, and does not push the page down.
   In the flow it made the header taller, which the browser answers by moving the scroll position down by the same amount (scroll anchoring); site.js reads
   that as the reader having scrolled away from where the drawer opened and folds it shut at once, so a menu flashed and closed. As an overlay the header keeps
   its height, the page stays where it is, and the pager's pages stay where it counted them. */
.site-header .nav-drawer { position: absolute; top: 100%; left: 0; right: 0; background: none; }
@media (prefers-reduced-motion: no-preference) {
  .site-header .nav-drawer { transition: grid-template-rows .36s cubic-bezier(.2, .7, .3, 1); }
}

/* THE GLASS. One recipe for the bar, the menu under it and the cards of the front page: a thin wash of the ground over a strong blur of what is behind, lifted in colour. It is not on the header
   itself but on a layer behind it (::before), so that the header, which holds the menu, is not a backdrop root: an element with a backdrop filter of its own is, and what a child behind it sees is
   only that element's own content, which would leave the menu nothing to blur.
   The bar and its menu are ONE layer: it is as tall as the bar (--bar-h, hero.css) and reaches down over the menu as tall as the menu is (--drawer-h, which site.js sets as the menu grows and
   shrinks), so there is no seam between them: not a strip with no glass, and not two blurs that end at the same line. */
:root { --glass-wash: rgb(var(--th-bg-rgb) / .2); --glass-blur: blur(26px) saturate(1.8) brightness(1.04); --glass-edge: rgb(var(--th-fg-rgb) / .1); --glass-lift: rgb(var(--th-fg-rgb) / .05); --drawer-h: 0px; --nav-blur: blur(36px);
  --nav-wash: rgb(var(--th-bg-rgb) / .62); }     /* (the bar and its menu are glass under a dark wash of the ground (white on paper): enough that the words on it read over a heading or a figure that the page has under it, and no lift in
                                                    saturation or brightness; the cards keep --glass-*) */
.site-header::before { content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: calc(0px - var(--drawer-h)); z-index: -1; pointer-events: none; background: var(--nav-wash);
  -webkit-backdrop-filter: var(--nav-bf, var(--nav-blur)); backdrop-filter: var(--nav-bf, var(--nav-blur)); box-shadow: inset 0 -1px 0 var(--glass-edge), inset 0 1px 0 var(--glass-lift); }
/* (--nav-bf is glass.js's: where the browser can draw it, the layer bends what is behind it, as the rim of a lens does, instead of only blurring it; elsewhere it is not set and the blur stands.)
   While a menu is open the bar and the menu are blurred more (--nav-xb, a length that eases in and out), so that what is written in the menu reads over whatever the page has behind it. */
@property --nav-xb { syntax: '<length>'; inherits: true; initial-value: 0px; }
html { --nav-xb: 0px; transition: --nav-xb .3s ease; }
html.nav-open { --nav-xb: 16px; }

/* THE PICK-UP (pickup.js): the bar's wordmark and its theme switch each stand in a rail, a layer as tall as the page over it, where they are position: sticky: the browser carries each up with the page
   from where the hero has it (--pu-x and --pu-y, its place in the page) and holds it at the bar's place (--pu-t). The bar keeps an empty slot for each, so that its own layout stays as it was; the
   hero's copies are left unseen. A rail is shown once the hero has disclosed its strip. */
body.pu { position: relative; }
.pu-rail { position: absolute; top: 0; bottom: 0; left: 0; right: 0; z-index: 110; pointer-events: none; opacity: 0; transition: opacity .6s ease .3s; }
.pu-rail.pu-on { opacity: 1; }
.pu-rail > * { position: sticky; top: var(--pu-t, 0px); width: max-content; margin: var(--pu-y, 0px) 0 0 var(--pu-x, 0px) !important; pointer-events: auto; }
.pu-slot { flex: none; }
/* a part the hero has no slot for (the switch, on a phone) is not picked up: it stands in the bar, and is there when the bar is */
html.hdr-clear .pu-rail.pu-solo { opacity: 0; visibility: hidden; transition: none; }
@media (prefers-reduced-motion: reduce) { .pu-rail { transition: none; } }
.site-header .nav-drawer-inner { position: relative; }

/* While a menu is open the page is dimmed and the bar is not: a veil over the page and under the header (site.js puts .nav-open on <html> and makes .nav-scrim). The header is
   z-index 100 and the veil 90, above the front page's timeline bar (40) and its stage (20). The veil takes no pointer, so leaving the header is what closes a menu. */
.nav-scrim { position: fixed; inset: 0; z-index: 90; background: rgb(11 18 36 / .52); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .28s ease, visibility 0s linear .28s; }
html.nav-open .nav-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
/* the night's ground is already dark, so the same veil needs more to be seen */
:root[data-theme="dark"] .nav-scrim, :root:not([data-theme]) .nav-scrim { background: rgb(0 0 0 / .66); }
@media (prefers-reduced-motion: reduce) { .nav-scrim { transition: none; } }

/* The bar is glass (the layer behind it is above), whether it is pointed at or not, and the menu under it is the same glass, so that the two read as one piece: the bar has no rule of its own, and
   the one hairline of the glass is at the foot of the bar and the menu together. */
html .site-header { background: none; box-shadow: none; }
html .site-header { transition: opacity .35s ease, transform .4s cubic-bezier(.22, .8, .24, 1); }
@media (prefers-reduced-motion: reduce) { html .site-header { transition: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root { --glass-wash: rgb(var(--th-bg-rgb) / .92); --nav-wash: rgb(var(--th-bg-rgb) / .92); } }

/* When the bar comes in (the first scroll down from the hero, hero-reel.js puts .is-shimmer on it) its glass is revealed from the left, and a band of light crosses it from left to right as it goes,
   which lifts the glass: --rv is how much of the width the glass has reached, a registered number. */
@property --rv { syntax: '<number>'; inherits: false; initial-value: 1; }
.site-header.is-shimmer::before { -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--rv) * 115% - 15%), transparent calc(var(--rv) * 115%)); mask-image: linear-gradient(90deg, #000 calc(var(--rv) * 115% - 15%), transparent calc(var(--rv) * 115%));
  animation: glass-in 1.1s cubic-bezier(.3, .7, .2, 1) both; }
.site-header::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent 0 41%, rgb(var(--th-fg-rgb) / .02) 46%, rgb(var(--th-fg-rgb) / .075) 50%, rgb(var(--th-fg-rgb) / .02) 54%, transparent 59% 100%) no-repeat; background-size: 260% 100%; background-position: 100% 0; }
.site-header.is-shimmer::after { animation: glass-shimmer 1.2s cubic-bezier(.35, .1, .25, 1) both; }
@keyframes glass-in { from { --rv: 0; } to { --rv: 1; } }
@keyframes glass-shimmer { 0% { opacity: 0; background-position: 100% 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .site-header.is-shimmer::before, .site-header.is-shimmer::after { animation: none; } }

/* The bar goes away when the page has been scrolled all the way to its foot (site.js puts .at-foot on <html>) and comes back with the first scroll up: there it
   covers nothing, and the footer's links are what the reader came for. It moves up out of sight and is hidden once it has, so that nothing in it can be focused.
   The transitions are the ones stage.css gives the bar on the front page, with the move added; the front page's clear bar over the hero (stage.css) still has none. */
.site-header { transition: opacity .35s ease, transform .4s cubic-bezier(.22, .8, .24, 1), background-color .4s ease, border-color .4s ease; }
html.at-foot .site-header { transform: translateY(-100%); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s ease, transform .4s cubic-bezier(.22, .8, .24, 1), visibility 0s .4s; }
@media (prefers-reduced-motion: reduce) { .site-header, html.at-foot .site-header { transition: none; } }
/* The wordmark and the theme's switch are not in the bar but in rails over the page (the pick-up, below), so the bar's going does not take them: each goes with it the same way, up out of sight by the
   bar's height while it fades, with the same times, is hidden once it has gone (nothing of it can be focused) and is back with the bar on the first scroll up. */
.pu-rail > * { transition: opacity .35s ease, transform .4s cubic-bezier(.22, .8, .24, 1), visibility 0s; }
html.at-foot .pu-rail > * { transform: translateY(calc(0px - var(--bar-h))); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s ease, transform .4s cubic-bezier(.22, .8, .24, 1), visibility 0s .4s; }
@media (prefers-reduced-motion: reduce) { .pu-rail > *, html.at-foot .pu-rail > * { transition: none; } }

/* THE MENU ON A SMALL SCREEN (site.js builds the burger, the main menu and the arrow on each panel). Under 700px the bar's items are not shown: the wordmark stands at the left of the bar, the theme's
   switch and the burger at the right, and the menu is the drawer, as a sheet under the bar that is as tall as the window leaves and scrolls (and does not hand what it cannot scroll on to the page:
   overscroll-behavior). It is the main menu (Platform and Resources open their panels, Pricing is a link), or one panel with its category on top and the arrow to the left of it that goes back. */
.site-header { --nav-x: var(--padding); }                  /* (the bar's side padding, which the sheet has too) */
.nav-burger, .nd-main, .nd-back { display: none; }
@media (max-width: 580px) { .site-header { --nav-x: 5vw; } }
@media (max-width: 700px) {
  .nav-main { visibility: hidden; }                       /* (the bar's room between the wordmark and the switch: it keeps its place, and shows and offers nothing) */
  .navmenu { display: none; }
  html.nav-open .site-header { --nav-wash: rgb(var(--th-bg-rgb) / .86); }      /* (a menu of words over the page needs more under it than the bar does: the glass is one layer, bar and menu) */
  .nav-burger { order: 99; display: grid; place-items: center; width: 40px; height: 40px; margin: 0 -8px 0 4px; padding: 0; border: 0; background: none; color: var(--th-fg); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .nav-burger:focus-visible { outline: 1px solid var(--th-fg-2); outline-offset: 1px; }
  .nav-burger svg { display: block; width: 24px; height: 24px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .nav-burger path { transition: transform .35s cubic-bezier(.22, .8, .24, 1), opacity .2s ease; }
  .nav-burger .nb-t { transform-origin: 12px 7px; } .nav-burger .nb-m { transform-origin: 12px 12px; } .nav-burger .nb-b { transform-origin: 12px 17px; }
  html.nav-open .nav-burger .nb-t { transform: translateY(5px) rotate(45deg); }
  html.nav-open .nav-burger .nb-m { opacity: 0; transform: scaleX(.2); }
  html.nav-open .nav-burger .nb-b { transform: translateY(-5px) rotate(-45deg); }

  .nav-drawer-inner { max-height: calc(100vh - var(--bar-h)); max-height: calc(100svh - var(--bar-h)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .nav-drawer-panel { padding: 0 var(--nav-x) calc(8px + env(safe-area-inset-bottom, 0px)); }
  .nd-cols { padding-top: 20px; }
  .nd-main { display: block; padding: 4px var(--nav-x) calc(24px + env(safe-area-inset-bottom, 0px)); }
  .nav-drawer[data-view="panel"] .nd-main { display: none; }
  .nd-main-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; margin: 0; padding: 18px 0; border: 0; border-bottom: 1px solid var(--th-hair-2); background: none;
    color: var(--th-fg); font: 400 24px/1.2 var(--display); letter-spacing: -.02em; text-align: left; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .nd-main-item:last-child { border-bottom: 0; }
  .nd-main-item svg { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--th-fg-2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
  /* the head of a panel: the arrow, and the category beside it; it stays on top while the panel scrolls under it */
  .nd-back { display: flex; position: sticky; top: 0; z-index: 1; align-items: center; gap: 14px; width: 100%; margin: 0; padding: 18px 0 16px; border: 0; border-bottom: 1px solid var(--th-hair-2);
    background: rgb(var(--th-bg-rgb) / .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--th-fg); font: 500 22px/1.2 var(--display); letter-spacing: -.02em; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .nd-back svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
  .nd-main-item:active, .nd-back:active { opacity: .6; }
  .nd-main-item:focus-visible, .nd-back:focus-visible { outline: 1px solid var(--th-fg-2); outline-offset: -1px; }
}
