Exploiting the sensitivity of the IRAM NOrthern Extended Millimeter Array (NOEMA) and its ability to process large instantaneous bandwidths, we have studied the morphology and other properties of the molecular gas and dust in the starburst galaxy, H-ATLAS J131611.5+281219 (HerBS-89a), at z=2.95. High angular resolution (0 ′′ . 3) images reveal a partial 1 ′′ . 0 diameter Einstein ring in the dust continuum emission and the molecular emission lines of 12 CO (9-8) and H 2 O (2 02 − 1 11 ). Together with lower angular resolution (0 ′′ . 6) images, we report the detection of a series of molecular lines including the three fundamental transitions of the molecular ion OH + , namely (1 1 − 0 1 ), (1 2 − 0 1 ) and (1 0 − 0 1 ), seen in absorption; the molecular ion CH + (1 − 0) seen in absorption (and tentatively in emission); two transitions of amidogen (NH 2 ), namely (2 02 − 1 11 ) and (2 20 − 2 11 ) seen in emission; and HCN(11 − 10) and/or NH(1 2 − 0 1 ) seen in absorption. The NOEMA data are complemented with Very Large Array data tracing the 12 CO(1 − 0) emission line, which provides a measurement of the total mass of molecular gas and an anchor for a CO excitation analysis. In addition, we present Hubble Space Telescope imaging that reveals the foreground lensing galaxy in the near-infrared (1.15µm). Together with photometric data from the Gran Telescopio Canarias, we derive a photometric redshift of z phot = 0.9 +0.3 −0.5 for the foreground lensing galaxy. Modelling the lensing of HerBS-89a, we reconstruct the dust continuum (magnified by a factor µ ≃ 5.0) and molecular emission lines (magnified by µ ∼ 4 − 5) in the source plane, which probe scales of ∼ 0 ′′ . 1 (or 800 pc). The 12 CO(9 − 8) and H 2 O (2 02 − 1 11 ) emission lines have comparable spatial and kinematic distributions; the source-plane reconstructions do not clearly distinguish between a one-component and a two-component scenario, but the latter, which reveals two compact rotating components with sizes of ≈ 1 kpc, that are likely merging, more naturally accounts for the broad line widths observed in HerBS-89a. In the core of HerBS-89a, very dense gas with n H 2 ∼ 10 7−9 cm −3 is revealed by the NH 2 emission lines and the possible HCN(11 − 10) absorption line. HerBS-89a is a powerful star forming galaxy with a molecular gas mass of M mol = (2.1 ± 0.4) × 10 11 M ⊙ , an infrared luminosity of L IR = (4.6 ± 0.4) × 10 12 L ⊙ , and a dust mass of M dust = (2.6 ± 0.2) × 10 9 M ⊙ , yielding a dust-to-gas ratio δ GDR ≈ 80. We derive a star formation rate SFR = 614 ± 59 M ⊙ yr −1 and a depletion timescale τ depl = (3.4 ± 1.0) × 10 8 years. The OH + and CH + absorption lines, which trace low (∼ 100 cm −3 ) density molecular gas, all have their main velocity component red-shifted by ∆V ∼ 100 km s −1 relative to the global CO reservoir. We argue that these absorption lines trace a rare example of gas inflow towards the center of a starburst galaxy, indicating that HerBS-89a is accreting gas from its surroundings.