/* =========================================================
   HEX WEB — HEADER
   Tailwind-compatible glassmorphism header
   Desktop + Android/mobile responsive
   ========================================================= */

.hex-header {
  padding: 8px 8px 0;
  pointer-events: none;
}

.hex-header-shell {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(12, 15, 22, 0.72);
  box-shadow:
    0 10px 35px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.hex-brand {
  text-decoration: none;
}

.hex-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background:
    linear-gradient(
      145deg,
      rgba(124, 92, 255, 0.28),
      rgba(255, 255, 255, 0.035)
    );
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 5px 18px rgba(0, 0, 0, 0.16);
}

.hex-nav-link {
  position: relative;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 12px;
  color: #8f99aa;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.hex-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.07);
}

.hex-nav-link.is-active {
  color: #fff;
  background: rgba(124, 92, 255, 0.13);
  border-color: rgba(124, 92, 255, 0.22);
}

.hex-glass-btn,
.hex-github-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: #cbd2dd;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.hex-glass-btn {
  width: 38px;
  padding: 0;
  cursor: pointer;
}

.hex-github-btn {
  padding: 0 13px;
}

.hex-glass-btn:hover,
.hex-github-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.14);
}

.hex-glass-btn:active,
.hex-github-btn:active {
  transform: scale(0.97);
}

.hex-icon {
  width: 17px;
  height: 17px;
}

.hex-mobile-menu {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.hex-mobile-menu span {
  display: block;
  width: 17px;
  height: 1.5px;
  border-radius: 999px;
  background: #cbd2dd;
  transition: transform 180ms ease, opacity 180ms ease;
}

.hex-mobile-menu.is-open span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.hex-mobile-menu.is-open span:nth-child(2) {
  opacity: 0;
}

.hex-mobile-menu.is-open span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.hex-mobile-panel {
  pointer-events: auto;
  width: min(100%, 1500px);
  margin: 8px auto 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  background: rgba(12, 15, 22, 0.84);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.hex-mobile-panel.hidden {
  display: none;
}

.hex-mobile-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 13px;
  background: transparent;
  color: #9aa4b4;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.hex-mobile-link:hover,
.hex-mobile-link.is-active {
  border-color: rgba(124, 92, 255, 0.2);
  background: rgba(124, 92, 255, 0.11);
  color: #fff;
}

/* Safe area for Android devices with display cutouts */
@supports (padding: env(safe-area-inset-top)) {
  .hex-header {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }
}

/* Small Android screens */
@media (max-width: 380px) {
  .hex-header-shell {
    height: 58px;
    border-radius: 14px;
  }

  .hex-brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
  }

  .hex-mobile-menu {
    width: 36px;
    height: 36px;
  }
}

/* Reduce transparency/animation when requested by OS */
@media (prefers-reduced-motion: reduce) {
  .hex-nav-link,
  .hex-glass-btn,
  .hex-github-btn,
  .hex-mobile-menu span {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .hex-header-shell,
  .hex-mobile-panel {
    background: #0c0f16;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
