This is the 12th move of this game I played as white: https://lichess.org/b7B16RLF/white#22
[FEN ""]
1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d3 Bc5 5. Be3 { C65 Ruy Lopez: Berlin Defense, Kaufmann Variation } Bxe3 6. fxe3 d6 7. d4 Bd7 8. Nc3 O-O 9. Qe2 a6 10. Ba4?! { (0.06 → -0.77) Inaccuracy. Bd3 was best. } (10. Bd3) 10... h6?! { (-0.77 → -0.21) Inaccuracy. exd4 was best. } (10... exd4 11. exd4 Re8 12. Bb3 Na5 13. O-O b5 14. Qd2 b4 15. Nd5 Nxe4 16. Qxb4 c5 17. Qa3) 11. O-O-O Qe7?! { (-0.73 → 0.20) Inaccuracy. b5 was best. } (11... b5 12. Bb3) 12. h3? { (0.20 → -1.24) Mistake. d5 was best. } (12. d5 Nb8) 12... b5 13. Bb3 Rab8?! { (-1.27 → -0.46) Inaccuracy. Na5 was best. } (13... Na5) 14. g4 h5?? { (-0.22 → 3.88) Blunder. Na5 was best. } (14... Na5 15. dxe5 dxe5 16. Rhg1 b4 17. Nd5 Nxd5 18. exd5 e4 19. Nd4 Rb6 20. Kb1 Rd6 21. Bc4) 15. g5 Nh7 16. Rdg1?? { (3.87 → 0.90) Blunder. g6 was best. } (16. g6 Kh8 17. Bxf7 exd4 18. Nd5 Qxe4 19. Ng5 Qh4 20. Nxh7 Rxf7 21. gxf7 Kxh7 22. Rhg1 Bf5) 16... Ra8?? { (0.90 → 4.30) Blunder. g6 was best. } (16... g6) 17. Nd5 Qd8 18. Qg2?? { (4.35 → 1.82) Blunder. g6 was best. } (18. g6 Kh8 19. gxh7 g6 20. Qd2 Rb8 21. dxe5 dxe5 22. Qc3 b4 23. Qd3 Rb5 24. c4 Rc5) 18... f6?? { (1.82 → Mate in 2) Checkmate is now unavoidable. g6 was best. } (18... g6 19. Nf6+ Kh8 20. dxe5 a5 21. Bd5 a4 22. Rd1 Ra6 23. Bxc6 Bxc6 24. Qg3 b4 25. Rh2) 19. gxf6?! { (Mate in 2 → 11.14) Lost forced checkmate sequence. Ne7+ was best. } (19. Ne7+ Kh8 20. Ng6#) 19... Nxf6?! { (11.14 → Mate in 1) Checkmate is now unavoidable. Rf7 was best. } (19... Rf7 20. Ne7+ Kf8 21. Bxf7 Bg4 22. hxg4 Kxf7 23. gxh5 Qxe7 24. Qxg7+ Ke8 25. fxe7 Nxe7 26. dxe5) 20. Qxg7# { White wins by checkmate. } 1-0
We had castled opposite site, and I wanted to start an attack on Black's king. Hence the move h3. Stockfish instead wants me to play d5.
What are the dangers of h3 in this case? What's the idea behind d5? Is there a way to play h3 safely in this position?