/*
 * The site header, shared by the home page (and its experiment routes) and
 * the document pages (privacy policy, help center, contact, ...), so every
 * page has the same header. Self-contained: it doesn't rely on either page's
 * tokens (main.css and document-page.css define different ones), and it is
 * sized in px because the home page scales its root font size on some
 * screens. The fixed height is --site-header-h, for pages to offset content.
 *
 * Markup: public/index.html (home) and templates/partials/site-header.html.
 */
:root {
  --site-header-h: 72px;
}

.site-header {
  --sh-bg: hsl(80, 10%, 95%);
  --sh-ink: hsl(141, 100%, 10%);
  --sh-ink-muted: hsl(141 100% 10% / 0.68);
  --sh-accent: hsl(67, 100%, 50%);
  --sh-accent-dark: hsl(67, 100%, 35%);
  --sh-container: 1320px;
  --sh-gutter: clamp(20px, 8px + 3vw, 48px);
  --sh-pill: 999px;
  --sh-ease: cubic-bezier(0.32, 0, 0.03, 0.99);
  --sh-time: 550ms;

  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: var(--site-header-h);
  padding: 0 var(--sh-gutter);
  background-color: var(--sh-bg);
  box-sizing: border-box;
  font-family: "Funnel Display", sans-serif;
}

.site-header .header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: var(--sh-container);
}

.site-header .site-logo {
  display: inline-flex;
  flex-shrink: 0;
}
.site-header .site-logo svg,
.site-header .site-logo img {
  display: block;
  width: clamp(104px, 96px + 1vw, 120px);
  height: auto;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 8px + 1.2vw, 32px);
}
.site-header nav a {
  position: relative;
  display: inline-block;
  padding-block: 8px;
  color: var(--sh-ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 400ms ease,
    color 400ms ease;
}
.site-header nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: var(--sh-accent-dark);
  transform: scaleX(0);
  transform-origin: center;
  transition:
    transform 600ms ease,
    bottom 400ms ease;
}

.site-header .btns-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
}

/* Primary pill: the site's dark button (see BUTTONS in main.css), at header
   size. 40px tall around a 32px badge: 4px on the top, bottom and right, so
   the badge is concentric with the pill's end. Sizes are set explicitly
   because main.css (loaded later) sizes .btn01 for page sections. */
.site-header .btn01 {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  height: 40px;
  min-height: 40px;
  padding: 4px 4px 4px 18px;
  border: 0;
  border-radius: var(--sh-pill);
  background: var(--sh-ink);
  color: var(--sh-bg);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--sh-time) var(--sh-ease);
}
.site-header .btn01 svg {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--sh-pill);
  transition: translate calc(var(--sh-time) / 1.5) var(--sh-ease);
}
.site-header .btn01 svg rect {
  fill: var(--sh-accent);
}
.site-header .btn01 svg path {
  stroke: var(--sh-ink);
}

.site-header .btn-login {
  box-sizing: border-box;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: stretch;
  padding: 0 18px;
  border: 1px solid var(--sh-ink);
  border-radius: var(--sh-pill);
  color: var(--sh-ink);
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--sh-time) var(--sh-ease),
    color var(--sh-time) var(--sh-ease);
}

.site-header a:focus-visible {
  outline: 3px solid var(--sh-accent-dark);
  outline-offset: 4px;
}

@media (min-width: 1025px) {
  .site-header nav a:hover {
    color: var(--sh-ink-muted);
  }
  .site-header nav a:hover::after {
    transform: scaleX(100%);
  }
  .site-header .btn01:hover {
    background-color: hsl(141, 100%, 18%);
  }
  .site-header .btn01:hover svg {
    translate: 4px 0;
  }
  .site-header .btn-login:hover {
    background-color: var(--sh-ink);
    color: var(--sh-bg);
  }
}

@media (min-width: 1601px) {
  .site-header nav {
    gap: clamp(24px, 2vw, 40px);
  }
  .site-header .btn01 {
    width: auto;
    min-width: 280px;
    max-width: 320px;
  }
}

/* No room for the nav (logo, 5 links, pill and log in need about 1160px):
   logo, pill and log in only. */
@media (max-width: 1199px) {
  .site-header nav {
    display: none;
  }
}
/* Phones: logo and log in. */
@media (max-width: 900px) {
  .site-header .btn01 {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header *,
  .site-header *::after {
    transition: none !important;
  }
}

@media print {
  .site-header {
    display: none;
  }
}
