@layer components {
  /* The brand and Sign Out, then on the list the search and Keep a Link. On the list it sits in the sand band
     with the kinds below it; on a keep's page, in the keep's own color */
  .header {
    width: 100%;
  }

  .keeps-screen .header {
    background: var(--color-band);
  }

  .header__bar,
  .header__search {
    width: min(var(--page-width), 100% - 2 * var(--page-padding));
    margin-inline: auto;
  }

  .header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 88px;
  }

  .header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: calc(18.4 * var(--pt));
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.04em;
  }

  .brand__mark {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: color-mix(in srgb, currentColor 8%, transparent);

    .loop {
      width: 17px;
      height: 10px;
      stroke-width: 4.4;
    }
  }

  .header__nav {
    display: flex;
    align-items: center;
    gap: 32px;

    @media (max-width: 699px) {
      gap: 20px;
    }

    form {
      display: contents;
    }

    .btn--primary {
      --btn-background: var(--tint-ink, var(--color-button));
      --btn-hover-background: color-mix(in srgb, var(--tint-ink, var(--color-button)) 86%, transparent);
      --btn-border: var(--tint-ink, var(--color-button));
      --btn-color: var(--tint-ink-inverse, var(--color-button-ink));
    }
  }

  .header__sign-out {
    font-size: var(--text-control);
    font-weight: 600;
    letter-spacing: -0.03em;
    white-space: nowrap;

    @media (hover: hover) and (pointer: fine) {
      &:hover {
        text-decoration: underline;
        text-underline-offset: 4px;
      }
    }
  }

  /* Just the plus where there's no room for the words */
  .header__add {
    @media (max-width: 699px) {
      width: 44px;
      padding: 0;

      span {
        display: none;
      }
    }
  }

  .header__search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 4px;

    .search {
      flex: 1;
      min-width: 0;
    }
  }

  .header__keep {
    min-height: 60px;
    padding: 0 24px 0 20px;
    border-radius: 18px;

    /* Just the plus where there's no room for the words */
    @media (max-width: 699px) {
      width: 60px;
      padding: 0;

      span {
        display: none;
      }
    }
  }
}
