.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}
.brand .logo { width: 28px; height: 28px; }

.menu {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.menu-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.menu-link:hover { color: var(--blue); }

.has-dropdown { position: relative; }
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  padding: 10px;
}
.has-dropdown:hover .dropdown { display: block; }

/* Allow JS toggle on both desktop & mobile */
.has-dropdown.dropdown-open .dropdown { display: block; }

.dropdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  min-width: 260px;
}
.dropdown-grid a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  display: block;
}
.dropdown-grid a:hover {
  background: var(--soft);
  color: var(--blue);
}

/* Mobile */
.hamburger {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 4px 0;
  border-radius: 2px;
}

@media (max-width: 860px) {
  .hamburger { display: block; }

  .menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
  }
  .nav.open .menu { display: flex; }

  /* Dropdown becomes inline in mobile menu */
  .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    margin-top: 6px;
  }
  .dropdown-grid { grid-template-columns: 1fr; }

  /* Make the Tools link look like a toggle on mobile */
  .has-dropdown > .menu-link { display: flex; justify-content: space-between; align-items: center; }
  .has-dropdown > .menu-link::after {
    content: '▾';
    margin-left: 8px;
    transform: rotate(0deg);
    transition: transform .2s ease;
  }
  .has-dropdown.dropdown-open > .menu-link::after { transform: rotate(180deg); }

  /* Optional: lock page scroll when menu is open */
  .nav-lock body { overflow: hidden; }
}
