/* Site header: logo, navigation (Product) and the Contact button over the hero. */
/* stacked above the hero's headline block, which covers the whole first screen and would otherwise take the header's hovers and clicks */
.site-header {
  position: absolute;
  z-index: 3;
  top: max(28px, env(safe-area-inset-top));
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  --logo-h: clamp(44px, 4.5vw, 68px);
}

.site-header > * { opacity: calc(1 - var(--dive, 0) * 6); }

/* phones have no dive to fade with, so it goes on scroll with the hero's headline (page-leave in base.css); it sits in the page's
   flow, so without scroll timelines it simply scrolls away */
@media (max-width: 760px) {
  @supports (animation-timeline: scroll()) {
    @media (prefers-reduced-motion: no-preference) {
      .site-header {
        animation: page-leave linear both;
        animation-timeline: scroll(root block);
        animation-range: 0 50vh;
      }
    }
  }
}

.logo {
  font: 800 20px var(--font-display);
  font-synthesis: none;
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--ink);
}

/* the logo grows with the window like the hero's figures and the header links (--text-figure, --text-nav), so they stay in proportion */
.logo svg {
  display: block;
  height: var(--logo-h);
  width: auto;
  color: var(--ink);
}

nav {
  display: flex;
  align-items: center;
  gap: 38px;
}

nav a {
  color: var(--mute);
  text-decoration: none;
  font-size: var(--text-nav);
  letter-spacing: .02em;
}

nav a:not(.btn) { display: none; }

/* text links: on hover (and keyboard focus) the label grows slightly and a line runs in under it from the left */
nav a:not(.btn) {
  position: relative;
  transition: color .25s, scale .25s cubic-bezier(.2, .7, .2, 1);
}

nav a:not(.btn)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  scale: 0 1;
  transform-origin: left;
  transition: scale .3s cubic-bezier(.2, .7, .2, 1);
}

nav a:not(.btn):focus-visible { scale: 1.08; color: var(--ink); }
nav a:not(.btn):focus-visible::after { scale: 1 1; }

@media (prefers-reduced-motion: reduce) {
  nav a:not(.btn), nav a:not(.btn)::after { transition: none; }
}

.btn {
  background: var(--btn);
  color: var(--btn-ink);
  padding: 10px 16px;
  border-radius: 3px;
  font-weight: 500;
  white-space: nowrap;
}

nav a.btn { transition: background .25s; }

nav a.btn:focus-visible {
  color: var(--btn-ink);
  background: var(--circle-base);
}

/* on phones the button's width follows the logo's height: about 128px beside the 44px logo, and lower than it, its label a touch over the 15px links */
@media (max-width: 760px) {
  .btn {
    display: inline-block;
    box-sizing: border-box;
    width: calc(var(--logo-h) * 2.9);
    padding: 8.5px 0;
    font-size: 16px;
    text-align: center;
  }
}

@media (min-width: 761px) {
  nav a:not(.btn) { display: inline-block; }
  .btn { padding: 10px 22px; }
}

/* hover-only looks, for devices that can hover: a phone keeps :hover after a tap until the next one elsewhere */
@media (hover: hover) {
  nav a:not(.btn):hover { scale: 1.08; color: var(--ink); }
  nav a:not(.btn):hover::after { scale: 1 1; }

  nav a.btn:hover {
    color: var(--btn-ink);
    background: var(--circle-base);
  }
}
