/* Site bar — the nav (or MENU button on smaller screens) and the STAMP logo.
   On the landing screen they sit at the bottom. As you scroll they move up with
   the page and dock at the top; the logo shrinks steadily on the way up and
   becomes the navbar.

   The movement up is real scrolling: each item sits in a track that runs the full
   height of the page and is position: sticky, so the browser moves it with the
   page and stops it at the top itself. Nothing chases the scroll position in
   code, so it can't lag or shake (especially on phones). js/site-bar.js only
   sets where each item starts and docks, and the logo's shrink and slide. */

body {
  position: relative; /* the tracks below run the full height of the page */
}

.site-bar {
  --bar-gutter: clamp(32px, 4.3vw, 62px);

  position: absolute;
  inset: 0;
  z-index: 800;
  pointer-events: none;
  color: var(--white);
}

.site-bar__track {
  position: absolute;
  top: 0;
  bottom: 0;
}

.site-bar__track--left {
  left: var(--bar-gutter);
}

.site-bar__track--logo {
  left: 0;
  right: 0;
}

/* Start position (margin-top) and docked position (top) are set by js/site-bar.js */
.site-bar__left,
.site-bar__logo {
  position: sticky;
  pointer-events: auto;
}

.site-bar__logo {
  display: block;
  width: 63vw;
  margin-left: auto;
  margin-right: var(--bar-gutter);
  transform-origin: center bottom; /* shrinks toward its bottom edge, which stays glued to the landing screen */
  will-change: transform;
}


.site-bar__logo img {
  width: 100%;
  height: auto;
}

.site-bar__nav {
  display: none;
}

.site-bar__nav ul {
  display: flex;
  gap: 22px;
}

.site-bar__nav a {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
}

.site-bar__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.site-bar__menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  margin: 0 0 4px;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.05;
  color: var(--white);
  cursor: pointer;
}

.site-bar a:focus-visible,
.site-bar button:focus-visible {
  outline: 1px solid var(--beige);
  outline-offset: 4px;
}

@media (min-width: 640px) {
  .site-bar__logo {
    width: 54.5vw;
  }
}

/* Desktop: nav links replace the menu button */
@media (min-width: 960px) {
  .site-bar__nav {
    display: block;
    margin-bottom: 2px;
  }

  .site-bar__menu {
    display: none;
  }
}

/* Over light sections (e.g. the beige What We Solve intro) the bar turns black */
.site-bar__nav a,
.site-bar__menu {
  transition: color 0.3s ease;
}

.site-bar__logo img {
  transition: filter 0.3s ease;
}

.site-bar.is-dark .site-bar__nav a,
.site-bar.is-dark .site-bar__menu {
  color: var(--black);
}

.site-bar.is-dark .site-bar__logo img {
  filter: brightness(0);
}
