// Hatch × Malachyte — Welcome / pitch step
function StepWelcome({ onStart, state, setState }) {
  const personas = window.PERSONAS;
  const setPersona = (id) => setState(s => ({ ...s, persona: id, favorites: [] }));

  return (
    <div className="welcome-shell">
      <div className="welcome-logos">
        <img src="assets/hatch-logo.png" alt="HATCH" className="logo-hatch" />
        <span className="sep" />
        <img src="assets/malachyte-logo-gradient.png" alt="Malachyte" className="logo-mal" />
      </div>

      <div style={{ textAlign: 'center', display: 'flex', flexDirection: 'column', gap: 12, alignItems: 'center' }}>
        <div className="welcome-eye">Phase 1 POC · New Arrivals PLP</div>
        <h1 className="welcome-title">Hatch Collection Demo</h1>
      </div>

      <div className="welcome-compare">
        <div className="compare-card compare-card--before">
          <div className="compare-icon"><img src="assets/hatch-logo.png" alt="" /></div>
          <div>
            <h4>Hatch today</h4>
            <p>
              96 new arrivals, one fixed order for every visitor. A postpartum mom looking for
              nursing pieces and a trend-chaser in her first trimester see the exact same grid —
              sorted by price, anchored by the $278 Maisie Dress.
            </p>
          </div>
        </div>
        <div className="compare-card compare-card--after">
          <div className="compare-icon"><img src="assets/malachyte-symbol-gradient.png" alt="" /></div>
          <div>
            <h4>With Malachyte</h4>
            <p>
              Same 96 products, re-ranked by lifecycle stage · style signals · nursing intent.
              A new mom sees nursing-compatible pieces and recovery loungewear first. A style-forward
              shopper sees statement dresses and patterns. No two visitors see the same grid.
            </p>
          </div>
        </div>
      </div>

      <button className="btn btn-mal" onClick={onStart}>Open the New Arrivals PLP →</button>
    </div>
  );
}

function PortraitWithSignals({ persona }) {
  const anchors = ['wp-sig--tl', 'wp-sig--tr', 'wp-sig--bl', 'wp-sig--br'];
  return (
    <div className="wp-portrait-wrap">
      <div className="wp-portrait">
        <img src={persona.img} alt={persona.name} />
      </div>
      {(persona.signals || []).slice(0, 4).map((s, i) => (
        <span key={i} className={`wp-sig ${anchors[i]} wp-sig--${s.tone || 'amber'}`}>{s.label}</span>
      ))}
    </div>
  );
}

Object.assign(window, { StepWelcome, PortraitWithSignals });
