  We study foliations by chord-arc Jordan curves of the twice punctured Riemann
sphere $\mathbb C \smallsetminus \{0\}$ using the Loewner-Kufarev equation. We
associate to such a foliation a function on the plane that describes the "local
winding" along each leaf. Our main theorem is that this function has finite
Dirichlet energy if and only if the Loewner driving measure $\rho$ has finite
Loewner-Kufarev energy, defined by $$S(\rho) = \frac{1}{2}\iint_{S^1 \times
\mathbb{R}} \nu_t'(\theta)^2 \, d \theta d t$$ whenever $\rho$ is of the form
$\nu_t(\theta)^2 d \theta d t$, and set to $\infty$ otherwise. Moreover, if
either of these two energies is finite they are equal up to a constant factor,
and in this case, the foliation leaves are Weil-Petersson quasicircles.
  This duality between energies has several consequences. The first is that the
Loewner-Kufarev energy is reversible, that is, invariant under inversion and
time-reversal of the foliation. Furthermore, the Loewner energy of a Jordan
curve can be expressed using the minimal Loewner-Kufarev energy of those
measures that generate the curve as a leaf. This provides a new and
quantitative characterization of Weil-Petersson quasicircles. Finally, we
consider conformal distortion of the foliation and show that the
Loewner-Kufarev energy satisfies an exact transformation law involving the
Schwarzian derivative. The proof of our main theorem uses an isometry between
the Dirichlet energy space on the unit disc and $L^2(2\rho)$ that we construct
using Hadamard's variational formula expressed by means of the Loewner-Kufarev
equation. Our results are related to $\kappa$-parameter duality and large
deviations of Schramm-Loewner evolutions coupled with Gaussian random fields.
