:root {
  --nf-header-brand-font: Changa, Inter, Arial, sans-serif;
  --nf-header-primary: #e0473c;
  --nf-header-gradient-start: #ff7b6e;
  --nf-header-gradient-mid: #e9584d;
  --nf-header-gradient-end: #d23d33;
  --nf-header-border: #a2362f;
  --nf-header-shadow: rgba(224, 71, 60, 0.18);
  --nf-header-bg: rgba(11, 12, 14, 0.95);
  --nf-header-text: #e6e9ee;
  --nf-header-muted: #ccc;
}

.nf-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nf-header-bg);
  border-bottom: 2px solid var(--nf-header-primary);
}

.nf-header-container {
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 24px);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nf-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  color: var(--nf-header-text);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}

.nf-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: white;
  flex: 0 0 auto;
}

.nf-brand-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.nf-brand span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--nf-header-brand-font);
  font-weight: 700;
}

.nf-brand span.nf-brand-font-loading {
  opacity: 0;
}

.nf-nav-links {
  display: flex;
  gap: clamp(8px, 2vw, 20px);
  align-items: center;
  flex-wrap: nowrap;
  margin-left: auto;
  justify-content: flex-end;
}

.nf-nav-links a {
  color: var(--nf-header-muted);
  text-decoration: none;
  font-size: clamp(11px, 2vw, 14px);
}

.nf-nav-links a:hover,
.nf-nav-links a[aria-current="page"] {
  color: var(--nf-header-primary);
}

.nf-nav-links .nf-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--nf-header-gradient-start) 0%, var(--nf-header-gradient-mid) 48%, var(--nf-header-gradient-end) 100%);
  color: white;
  font-weight: 600;
  border: 2px solid var(--nf-header-border);
  box-shadow: 0 4px 12px var(--nf-header-shadow);
}

.nf-mobile-actions {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  position: relative;
}

.nf-login-link {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--nf-header-border);
  background: linear-gradient(180deg, var(--nf-header-gradient-start) 0%, var(--nf-header-gradient-mid) 48%, var(--nf-header-gradient-end) 100%);
  box-shadow: 0 4px 12px var(--nf-header-shadow);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
  text-decoration: none;
}

.nf-nav-links .nf-login-link {
  color: white;
  margin-left: 4px;
}

.nf-nav-links .nf-login-link:hover {
  color: white;
}

.nf-auth-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nf-profile-link {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--nf-header-border);
  background: rgba(15, 17, 19, 0.72);
  box-shadow: 0 4px 12px var(--nf-header-shadow);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px 0 7px;
  text-decoration: none;
  overflow: hidden;
}

.nf-profile-link:hover,
.nf-profile-link:focus-visible {
  border-color: var(--nf-header-primary);
  outline: none;
}

.nf-profile-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--nf-header-gradient-start) 0%, var(--nf-header-gradient-mid) 48%, var(--nf-header-gradient-end) 100%);
  color: white;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
}

.nf-profile-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.nf-profile-avatar img + span {
  display: none;
}

.nf-profile-name {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: white;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.nf-menu-toggle {
  width: 28px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--nf-header-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nf-menu-toggle span {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  display: block;
}

.nf-menu-toggle:hover,
.nf-menu-toggle[aria-expanded="true"] {
  color: var(--nf-header-text);
}

.nf-mobile-menu {
  display: none;
}

@media (max-width: 768px) {
  .nf-header-container {
    height: 52px;
    gap: 8px;
    padding: 0 10px;
  }

  .nf-brand {
    font-size: 13px;
    letter-spacing: 0;
  }

  .nf-brand-icon {
    width: 30px;
    height: 30px;
  }

  .nf-brand-icon img {
    width: 19px;
    height: 19px;
  }

  .nf-nav-links {
    display: none;
  }

  .nf-mobile-actions {
    display: flex;
  }

  .nf-login-link,
  .nf-profile-link,
  .nf-menu-toggle {
    min-height: 32px;
  }

  .nf-profile-link {
    min-width: 32px;
    height: 32px;
    gap: 6px;
    padding: 0 9px 0 5px;
  }

  .nf-profile-avatar {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    border-radius: 6px;
    font-size: 12px;
  }

  .nf-profile-name {
    max-width: 68px;
  }

  .nf-menu-toggle {
    width: 28px;
  }

  .nf-mobile-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: max-content;
    max-width: calc(100vw - 20px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 6px;
    background: rgba(13, 14, 16, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
  }

  .nf-mobile-menu[hidden] {
    display: none;
  }

  .nf-mobile-menu a {
    min-height: 31px;
    border-radius: 6px;
    color: var(--nf-header-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 9px;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
  }

  .nf-mobile-menu a:hover,
  .nf-mobile-menu a[aria-current="page"] {
    color: var(--nf-header-primary);
    background: rgba(255, 255, 255, 0.06);
  }
}
