// landing-tweaks.jsx — Wisbid expressive tweaks panel.
// Three controls that reshape feel, not single properties:
//   • Mood     — Editorial (warm light) / Frosted (glassy mid-day) / Midnight (inverted dark)
//   • Voice    — Calm / Bold / Quiet — overall type rhythm + heading weight + tracking
//   • Motion   — Lively / Easeful / Off — global scroll-reveal + animation tempo
//
// Each tweak sets a few CSS vars on <html data-tweak-...> that other stylesheets
// already key off via attribute selectors below. No layout rewrites.

(function () {
  const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
    "mood": "editorial",
    "voice": "calm",
    "motion": "lively"
  }/*EDITMODE-END*/;

  const WisbidTweaks = () => {
    const [t, setTweak] = useTweaks(TWEAK_DEFAULTS);

    // Push attribute selectors onto <html> so they cascade to everything.
    useEffect(() => {
      const html = document.documentElement;
      html.setAttribute("data-tweak-mood", t.mood);
      html.setAttribute("data-tweak-voice", t.voice);
      html.setAttribute("data-tweak-motion", t.motion);
    }, [t.mood, t.voice, t.motion]);

    return (
      <TweaksPanel>
        <TweakSection label="Mood" />
        <TweakRadio
          label="Surface"
          value={t.mood}
          options={["editorial", "frosted", "midnight"]}
          onChange={(v) => setTweak("mood", v)}
        />

        <TweakSection label="Voice" />
        <TweakRadio
          label="Type rhythm"
          value={t.voice}
          options={["calm", "bold", "quiet"]}
          onChange={(v) => setTweak("voice", v)}
        />

        <TweakSection label="Motion" />
        <TweakRadio
          label="Tempo"
          value={t.motion}
          options={["lively", "easeful", "off"]}
          onChange={(v) => setTweak("motion", v)}
        />
      </TweaksPanel>
    );
  };

  window.WisbidTweaks = WisbidTweaks;
})();
