
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Let the ellipse $C$: $\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$ ($a > b > 0$) have its left and right foci as $F_1$ and $F_2$ respectively, and let $A(a, 0)$ and $B(0, b)$ satisfy the condition $|AB| = \frac{\sqrt{2}}{2}|F_1F_2|$.

$(1)$ Find the eccentricity of the ellipse $C$;

$(2)$ If the distance from the origin $O$ to the line $AB$ is $\frac{3\sqrt{3}}{2}$, find the equation of the ellipse $C$;

$(3)$ Under the condition of $(2)$, if a line $l$ passing through point $P(-2,1)$ intersects the ellipse $C$ at points $M$ and $N$, and point $P$ is exactly the midpoint of segment $MN$, find the equation of line $l$.

Present the answer in LaTex format: \boxed{Your answer}
user