/* ==========================================================================
   CodeMist — Header
   ========================================================================== */

.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(10, 18, 14, .22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border);
}

.header__inner {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-width: 0;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--c-text);
  flex-shrink: 0;
}

.header__logo-prompt {
  color: var(--c-accent);
  text-shadow: var(--glow-sm);
}

.header__logo-cursor {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  background: var(--c-accent);
  animation: header-blink 1.1s steps(1) infinite;
  box-shadow: var(--glow-sm);
}

@keyframes header-blink { 50% { opacity: 0; } }

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  font-family: var(--f-mono);
  font-size: var(--fs-sm);
}

.header__nav-link {
  color: var(--c-text-dim);
  position: relative;
  padding: var(--sp-2) 0;
  transition: color var(--dur-base) var(--ease);
}

.header__nav-link:hover,
.header__nav-link[aria-current="page"] { color: var(--c-accent); }

.header__nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--c-accent);
  box-shadow: var(--glow-sm);
  border-radius: var(--radius-pill);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.header__user {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: var(--c-text-dim);
  max-width: 160px;
}

.header__user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.header__avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--c-border-strong);
  flex-shrink: 0;
}

@media (max-width: 780px) {
  .header__nav { display: none; } /* на мобильных навигация переезжает в нижнее меню */
}

@media (max-width: 420px) {
  .header__inner { padding-inline: var(--sp-4); }
  .header__logo { font-size: var(--fs-sm); }
}
