/* ── Unified navigation bar ── */
.topbar {
  position: sticky; top: 0; z-index: 2200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 44px);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15,26,35,.08);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #0f1a23;
  font-weight: 800; font-size: 1.05rem;
}
.brand img { border-radius: 50%; width: 34px; height: 34px; }

.menu-btn {
  display: none; background: transparent;
  border: 1px solid rgba(15,26,35,.10); border-radius: 10px;
  padding: 8px 12px; font-size: 1.1rem; cursor: pointer; color: #0f1a23;
}

.nav-right { display: flex; align-items: center; gap: 4px; }

.nav-pages { display: flex; gap: 4px; align-items: center; }

.nav-pages a, .links a {
  padding: 8px 13px; border-radius: 999px;
  color: #5e6b75; font-weight: 700; font-size: .9rem;
  text-decoration: none; transition: .15s;
}
.nav-pages a:hover, .links a:hover { background: rgba(15,26,35,.06); color: #0f1a23; }
.nav-pages a[aria-current="page"] { background: #0e2433; color: #fff; }

.links { display: flex; gap: 4px; align-items: center; }

.nav-sep {
  width: 1px; height: 22px; background: rgba(15,26,35,.10);
  margin: 0 6px; flex-shrink: 0;
}

.lang-switch {
  display: flex; margin-left: 8px;
  border: 1px solid rgba(15,26,35,.10); border-radius: 999px; overflow: hidden;
}
.lang-switch a {
  padding: 6px 10px; font-size: .82rem; font-weight: 700;
  color: #5e6b75; text-decoration: none; transition: .15s;
}
.lang-switch a:hover { background: rgba(15,26,35,.04); }
.lang-switch a.active { background: #0e2433; color: #fff; }

/* ── Mobile responsive ── */
@media (max-width: 680px) {
  .menu-btn { display: block; }
  .nav-right { display: none; }

  body.menu-open .nav-right {
    display: flex; flex-direction: column; gap: 4px; align-items: stretch;
    position: absolute; right: 16px; top: 58px;
    background: #fff; border: 1px solid rgba(15,26,35,.10);
    border-radius: 16px; padding: 12px; min-width: 200px;
    box-shadow: 0 10px 40px rgba(0,0,0,.12); z-index: 30;
  }
  body.menu-open .nav-pages { display: flex; flex-direction: column; }
  body.menu-open .nav-sep { display: block; width: 100%; height: 1px; margin: 6px 0; }
  body.menu-open .links { display: flex; flex-direction: column; }
  body.menu-open .lang-switch { display: flex; margin: 4px 0 0; }
}

@media screen and (prefers-color-scheme: dark) {
  .topbar {
    background: rgba(18, 24, 32, .88);
    border-bottom-color: rgba(200, 215, 230, .08);
  }

  .brand,
  .menu-btn {
    color: #e4eaf0;
  }

  .menu-btn,
  .lang-switch {
    border-color: rgba(200, 215, 230, .12);
  }

  .nav-pages a,
  .links a,
  .lang-switch a {
    color: #9aabb8;
  }

  .nav-pages a:hover,
  .links a:hover,
  .lang-switch a:hover {
    background: rgba(200, 215, 230, .08);
    color: #e4eaf0;
  }

  .nav-pages a[aria-current="page"],
  .lang-switch a.active {
    background: #8ab4d6;
    color: #0e141a;
  }

  .nav-sep {
    background: rgba(200, 215, 230, .10);
  }

  @media (max-width: 680px) {
    body.menu-open .nav-right {
      background: #1e2a38;
      border-color: rgba(200, 215, 230, .12);
      box-shadow: 0 16px 46px rgba(0, 0, 0, .42);
    }

    body.menu-open .nav-sep {
      background: rgba(200, 215, 230, .10);
    }
  }
}
