Visualize a Recursive Acronym
APL (Dyalog Extended), 33 32 bytes

-1 byte thanks to Bubbler.



Anonymous infix lambda. Takes count as left argument and string as right argument.

{('\b',⊃¨⍵⊆⍨≠⍵)⎕R(1⌽')(',⍵)⍣⍺⊢⍵}


Try it online!

{…} "dfn"; number is ⍺ and text is ⍵:

 ⊢⍵ on the text:

 ⍣⍺ repeat given number of times

 (…)⎕R(…) PCRE Replace:

  ')(',⍵ the text prefixed by ")("

  1⌽ cyclically rotated one step left (puts ")" at end)

  … with:

  ≠⍵ The mask of non-spaces in the text

  ⍵⊆⍨ characters runs in the text corresponding to runs of 1s in that

  ⊃¨ first character of each

 '\b', prepend PCRE for word boundary