header {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 100;
  background: var(--header-bg-color);
  backdrop-filter: blur(0.25em);
  box-shadow: var(--header-shadow);

  nav {
    display: flex;
    width: 100%;

    /* Equal columns so the bar fits its widest content — five items at 320px
       still clear the 44px touch target. */
    & > * {
      flex: 1;
    }
  }

  a {
    font: inherit;
    cursor: pointer;
    color: var(--button-fg-color);

    display: flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 4em;
    padding: 0;
    background: transparent;
    border: none;

    &:hover {
      background: var(--header-link-hover-color);
      color: var(--button-fg-color);
      text-decoration: none;
    }

    & > svg {
      height: 2em;
      fill: var(--button-fg-color);
    }

    & > span {
      display: none;
    }
  }
}

@media screen and (min-width: 36em) {
  header {
    position: relative;
    background: none;
    box-shadow: none;
    padding: 0 1em;

    nav {
      width: auto;
      gap: 1em;

      & > * {
        flex: 0 0 auto;
      }
    }
  }

  header a {
    width: auto;
    height: auto;
    padding: 0.5em 0;
    color: var(--link-color);

    &:hover {
      background: none;
      color: var(--link-hover-color);
      text-decoration: underline;
    }

    & > span { display: block; }
    & > svg { display: none; }
  }
}
