html {
  scroll-padding-top: 84px;
}

.icon {
  display: block;
  flex: 0 0 auto;
}

.global-header {
  position: fixed;
  z-index: 60;
  inset: 0 0 auto;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 4vw;
  border-bottom: 1px solid #ffffff20;
  background: #090909d9;
  color: #f1efe9;
  backdrop-filter: blur(16px) saturate(1.2);
}

.global-brand {
  justify-self: start;
  color: inherit;
  font:
    700 0.86rem Arial,
    sans-serif;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.global-brand span {
  color: #caff4f;
}

.global-navigation {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  font:
    600 0.68rem Arial,
    sans-serif;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.global-navigation a,
.global-action {
  color: inherit;
  text-decoration: none;
}

.global-navigation a {
  position: relative;
  padding-block: 0.7rem;
}

.global-navigation a::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: #caff4f;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.global-navigation a:hover::after,
.global-navigation a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.global-tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.global-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid #ffffff48;
  border-radius: 999px;
  font:
    700 0.62rem Arial,
    sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.global-action:hover,
.global-action:focus-visible {
  border-color: #caff4f;
  background: #caff4f;
  color: #090909;
}

.global-menu {
  display: none;
  border: 0;
  background: transparent;
  color: inherit;
  font:
    700 0.68rem Arial,
    sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.language-switcher {
  position: relative;
  color: #f1efe9;
  font-family: Arial, sans-serif;
}

.language-switcher summary {
  min-width: 68px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #ffffff32;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
}

.language-switcher summary::-webkit-details-marker {
  display: none;
}

.language-switcher summary strong {
  font-size: 0.64rem;
  letter-spacing: 0.1em;
}

.language-chevron {
  transition: transform 180ms ease;
}

.language-switcher[open] .language-chevron {
  transform: rotate(180deg);
}

.language-switcher summary:hover,
.language-switcher summary:focus-visible,
.language-switcher[open] summary {
  border-color: #caff4f;
}

.language-menu {
  position: absolute;
  z-index: 2;
  top: calc(100% + 0.65rem);
  inset-inline-end: 0;
  width: 190px;
  padding: 0.45rem;
  border: 1px solid #3a3a35;
  border-radius: 12px;
  background: #11110ff5;
  box-shadow: 0 18px 45px #0008;
}

.language-menu a {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  color: #d4d2cb;
  text-decoration: none;
}

.language-menu a:hover,
.language-menu a:focus-visible {
  background: #ffffff0c;
  color: white;
}

.language-menu a.active {
  background: #caff4f;
  color: #090909;
}

.language-menu small {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.back-to-top {
  position: fixed;
  z-index: 45;
  inset-inline-end: 1.25rem;
  bottom: 1.25rem;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff48;
  border-radius: 50%;
  background: #11110fe8;
  color: #f1efe9;
  box-shadow: 0 10px 28px #0005;
  text-decoration: none;
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    visibility 180ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  border-color: #caff4f;
  background: #caff4f;
  color: #090909;
  transform: translateY(-3px);
}

body:has(.audio-player:not([hidden])) .back-to-top {
  bottom: 8rem;
}

@media (width <= 1100px) {
  .global-header {
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
    padding-inline: 5vw;
  }

  .global-menu {
    display: block;
    grid-column: 2;
    grid-row: 1;
  }

  .global-navigation {
    display: none;
    position: absolute;
    top: calc(100% + 0.45rem);
    inset-inline: 5vw;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.65rem;
    border: 1px solid #34342f;
    border-radius: 14px;
    background: #11110ff7;
    box-shadow: 0 20px 50px #0009;
  }

  .global-navigation.is-open {
    display: flex;
  }

  .global-navigation a {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 0.8rem;
    border-radius: 8px;
  }

  .global-navigation a:hover,
  .global-navigation a:focus-visible {
    background: #ffffff0c;
    color: #caff4f;
  }

  .global-navigation a::after {
    display: none;
  }

  .global-tools {
    grid-column: 3;
    grid-row: 1;
  }

  .global-action {
    display: none;
  }
}

@media (width <= 520px) {
  .global-header {
    min-height: 64px;
  }

  .global-brand {
    font-size: 0.76rem;
  }

  .language-switcher summary {
    min-width: 58px;
    padding-inline: 0.5rem;
  }

  .back-to-top {
    inset-inline-end: 0.85rem;
    bottom: 0.85rem;
    width: 44px;
    height: 44px;
  }

  body:has(.audio-player:not([hidden])) .back-to-top {
    bottom: 7.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-navigation a::after,
  .global-action,
  .language-chevron,
  .back-to-top {
    transition: none;
  }
}
