Prep the oven and pan: Preheat the oven to 375°F (190°C).
Grease a 9x13-inch baking dish with butter or cooking spray.
Slice the potatoes: Use a mandoline or a sharp knife to slice the potatoes 1/8-inch thick. Keep slices in a bowl of cold water while you work to prevent browning. Drain and pat dry before layering.
Sauté the aromatics: In a medium pot, heat butter and olive oil over medium heat.
Add onion and cook until soft and translucent, about 5–7 minutes. Stir in garlic and cook 30 seconds.
Make the sauce: Sprinkle in the flour and cook, stirring, for 1 minute. Slowly whisk in the milk, then the cream, until smooth.
Add Dijon, salt, pepper, paprika, and thyme. Simmer 3–5 minutes, whisking, until slightly thickened.
Add some cheese to the sauce: Off the heat, whisk in 1 cup cheddar and 1/2 cup Gruyère until melted. Taste and adjust seasoning.
The sauce should be well-salted since it flavors the potatoes.
Layer the dish: Arrange half the potatoes in the dish, slightly overlapping. Pour over half the sauce. Sprinkle with 1/2 cup cheddar, 1/4 cup Gruyère, and 2 tablespoons Parmesan.
Repeat with remaining potatoes, sauce, and cheeses, reserving a little Parmesan for the top.
Cover and bake: Cover tightly with foil and bake 40 minutes. This steams the potatoes so they become tender without the top over-browning.
Uncover and finish: Remove foil and bake another 20–30 minutes, until the top is deeply golden and the potatoes are easily pierced with a knife.
Rest before serving: Let the dish rest 15 minutes. This allows the sauce to set and makes neat slices easier.
Garnish (optional): Sprinkle with extra thyme or chopped chives for a fresh pop of color.