// Signature.jsx — email signatures, plain text + minimal HTML.
// Per brief §8.6: plain text retains the telex line. HTML version is
// essentially monospaced. No images, no banners, no social rule.

function PlainTextSignature() {
  const text = [
    '--',
    'William S. Fraser',
    'Office of the Corporate Secretary',
    'North Atlantic Semiconductor, Inc.',
    '',
    'Telex         510-3211 NATLSEMI',
    'Marine cable  NATLSEMI NEW YORK',
    '',
    'The Company does not accept correspondence by post,',
    'telephone or facsimile.',
  ].join('\n');

  return (
    <div style={{
      width: 520, background:'#fff', padding:'24px 26px',
      boxShadow:'inset 0 0 0 1px #ececec',
      fontFamily:'"IBM Plex Mono", monospace',
      fontSize: 12, lineHeight: 1.55, color:'#222',
    }}>
      <div style={{
        fontFamily:'"IBM Plex Mono", monospace', fontSize: 9,
        letterSpacing:'0.08em', color:'#666', marginBottom: 12,
      }}>
        PLAIN TEXT — TELEX RETAINED
      </div>
      <pre style={{
        margin: 0, fontFamily:'inherit', fontSize: 'inherit', lineHeight:'inherit',
        whiteSpace:'pre-wrap', color:'#111',
      }}>{text}</pre>
    </div>
  );
}

function HtmlSignature({ palette = 'B', mark = 'A', markComp = null }) {
  const p = PALETTES[palette];
  return (
    <div style={{
      width: 520, background:'#fff', padding:'24px 26px',
      boxShadow:'inset 0 0 0 1px #ececec',
      fontFamily:'"IBM Plex Mono", monospace',
      fontSize: 11, lineHeight: 1.55, color:'#222',
    }}>
      <div style={{
        fontFamily:'"IBM Plex Mono", monospace', fontSize: 9,
        letterSpacing:'0.08em', color:'#666', marginBottom: 12,
      }}>
        HTML — MONOSPACED
      </div>

      {/* The signature itself */}
      <div style={{ borderTop:`2px solid ${p.accent}`, paddingTop: 10 }}>
        <div style={{ marginBottom: 8 }}>
          <Lockup palette={palette} mark={mark} size={8.4} markComp={markComp} />
        </div>
        <div style={{ fontSize: 11.5, lineHeight: 1.55 }}>
          <div style={{ fontWeight: 600 }}>William&nbsp;S.&nbsp;Fraser</div>
          <div>Office of the Corporate Secretary</div>
          <div style={{ marginTop: 8 }}>Telex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;510-3211 NATLSEMI</div>
          <div>Marine cable&nbsp;&nbsp;NATLSEMI NEW YORK</div>
          <div style={{ marginTop: 8, fontSize: 10, color:'#666' }}>
            The Company does not accept correspondence by<br/>
            post, telephone or facsimile.
          </div>
        </div>
        <div style={{
          marginTop: 12, paddingTop: 8, borderTop:'1px solid #ddd',
          fontSize: 9, color:'#666',
        }}>
          North Atlantic Semiconductor, Inc.&nbsp;&nbsp;·&nbsp;&nbsp;North Atlantic Semiconductor Ltd
        </div>
      </div>
    </div>
  );
}

Object.assign(window, { PlainTextSignature, HtmlSignature });
