To solve this optimization problem, we first need to define the decision variables and the objective function. Let's denote the number of kilograms of mixture A to be made as `x` and the number of kilograms of mixture B to be made as `y`. The objective is to maximize profit, which can be calculated based on the profits per kilogram of each mixture.

Given:
- 30 kilograms of gummy bears
- 25 kilograms of gummy worms
- Mixture A: 75% gummy bears, 25% gummy worms
- Mixture B: 40% gummy bears, 60% gummy worms
- Profit per kilogram of mixture A: $30
- Profit per kilogram of mixture B: $40

The objective function to maximize profit can be written as:
\[ \text{Maximize} \quad 30x + 40y \]

Constraints are based on the availability of gummy bears and gummy worms. For gummy bears, considering that mixture A uses 75% and mixture B uses 40%, we have:
\[ 0.75x + 0.40y \leq 30 \]
For gummy worms, since mixture A uses 25% and mixture B uses 60%, we have:
\[ 0.25x + 0.60y \leq 25 \]

Also, \( x \geq 0 \) and \( y \geq 0 \), as the quantities of mixtures cannot be negative.

Now, let's translate this problem into Gurobi code in Python:

```python
from gurobipy import *

# Create a model
m = Model("Gummy_Mixtures")

# Define decision variables
x = m.addVar(lb=0, name="Mixture_A")
y = m.addVar(lb=0, name="Mixture_B")

# Objective function: Maximize profit
m.setObjective(30*x + 40*y, GRB.MAXIMIZE)

# Constraints
m.addConstr(0.75*x + 0.40*y <= 30, "Gummy_Bears_Constraint")
m.addConstr(0.25*x + 0.60*y <= 25, "Gummy_Worms_Constraint")

# Optimize the model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print(f"Optimal solution: x = {x.x}, y = {y.x}")
    print(f"Maximum profit: {m.objVal}")
else:
    print("No optimal solution found")
```