A1 · The word agrees with the speaker or the thing
Agreement — gender, you, thank you
Obrigado is about you, not them. Articles and possessives match the noun: o meu pai, a minha mãe. And 'you' is a relationship: tu with friends, o senhor / a senhora with older strangers.
Obrigado. / Obrigada.
Thank you (man speaking / woman speaking).
O meu café. A minha bica.
My coffee. My espresso. (noun gender)
Como está, senhora Silva?
How are you, Mrs Silva? (polite)