// i18n.jsx — bilingual EN/FR dictionary + React context
// Pass `lang` through context. Components call `useT()` and look up keys.
// Quotes/testimonials are NOT translated — they sit in their original tongue.

const I18N = {
  en: {
    nav: { services: 'Services', about: 'About', how: 'Method', contact: 'Contact', book: 'Book a call' },
    hero: {
      eyebrow: 'Paris \u00b7 Independent \u00b7 All founders',
      l1: 'Twenty years', l2: 'of markets.', l3: 'On your side',
      sub: 'Twenty years in financial markets. Ten years building three companies of my own. Six years mentoring fintech founders through incubators. I help tech startups think sharper, ship faster, and reach the people who actually decide.',
      cta1: 'Book a 30-min call', cta2: 'See my offering',
      strip: 'Worked with founders from',
    },
    services: {
      eyebrow: '01 / Services',
      title: 'Three ways I work with founders.',
      cta: 'Discuss',
      list: [
        { tag: 'Founders', title: 'Mentoring',
          body: 'Recurring 1:1s with tech founders. Pitch, narrative, market positioning, deal prep. I challenge your assumptions until they hold \u2014 then we work on what comes after.',
          foot: 'Recurring \u00b7 monthly' },
        { tag: 'Boards', title: 'Strategic review',
          body: 'A high-level review of your business, conduct and decisions. Each quarter, I read the numbers, talk to the team, and give the board a written assessment \u2014 including the calls I would make differently.',
          foot: 'Recurring \u00b7 quarterly' },
        { tag: 'Industry access', title: 'Business development',
          body: 'Warm, targeted intros to brokerage, buy-side and sell-side decision-makers. Twenty years of relationships. I will not make an intro I would not bet on.',
          foot: 'Project basis' },
      ],
    },
    about: {
      eyebrow: '02 / About',
      quote: 'You don\u2019t need another deck reviewer. You need someone who has sat in the seat you\u2019re trying to sell to, and someone who has built a company himself.',
      caption: 'Fabrice \u00b7 Paris',
      p1: 'Twenty years in financial markets. I sat on the trading sell-side and buy-side in Frankfurt and Paris through three crises and a decade of financial market change. I know what makes a decision-maker pick up the phone, or makes them ghost you.',
      p2a: 'Ten years building my own. ', p2b: 'Three companies, founder or co-founder', p2c: ' \u2014 the kind of operating scars that make abstract advice useless and concrete advice cheap.',
      p3a: 'Six years mentoring fintech founders inside ', p3wilco: 'P58', p3b: ', ', p3pnp: 'Wilco', p3c: '', p3swave: '', p3d: ' and a handful of corporate incubators. Strategy, intros, and the occasional honest \u201cdon\u2019t do that\u201d.',
      stats: [
        { n: '20', l: 'years in markets' },
        { n: '3',  l: 'companies built' },
        { n: '6',  l: 'years mentoring' },
        { n: '40+',l: 'founders mentored' },
      ],
    },
    how: {
      eyebrow: '03 / Method',
      title: 'Light process. Short loops. No retainers you can\u2019t leave.',
      steps: [
        { n: '01', t: 'Intro call', d: '30 minutes. Free. You tell me where you\u2019re stuck. I tell you whether I\u2019m the right person.' },
        { n: '02', t: 'Scope',     d: 'One page, written. Outcome, cadence, fee. Signed by email. No agency paperwork.' },
        { n: '03', t: 'Work',      d: 'Weekly cadence for mentoring. One-to-two weeks for a review. Intros happen when they\u2019re ready, not on a timer.' },
        { n: '04', t: 'Out',       d: 'No lock-in. Three-month review on recurring work. Stop whenever it stops being useful.' },
      ],
    },
    testimonials: { eyebrow: '04 / Founders', title: 'What founders say after we work together.' },
    contact: {
      eyebrow: '05 / Get in touch',
      title: 'Tell me what you\u2019re working on.',
      sub: 'A short note is enough. I reply promptly in English or French.',
      lEmail: 'Email', lInPerson: 'In person', lLinkedIn: 'LinkedIn',
      inPerson: 'Paris',
      fName: 'Name', fEmail: 'Email', fTopic: 'What\u2019s the topic?', fMsg: 'One question or one paragraph', send: 'Send',
      phName: 'Camille Laurent', phEmail: 'camille@founder.com', phMsg: 'Where you\u2019re stuck, in plain language.',
      topics: [['mentoring','Mentoring'],['review','Strategic review'],['intros','Business development'],['other','Other']],
      demo: 'Demo only \u2014 message would be sent.',
      sending: 'Sending\u2026',
      okTitle: 'Message sent.',
      okBody: 'Thanks \u2014 it landed in my inbox. I\u2019ll reply promptly, in English or French.',
      again: 'Send another',
      err: 'Something went wrong. Please email hello@beep-consult.com directly.',
      failTitle: 'Couldn\u2019t send just now.',
      failBody: 'The form service is briefly unavailable. Send the same message straight from your email app \u2014 it\u2019s already filled in.',
      failCta: 'Open in email instead',
      retry: 'Try the form again',
    },
    footer: {
      tag: ['Independent fintech', 'advisory. Paris.'],
      services: 'Services', more: 'More', legal: 'Legal',
      mServices: ['Mentoring', 'Strategic review', 'Business development'],
      mMore: ['About', 'Method', 'Contact'],
      mLegal: ['Legal notices', 'Privacy'],
      tech: 'Hosted in Paris',
    },
  },
  fr: {
    nav: { services: 'Services', about: '\u00c0 propos', how: 'M\u00e9thode', contact: 'Contact', book: 'Prendre RDV' },
    hero: {
      eyebrow: 'Paris \u00b7 Ind\u00e9pendant \u00b7 Tous fondateurs',
      l1: 'Vingt ans', l2: 'de march\u00e9s.', l3: '\u00c0 vos c\u00f4t\u00e9s',
      sub: 'Vingt ans sur les march\u00e9s financiers. Dix ans \u00e0 b\u00e2tir trois entreprises. Six ans \u00e0 accompagner des fondateurs fintech au sein d\u2019incubateurs. J\u2019aide les startups tech \u00e0 penser plus juste, livrer plus vite, et atteindre les d\u00e9cideurs qui comptent vraiment.',
      cta1: 'R\u00e9server 30 minutes', cta2: 'Voir mes services',
      strip: 'Fondateurs accompagn\u00e9s de',
    },
    services: {
      eyebrow: '01 / Services',
      title: 'Trois fa\u00e7ons de travailler ensemble.',
      cta: 'En parler',
      list: [
        { tag: 'Fondateurs', title: 'Mentorat',
          body: 'Sessions 1:1 r\u00e9guli\u00e8res avec des fondateurs tech. Pitch, narrative, positionnement, pr\u00e9paration de deal. Je challenge vos hypoth\u00e8ses jusqu\u2019\u00e0 ce qu\u2019elles tiennent.',
          foot: 'R\u00e9current \u00b7 mensuel' },
        { tag: 'Conseils d\u2019administration', title: 'Revue strat\u00e9gique',
          body: 'Une revue de votre business, de votre gouvernance et de vos d\u00e9cisions. Chaque trimestre j\u2019\u00e9change avec l\u2019\u00e9quipe et je remets au board une \u00e9valuation \u00e9crite \u2014 y compris les arbitrages \u00e0 faire.',
          foot: 'R\u00e9current \u00b7 trimestriel' },
        { tag: 'Acc\u00e8s industrie', title: 'Business development',
          body: 'Mises en relation cibl\u00e9es avec les d\u00e9cideurs brokerage, buy-side et sell-side. Vingt ans de relations. Je ne fais pas d\u2019intro sur laquelle je ne parierais pas.',
          foot: 'Au projet' },
      ],
    },
    about: {
      eyebrow: '02 / \u00c0 propos',
      quote: 'Vous n\u2019avez pas besoin d\u2019un \u00e9ni\u00e8me relecteur de pitch. Vous avez besoin de quelqu\u2019un qui a \u00e9t\u00e9 assis \u00e0 la place de la personne que vous essayez de convaincre, et qui a lui-m\u00eame b\u00e2ti une entreprise.',
      caption: 'Fabrice \u00b7 Paris',
      p1: 'Vingt ans sur les march\u00e9s financiers. Trading, sell-side puis buy-side, \u00e0 Francfort et Paris, et \u00e0 travers trois crises et une d\u00e9cennie de transformation technologiques des march\u00e9s. Je comprends comment atteindre un d\u00e9cideur \u2014 ou le perdre.',
      p2a: 'Dix ans \u00e0 construire les miennes. ', p2b: 'Trois entreprises, fondateur ou co-fondateur', p2c: ' \u2014 le genre de cicatrices op\u00e9rationnelles qui rendent les conseils abstraits inutiles, les concrets pr\u00e9cieux.',
      p3a: 'Six ans \u00e0 accompagner des fondateurs fintech au sein de ', p3wilco: 'P58', p3b: ', ', p3pnp: 'Wilco', p3c: '', p3swave: '', p3d: ' et d\u2019une poign\u00e9e d\u2019incubateurs corporate. Strat\u00e9gie, intros, et le franc \u00ab ne fais pas \u00e7a \u00bb quand il le faut.',
      stats: [
        { n: '20', l: 'ans sur les march\u00e9s' },
        { n: '3',  l: 'entreprises b\u00e2ties' },
        { n: '6',  l: 'ans de mentorat' },
        { n: '40+',l: 'fondateurs accompagn\u00e9s' },
      ],
    },
    how: {
      eyebrow: '03 / M\u00e9thode',
      title: 'Processus l\u00e9ger. It\u00e9rations courtes. Engagement flexible.',
      steps: [
        { n: '01', t: 'Premier call', d: '30 minutes. Gratuit. Vous me dites o\u00f9 vous bloquez. Je vous dis si je suis la bonne personne.' },
        { n: '02', t: 'Cadrage',       d: 'Une page, \u00e9crite. Objectif, cadence, honoraires. Sign\u00e9 par email. Aucune paperasse d\u2019agence.' },
        { n: '03', t: 'Mission',       d: 'Cadence hebdomadaire pour le mentorat. Une \u00e0 deux semaines pour une revue. Les intros se font quand elles sont pr\u00eates, pas sur minuteur.' },
        { n: '04', t: 'Sortie',        d: 'Aucun engagement. Revue \u00e0 trois mois pour le r\u00e9current. On arr\u00eate d\u00e8s que \u00e7a cesse d\u2019\u00eatre utile.' },
      ],
    },
    testimonials: { eyebrow: '04 / Fondateurs', title: 'Ce que disent les fondateurs apr\u00e8s leurs missions.' },
    contact: {
      eyebrow: '05 / Contact',
      title: 'Dites-moi sur quoi vous travaillez.',
      sub: 'Quelques lignes suffisent. R\u00e9ponse rapide en anglais ou fran\u00e7ais.',
      lEmail: 'Email', lInPerson: 'Sur place', lLinkedIn: 'LinkedIn',
      inPerson: 'Paris',
      fName: 'Nom', fEmail: 'Email', fTopic: 'Quel est le sujet ?', fMsg: 'Une question ou un paragraphe', send: 'Envoyer',
      phName: 'Camille Laurent', phEmail: 'camille@founder.com', phMsg: 'O\u00f9 vous bloquez, en clair.',
      topics: [['mentoring','Mentorat'],['review','Revue strat\u00e9gique'],['intros','Business development'],['other','Autre']],
      demo: 'D\u00e9mo \u2014 le message serait envoy\u00e9.',
      sending: 'Envoi\u2026',
      okTitle: 'Message envoy\u00e9.',
      okBody: 'Merci \u2014 votre message est bien arriv\u00e9 dans ma bo\u00eete. Je vous r\u00e9ponds rapidement, en fran\u00e7ais ou en anglais.',
      again: 'Envoyer un autre',
      err: 'Une erreur est survenue. \u00c9crivez-moi directement \u00e0 hello@beep-consult.com.',
      failTitle: 'Envoi impossible pour le moment.',
      failBody: 'Le service de formulaire est momentan\u00e9ment indisponible. Envoyez le m\u00eame message depuis votre messagerie \u2014 il est d\u00e9j\u00e0 pr\u00e9-rempli.',
      failCta: 'Ouvrir dans ma messagerie',
      retry: 'R\u00e9essayer le formulaire',
    },
    footer: {
      tag: ['Conseil fintech', 'ind\u00e9pendant. Paris.'],
      services: 'Services', more: 'Plus', legal: 'L\u00e9gal',
      mServices: ['Mentorat', 'Revue strat\u00e9gique', 'Business development'],
      mMore: ['\u00c0 propos', 'M\u00e9thode', 'Contact'],
      mLegal: ['Mentions l\u00e9gales', 'Confidentialit\u00e9'],
      tech: 'H\u00e9berg\u00e9 \u00e0 Paris',
    },
  },
};

const LangContext = React.createContext({ lang: 'en', setLang: () => {} });

const LangProvider = ({ children }) => {
  const [lang, setLangState] = React.useState(() => {
    try { return localStorage.getItem('beep.lang') || 'en'; } catch { return 'en'; }
  });
  const setLang = (l) => {
    setLangState(l);
    try { localStorage.setItem('beep.lang', l); } catch {}
    document.documentElement.setAttribute('lang', l);
  };
  React.useEffect(() => { document.documentElement.setAttribute('lang', lang); }, [lang]);
  return <LangContext.Provider value={{ lang, setLang }}>{children}</LangContext.Provider>;
};

const useLang = () => React.useContext(LangContext);
const useT = () => {
  const { lang } = useLang();
  return I18N[lang] || I18N.en;
};

window.I18N = I18N;
window.LangContext = LangContext;
window.LangProvider = LangProvider;
window.useLang = useLang;
window.useT = useT;
