/* Site chrome: the typeface, the shared header and the shared footer.
 *
 * homepage/build.mjs links this stylesheet into every registered page and inserts the matching markup from
 * src/shared-header.html and src/shared-footer.html, so the header and footer look and behave the same on every
 * page. Header and footer classes carry a wh- / wf- prefix (and are scoped under .site-header / .site-footer)
 * because the page stylesheets (styles.css, docs.css, markets.css, home.css) already use names like .btn,
 * .nav-links and .wrap.
 *
 * The header is laid out in a 1536-px design space: --u is one design pixel, set to 100vw / 1536 here and
 * refined by script.js to exclude the scrollbar, so the header keeps the same proportions at every desktop
 * width. Below 1100 px it switches to a fixed-size header with a menu button.
 */

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --u: calc(100vw / 1536);
  --chrome-ink: #0a0b2e;
  --chrome-nav: #0d1a3a;
  --chrome-muted: #4c4f63;
  --chrome-muted-2: #6c6f82;
  --chrome-blue: #0050fd;
  --chrome-blue-hover: #0042d9;
  --chrome-line: #ebe8e0;
  --chrome-font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.site-header,
.site-footer {
  font-family: var(--chrome-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.site-header *,
.site-footer * {
  box-sizing: border-box;
}

/* ───────── Header ───────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: calc(65 * var(--u));
  margin: 0;
  border: 0;
  background: rgba(254, 253, 249, 0.88);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(10, 11, 46, 0.07);
  line-height: normal;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

/* The home page header floats over the hero illustration and gains its background once the page scrolls. */
.home .site-header {
  position: fixed;
  inset: 0 0 auto 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.home .site-header.is-scrolled {
  background: rgba(254, 253, 249, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(10, 11, 46, 0.07);
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

.site-header .wh-logo {
  position: absolute;
  top: 0;
  left: calc(90 * var(--u));
  display: flex;
  height: 100%;
  align-items: center;
}

.site-header .wh-word {
  display: block;
  width: max(104px, calc(124 * var(--u)));
  height: auto;
  margin-top: calc(2 * var(--u));
}

.site-header .wh-nav {
  position: absolute;
  top: 0;
  left: calc(598 * var(--u));
  display: flex;
  height: 100%;
  align-items: center;
  gap: calc(33.5 * var(--u));
  color: var(--chrome-nav);
  font-size: max(14px, calc(14.5 * var(--u)));
  font-weight: 500;
}

.site-header .wh-nav a,
.site-header .wh-signin {
  transition: color 0.15s ease;
}

.site-header .wh-nav a:hover,
.site-header .wh-signin:hover,
.site-header .wh-nav a[aria-current] {
  color: var(--chrome-blue);
}

.site-header .wh-actions {
  position: absolute;
  top: 0;
  right: calc(90 * var(--u));
  display: flex;
  height: 100%;
  align-items: center;
  gap: calc(31 * var(--u));
}

.site-header .wh-signin {
  color: var(--chrome-nav);
  font-size: max(14px, calc(14.5 * var(--u)));
  font-weight: 500;
}

.site-header .wh-cta {
  display: inline-flex;
  height: max(38px, calc(41 * var(--u)));
  align-items: center;
  justify-content: center;
  padding: 0 calc(24 * var(--u));
  border-radius: 999px;
  background: var(--chrome-blue);
  box-shadow: 0 8px 18px -10px rgba(0, 80, 253, 0.75);
  color: #fff;
  font-size: max(14px, calc(15.5 * var(--u)));
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.site-header .wh-cta:hover {
  background: var(--chrome-blue-hover);
}

.site-header .wh-cta:active {
  transform: translateY(1px);
}

.site-header .wh-menu-btn,
.site-header .wh-menu {
  display: none;
}

.site-header :focus-visible,
.site-footer :focus-visible {
  outline: 3px solid #8fb0ff;
  outline-offset: 3px;
  border-radius: 6px;
}

/* ───────── Footer ───────── */

.site-footer {
  margin: 0;
  padding: 0;
  border-top: 1px solid #efeadf;
  background: #f8f5ee;
  color: var(--chrome-muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.home .site-footer {
  margin-top: clamp(72px, 8vw, 120px);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer .wf-inner {
  width: min(1356px, 100% - 2 * clamp(20px, 5.86vw, 90px));
  margin-inline: auto;
}

.site-footer .wf-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 32px;
  padding: 64px 0 44px;
}

.site-footer .wf-brand img {
  display: block;
  width: 104px;
  height: auto;
}

.site-footer .wf-brand p {
  max-width: 280px;
  margin: 16px 0 0;
}

.site-footer .wf-col {
  display: grid;
  align-content: start;
  gap: 10px;
}

.site-footer .wf-h {
  margin: 0 0 4px;
  color: var(--chrome-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-footer .wf-col a:hover {
  color: var(--chrome-blue);
}

.site-footer .wf-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 32px;
  border-top: 1px solid #ebe5d8;
  color: var(--chrome-muted-2);
  font-size: 13.5px;
}

/* ───────── Tablet and phone ───────── */

@media (max-width: 1099px) {
  :root {
    --u: 1px;
  }

  .site-header {
    height: 64px;
  }

  .site-header .wh-logo {
    left: 20px;
  }

  .site-header .wh-word {
    width: 100px;
    margin-top: 2px;
  }

  .site-header .wh-nav,
  .site-header .wh-actions {
    display: none;
  }

  .site-header .wh-menu-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(10, 11, 46, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--chrome-ink);
    cursor: pointer;
  }

  .site-header .wh-menu-btn svg {
    width: 20px;
    height: 20px;
  }

  .site-header .wh-menu {
    position: absolute;
    top: 64px;
    right: 12px;
    left: 12px;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--chrome-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(10, 11, 46, 0.05), 0 40px 80px -40px rgba(10, 11, 46, 0.38);
  }

  .site-header.menu-open .wh-menu {
    display: flex;
  }

  .site-header.menu-open,
  .home .site-header.menu-open {
    background: rgba(254, 253, 249, 0.96);
  }

  .site-header .wh-menu a {
    padding: 12px;
    border-radius: 10px;
    color: var(--chrome-ink);
    font-size: 16px;
    font-weight: 500;
  }

  .site-header .wh-menu a:hover {
    background: #f4f3ee;
  }

  .site-header .wh-menu a[aria-current] {
    color: var(--chrome-blue);
  }

  .site-header .wh-menu .wh-cta {
    height: 46px;
    margin-top: 8px;
    color: #fff;
  }

  .site-header .wh-menu .wh-cta:hover {
    background: var(--chrome-blue-hover);
  }

  .site-footer .wf-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .site-footer .wf-brand {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header .wh-cta {
    transition: none;
  }
}
