/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 14, 19, .82);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.hbar {
  max-width: 1160px;
  margin: 0 auto;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 22px;
}

/* Brand */
.brand { display: flex; align-items: center; }
.brand-logo { height: 28px; width: auto; display: block; }

/* Top nav */
nav.top { display: flex; gap: 4px; margin-left: 6px; }
nav.top a {
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 13.5px;
  transition: .12s;
}
nav.top a:hover { background: var(--surface-2); color: var(--ink); }
nav.top a.active { color: #fff; background: var(--surface-3); }

/* User badge */
.hbar .sp { flex: 1; }
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 5px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 30px;
  cursor: pointer;
  transition: .12s;
}
.me:hover { border-color: var(--faint); background: var(--surface); }
.me .nm { font-size: 13px; font-weight: 600; }
.me .nm small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.ava {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a4452, #171c24);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 12px;
  color: #fff;
}

/* ── Page wrapper ── */
.wrap { max-width: 1160px; margin: 0 auto; padding: 26px 22px 70px; }

/* ── Footer ── */
footer { border-top: 1px solid var(--line); margin-top: 50px; }
.foot {
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 12.5px;
  flex-wrap: wrap;
  gap: 10px;
}

/* Login button (guest state) */
.btn-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #4c7db1 0%, #2e5480 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: filter .13s, transform .1s;
  box-shadow: 0 2px 12px rgba(60, 110, 180, .3), inset 0 1px 0 rgba(255,255,255,.1);
  white-space: nowrap;
}
.btn-login:hover  { filter: brightness(1.15); transform: translateY(-1px); color: #fff; }
.btn-login:active { filter: brightness(.93);  transform: translateY(0); }
.btn-login svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Avatar in user badge */
.me .ava { overflow: hidden; }
.me .ava img { width: 100%; height: 100%; object-fit: cover; }

/* ── Burger ── */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-2);
  transition: transform .22s ease, opacity .18s ease, width .18s ease;
  transform-origin: center;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav drawer ── */
.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--line-2);
  background: rgba(11, 14, 19, .97);
  backdrop-filter: blur(12px);
  overflow: hidden;
  max-height: 0;
  transition: max-height .28s ease;
}
.mobile-nav.open { max-height: 400px; }
.mobile-nav a {
  display: block;
  padding: 15px 22px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
  transition: background .12s, color .12s;
}
.mobile-nav a:hover, .mobile-nav a.active { background: var(--surface-2); color: var(--ink); }
.mobile-nav a.active { color: #fff; }
.mobile-nav__divider { height: 1px; background: var(--line); margin: 4px 0; }
.mobile-nav__login {
  color: #7db3e0 !important;
  font-weight: 600 !important;
}
.mobile-nav__profile {
  display: flex !important;
  align-items: center;
  gap: 12px;
}
.mobile-nav__profile .ava { width: 28px; height: 28px; font-size: 11px; flex-shrink: 0; }

/* ── Focus ring ── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Responsive ── */
@media (max-width: 860px) {
  nav.top { display: none; }
  .burger { display: flex; }
  .mobile-nav { display: flex; }

  /* Compact login button — icon only on tiny screens */
  .btn-login__text { display: none; }
  .btn-login { padding: 0 10px; gap: 0; }
  .btn-login svg { width: 18px; height: 18px; }

  /* Compact user badge — avatar only */
  .me .nm { display: none; }
  .me { padding: 5px; }

  h1.big, .hero h1 { font-size: 24px; }
}

@media (max-width: 480px) {
  .hbar { gap: 10px; padding: 0 14px; }
}
