// ========== Krossnote i18n ==========
// Lightweight FR/EN translation system with a language switcher.
// Usage:
//   const t = useT();        // hook returns a translate function
//   t('nav.home')            // returns translated string
// Switching language re-renders the whole app via a top-level state in useLang.

(function () {
  const STORAGE_KEY = "krossnote-lang";

  const DICT = {
    fr: {
      // ---- Nav (shared) ----
      "nav.home": "Accueil",
      "nav.features": "Fonctionnalités",
      "nav.pricing": "Tarifs",
      "nav.login": "Connexion",
      "nav.demo": "Demander une démo",

      // ---- Footer (shared) ----
      "footer.tagline":
        "Logiciel d'inspection pour le génie civil. De l'annotation terrain au rapport client, sans recopie.",
      "footer.product": "Produit",
      "footer.company": "Entreprise",
      "footer.contact": "Contact",
      "footer.about": "À propos",
      "footer.legal": "Mentions légales",
      "footer.rgpd": "RGPD",
      "footer.linkedin": "LinkedIn Krossnote",
      "footer.copyright": "© 2026 Krossnote — Tous droits réservés",
      "footer.location": "Marseille · France",

      // ---- Final CTA (shared) ----
      "cta.eyebrow": "Demander une démo",
      "cta.title.a": "Voyez Krossnote sur ",
      "cta.title.em": "vos plans",
      "cta.title.b": " en 30 minutes.",
      "cta.lead":
        "Dites-nous quelques mots sur vos missions. On vous rappelle et on vous montre Krossnote sur un ouvrage qui ressemble aux vôtres.",
      "cta.book": "Réserver un créneau",
      "cta.modules": "Voir les modules",
      "cta.back": "Retour à l'accueil",

      // ---- Landing: Hero ----
      "hero.eyebrow": "Logiciel d'inspection · Génie civil",
      "hero.title.a": "Vos croquis terrain deviennent vos ",
      "hero.title.em": "livrables clients.",
      "hero.lead": "Dessinez sur plan, relevez vos désordres, et laissez l'IA structurer vos rapports. Krossnote permet de gagner 50% de temps au bureau.",
      "hero.cta1": "Demander une démo",
      "hero.cta2": "Découvrir les modules",
      "hero.meta1.num": "5 000+",
      "hero.meta1.label": "Inspections réalisées",
      "hero.meta2.num": "20+",
      "hero.meta2.label": "Bureaux d'études",
      "hero.meta3.num": "DWG · DOCX",
      "hero.meta3.label": "Formats natifs",
      "hero.alt": "Mur de béton fissuré et son relevé blueprint annoté",

      // ---- Landing: Proof ----
      "proof.eyebrow": "Ils nous font confiance",
      "proof.stat.em": "5 000+",
      "proof.stat.text": " inspections réalisées avec Krossnote",
      "proof.sub":
        "20+ Bureaux d'études en génie civil, intervenant sur les ouvrages d'art, tunnels et viaducs.",

      // ---- Landing: Audience ----
      "aud.eyebrow": "Pour qui et quoi ?",
      "aud.title": "Bureaux d'études en génie civil. De l'annotation terrain au rapport client, sans recopie.",
      "aud.lead": "Krossnote accompagne deux missions clés des bureaux d'études : l'inspection d'ouvrages et le diagnostic structurel ou reconnaissance structurelle. Un outil unique, deux modules métier pensés pour le terrain.",
      "aud.card1.num": "01 / Module Plan & Rapport",
      "aud.card1.title": "Inspection d'ouvrages",
      "aud.card1.li1":
        "Annotez vos plans de désordres directement sur le terrain, avec votre légende",
      "aud.card1.li2": "Capturez photos, textes, vocaux dans un seul outil",
      "aud.card1.li3":
        "Générez vos rapports IQOA à partir de vos propres trames",
      "aud.card2.num": "02 / Module Diagnostic",
      "aud.card2.title": "Diagnostic structurel",
      "aud.card2.li1":
        "Saisissez vos sondages dans un carnet de mission digital",
      "aud.card2.li2":
        "Obtenez des coupes structurelles propres, exportables en DWG",
      "aud.card2.li3":
        "Produisez vos rapports de diagnostic depuis vos données terrain",
      "aud.cta.note":
        "30 min pour découvrir si Krossnote s'adapte à vos missions.",

      // ---- Landing: Value ----
      "val.eyebrow": "Quelle valeur ?",
      "val.title": "Trois gains concrets, mesurables à la première mission.",
      "val.b1.num": "01 · Module Plan",
      "val.b1.title": "Dessinez sur le terrain comme sur un croquis — le plan est prêt, rien à recopier au bureau.",
      "val.b1.body": "Utilisez des outils de dessin pensés pour le terrain et l'inspection. Personnalisez votre légende, travaillez hors connexion, et retrouvez vos relevés prêts à finaliser au bureau.",
      "val.b1.li1": "Sélectionnez un désordre et dessinez — couleur, calque et hachures automatiques",
      "val.b1.li2": "Accrochage intelligent et outils libres (lignes, polygones, textes)",
      "val.b1.li3": "Mode hors-ligne complet avec synchronisation au retour du réseau",
      "val.b2.num": "02 · Module Rapport",
      "val.b2.title": "Des données terrain au rapport client en quelques clics.",
      "val.b2.body": "Prenez vos photos, vos notes vocales sur le terrain et importez vos rapports précédents. L'IA les organise dans votre trame de rapport — vous ajustez et exportez en DOCX.",
      "val.b2.li1": "Concaténation intelligente des rapports précédents",
      "val.b2.li2":
        "Tri automatique par partie d'ouvrage, photos et constatations",
      "val.b2.li3": "Export DOCX fidèle à votre charte graphique",
      "val.b3.num": "03 · Module Diagnostic",
      "val.b3.title": "Des relevés de sondage aux coupes CAD, automatiquement.",
      "val.b3.body":
        "Relevez dimensions et aciers sur le terrain, visualisez vos coupes en temps réel sur mobile. Exportez vos coupes DWG et fiches sondages DOCX prêtes à intégrer au rapport.",
      "val.b3.li1":
        "Carnet de mission digital : dimensions, aciers, cadres, étriers",
      "val.b3.li2": "Coupes structurelles rendues en live pendant la saisie",
      "val.b3.li3": "Exports DWG, SVG et DOCX (fiches prêtes)",

      // ---- Landing: Cross-platform ----
      "cross.eyebrow": "Cross-platform · Collaboration",
      "cross.title":
        "Terrain, bureau, en déplacement — vos données vous suivent.",
      "cross.lead":
        "Krossnote fonctionne sur tablette, smartphone et desktop. Votre équipe accède aux mêmes données, où qu'elle soit — avec un mode hors-ligne complet qui se synchronise au retour du réseau.",
      "cross.t1.label": "Tablette & smartphone · chantier",
      "cross.t1.meta": "App · offline",
      "cross.t2.label": "Desktop · bureau d'études",
      "cross.t2.meta": "Web · temps réel",
      "cross.t3.label": "Collaboration multi-inspecteurs",
      "cross.t3.meta": "Suivi des versions",

      // ---- Landing: Process ----
      "proc.eyebrow": "Process client",
      "proc.title": "Comment ça marche ?",
      "proc.lead":
        "30 minutes pour savoir si Krossnote s'adapte à vos missions.",
      "proc.step": "ÉTAPE",
      "proc.s1.t": "Prenez contact",
      "proc.s1.d":
        "Dites-nous si vous faites de l'inspection, du diagnostic, ou les deux.",
      "proc.s2.t": "On vous montre",
      "proc.s2.d":
        "En 30 min, on fait le point sur votre process et on vous montre Krossnote en action.",
      "proc.s3.t": "On s'adapte",
      "proc.s3.d":
        "Vous recevez un devis adapté à vos besoins et à votre volume de missions.",
      "proc.s4.t": "Vous êtes autonomes",
      "proc.s4.d":
        "Formation d'1h au module dessin pour prendre en main l'outil rapidement.",
      "proc.outcome": "Résultat : du temps gagné dès votre première mission.",

      // ---- Features page hero ----
      "feat.eyebrow": "Fonctionnalités",
      "feat.title.a": "Trois modules, une ",
      "feat.title.em": "chaîne complète",
      "feat.title.b": " du terrain au livrable.",
      "feat.sub":
        "Plan, Rapport, Diagnostic — Krossnote couvre l'ensemble de vos missions d'inspection d'ouvrages et de diagnostic structurel, avec des exports DWG et DOCX natifs.",
      "feat.cta.note":
        "30 min pour découvrir si Krossnote s'adapte à vos missions.",

      // ---- Tarifs page ----
      "tar.eyebrow": "Tarifs",
      "tar.title.a": "Un tarif ",
      "tar.title.em": "adapté",
      "tar.title.b": " à votre volume de missions.",
      "tar.sub":
        "Pas de prix public : on fait le point ensemble en 30 min, et on vous envoie un devis taillé pour vos besoins.",
      "tar.how.eyebrow": "Comment on calcule",
      "tar.how.title": "Trois critères, un devis clair.",
      "tar.how.c1.t": "Modules activés",
      "tar.how.c1.d":
        "Plan, Rapport, Diagnostic — vous payez ce dont vous avez besoin.",
      "tar.how.c2.t": "Nombre d'inspecteurs",
      "tar.how.c2.d":
        "Comptes nominatifs pour le terrain et le bureau d'études.",
      "tar.how.c3.t": "Volume de missions",
      "tar.how.c3.d":
        "Le tarif s'ajuste à votre cadence — quelques missions par mois ou des dizaines.",
      "tar.in.eyebrow": "Inclus dans tous les forfaits",
      "tar.in.li1": "Mises à jour produit en continu",
      "tar.in.li2": "Mode hors-ligne complet",
      "tar.in.li3": "Synchronisation multi-inspecteurs",
      "tar.in.li4": "Exports DWG et DOCX natifs",
      "tar.in.li5": "Formation d'1h au module dessin",
      "tar.in.li6": "Support par email et visio",
      "tar.contact": "Demander un devis",
      "tar.cta.note": "Réponse sous 24h ouvrées.",

      // ---- Features modules content (structured) ----
      "feat.m1.eyebrow": "Module 01 · Plan",
      "feat.m1.title": "Relevé de désordres",
      "feat.m1.lead": "Annotez vos plans DWG directement sur le terrain, prêts à être joints à votre rapport.",
      "feat.m1.f1.num": "01 · Fonds de plan",
      "feat.m1.f1.title": "Partez du bon support pour chaque mission.",
      "feat.m1.f1.lead":
        "Quel que soit l'état de votre documentation, commencez votre relevé sans perdre de temps.",
      "feat.m1.f1.b1": "Importez vos plans DWG existants",
      "feat.m1.f1.b2": "Importez des PDF ou des images comme fond de plan",
      "feat.m1.f1.b3":
        "Créez un plan de zéro avec les outils de dessin intégrés",
      "feat.m1.f1.b4":
        "Générez des fonds de plan cotés à partir de modèles paramétriques d'ouvrages",
      "feat.m1.f1.stage": "Fonds de plan · DWG / PDF / image",
      "feat.m1.f2.num": "02 · Outils de dessin",
      "feat.m1.f2.title": "Des outils pensés pour le terrain",
      "feat.m1.f2.lead": "Dessinez vos désordres à la volée, comme sur papier.",
      "feat.m1.f2.b1": "Sélectionnez un désordre et dessinez — couleur, calque et hachures s'appliquent automatiquement",
      "feat.m1.f2.b2": "Outils de dessin libres (lignes, polygones, textes)",
      "feat.m1.f2.b3": "Accrochage intelligent pour des tracés précis",
      "feat.m1.f2.b4": "Optimisé pour l'utilisation au stylet",
      "feat.m1.f2.stage": "Dessin sur plan · stylet",
      "feat.m1.f3.num": "03 · Légende et paramétrage",
      "feat.m1.f3.title": "Retrouvez votre charte graphique dans chaque livrable.",
      "feat.m1.f3.lead": "Créez des légendes partagées au sein de vos équipes",
      "feat.m1.f3.b1": "Personnalisez vos couleurs, hachures et symboles",
      "feat.m1.f3.b2": "Gérez vos calques comme dans un logiciel CAD",
      "feat.m1.f3.b3": "Définissez vos échelles de texte",
      "feat.m1.f3.b4": "Votre charte est directement créée dans le dessin",
      "feat.m1.f3.stage": "Légende · calques · échelles",
      "feat.m1.f4.num": "04 · Collaboration et terrain",
      "feat.m1.f4.title": "Travaillez à plusieurs, même sans réseau.",
      "feat.m1.f4.lead":
        "Plusieurs inspecteurs sur le même ouvrage, zéro conflit de versions.",
      "feat.m1.f4.b1":
        "Suivi des versions lorsque plusieurs inspecteurs travaillent sur un même plan",
      "feat.m1.f4.b2":
        "Mode hors-ligne complet — synchronisation au retour du réseau",
      "feat.m1.f4.stage": "Collaboration · offline sync",

      "feat.m2.eyebrow": "Module 02 · Rapport",
      "feat.m2.title": "Observations et rapport d'inspection",
      "feat.m2.lead":
        "Capturez vos données terrain et produisez des rapports personnalisés assistés par l'IA, sans ressaisie.",
      "feat.m2.f1.num": "01 · Observations terrain",
      "feat.m2.f1.title": "Relevez vos données depuis votre smartphone.",
      "feat.m2.f1.lead":
        "Vocal, photo, texte — tout ce dont vous avez besoin pour capturer une inspection.",
      "feat.m2.f1.b1": "Dictez vos observations en vocal",
      "feat.m2.f1.b2": "Prenez et annotez vos photos directement dans l'app",
      "feat.m2.f1.b3": "Ajoutez des notes texte à chaque observation",
      "feat.m2.f1.stage": "Observations · vocal / photo / texte",
      "feat.m2.f2.num": "02 · Informations générales",
      "feat.m2.f2.title": "Préremplissez votre rapport sans ressaisie.",
      "feat.m2.f2.lead":
        "L'IA lit vos rapports précédents et remplit la trame à votre place.",
      "feat.m2.f2.b1":
        "Intégrez des champs personnalisables dans votre trame, adaptés à chaque inspection",
      "feat.m2.f2.b2":
        "Demandez à l'IA d'extraire les informations du rapport précédent",
      "feat.m2.f2.stage": "Trame · champs personnalisés · IA",
      "feat.m2.f3.num": "03 · Section photographique",
      "feat.m2.f3.title": "Organisez vos photos terrain en quelques gestes.",
      "feat.m2.f3.lead":
        "Triez, commentez, associez — en quelques secondes par partie d'ouvrage.",
      "feat.m2.f3.b1": "Triez vos photos par partie d'ouvrage rapidement",
      "feat.m2.f3.b2":
        "Ajoutez commentaires et localisation manuellement ou via l'IA",
      "feat.m2.f3.b3":
        "Associez des photos entre elles pour créer des constatations",
      "feat.m2.f3.b4":
        "Paramétrez l'export des photos dans le corps du rapport ou en annexe",
      "feat.m2.f3.stage": "Section photos · tri · IA",
      "feat.m2.f4.num": "04 · Section constatations",
      "feat.m2.f4.title": "Documentez chaque désordre de manière structurée.",
      "feat.m2.f4.lead":
        "Catalogues IQOA natifs ou personnalisés, format d'export libre.",
      "feat.m2.f4.b1": "Créez et éditez les constatations par partie d'ouvrage",
      "feat.m2.f4.b2":
        "Utilisez les catalogues IQOA ou vos catalogues personnalisés",
      "feat.m2.f4.b3":
        "Notez chaque constatation depuis le catalogue ou manuellement",
      "feat.m2.f4.b4":
        "Paramétrez le format d'export : tableau, liste, avec ou sans photo",
      "feat.m2.f4.stage": "Constatations · catalogues IQOA",
      "feat.m2.f5.num": "05 · Section vue d'ensemble",
      "feat.m2.f5.title": "Gérez les vues d'ensemble de l'ouvrage.",
      "feat.m2.f5.lead": "Une vue par partie, exportable dans le rapport ou en annexe.",
      "feat.m2.f5.b1": "Définissez des vues d'ensemble pour l'ouvrage et ses parties",
      "feat.m2.f5.b2": "Paramétrez l'export de ces vues dans le rapport ou en annexe",
      "feat.m2.f5.stage": "Vues d'ensemble · ouvrage / parties",

      "feat.m3.eyebrow": "Module 03 · Diagnostic",
      "feat.m3.title": "Diagnostic structurel",
      "feat.m3.lead":
        "Relevez vos sondages sur le terrain et exportez des coupes et fiches propres, prêtes pour le rapport.",
      "feat.m3.f1.num": "01 · Carnet de mission",
      "feat.m3.f1.title": "Saisissez vos données de sondage directement sur le terrain.",
      "feat.m3.f1.lead": "Visualisez la coupe en direct pendant que vous saisissez aciers filants, cadres et étriers.",
      "feat.m3.f1.b1": "Renseignez les données de vos sondages et carottages (dimensions, aciers, cadres, étriers)",
      "feat.m3.f1.b2": "Visualisez les coupes des éléments structuraux en temps réel pendant la saisie",
      "feat.m3.f1.b3": "Fonctionne hors connexion — synchronisation au retour du réseau",
      "feat.m3.f1.stage": "Carnet · sondages · coupes live",
      "feat.m3.f2.num": "02 · Export",
      "feat.m3.f2.title": "Des livrables propres, directement exploitables.",
      "feat.m3.f2.lead":
        "DWG coté et DOCX formaté — prêts à coller dans votre rapport.",
      "feat.m3.f2.b1":
        "Fichiers CAD : coupes exportées dans un fichier DWG, organisées dans une grille propre",
      "feat.m3.f2.b2":
        "Fichiers DOCX : fiches sondages prêtes à intégrer directement dans votre rapport",
      "feat.m3.f2.stage": "Export DWG · DOCX",
      "feat.m3.f3.num": "03 · Collaboration",
      "feat.m3.f3.title": "Travaillez à plusieurs sur une même mission.",
      "feat.m3.f3.lead":
        "Plusieurs inspecteurs, un seul carnet — en temps réel.",
      "feat.m3.f3.b1":
        "Collaboration en temps réel : visualisez les saisies des autres inspecteurs en direct",
      "feat.m3.f3.b2":
        "Mode hors-ligne complet — synchronisation au retour du réseau",
      "feat.m3.f3.stage": "Collaboration temps réel",

      "feat.subnav.plan": "Plan",
      "feat.subnav.rapport": "Rapport",
      "feat.subnav.diagnostic": "Diagnostic",

      // ---- Modal démo ----
      "modal.eyebrow": "Demander une démo",
      "modal.title": "Parlez-nous de vos missions",
      "modal.lead": "30 minutes pour voir Krossnote sur un ouvrage qui ressemble aux vôtres.",
      "modal.prenom": "Prénom",
      "modal.nom": "Nom",
      "modal.email": "Adresse e-mail",
      "modal.raison": "Raison de votre demande",
      "modal.raison.placeholder": "Ex : inspection d'ouvrages d'art, diagnostic structurel…",
      "modal.submit": "Envoyer la demande",
      "modal.sending": "Envoi en cours…",
      "modal.success.title": "Demande envoyée !",
      "modal.success.body": "Nous vous recontacterons dans les 24 h pour planifier votre démo.",
      "modal.success.close": "Fermer",
      "modal.error": "Une erreur est survenue. Écrivez-nous à francois@diagnosticrapid.fr.",
    },

    en: {
      // ---- Nav ----
      "nav.home": "Home",
      "nav.features": "Features",
      "nav.pricing": "Pricing",
      "nav.login": "Sign in",
      "nav.demo": "Request a demo",

      // ---- Footer ----
      "footer.tagline":
        "Inspection software for civil engineering. From field annotation to client deliverable, without rekeying.",
      "footer.product": "Product",
      "footer.company": "Company",
      "footer.contact": "Contact",
      "footer.about": "About",
      "footer.legal": "Legal notice",
      "footer.rgpd": "GDPR",
      "footer.linkedin": "Krossnote on LinkedIn",
      "footer.copyright": "© 2026 Krossnote — All rights reserved",
      "footer.location": "Marseille · France",

      // ---- Final CTA ----
      "cta.eyebrow": "Request a demo",
      "cta.title.a": "See Krossnote on ",
      "cta.title.em": "your drawings",
      "cta.title.b": " in 30 minutes.",
      "cta.lead":
        "Tell us a few words about your missions. We'll call you back and show you Krossnote on a structure similar to yours.",
      "cta.book": "Book a slot",
      "cta.modules": "View the modules",
      "cta.back": "Back to home",

      // ---- Landing: Hero ----
      "hero.eyebrow": "Inspection software · Civil engineering",
      "hero.title.a": "Your field sketches become your ",
      "hero.title.em": "client deliverables.",
      "hero.lead": "Draw on the plan, log defects, and let AI structure your reports. Krossnote saves 50% of office time.",
      "hero.cta1": "Request a demo",
      "hero.cta2": "Discover the modules",
      "hero.meta1.num": "5,000+",
      "hero.meta1.label": "Inspections completed",
      "hero.meta2.num": "20+",
      "hero.meta2.label": "Engineering firms",
      "hero.meta3.num": "DWG · DOCX",
      "hero.meta3.label": "Native exports",
      "hero.alt": "Cracked concrete wall and its annotated blueprint survey",

      // ---- Landing: Proof ----
      "proof.eyebrow": "Trusted by",
      "proof.stat.em": "5,000+",
      "proof.stat.text": " inspections completed with Krossnote",
      "proof.sub": "Civil engineering consultancies working on bridges and structures.",

      // ---- Landing: Audience ----
      "aud.eyebrow": "Who is it for?",
      "aud.title": "Civil engineering consultancies. From field annotation to client report, without rekeying.",
      "aud.lead": "Krossnote supports two key missions for engineering firms: structural inspection and structural diagnosis or structural assessment. One tool, two purpose-built modules designed for the field.",
      "aud.card1.num": "01 / Plan & Report module",
      "aud.card1.title": "Structural inspection",
      "aud.card1.li1":
        "Annotate defect plans directly on site, using your own legend",
      "aud.card1.li2": "Capture photos, text and voice notes in a single tool",
      "aud.card1.li3": "Generate IQOA-style reports from your own templates",
      "aud.card2.num": "02 / Diagnostic module",
      "aud.card2.title": "Structural diagnosis",
      "aud.card2.li1": "Log your sampling in a digital field notebook",
      "aud.card2.li2": "Get clean structural sections, exportable as DWG",
      "aud.card2.li3":
        "Produce your diagnostic reports straight from field data",
      "aud.cta.note": "30 minutes to find out if Krossnote fits your missions.",

      // ---- Landing: Value ----
      "val.eyebrow": "What value?",
      "val.title": "Three concrete gains, measurable on your first mission.",
      "val.b1.num": "01 · Plan module",
      "val.b1.title": "Draw on site as you would on paper — the plan is ready, no rekeying at the office.",
      "val.b1.body": "Use drawing tools designed for the field and inspection work. Customise your legend, work offline, and find your surveys ready to finalise back at the office.",
      "val.b1.li1": "Pick a defect and draw — colour, layer and hatching apply automatically",
      "val.b1.li2": "Smart snapping and free drawing tools (lines, polygons, text)",
      "val.b1.li3": "Full offline mode with sync when the network returns",
      "val.b2.num": "02 · Report module",
      "val.b2.title": "From field data to client report in a few clicks.",
      "val.b2.body": "Take photos and voice notes in the field, then import your previous reports. AI organises them into your report template — you adjust and export to DOCX.",
      "val.b2.li1": "Smart consolidation of previous reports",
      "val.b2.li2": "Automatic sorting by structural part, photos and findings",
      "val.b2.li3": "DOCX export faithful to your visual identity",
      "val.b3.num": "03 · Diagnostic module",
      "val.b3.title": "From sampling logs to CAD sections, automatically.",
      "val.b3.body":
        "Capture dimensions and rebar on the field, see your sections render live on mobile. Export your DWG sections and DOCX sampling sheets, ready to drop into the report.",
      "val.b3.li1": "Digital field notebook: dimensions, rebar, stirrups, ties",
      "val.b3.li2": "Structural sections rendered live as you input data",
      "val.b3.li3": "Exports as DWG, SVG and DOCX (ready-made sheets)",

      // ---- Cross-platform ----
      "cross.eyebrow": "Cross-platform · Collaboration",
      "cross.title": "Field, office, on the move — your data follows you.",
      "cross.lead":
        "Krossnote runs on tablet, smartphone and desktop. Your team accesses the same data wherever they are — with a full offline mode that syncs as soon as the network is back.",
      "cross.t1.label": "Tablet & smartphone · on site",
      "cross.t1.meta": "App · offline",
      "cross.t2.label": "Desktop · office",
      "cross.t2.meta": "Web · real-time",
      "cross.t3.label": "Multi-inspector collaboration",
      "cross.t3.meta": "Version tracking",

      // ---- Process ----
      "proc.eyebrow": "Client process",
      "proc.title": "How does it work?",
      "proc.lead": "30 minutes to find out if Krossnote fits your missions.",
      "proc.step": "STEP",
      "proc.s1.t": "Get in touch",
      "proc.s1.d": "Tell us if you do inspection, diagnosis, or both.",
      "proc.s2.t": "We show you",
      "proc.s2.d":
        "In 30 minutes we review your process and show you Krossnote in action.",
      "proc.s3.t": "We adapt",
      "proc.s3.d":
        "You get a quote tailored to your needs and your mission volume.",
      "proc.s4.t": "You're autonomous",
      "proc.s4.d":
        "1-hour training on the drawing module to get up to speed quickly.",
      "proc.outcome": "Outcome: time saved from your very first mission.",

      // ---- Features page hero ----
      "feat.eyebrow": "Features",
      "feat.title.a": "Three modules, ",
      "feat.title.em": "one complete chain",
      "feat.title.b": " from field to deliverable.",
      "feat.sub":
        "Plan, Report, Diagnostic — Krossnote covers all your structural inspection and structural diagnosis missions, with native DWG and DOCX exports.",
      "feat.cta.note":
        "30 minutes to find out if Krossnote fits your missions.",

      // ---- Tarifs ----
      "tar.eyebrow": "Pricing",
      "tar.title.a": "Pricing ",
      "tar.title.em": "tailored",
      "tar.title.b": " to your mission volume.",
      "tar.sub":
        "No public price list: we review your needs together in 30 minutes and send you a tailored quote.",
      "tar.how.eyebrow": "How we price",
      "tar.how.title": "Three criteria, one clear quote.",
      "tar.how.c1.t": "Active modules",
      "tar.how.c1.d": "Plan, Report, Diagnostic — pay for what you need.",
      "tar.how.c2.t": "Number of inspectors",
      "tar.how.c2.d": "Named seats for the field and the office.",
      "tar.how.c3.t": "Mission volume",
      "tar.how.c3.d":
        "Pricing scales with your cadence — a few missions a month or dozens.",
      "tar.in.eyebrow": "Included in every plan",
      "tar.in.li1": "Continuous product updates",
      "tar.in.li2": "Full offline mode",
      "tar.in.li3": "Multi-inspector synchronisation",
      "tar.in.li4": "Native DWG and DOCX exports",
      "tar.in.li5": "1-hour training on the drawing module",
      "tar.in.li6": "Email and video support",
      "tar.contact": "Request a quote",
      "tar.cta.note": "Reply within 24 business hours.",

      // ---- Features modules content ----
      "feat.m1.eyebrow": "Module 01 · Plan",
      "feat.m1.title": "Defect survey",
      "feat.m1.lead": "Annotate your DWG plans directly on site, ready to attach to your report.",
      "feat.m1.f1.num": "01 · Base plans",
      "feat.m1.f1.title": "Start from the right base for every mission.",
      "feat.m1.f1.lead":
        "Whatever the state of your documentation, start your survey without losing time.",
      "feat.m1.f1.b1": "Import your existing DWG plans",
      "feat.m1.f1.b2": "Import PDFs or images as a base plan",
      "feat.m1.f1.b3":
        "Create a plan from scratch with the built-in drawing tools",
      "feat.m1.f1.b4":
        "Generate dimensioned base plans from parametric structure templates",
      "feat.m1.f1.stage": "Base plans · DWG / PDF / image",
      "feat.m1.f2.num": "02 · Drawing tools",
      "feat.m1.f2.title": "Tools designed for the field.",
      "feat.m1.f2.lead": "Sketch defects on the fly, as you would on paper.",
      "feat.m1.f2.b1": "Pick a defect and draw — colour, layer and hatching apply automatically",
      "feat.m1.f2.b2": "Free drawing tools (lines, polygons, text)",
      "feat.m1.f2.b3": "Smart snapping for precise tracings",
      "feat.m1.f2.b4": "Optimised for stylus use",
      "feat.m1.f2.stage": "Drawing on plan · stylus",
      "feat.m1.f3.num": "03 · Legend and settings",
      "feat.m1.f3.title": "Find your visual identity in every deliverable.",
      "feat.m1.f3.lead": "Create legends shared across your teams.",
      "feat.m1.f3.b1": "Customise your colours, hatching and symbols",
      "feat.m1.f3.b2": "Manage your layers as you would in CAD software",
      "feat.m1.f3.b3": "Define your text scales",
      "feat.m1.f3.b4": "Your legend is created directly within the drawing",
      "feat.m1.f3.stage": "Legend · layers · scales",
      "feat.m1.f4.num": "04 · Collaboration and field",
      "feat.m1.f4.title": "Work as a team, even without a network.",
      "feat.m1.f4.lead":
        "Several inspectors on the same structure, zero version conflicts.",
      "feat.m1.f4.b1":
        "Version tracking when several inspectors work on the same plan",
      "feat.m1.f4.b2": "Full offline mode — sync when the network returns",
      "feat.m1.f4.stage": "Collaboration · offline sync",

      "feat.m2.eyebrow": "Module 02 · Report",
      "feat.m2.title": "Observations and inspection report",
      "feat.m2.lead":
        "Capture field data and produce custom AI-assisted reports, without rekeying.",
      "feat.m2.f1.num": "01 · Field observations",
      "feat.m2.f1.title": "Capture data straight from your smartphone.",
      "feat.m2.f1.lead":
        "Voice, photo, text — everything you need to capture an inspection.",
      "feat.m2.f1.b1": "Dictate your observations by voice",
      "feat.m2.f1.b2": "Take and annotate photos directly in the app",
      "feat.m2.f1.b3": "Add text notes to each observation",
      "feat.m2.f1.stage": "Observations · voice / photo / text",
      "feat.m2.f2.num": "02 · General information",
      "feat.m2.f2.title": "Pre-fill your report without rekeying.",
      "feat.m2.f2.lead":
        "AI reads your previous reports and fills the template for you.",
      "feat.m2.f2.b1":
        "Plug customisable fields into your template, suited to each inspection",
      "feat.m2.f2.b2": "Ask AI to extract information from the previous report",
      "feat.m2.f2.stage": "Template · custom fields · AI",
      "feat.m2.f3.num": "03 · Photo section",
      "feat.m2.f3.title": "Organise field photos in a few gestures.",
      "feat.m2.f3.lead": "Sort, comment, link — seconds per structural part.",
      "feat.m2.f3.b1": "Sort photos by structural part quickly",
      "feat.m2.f3.b2": "Add comments and location manually or via AI",
      "feat.m2.f3.b3": "Link photos together to build findings",
      "feat.m2.f3.b4":
        "Configure photo export in the report body or as an annex",
      "feat.m2.f3.stage": "Photo section · sort · AI",
      "feat.m2.f4.num": "04 · Findings section",
      "feat.m2.f4.title": "Document each defect in a structured way.",
      "feat.m2.f4.lead":
        "Native or custom IQOA catalogues, free export format.",
      "feat.m2.f4.b1": "Create and edit findings by structural part",
      "feat.m2.f4.b2": "Use IQOA catalogues or your own custom ones",
      "feat.m2.f4.b3": "Score each finding from the catalogue or manually",
      "feat.m2.f4.b4":
        "Configure export format: table, list, with or without photo",
      "feat.m2.f4.stage": "Findings · IQOA catalogues",
      "feat.m2.f5.num": "05 · Overview section",
      "feat.m2.f5.title": "Set the overall views of your assets.",
      "feat.m2.f5.lead": "One view per part, exportable in the report or as an annex.",
      "feat.m2.f5.b1": "Define overview views for the structure and its parts",
      "feat.m2.f5.b2":
        "Configure export of these views in the report or as an annex",
      "feat.m2.f5.stage": "Overviews · structure / parts",

      "feat.m3.eyebrow": "Module 03 · Diagnostic",
      "feat.m3.title": "Structural diagnosis",
      "feat.m3.lead":
        "Capture your sampling on site and export clean sections and sheets, ready for the report.",
      "feat.m3.f1.num": "01 · Field notebook",
      "feat.m3.f1.title": "Capture sampling data directly on site.",
      "feat.m3.f1.lead": "See the section live as you input longitudinal rebar, stirrups and ties.",
      "feat.m3.f1.b1": "Capture sampling and core data (dimensions, rebar, stirrups, ties)",
      "feat.m3.f1.b2": "See structural element sections rendered live during input",
      "feat.m3.f1.b3": "Works offline — sync when the network returns",
      "feat.m3.f1.stage": "Notebook · sampling · live sections",
      "feat.m3.f2.num": "02 · Export",
      "feat.m3.f2.title": "Clean deliverables, directly usable.",
      "feat.m3.f2.lead":
        "Dimensioned DWG and formatted DOCX — ready to drop into your report.",
      "feat.m3.f2.b1":
        "CAD files: sections exported as DWG, organised on a clean grid",
      "feat.m3.f2.b2":
        "DOCX files: sampling sheets ready to integrate directly into your report",
      "feat.m3.f2.stage": "Export DWG · DOCX",
      "feat.m3.f3.num": "03 · Collaboration",
      "feat.m3.f3.title": "Work together on the same mission.",
      "feat.m3.f3.lead": "Several inspectors, one notebook — in real time.",
      "feat.m3.f3.b1":
        "Real-time collaboration: see other inspectors' input live",
      "feat.m3.f3.b2": "Full offline mode — sync when the network returns",
      "feat.m3.f3.stage": "Real-time collaboration",

      "feat.subnav.plan": "Plan",
      "feat.subnav.rapport": "Report",
      "feat.subnav.diagnostic": "Diagnostic",

      // ---- Demo modal ----
      "modal.eyebrow": "Book a demo",
      "modal.title": "Tell us about your projects",
      "modal.lead": "30 minutes to see Krossnote on a structure similar to yours.",
      "modal.prenom": "First name",
      "modal.nom": "Last name",
      "modal.email": "Email address",
      "modal.raison": "Reason for your request",
      "modal.raison.placeholder": "E.g. bridge inspection, structural assessment…",
      "modal.submit": "Send request",
      "modal.sending": "Sending…",
      "modal.success.title": "Request sent!",
      "modal.success.body": "We'll get back to you within 24 hours to schedule your demo.",
      "modal.success.close": "Close",
      "modal.error": "An error occurred. Email us at francois@diagnosticrapid.fr.",
    },
  };

  // ---- detect initial lang ----
  function detectLang() {
    try {
      const saved = localStorage.getItem(STORAGE_KEY);
      if (saved === "fr" || saved === "en") return saved;
    } catch (e) {}
    const nav = (navigator.language || "fr").toLowerCase();
    return nav.startsWith("en") ? "en" : "fr";
  }

  let currentLang = detectLang();
  const listeners = new Set();

  function setLang(lang) {
    if (lang !== "fr" && lang !== "en") return;
    currentLang = lang;
    try {
      localStorage.setItem(STORAGE_KEY, lang);
    } catch (e) {}
    document.documentElement.lang = lang;
    listeners.forEach((fn) => fn(lang));
  }

  function t(key) {
    const d = DICT[currentLang] || DICT.fr;
    if (key in d) return d[key];
    return DICT.fr[key] || key;
  }

  function useT() {
    const [, setTick] = React.useState(0);
    React.useEffect(() => {
      const fn = () => setTick((v) => v + 1);
      listeners.add(fn);
      return () => listeners.delete(fn);
    }, []);
    return t;
  }

  function useLang() {
    const [lang, setLangState] = React.useState(currentLang);
    React.useEffect(() => {
      const fn = (l) => setLangState(l);
      listeners.add(fn);
      return () => listeners.delete(fn);
    }, []);
    return [lang, setLang];
  }

  // ---- Language switcher dropdown component ----
  function LangSwitcher({ dark = false }) {
    const [lang, setL] = useLang();
    const [open, setOpen] = React.useState(false);
    const ref = React.useRef(null);
    React.useEffect(() => {
      const onDoc = (e) => {
        if (ref.current && !ref.current.contains(e.target)) setOpen(false);
      };
      document.addEventListener("click", onDoc);
      return () => document.removeEventListener("click", onDoc);
    }, []);

    const flagFR = (
      <svg
        width="18"
        height="13"
        viewBox="0 0 18 13"
        style={{ display: "block", borderRadius: 2, overflow: "hidden" }}
      >
        <rect width="6" height="13" fill="#0055A4" />
        <rect x="6" width="6" height="13" fill="#fff" />
        <rect x="12" width="6" height="13" fill="#EF4135" />
      </svg>
    );
    const flagEN = (
      <svg
        width="18"
        height="13"
        viewBox="0 0 18 13"
        style={{ display: "block", borderRadius: 2, overflow: "hidden" }}
      >
        <rect width="18" height="13" fill="#012169" />
        <path d="M0 0 L18 13 M18 0 L0 13" stroke="#fff" strokeWidth="2" />
        <path d="M0 0 L18 13 M18 0 L0 13" stroke="#C8102E" strokeWidth="1" />
        <path d="M9 0 V13 M0 6.5 H18" stroke="#fff" strokeWidth="3" />
        <path d="M9 0 V13 M0 6.5 H18" stroke="#C8102E" strokeWidth="1.5" />
      </svg>
    );
    const flag = lang === "en" ? flagEN : flagFR;
    const code = lang === "en" ? "EN" : "FR";

    const fg = dark ? "rgba(255,255,255,0.82)" : "var(--fg-2)";
    const bg = dark ? "rgba(255,255,255,0.06)" : "transparent";
    const border = dark
      ? "1px solid rgba(255,255,255,0.14)"
      : "1px solid var(--kn-slate-200)";

    return (
      <div ref={ref} style={{ position: "relative" }}>
        <button
          type="button"
          onClick={() => setOpen((o) => !o)}
          aria-label="Change language"
          style={{
            display: "inline-flex",
            alignItems: "center",
            gap: 8,
            padding: "8px 12px",
            borderRadius: 8,
            background: bg,
            border,
            color: fg,
            fontSize: 13,
            fontWeight: 500,
            letterSpacing: "-0.005em",
            cursor: "pointer",
          }}
        >
          {flag}
          <span>{code}</span>
          <svg
            width="10"
            height="10"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            strokeWidth="2.5"
          >
            <polyline points="6 9 12 15 18 9" />
          </svg>
        </button>
        {open && (
          <div
            style={{
              position: "absolute",
              top: "calc(100% + 6px)",
              right: 0,
              background: "#fff",
              border: "1px solid var(--kn-slate-200)",
              borderRadius: 10,
              boxShadow: "var(--shadow-3)",
              minWidth: 140,
              padding: 6,
              zIndex: 100,
            }}
          >
            {[
              { code: "fr", label: "Français", flag: flagFR },
              { code: "en", label: "English", flag: flagEN },
            ].map((o) => (
              <button
                key={o.code}
                type="button"
                onClick={() => {
                  setL(o.code);
                  setOpen(false);
                }}
                style={{
                  display: "flex",
                  alignItems: "center",
                  gap: 10,
                  width: "100%",
                  padding: "8px 10px",
                  borderRadius: 6,
                  background:
                    o.code === lang ? "var(--kn-slate-100)" : "transparent",
                  color: "var(--kn-ink)",
                  fontSize: 14,
                  fontWeight: 500,
                  cursor: "pointer",
                  textAlign: "left",
                }}
              >
                {o.flag}
                <span>{o.label}</span>
                {o.code === lang && (
                  <svg
                    width="14"
                    height="14"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="var(--kn-orange)"
                    strokeWidth="2.5"
                    strokeLinecap="round"
                    strokeLinejoin="round"
                    style={{ marginLeft: "auto" }}
                  >
                    <polyline points="20 6 9 17 4 12" />
                  </svg>
                )}
              </button>
            ))}
          </div>
        )}
      </div>
    );
  }

  // expose to window so other Babel scripts can pick them up
  Object.assign(window, {
    useT,
    useLang,
    setLang,
    t: t,
    LangSwitcher,
    KN_DICT: DICT,
  });

  // initial doc lang
  if (typeof document !== "undefined")
    document.documentElement.lang = currentLang;
})();
