/* =========================================================
   SITE HEADER
========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 9999;

  height: var(--header-height);

  background: #202134;

  border-bottom: 1px solid rgba(255, 255, 255, 0.055);

  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.2);
}

.site-header__container {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 15px 0;

  width: min(calc(100% - 40px), var(--container));
  height: 100%;
  margin-inline: auto;
}

/* =========================================================
   LOGO
========================================================= */

.site-header__logo {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;

  width: fit-content;
  max-width: 190px;

  color: #fff;

  font-size: 20px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.035em;

  transition: opacity var(--transition);
}

.site-header__logo:hover {
  opacity: 0.9;
}
.site-header__logo::before,
.site-header__logo::after {
  display: none;
  content: none;
}

.site-header__logo-image,
.site-header__logo img {
  display: block;

  width: auto;
  height: auto;
  max-width: 190px;
  max-height: 44px;

  object-fit: contain;

  border: 0;
  box-shadow: none;
}

.site-header__logo-text {
  overflow: hidden;

  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   DESKTOP NAVIGATION
========================================================= */

.site-header__nav {
  display: flex;
  align-items: center;

  min-width: 0;
  margin-left: auto;
}

.site-header__menu {
  display: flex;
  align-items: center;
  gap: 30px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.site-header__menu li {
  margin: 0;
  padding: 0;
}

.site-header__menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 42px;
  padding: 0;

  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;

  transition:
    color 200ms ease,
    transform 200ms ease,
    opacity 200ms ease;
}

.site-header__menu a::before,
.site-header__menu a::after {
  display: none;
  content: none;
}

.site-header__menu a:hover {
  color: rgba(255, 255, 255, 0.96);

  transform: translateY(-1px);
}

.site-header__menu .current-menu-item > a,
.site-header__menu .current-menu-ancestor > a {
  color: var(--text);
}

/* =========================================================
   HEADER ACTIONS
========================================================= */

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;

  margin-left: 20px;
}

.site-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 44px;
  padding: 0 22px;

  border: 1px solid transparent;
  border-radius: 11px;

  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;

  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.site-header__btn:hover {
  transform: translateY(-1px);
}

.site-header__btn:active {
  transform: translateY(0);
}

/* =========================================================
   HEADER ACTION BUTTONS
========================================================= */

.site-header__btn--ghost,
.site-header__btn--primary {
  position: relative;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  min-height: 48px;
  padding: 7px 14px 7px 8px;

  color: #fff !important;
  text-decoration: none;

  border: 1px solid transparent;
  border-radius: 14px;

  font-size: 14px;
  font-weight: 800;
  line-height: 1;

  transition:
    transform 200ms ease,
    filter 200ms ease,
    box-shadow 200ms ease;
}

/* =========================================================
   LOGIN
========================================================= */

.site-header__btn--ghost {
  min-width: 116px;

  background:
    linear-gradient(180deg, #252239 0%, #17182b 100%) padding-box,
    linear-gradient(115deg, rgba(255, 37, 92, 0.58) 0%, rgba(105, 77, 137, 0.58) 48%, rgba(112, 116, 148, 0.42) 100%) border-box;

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

/* Login icon box */
.site-header__btn--ghost::before {
  display: inline-flex;
  flex: 0 0 34px;

  width: 34px;
  height: 34px;

  content: '';

  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff285d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M13 4h5a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-5'/%3E%3C/svg%3E") center / 19px 19px no-repeat,
    linear-gradient(180deg, rgba(255, 42, 94, 0.07), rgba(255, 42, 94, 0.025));

  border: 1px solid rgba(255, 37, 92, 0.42);
  border-radius: 9px;

  transition:
    background 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
}

.site-header__btn--ghost:hover {
  color: #fff !important;

  filter: brightness(1.07);

  transform: translateY(-2px);
}

.site-header__btn--ghost:hover::before {
  border-color: rgba(255, 37, 92, 0.78);

  /* box-shadow: 0 0 14px rgba(255, 37, 92, 0.11); */

  transform: translateX(-1px);
}

/* =========================================================
   REGISTER
========================================================= */

.site-header__btn--primary {
  min-width: 146px;
  padding-right: 18px;

  background:
    linear-gradient(105deg, #d90b4f 0%, #ed0f58 25%, #f71862 55%, #ff285f 80%, #ff3b63 100%) padding-box,
    linear-gradient(110deg, #ff2f66 0%, #ff4775 50%, #ff667f 100%) border-box;

  background-size:
    150% 100%,
    100% 100%;

  animation:
    header-register-gradient 7s ease-in-out infinite,
    header-register-glow 3.6s ease-in-out infinite;
}

/* Register icon box */
.site-header__btn--primary::before {
  display: inline-flex;
  flex: 0 0 34px;

  width: 34px;
  height: 34px;

  content: '';

  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3'/%3E%3Cpath d='M5.5 20v-2.5A5.5 5.5 0 0 1 11 12h2a5.5 5.5 0 0 1 5.5 5.5V20'/%3E%3C/svg%3E") center / 19px 19px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055));

  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 9px;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);

  transition:
    background 200ms ease,
    border-color 200ms ease,
    transform 200ms ease;
}

.site-header__btn--primary:hover {
  color: #fff !important;

  filter: brightness(1.04);

  transform: translateY(-2px);
}

.site-header__btn--primary:hover::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3'/%3E%3Cpath d='M5.5 20v-2.5A5.5 5.5 0 0 1 11 12h2a5.5 5.5 0 0 1 5.5 5.5V20'/%3E%3C/svg%3E") center / 19px 19px no-repeat,
    rgba(255, 255, 255, 0.17);

  border-color: rgba(255, 255, 255, 0.58);

  transform: scale(1.03);
}

/* =========================================================
   REGISTER ANIMATION
========================================================= */

@keyframes header-register-gradient {
  0%,
  100% {
    background-position:
      0% 50%,
      0 0;
  }

  50% {
    background-position:
      100% 50%,
      0 0;
  }
}

/* =========================================================
   TOUCH / REDUCED MOTION
========================================================= */

@media (hover: none) {
  .site-header__btn--ghost:hover,
  .site-header__btn--primary:hover {
    transform: none;
    filter: none;
  }

  .site-header__btn--ghost:hover::before,
  .site-header__btn--primary:hover::before {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header__btn--ghost,
  .site-header__btn--primary,
  .site-header__btn--ghost::before,
  .site-header__btn--primary::before {
    transition: none;
    animation: none;
  }
}

/* =========================================================
   BURGER
========================================================= */

.site-header__burger {
  display: none;
  flex: 0 0 38px;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 38px;
  height: 38px;
  padding: 0;

  color: var(--text);
  background: rgba(255, 255, 255, 0.035);

  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;

  cursor: pointer;

  transition:
    background 200ms ease,
    border-color 200ms ease,
    transform 200ms ease;
}

.site-header__burger:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.17);
}

.site-header__burger:active {
  transform: scale(0.96);
}

.site-header__burger span {
  display: block;

  width: 17px;
  height: 2px;
  margin: 2.5px 0;

  background: currentColor;
  border-radius: 999px;

  transform-origin: center;

  transition:
    transform 220ms ease,
    opacity 180ms ease;
}

body.menu-open .site-header__burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.menu-open .site-header__burger span:nth-child(2) {
  opacity: 0;
}

body.menu-open .site-header__burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   MOBILE MENU
========================================================= */

.mobile-menu {
  position: fixed;
  inset: var(--header-height) 0 0;
  z-index: 9998;

  display: block;

  overflow: hidden;

  background: rgba(16, 16, 26, 0.99);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translateY(-8px);

  transition:
    opacity 220ms ease,
    visibility 220ms ease,
    transform 220ms ease;

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.menu-open .mobile-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform: translateY(0);
}

.mobile-menu__overlay {
  position: absolute;
  inset: 0;
}

.mobile-menu__inner {
  position: relative;
  z-index: 1;

  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;

  width: min(calc(100% - 32px), 620px);
  height: 100%;
  margin-inline: auto;
  padding: 32px 0;

  overflow-y: auto;
}

.mobile-menu__nav {
  width: 100%;
}

.mobile-menu__list {
  display: grid;
  justify-content: center;
  gap: 4px;

  width: 100%;
  margin: 0;
  padding: 0;

  list-style: none;
}

.mobile-menu__list li {
  margin: 0;
  padding: 0;
}

.mobile-menu__list a {
  display: flex;
  align-items: center;

  width: 100%;
  min-height: 56px;
  padding: 11px 4px;

  color: rgba(255, 255, 255, 0.64);

  font-size: clamp(25px, 7vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;

  transition:
    color 200ms ease,
    padding-left 200ms ease,
    transform 200ms ease;
}

.mobile-menu__list a:hover,
.mobile-menu__list .current-menu-item > a {
  color: var(--text);

  padding-left: 10px;
}

.mobile-menu__list a:active {
  transform: scale(0.985);
}

.mobile-menu__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;

  width: 100%;
  margin-top: 28px;
}

.mobile-menu__actions .site-header__btn {
  width: 100%;
  min-height: 46px;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1024px) {
  .site-header__container {
    grid-template-columns: minmax(130px, 1fr) auto minmax(190px, 1fr);
    gap: 20px;
  }

  .site-header__logo,
  .site-header__logo-image,
  .site-header__logo img {
    max-width: 140px;
  }

  .site-header__menu {
    gap: 20px;
  }

  .site-header__menu a {
    font-size: 12px;
  }

  .site-header__btn {
    padding-inline: 14px;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {
  .site-header__container {
    display: flex;
    align-items: center;
    gap: 7px;

    width: min(calc(100% - 20px), var(--container));
  }

  .site-header__logo {
    flex: 0 1 auto;

    max-width: 104px;

    font-size: 16px;
  }

  .site-header__nav {
    display: none;
  }

  .site-header__actions {
    gap: 6px;
    margin-left: auto;
  }

  .site-header__btn {
    min-height: 34px;

    font-size: 11px;
  }

  .site-header__btn--primary {
    min-height: 36px;
    padding: 8px 11px;

    border-radius: 9px;
  }

  .site-header__burger {
    display: flex;
  }

  .mobile-menu__actions {
    display: none;
  }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {
  .site-header__container {
    width: min(calc(100% - 16px), var(--container));
    gap: 5px;
  }

  .site-header__logo {
    max-width: 82px;
  }

  .site-header__logo-image,
  .site-header__logo img {
    max-width: 120px;
    max-height: 46px;
  }

  .site-header__actions {
    gap: 5px;
  }

  .site-header__btn--primary {
    min-height: 34px;
    padding-inline: 9px;

    font-size: 10px;
  }

  .site-header__burger {
    flex-basis: 36px;

    width: 36px;
    height: 36px;
  }

  .mobile-menu__inner {
    width: min(calc(100% - 24px), 620px);
  }

  .mobile-menu__list a {
    min-height: 52px;

    font-size: 25px;
  }
}

/* =========================================================
   MOBILE HEADER ACTIONS — COMPACT
========================================================= */

@media (max-width: 768px) {
  .site-header__actions {
    gap: 5px;
    margin-left: auto;
  }

  .site-header__btn--ghost,
  .site-header__btn--primary {
    gap: 6px;

    min-height: 38px;
    padding: 4px 9px 4px 5px;

    border-radius: 10px;

    font-size: 10px;
  }

  .site-header__btn--ghost {
    min-width: 84px;
  }

  .site-header__btn--primary {
    min-width: 104px;
    padding-right: 10px;
  }

  .site-header__btn--ghost::before,
  .site-header__btn--primary::before {
    flex-basis: 26px;

    width: 26px;
    height: 26px;

    border-radius: 7px;
  }

  .site-header__btn--ghost::before {
    background-size:
      15px 15px,
      auto;
  }

  .site-header__btn--primary::before {
    background-size:
      15px 15px,
      auto;
  }
}

/* =========================================================
   SMALL MOBILE HEADER ACTIONS — COMPACT
========================================================= */

@media (max-width: 420px) {
  .site-header__actions {
    gap: 4px;
  }

  .site-header__btn--ghost,
  .site-header__btn--primary {
    gap: 5px;

    min-height: 34px;
    padding: 3px 7px 3px 4px;

    border-radius: 9px;

    font-size: 9px;
  }

  .site-header__btn--ghost {
    min-width: 76px;
  }

  .site-header__btn--primary {
    min-width: 92px;
    padding-right: 8px;
  }

  .site-header__btn--ghost::before,
  .site-header__btn--primary::before {
    flex-basis: 24px;

    width: 24px;
    height: 24px;

    border-radius: 6px;
  }

  .site-header__btn--ghost::before {
    background-size:
      14px 14px,
      auto;
  }

  .site-header__btn--primary::before {
    background-size:
      14px 14px,
      auto;
  }
}

/* =========================================================
   DESKTOP SAFETY
========================================================= */

@media (min-width: 769px) {
  .site-header__burger {
    display: none;
  }

  .mobile-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* =========================================================
   TOUCH DEVICES
========================================================= */

@media (hover: none) {
  .site-header__logo:hover,
  .site-header__menu a:hover,
  .site-header__btn:hover {
    transform: none;
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .site-header__logo,
  .site-header__menu a,
  .site-header__menu a::after,
  .site-header__btn,
  .site-header__btn--primary::after,
  .site-header__burger,
  .site-header__burger span,
  .mobile-menu,
  .mobile-menu__list a {
    transition: none;
  }
}
