body.admin-bar .site-header {
  top: 32px;
}

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(620px, 1fr) 110px;
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--ink);
}

.reading-progress {
  position: absolute;
  z-index: 0;
  inset: 0 auto 0 0;
  width: var(--rail-width);
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  background: #f4f4f4;
}

.reading-progress span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--scroll-progress, 0%);
  background: #d0d0d0;
  transition: width 0.08s linear;
}

.site-brand-switcher {
  position: relative;
  z-index: 2;
  min-width: 0;
  height: var(--header-h);
}

.site-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-h);
  background: transparent;
  font-size: 1.2em;
  font-weight: 400;
  text-decoration: none;
}

.site-brand-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: max-content;
  min-width: 100%;
  max-width: min(430px, 100vw);
  margin: 0;
  padding: 0;
  visibility: hidden;
  pointer-events: none;
  list-style: none;
}

.site-brand-switcher:hover > .site-brand-menu,
.site-brand-switcher:focus-within > .site-brand-menu {
  visibility: visible;
  pointer-events: auto;
}

.site-brand-menu > li {
  --fold-order: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 320ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 0ms;
}

.site-brand-menu > li:nth-child(1) { --fold-order: 0; }
.site-brand-menu > li:nth-child(2) { --fold-order: 1; }

.site-brand-switcher:hover > .site-brand-menu > li,
.site-brand-switcher:focus-within > .site-brand-menu > li {
  max-height: 90px;
  transition-delay: calc(var(--fold-order) * 44ms);
}

.site-brand-menu a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 13px 22px;
  background: #fff;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand-menu > li > a {
  transform: skewX(-1deg);
  transform-origin: top center;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 0ms;
}

.site-brand-switcher:hover > .site-brand-menu > li > a,
.site-brand-switcher:focus-within > .site-brand-menu > li > a {
  transform: skewX(0deg);
  transition-delay: calc(var(--fold-order) * 44ms);
}

.site-brand-menu > li:nth-child(even) > a {
  background: #f4f4f4;
}

.site-brand-menu > li > a:hover,
.site-brand-menu > li > a:focus-visible {
  color: var(--ink);
  background: #dedede;
}

.site-nav {
  height: var(--header-h);
  background: var(--ink);
}

.site-nav > ul {
  display: flex;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li {
  position: relative;
}

.site-nav > ul > li {
  flex: 0 0 auto;
  height: 100%;
}

@media (min-width: 901px) {
  .site-nav.is-horizontally-scrollable {
    position: relative;
  }

  .site-nav.is-horizontally-scrollable > ul {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scrollbar-width: none;
  }

  .site-nav.is-horizontally-scrollable > ul::-webkit-scrollbar {
    display: none;
  }

  .site-nav.is-horizontally-scrollable::before,
  .site-nav.is-horizontally-scrollable::after {
    content: "";
    position: absolute;
    z-index: 6;
    top: 0;
    bottom: 0;
    width: 48px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .site-nav.is-horizontally-scrollable::before {
    left: 0;
    background: linear-gradient(90deg, var(--ink) 0%, rgba(41, 46, 68, 0.82) 34%, rgba(41, 46, 68, 0) 100%);
  }

  .site-nav.is-horizontally-scrollable::after {
    right: 0;
    background: linear-gradient(270deg, var(--ink) 0%, rgba(41, 46, 68, 0.82) 34%, rgba(41, 46, 68, 0) 100%);
  }

  .site-nav.is-horizontally-scrollable.can-scroll-left::before,
  .site-nav.is-horizontally-scrollable.can-scroll-right::after {
    opacity: 1;
  }

  .site-nav.is-horizontally-scrollable .sub-menu {
    position: fixed;
    z-index: 7;
    top: var(--submenu-top, var(--header-h));
    left: var(--submenu-left, 0px);
    width: max-content;
    min-width: var(--submenu-min-width, 0px);
    max-width: min(430px, calc(100vw - 16px));
  }
}

.site-nav a {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: var(--header-h);
    padding: 8px 26px;
    overflow: hidden;
    color: #dbdbdb;
    font-size: clamp(0.67rem, 0.78vw, 0.86rem);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    text-transform: uppercase;
}

.site-nav > ul > li > a::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: #324352;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.24s ease;
}

.site-nav > ul > li > a:hover::before,
.site-nav > ul > li > a:focus-visible::before,
.site-nav > ul > li > a.is-active::before {
  transform: scaleY(1);
}

.site-nav > ul > li > a:hover,
.site-nav > ul > li > a:focus-visible,
.site-nav > ul > li > a.is-active {
  color: #fff;
}

.site-nav .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: max-content;
  min-width: 100%;
  max-width: 430px;
  margin: 0;
  padding: 0;
  visibility: hidden;
  pointer-events: none;
  list-style: none;
}

.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu {
  visibility: visible;
  pointer-events: auto;
}

@media (min-width: 901px) {
  .site-nav.is-horizontally-scrollable li:hover > .sub-menu {
    visibility: hidden;
    pointer-events: none;
  }

  .site-nav.is-horizontally-scrollable li.is-submenu-open > .sub-menu,
  .site-nav.is-horizontally-scrollable li:focus-within > .sub-menu {
    visibility: visible;
    pointer-events: auto;
  }

  .site-nav.is-horizontally-scrollable.awaiting-pointer-intent > ul > li > a:hover:not(.is-active)::before {
    transform: scaleY(0);
  }

  .site-nav.is-horizontally-scrollable.awaiting-pointer-intent > ul > li > a:hover:not(.is-active) {
    color: #dbdbdb;
  }
}

.site-nav .sub-menu > li {
  --fold-order: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 320ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 0ms;
}

.site-nav .sub-menu > li:nth-child(1) { --fold-order: 0; }
.site-nav .sub-menu > li:nth-child(2) { --fold-order: 1; }
.site-nav .sub-menu > li:nth-child(3) { --fold-order: 2; }
.site-nav .sub-menu > li:nth-child(4) { --fold-order: 3; }
.site-nav .sub-menu > li:nth-child(5) { --fold-order: 4; }
.site-nav .sub-menu > li:nth-child(6) { --fold-order: 5; }
.site-nav .sub-menu > li:nth-child(7) { --fold-order: 6; }
.site-nav .sub-menu > li:nth-child(8) { --fold-order: 7; }

.site-nav li:hover > .sub-menu > li,
.site-nav li:focus-within > .sub-menu > li {
  max-height: 90px;
  transition-delay: calc(var(--fold-order) * 44ms);
}

.site-nav .sub-menu a {
  justify-content: flex-start;
  height: auto;
  min-height: 0;
  padding: 13px 26px;
  border: 0;
  background: var(--ink);
  font-size: 0.92rem;
  white-space: normal;
}

.site-nav .sub-menu > li > a {
  transform: skewX(-1deg);
  transform-origin: top center;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 0ms;
}

.site-nav li:hover > .sub-menu > li > a,
.site-nav li:focus-within > .sub-menu > li > a {
  transform: skewX(0deg);
  transition-delay: calc(var(--fold-order) * 44ms);
}

.site-nav .sub-menu > li:nth-child(even) > a {
  background: #2e3349;
}

.site-nav .sub-menu > li > a:hover,
.site-nav .sub-menu > li > a:focus-visible {
  color: #fff;
  background: #324352;
}

@supports (interpolate-size: allow-keywords) {
  .site-brand-menu,
  .site-nav .sub-menu {
    interpolate-size: allow-keywords;
  }

  .site-brand-menu > li,
  .site-nav .sub-menu > li {
    height: 0;
    max-height: none;
    transition-property: height;
  }

  .site-brand-switcher:hover > .site-brand-menu > li,
  .site-brand-switcher:focus-within > .site-brand-menu > li,
  .site-nav li:hover > .sub-menu > li,
  .site-nav li:focus-within > .sub-menu > li {
    height: auto;
    max-height: none;
  }
}

.language-switch {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  align-self: center;
  justify-self: center;
  width: 72px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: #202538;
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.language-switch:hover {
  border-color: rgba(255, 255, 255, 0.26);
}

.language-switch:focus-within {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.25),
    0 0 0 3px rgba(255, 255, 255, 0.1);
}

.language-switch-thumb {
  position: absolute;
  z-index: 0;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.28),
    0 1px 2px rgba(0, 0, 0, 0.18);
  transform: translate3d(0, 0, 0);
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms ease;
  will-change: transform;
}

.language-switch.is-english .language-switch-thumb {
  transform: translate3d(36px, 0, 0);
}

.language-switch a {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 34px;
  border-radius: 50%;
  color: #b9bdc8;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms ease;
}

.language-switch .active {
  color: var(--ink);
}

.language-switch a:not(.active):hover {
  color: #fff;
}

.language-switch a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.language-switch.is-switching {
  pointer-events: none;
}

.menu-toggle {
  display: none;
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: var(--rail-width) 1fr 90px;
  }

  .site-nav a {
    padding-inline: 16px;
    font-size: 0.84rem;
  }
}

@media (max-width: 900px) {
  body.admin-bar .site-header {
    top: 46px;
  }

  .site-header {
    grid-template-columns: 1fr 70px 94px;
  }

  .reading-progress {
    width: calc(100% - 164px);
  }

  .site-brand {
    justify-content: flex-start;
    padding-left: 22px;
    font-size: clamp(0.82rem, 4vw, 1.2rem);
    white-space: nowrap;
  }

  .site-brand-menu {
    max-width: calc(100vw - 20px);
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: var(--ink);
    color: #fff;
    font: inherit;
    font-size: 0;
    cursor: pointer;
  }

  .menu-toggle::before {
    content: "☰";
    font-size: 25px;
  }

  .menu-toggle[aria-expanded="true"]::before {
    content: "×";
    font-size: 34px;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    right: 0;
    left: 0;
    display: none;
    height: auto;
    max-height: calc(100vh - var(--header-h));
    overflow: auto;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav > ul {
    display: block;
  }

  .site-nav a {
    justify-content: flex-start;
    min-height: 52px;
    padding: 10px 22px;
    font-size: 0.95rem;
  }

  .site-nav .sub-menu {
    position: static;
    width: auto;
    min-width: 0;
    max-width: none;
    visibility: visible;
    pointer-events: auto;
    perspective: none;
  }

  .site-nav .sub-menu > li,
  .site-nav li:hover > .sub-menu > li,
  .site-nav li:focus-within > .sub-menu > li {
    height: auto;
    max-height: none;
    overflow: visible;
    transition: none;
  }

  .site-nav .sub-menu > li > a,
  .site-nav li:hover > .sub-menu > li > a,
  .site-nav li:focus-within > .sub-menu > li > a {
    transform: none;
    transition: none;
  }

  .site-nav .sub-menu a {
    padding-left: 42px;
  }

  .language-switch {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  .language-switch,
  .language-switch a,
  .language-switch-thumb {
    transition: none;
  }

  .site-brand-menu > li,
  .site-brand-switcher:hover > .site-brand-menu > li,
  .site-brand-switcher:focus-within > .site-brand-menu > li,
  .site-nav .sub-menu > li,
  .site-nav li:hover > .sub-menu > li,
  .site-nav li:focus-within > .sub-menu > li {
    height: auto;
    max-height: none;
    overflow: visible;
    transition: none;
  }

  .site-brand-menu > li > a,
  .site-brand-switcher:hover > .site-brand-menu > li > a,
  .site-brand-switcher:focus-within > .site-brand-menu > li > a,
  .site-nav .sub-menu > li > a,
  .site-nav li:hover > .sub-menu > li > a,
  .site-nav li:focus-within > .sub-menu > li > a {
    transform: none;
    transition: none;
  }
}
