:root {
  --primary: #3b6bfd;
  --accent: #9b5bff;
  --text: #e7ebff;
  --bg1: #0a0b1e;
  --bg2: #111433;
}

.tt-header__wrapper {
  position: sticky;
  top: 0;
  z-index: 1050;
}

.tt-header {
  background: linear-gradient(90deg, var(--bg1), var(--bg2));
  color: var(--text);
  font-family: "Space Grotesk", "Inter", "Segoe UI", sans-serif;
  box-shadow: 0 16px 32px rgba(6, 8, 23, 0.45);
  width: 100%;
}

.tt-header__inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.tt-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(150px, 15vw, 210px);
  height: 56px;
  text-decoration: none;
}

.tt-logo__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tt-logo:hover,
.tt-logo:focus {
  outline: none;
  filter: drop-shadow(0 0 10px rgba(231, 235, 255, 0.35));
}

.tt-logo__word,
.tt-logo__accent {
  display: none;
}

.tt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.tt-nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tt-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(231, 235, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.tt-hamburger span:not(.tt-sr-only) {
  display: block;
  width: 20px;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform 0.3s ease;
}

.tt-nav-toggle:checked + .tt-hamburger span:nth-of-type(2) {
  transform: translateY(8px) rotate(45deg);
}

.tt-nav-toggle:checked + .tt-hamburger span:nth-of-type(3) {
  transform: scaleX(0);
}

.tt-nav-toggle:checked + .tt-hamburger span:nth-of-type(4) {
  transform: translateY(-8px) rotate(-45deg);
}

.tt-hamburger:hover,
.tt-hamburger:focus {
  background: rgba(231, 235, 255, 0.12);
  border-color: rgba(231, 235, 255, 0.56);
  outline: none;
}

.tt-nav-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex: 1;
  margin-left: auto;
}

.tt-nav {
  flex: 1;
}

.tt-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.tt-menu__link {
  display: inline-block;
  padding: 0.65rem 0.9rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.tt-menu__link:hover,
.tt-menu__link:focus {
  background: rgba(231, 235, 255, 0.16);
  color: #ffffff;
  outline: none;
}

.tt-menu__link--active,
.tt-menu__link--active:hover,
.tt-menu__link--active:focus {
  background: rgba(231, 235, 255, 0.24);
  color: #ffffff;
  cursor: default;
}

.tt-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.tt-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tt-lang select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid rgba(231, 235, 255, 0.36);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 500;
  padding: 0.55rem 2.75rem 0.55rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.tt-lang select option {
  color: #111433;
  background-color: #ffffff;
}

.tt-lang::after {
  content: "";
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 0.65rem;
  height: 0.35rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23e7ebff' d='M6 8a1 1 0 0 1-.71-.29l-5-5A1 1 0 0 1 1.71.29L6 4.59 10.29.29A1 1 0 0 1 11.71 1.7l-5 5A1 1 0 0 1 6 8Z'/%3E%3C/svg%3E");
  background-size: cover;
  background-repeat: no-repeat;
  transform: translateY(-50%);
  pointer-events: none;
}

.tt-lang select:hover,
.tt-lang select:focus {
  background: rgba(231, 235, 255, 0.16);
  border-color: rgba(231, 235, 255, 0.6);
  outline: none;
}

.tt-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  font-size: 1rem;
  min-height: 48px;
}

.tt-btn--login {
  border-color: var(--primary);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(59, 107, 253, 0.3);
}

.tt-btn--login:hover,
.tt-btn--login:focus {
  background: rgba(59, 107, 253, 0.18);
  color: #ffffff;
  outline: none;
}

.tt-btn--signup {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(155, 91, 255, 0.3);
}

.tt-btn--signup:hover,
.tt-btn--signup:focus {
  background: rgba(155, 91, 255, 0.2);
  color: #ffffff;
  outline: none;
}

.tt-header .btn-out-primary,
.tt-header .btn-out-pcolor2 {
  font-size: 1rem !important;
  padding: 0.75rem 1.75rem !important;
  border-radius: 10px !important;
  line-height: 1.2 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  min-width: 0 !important;
  gap: 0.35rem !important;
  color: var(--text) !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
  min-height: 48px !important;
}

.tt-header .btn-out-primary {
  border: 1px solid var(--primary) !important;
  box-shadow: 0 0 0 1px rgba(59, 107, 253, 0.3) !important;
}

.tt-header .btn-out-primary:hover,
.tt-header .btn-out-primary:focus {
  background: rgba(59, 107, 253, 0.18) !important;
  color: #ffffff !important;
}

.tt-header .btn-out-pcolor2 {
  border: 1px solid var(--accent) !important;
  box-shadow: 0 0 0 1px rgba(155, 91, 255, 0.3) !important;
}

.tt-header .btn-out-pcolor2:hover,
.tt-header .btn-out-pcolor2:focus {
  background: rgba(155, 91, 255, 0.2) !important;
  color: #ffffff !important;
}

.tt-logo:focus-visible,
.tt-hamburger:focus-visible,
.tt-menu__link:focus-visible,
.tt-lang select:focus-visible,
.tt-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(231, 235, 255, 0.28);
}

@media (max-width: 1200px) {
  .tt-header__inner {
    max-width: 100%;
  }
}

@media (max-width: 991px) {
  .tt-header__inner {
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
  }

  .tt-hamburger {
    display: inline-flex;
    margin-left: auto;
  }

  .tt-nav-panel {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-left: 0;
    flex: 0 0 100%;
    padding-bottom: 1rem;
  }

  .tt-nav-toggle:checked ~ .tt-nav-panel {
    display: flex;
  }

  .tt-nav {
    width: 100%;
  }

  .tt-menu {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .tt-menu__link {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .tt-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.9rem;
    width: 100%;
    margin-top: 0.75rem;
  }

  .tt-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .tt-btn {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .tt-logo {
    width: clamp(130px, 40vw, 180px);
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tt-hamburger,
  .tt-menu__link,
  .tt-lang select,
  .tt-btn {
    transition: none;
  }
}
