/* Header styles scoped for HimatGamePL */

.hg-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: linear-gradient(90deg, rgba(5, 7, 17, 0.92), rgba(17, 19, 33, 0.96));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

/* Brand */

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

.hg-header__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
}

.hg-header__logo::after {
  content: none;
}

.hg-header__logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: radial-gradient(circle at 30% 0, var(--color-accent-yellow), var(--color-accent-coral));
  color: #050711;
  font-size: var(--font-size-sm);
  font-weight: 800;
  box-shadow: var(--shadow-md);
}

.hg-header__logo-text {
  font-size: var(--font-size-lg);
}

/* Navigation */

.hg-header__nav {
  display: flex;
  align-items: center;
}

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

.hg-header__nav-item {
  position: relative;
}

.hg-header__nav-link {
  position: relative;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding-block: 6px;
}

.hg-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent-coral));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.hg-header__nav-link:hover,
.hg-header__nav-link:focus-visible {
  color: var(--color-accent-yellow);
}

.hg-header__nav-link:hover::after,
.hg-header__nav-link:focus-visible::after {
  transform: scaleX(1);
}

.hg-header__nav-link--cta {
  padding-inline: 16px;
  padding-block: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent-coral));
  color: #050711;
  box-shadow: var(--shadow-sm);
}

.hg-header__nav-link--cta::after {
  content: none;
}

.hg-header__nav-link--cta:hover,
.hg-header__nav-link--cta:focus-visible {
  filter: brightness(1.05);
  box-shadow: var(--shadow-glow-primary);
}

/* Mobile toggle */

.hg-header__toggle {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(5, 7, 17, 0.85);
  align-items: center;
  justify-content: center;
  padding: 0;
}

.hg-header__toggle:focus-visible {
  outline: 2px solid var(--color-accent-yellow);
  outline-offset: 3px;
}

.hg-header__toggle-bar {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background-color: var(--color-text);
  transition: transform var(--transition-fast), opacity var(--transition-fast), translate var(--transition-fast);
}

.hg-header__toggle-bar + .hg-header__toggle-bar {
  margin-top: 4px;
}

.hg-header__toggle.is-open .hg-header__toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.hg-header__toggle.is-open .hg-header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.hg-header__toggle.is-open .hg-header__toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile layout */

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

  .hg-header__toggle {
    display: inline-flex;
            flex-direction: column;
  }

  .hg-header__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    padding-inline: var(--container-padding-x);
    padding-bottom: var(--space-6);
    background: linear-gradient(180deg, rgba(5, 7, 17, 0.98), rgba(17, 19, 33, 0.98));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transform-origin: top;
  }

  .hg-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    margin-top: var(--space-4);
  }

  /* Progressive enhancement: menu visible by default when no JS */
  .hg-header__nav-list {
    max-height: none;
    opacity: 1;
    transform: translateY(0);
  }

  .js .hg-header__nav-list {
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height var(--transition-slow), opacity var(--transition-normal), transform var(--transition-normal);
  }

  .js .hg-header__nav-list.is-open {
    max-height: 320px;
    opacity: 1;
    transform: translateY(0);
  }

  .hg-header__nav-link {
    font-size: var(--font-size-md);
  }

  .hg-header__nav-item--cta {
    margin-top: var(--space-2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hg-header__toggle-bar,
  .js .hg-header__nav-list {
    transition: none !important;
  }
}