/* Header styles for Torvass Hub */

.th-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(5, 6, 10, 0.96), rgba(5, 6, 10, 0.82));
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.th-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
  gap: var(--space-4);
}

/* Brand */

.th-header__brand {
  display: flex;
  align-items: center;
}

.th-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
}

.th-header__logo-mark {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: radial-gradient(circle at 20% 0, rgba(19, 232, 255, 0.8), rgba(13, 110, 253, 0.1));
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.th-header__logo-glow {
  width: 80%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-accent-cyan), var(--color-accent-purple));
  box-shadow: 0 0 18px rgba(19, 232, 255, 0.8);
}

.th-header__title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.th-header__site-name {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.th-header__site-tagline {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-text-muted);
}

/* Navigation */

.th-header__nav {
  display: flex;
}

.th-header__nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.th-header__nav-item--highlight {
  margin-left: var(--space-1);
}

.th-header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding-inline: var(--space-3);
  padding-block: 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  transition:
    color var(--transition-base),
    background var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
  border: 1px solid transparent;
}

.th-header__nav-link:hover,
.th-header__nav-link:focus-visible {
  color: var(--color-text);
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.6);
}

.th-header__nav-link--cta {
  background: radial-gradient(circle at 0 0, rgba(19, 232, 255, 0.5), rgba(13, 110, 253, 0.75));
  color: #020617;
  border-color: rgba(19, 232, 255, 0.9);
  box-shadow: var(--shadow-glow-primary);
}

.th-header__nav-link--cta:hover,
.th-header__nav-link--cta:focus-visible {
  background: radial-gradient(circle at 100% 0, rgba(168, 85, 255, 0.7), rgba(13, 110, 253, 0.95));
  color: #020617;
}

.th-header__nav-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mobile toggle */

.th-header__nav-toggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding-inline: var(--space-3);
  padding-block: 0.45rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.th-header__nav-toggle-icon {
  position: relative;
  width: 18px;
  height: 14px;
}

.th-header__nav-toggle-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--color-text);
  transform-origin: center;
  transition: transform var(--transition-base), opacity var(--transition-base), top var(--transition-base), bottom var(--transition-base);
}

.th-header__nav-toggle-line:first-child {
  top: 0;
}

.th-header__nav-toggle-line:last-child {
  bottom: 0;
}

.th-header__nav-toggle[aria-expanded="true"] .th-header__nav-toggle-line:first-child {
  top: 6px;
  transform: rotate(45deg);
}

.th-header__nav-toggle[aria-expanded="true"] .th-header__nav-toggle-line:last-child {
  bottom: 6px;
  transform: rotate(-45deg);
}

.th-header__nav-toggle-text {
  white-space: nowrap;
}

/* Responsive */

@media (max-width: 768px) {
  .th-header__inner {
    padding-block: var(--space-2);
  }

  .th-header__nav-toggle {
    display: inline-flex;
  }

  .th-header__nav {
    position: fixed;
    inset-inline: 0;
    top: 56px;
    background: radial-gradient(circle at top, rgba(19, 232, 255, 0.16), transparent 55%),
      linear-gradient(to bottom, rgba(5, 6, 10, 0.98), rgba(5, 6, 10, 0.96));
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition-base), opacity var(--transition-base), visibility var(--transition-base);
  }

  .th-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-3) var(--space-4) var(--space-4);
  }

  .th-header__nav-link {
    width: 100%;
    justify-content: space-between;
  }

  .th-header__nav--open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 480px) {
  .th-header__site-name {
    font-size: var(--font-size-md);
  }

  .th-header__site-tagline {
    display: none;
  }
}

@media (min-width: 769px) {
  .th-header__nav-toggle {
    display: none;
  }

  .th-header__nav {
    position: static;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: transparent;
    border: 0;
  }
}

/* Utility class for body when mobile menu open */

.th-header--menu-open {
  overflow: hidden;
}