npj Natural Hazards, Published online: 29 June 2026; doi:10.1038/s44304-026-00242-3 Attention-based learning for early earthquake magnitude estimation from strong-motion records