header {
  position: fixed;
  top: var(--site-padding-top);
  left: var(--site-padding-sides);
  right: var(--site-padding-sides);
  display: flex;
  font-size: var(--font-size-big);
  line-height: 0;
  justify-content: space-between;
  align-items: end;
  z-index: 200;
}


#logo {
  font-size: var(--font-size-big);
  --line-height: .8;
  display: flex;
}
#logo_image {
  height: calc(var(--font-size-big) * 2 * var(--line-height));
  aspect-ratio: var(--aspect-ratio);
}
#logo svg {
  height: 100%;
}
#logo svg path {
  fill: var(--color);
}
#logo_text, #logo_text_collapsed {
  font-stretch: 75%;
  font-weight: 300;
  text-transform: uppercase;
  line-height: var(--line-height);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-left: .1em;
}
#logo_text span {
  display: flex;
  align-items: center;
  height: calc(1em * var(--line-height))
}
#logo_text_collapsed {
  display: none;
  margin-left: .25em;
}
#logo_text_collapsed #hyphen {
  margin-left: .1em;
}






/* NAV */

#menu_btn {
  text-transform: uppercase;
  font-weight: bold;
  position: relative;
  cursor: pointer;
  white-space: nowrap;
}
@media (hover: hover) {
  .header_page_link:hover span,
  #menu_btn:hover span {
    text-decoration: underline;
    text-underline-offset: .25em;
    text-decoration-thickness: 2px;
  }
}
#menu_btn:before {
  content: '';
  display: inline-block;
  height: calc(1em * var(--x-height-factor));
  width: calc(1em * var(--x-height-factor));
  box-sizing: border-box;
  border-top: var(--icon-stroke-width) solid var(--color);
  border-bottom: var(--icon-stroke-width) solid var(--color);
}
#menu_btn:after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  display: inline-block;
  height: var(--icon-stroke-width);
  width: calc(1em * var(--x-height-factor));
  background-color: var(--color);
  transform: translateY(-50%);
}
#nav_close_btn {
  --top-pos: calc(var(--site-padding-top) + (1em * var(--x-height-factor)) - .1em);
  position: sticky;
  height: calc(1em * var(--x-height-factor));
  width: calc(1em * var(--x-height-factor));
  margin-top: var(--top-pos);
  cursor: pointer;
  top: var(--top-pos);
  z-index: 1;
  pointer-events: none;
}
#nav_close_btn:after, #nav_close_btn:before {
  content: '';
  position: absolute;
  height: var(--icon-stroke-width);
  width: 120%;
  left: -10%;
  background-color: var(--color);
  transform: translateY(-50%) rotate(45deg);
  transform-origin: center;
}
#nav_close_btn:before {
  transform: translateY(-50%) rotate(-45deg);
}
nav {
  --gradient-width: 5em;
  --padding-left: 2em;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
  overflow-x: hidden;
  overflow-y: auto;
  line-height: var(--line-height-regular);
  padding: var(--site-padding-top) calc(var(--gradient-width) + var(--padding-left)) 2em var(--site-padding-sides);
  background: linear-gradient(to left, transparent 0, var(--color-background) var(--gradient-width));
  z-index: 300;
}
nav::-webkit-scrollbar {
  display: none;
}
#nav_close_btn_area {
  position: fixed;
  display: none;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 299;
  opacity: 0.25;
  background-color: var(--color-background);
}
.nav_open nav, .nav_open #nav_close_btn_area {
  display: block;
}
nav:before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(var(--color-background), transparent);
  height: 3.8em;
  pointer-events: none;
}




/* MENU */

#header_menu {
  display: flex;
  line-height: 0;
  justify-content: space-between;
  align-items: end;
}
#header_menu > * + *:not(nav) {
  margin-left: var(--header-item-gap);
}
#main_menu {
  margin-top: 2rem;
  font-weight: bold;
  text-transform: uppercase;
}
.main_menu_item, .sub_menu_item {
  line-height: 100%;
  color: var(--page-color);
}
.main_menu_item a:before {
  content: "/";
  margin-right: .25em;
}
@media (hover: hover) {
  .main_menu_item a:hover span {
    text-decoration: underline;
    text-underline-offset: .25em;
    text-decoration-thickness: 2px;
  }
}
.main_menu_item + .main_menu_item {
  margin-top: 1.5em;
}
.sub_menu {
  font-size: var(--font-size-regular);
  padding-left: 1.75em;
}
.sub_menu a:before {
  content: "⮑";
  margin-right: .5em;
  font-weight: normal;
  vertical-align: text-top;
}
.sub_menu_item {
  margin-top: 1em;
}
.is_open span {
  text-decoration: underline;
  text-underline-offset: .25em;
  text-decoration-thickness: 2px;
}





/* SEARCH */

#header_search {
  line-height: 100%;
  display: flex;
  position: relative;
}
#search_icon {
  position: relative;
  width: 1em;
  height: 1em;
  cursor: pointer;
}
#search_icon:after {
  position: absolute;
  content: '';
  border-radius: 1000px;
  border: var(--icon-stroke-width) solid var(--color);
  width: 50%;
  height: 50%;
  top: 11%;
  right: 0;
}
#search_icon:before {
  position: absolute;
  content: '';
  height: 50%;
  width: var(--icon-stroke-width);
  background-color: var(--color);
  bottom: 0;
  left: .07em;
  transform: rotate(60deg);
}
#search_input {
  display: none;
  line-height: 100%;
  height: 1em;
  position: relative;
  margin-left: .6em;
  font-size: .9em;
  font-weight: normal;
}
#header_search:after {
  display: none;
  position: absolute;
  content: '';
  right: 0;
  box-sizing: border-box;
  left: 1.6em;
  bottom: -.25em;
  height: var(--icon-stroke-width-thin);
  background-color: var(--color);
}
.search_open #search_input,
.search_open #header_search_cancel,
.search_open #header_search:after {
  display: unset;
}
#header_search_cancel {
  position: absolute;
  right: 0;
  bottom: 0;
  cursor: pointer;
  display: none;
}


/* PAGE LINK */

.header_page_link {
  line-height: 100%;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--color);
  font-weight: bold;
}
.search_open .header_page_link {
  display: none;
}
.header_page_link:before {
  content: '/';
  margin-right: .25em;
}



/* SOCIAL */

#social_links {
  white-space: nowrap;
}
.social_link {
  display: inline;
}
.social_link + .social_link {
  margin-left: .25em;
}
.social_link svg {
  height: calc(1em * var(--x-height-factor));
}
.social_link svg path {
  fill: var(--color);
}






@media (max-width: 800px) {

  header {
    left: 4px;
    right: 4px;
  }
  #logo_text {
    display: none;
  }
  #menu_btn span {
    display: none;
  }
  #logo_text_collapsed {
    display: flex;
  }
  nav {
    background: var(--color-background);
    right: 0;
    padding-right: var(--site-padding-sides);
  }
  body.nav_open {
    overflow: hidden;
  }
  .search_open #menu_btn,
  .search_open #social {
    display: none;
  }
  .search_open #header_search {
    margin-left: 0;
  }
  #search_input {
    width: 14rem;
    margin-left: .5em;
  }
  #header_search:after {
    left: 1.5em;
  }

}
