// Translations + language context
const TRANSLATIONS = {
  en: {
    dir: 'ltr',
    label: 'EN',
    nav: { programs: 'Programs', method: 'How We Teach', community: 'Community', contact: 'Contact', enroll: 'Enroll' },
    hero: {
      pill: 'Spring 2026 cohort — now enrolling',
      title1: 'Building the', titleFuture: 'Future', titleComma: ',', titleOne: 'One', titleBlock: 'Block', titleAt: 'at a Time.',
      sub: 'Empowering kids in ',
      subCity: 'Ouarzazate',
      subTail: ' through STEM, Robotics & Coding — from first LEGO clicks to real-world Arduino circuits.',
      cta1: 'Explore Programs', cta2: 'Join Us',
      trustNum: '240+ young builders', trustText: 'already coding, designing & inventing',
      trustStars: 'Loved by parents across Ouarzazate',
      live: 'LIVE BUILD', mission: "Today's mission",
      missionText: 'Discovery shuttle — assembled by Aya, age 10 🚀',
      badge1a: '+1 badge', badge1b: 'Aerospace builder',
      badge2a: 'Code uploaded', badge2b: 'Sensors online',
    },
    curriculum: {
      pill: 'Our learning path',
      title1: 'Three stages.', title2: 'One', titleHi: 'journey', title3: 'from clicks to circuits.',
      sub: 'Hover any card to peek inside the workshop. Every level builds on the last — kids progress at their own pace, with a real mentor by their side.',
      progress: ['Start curious', 'Build confidence', 'Engineer reality'],
      ages: 'Ages', toolkit: 'Toolkit', skills: 'Skills you grow', enroll: 'Enroll', watch: '▶ Watch them build',
      programs: [
        { title: 'Early Builders', tagline: 'Where curiosity clicks into place.', tools: ['LEGO® WeDo 2.0', 'ScratchJr', 'Story Coding'], duration: '90 min · weekly', skills: ['Sequencing', 'Cause & effect', 'Storytelling'] },
        { title: 'Advanced Creators', tagline: 'From kit to competition stage.', tools: ['SPIKE™ Prime', 'FLL Prep', 'Block + Python'], duration: '2 hr · weekly', skills: ['Mechanics', 'Algorithms', 'Team strategy'] },
        { title: 'Young Engineers', tagline: 'Real circuits. Real problems. Real solutions.', tools: ['Arduino UNO', 'Sensors & motors', 'C/C++'], duration: '2.5 hr · weekly', skills: ['Electronics', 'Prototyping', 'Engineering thinking'] },
      ],
    },
    method: {
      pill: 'Our methodology', title1: 'Not just play.', title2: 'Design Thinking', title3: 'for kids.',
      body1: 'Every workshop follows the same proven process used at top design schools — adapted for curious minds. Kids learn to',
      bodyBold: 'empathize, ideate, prototype, and iterate',
      body2: '. They leave with more than a robot. They leave with a way of thinking.',
      hi: "Hi, I'm Roby!", roby: 'Your guide through every build.',
      tryIt: 'Try it!', iterate: 'Iterate ⟳', make: 'Make it!',
      steps: [
        { title: 'Empathize', desc: 'Who are we building for? Kids interview each other and learn to listen.' },
        { title: 'Ideate', desc: 'Wild sketches, sticky notes, no bad ideas. Imagination warmed up.' },
        { title: 'Prototype', desc: "Click. Snap. Build. First versions are messy — and that's the point." },
        { title: 'Test & Iterate', desc: 'What broke? What worked? Real engineers love their failures.' },
      ],
    },
    social: {
      pill: '@robotics.center.ouz',
      title1: 'A workshop that', titleHi: 'never sleeps.',
      sub: 'Real moments from our cohorts — competitions, builds, late-night debugging snacks.',
      follow: 'Follow on Instagram',
      lockedTitle: 'Locked Workshop', lockedHint: 'Hover to peek',
      posts: [
        { caption: 'Satellites & Radar', tag: 'Space · WeDo 2.0', desc: 'Build a rotating dish and program a sweeping radar — discover how spacecraft listen to the sky.' },
        { caption: 'Speed & Racing Cars', tag: 'Physics · WeDo 2.0', desc: 'Engineer aerodynamic racers, tune the gear ratios, and learn how design choices shape pure speed.' },
        { caption: 'Volcano Chemistry', tag: 'Chemistry', desc: 'Trigger a real eruption with a safe chemical reaction — geology meets the joy of bubbling lava.' },
        { caption: 'Helicopter Rescue', tag: 'Mechanics', desc: 'Design a helicopter with a working rescue winch and complete a full search-and-recovery mission.' },
        { caption: 'Line Follower Robot', tag: 'WeDo · SPIKE Prime', desc: 'Calibrate light sensors and code a follow-the-line robot — graduate from WeDo to SPIKE Prime.' },
        { caption: 'Story Coding with Scratch', tag: 'Creative · Code', desc: 'Turn an idea into an animated story — characters, sound, and logic, all coded by the kids themselves.' },
        { caption: 'Robotic Hand', tag: 'SPIKE Prime', desc: 'Build a mechanical hand that grips and lifts — a hands-on intro to actuators and control.' },
        { caption: 'And many more on the way', tag: 'Coming soon', desc: 'New seasons bring new missions — drone racing, hydraulic arms, AI vision and more. Stay tuned.', more: true },
      ],
    },
    footer: {
      ctaPill: 'Limited spots — Spring 2026',
      ctaTitle1: 'Ready to build your', ctaTitle2: 'future engineer?',
      ctaSub: 'Book a free 30-minute trial workshop. No experience needed — just curiosity.',
      parent: "Parent's name", email: 'Email or WhatsApp', age: "Child's age",
      submit: 'Book free trial →', sending: 'Sending…', thanks: "Thanks! We'll be in touch soon 🎉",
      errorSend: "Couldn't reach our system. Please WhatsApp us directly.",
      org: 'A non-profit STEM workshop helping kids in southern Morocco build, code, and dream big.',
      visit: 'Visit us', addr1: '1174 Rue Ait Melloul', addr2: 'Ouarzazate 45000', addr3: 'Souss-Massa-Drâa, Morocco', maps: 'Open in Maps →',
      talk: 'Talk to us', hours: 'Sat–Sun · 9:00–18:00',
      follow: 'Follow', legal: 'Curriculum aligned with FIRST® LEGO® League standards. LEGO® is a trademark of the LEGO Group.',
      copy: '© 2026 Robotics Center Ouarzazate · مركز الروبوتيات',
      privacy: 'Privacy', conduct: 'Code of conduct', made: 'Made with ❤️ in Morocco',
    },
  },
  fr: {
    dir: 'ltr',
    label: 'FR',
    nav: { programs: 'Programmes', method: 'Notre Méthode', community: 'Communauté', contact: 'Contact', enroll: "S'inscrire" },
    hero: {
      pill: 'Promotion Printemps 2026 — inscriptions ouvertes',
      title1: 'Construire le', titleFuture: 'Futur', titleComma: ',', titleOne: 'Une', titleBlock: 'Brique', titleAt: 'à la Fois.',
      sub: "Donner aux enfants d'",
      subCity: 'Ouarzazate',
      subTail: " les clés des STEM, de la robotique et du code — du premier clic LEGO aux vrais circuits Arduino.",
      cta1: 'Voir les Programmes', cta2: 'Nous Rejoindre',
      trustNum: '240+ jeunes bâtisseurs', trustText: 'codent, conçoivent et inventent déjà',
      trustStars: 'Plébiscité par les parents de Ouarzazate',
      live: 'EN DIRECT', mission: "Mission du jour",
      missionText: 'Navette Discovery — assemblée par Aya, 10 ans 🚀',
      badge1a: '+1 badge', badge1b: 'Constructeur aérospatial',
      badge2a: 'Code chargé', badge2b: 'Capteurs actifs',
    },
    curriculum: {
      pill: 'Notre parcours',
      title1: 'Trois étapes.', title2: 'Un', titleHi: 'voyage', title3: 'des clics aux circuits.',
      sub: "Survolez une carte pour jeter un œil dans l'atelier. Chaque niveau s'appuie sur le précédent — chaque enfant avance à son rythme, avec un vrai mentor.",
      progress: ['Curieux', 'Confiants', 'Ingénieurs'],
      ages: 'Âges', toolkit: 'Outils', skills: 'Compétences acquises', enroll: "S'inscrire", watch: '▶ Voir construire',
      programs: [
        { title: 'Petits Bâtisseurs', tagline: 'Là où la curiosité prend forme.', tools: ['LEGO® WeDo 2.0', 'ScratchJr', 'Code-Histoires'], duration: '90 min · par semaine', skills: ['Séquençage', 'Cause & effet', 'Récit'] },
        { title: 'Créateurs Avancés', tagline: 'Du kit à la scène de compétition.', tools: ['SPIKE™ Prime', 'Préparation FLL', 'Blocs + Python'], duration: '2 h · par semaine', skills: ['Mécanique', 'Algorithmes', 'Stratégie'] },
        { title: 'Jeunes Ingénieurs', tagline: 'Vrais circuits. Vrais problèmes. Vraies solutions.', tools: ['Arduino UNO', 'Capteurs & moteurs', 'C/C++'], duration: '2,5 h · par semaine', skills: ['Électronique', 'Prototypage', 'Pensée ingénieur'] },
      ],
    },
    method: {
      pill: 'Notre méthode', title1: 'Pas juste un jeu.', title2: 'Le Design Thinking', title3: 'pour les enfants.',
      body1: "Chaque atelier suit le même processus éprouvé enseigné dans les meilleures écoles de design — adapté aux esprits curieux. Les enfants apprennent à",
      bodyBold: 'comprendre, imaginer, prototyper et itérer',
      body2: '. Ils repartent avec bien plus qu\'un robot : une nouvelle façon de penser.',
      hi: "Salut, je suis Roby !", roby: 'Ton guide à chaque étape.',
      tryIt: 'Essaie !', iterate: 'Itère ⟳', make: 'Crée !',
      steps: [
        { title: 'Comprendre', desc: 'Pour qui construit-on ? Les enfants s\'interviewent mutuellement et apprennent à écouter.' },
        { title: 'Imaginer', desc: 'Croquis audacieux, post-its, aucune mauvaise idée. L\'imagination s\'éveille.' },
        { title: 'Prototyper', desc: 'Clic. Emboîte. Construis. Les premières versions sont brouillonnes — c\'est le but.' },
        { title: 'Tester & Itérer', desc: 'Qu\'est-ce qui a cassé ? Qu\'est-ce qui a fonctionné ? Les vrais ingénieurs adorent leurs échecs.' },
      ],
    },
    social: {
      pill: '@robotics.center.ouz',
      title1: 'Un atelier qui', titleHi: 'ne dort jamais.',
      sub: 'Des moments réels de nos promotions — compétitions, montages et pauses grignotage nocturnes.',
      follow: 'Suivre sur Instagram',
      lockedTitle: 'Atelier verrouillé', lockedHint: 'Survole pour découvrir',
      posts: [
        { caption: 'Satellites & Radar', tag: 'Espace · WeDo 2.0', desc: 'Construis une parabole rotative et programme un radar — découvre comment les engins spatiaux écoutent le ciel.' },
        { caption: 'Voitures de course', tag: 'Physique · WeDo 2.0', desc: 'Conçois des bolides aérodynamiques, ajuste les engrenages et observe comment le design change la vitesse.' },
        { caption: 'Chimie du volcan', tag: 'Chimie', desc: 'Déclenche une vraie éruption avec une réaction chimique sans danger — quand la géologie rencontre la lave bouillonnante.' },
        { caption: 'Hélicoptère de sauvetage', tag: 'Mécanique', desc: 'Conçois un hélicoptère avec treuil de sauvetage et accomplis une mission de secours complète.' },
        { caption: 'Robot suiveur de ligne', tag: 'WeDo · SPIKE Prime', desc: 'Calibre les capteurs de lumière, code un robot qui suit la ligne et évolue de WeDo à SPIKE Prime.' },
        { caption: 'Histoires codées avec Scratch', tag: 'Création · Code', desc: 'Transforme une idée en histoire animée — personnages, sons et logique, tout est codé par les enfants.' },
        { caption: 'Main robotique', tag: 'SPIKE Prime', desc: 'Construis une main mécanique qui attrape et soulève — initiation pratique aux actionneurs et au contrôle.' },
        { caption: 'Et bien d\'autres à venir', tag: 'Bientôt', desc: 'Chaque saison apporte de nouvelles missions — courses de drones, bras hydrauliques, vision par IA et plus. Reste connecté.', more: true },
      ],
    },
    footer: {
      ctaPill: 'Places limitées — Printemps 2026',
      ctaTitle1: 'Prêt à former votre', ctaTitle2: 'futur ingénieur ?',
      ctaSub: 'Réservez un atelier d\'essai gratuit de 30 min. Aucune expérience requise — juste de la curiosité.',
      parent: 'Nom du parent', email: 'Email ou WhatsApp', age: "Âge de l'enfant",
      submit: 'Réserver l\'essai gratuit →', sending: 'Envoi…', thanks: 'Merci ! Nous vous contacterons très vite 🎉',
      errorSend: 'Impossible de joindre notre système. Contactez-nous directement sur WhatsApp.',
      org: 'Atelier STEM à but non lucratif qui aide les enfants du sud du Maroc à construire, coder et voir grand.',
      visit: 'Nous trouver', addr1: '1174 Rue Ait Melloul', addr2: 'Ouarzazate 45000', addr3: 'Souss-Massa-Drâa, Maroc', maps: 'Ouvrir dans Maps →',
      talk: 'Nous contacter', hours: 'Sam–Dim · 9h00–18h00',
      follow: 'Suivre', legal: 'Programme aligné sur les standards FIRST® LEGO® League. LEGO® est une marque du Groupe LEGO.',
      copy: '© 2026 Robotics Center Ouarzazate · مركز الروبوتيات',
      privacy: 'Confidentialité', conduct: 'Code de conduite', made: 'Fait avec ❤️ au Maroc',
    },
  },
  ar: {
    dir: 'rtl',
    label: 'AR',
    nav: { programs: 'البرامج', method: 'منهجيتنا', community: 'المجتمع', contact: 'اتصل بنا', enroll: 'سجّل الآن' },
    hero: {
      pill: 'دفعة ربيع 2026 — التسجيل مفتوح',
      title1: 'نبني', titleFuture: 'المستقبل', titleComma: '،', titleOne: 'لبنة', titleBlock: 'تلو', titleAt: 'الأخرى.',
      sub: 'نُمكّن أطفال ',
      subCity: 'ورزازات',
      subTail: ' عبر العلوم والتكنولوجيا والروبوتيات والبرمجة — من أولى قطع الليغو إلى دوائر أردوينو الحقيقية.',
      cta1: 'استكشف البرامج', cta2: 'انضم إلينا',
      trustNum: 'أكثر من 240 مبتكراً صغيراً', trustText: 'يبرمجون ويصممون ويبتكرون',
      trustStars: 'يحظى بثقة الآباء في ورزازات',
      live: 'بناء مباشر', mission: 'مهمة اليوم',
      missionText: 'مكوك ديسكفري — جمّعته آية، 10 سنوات 🚀',
      badge1a: 'شارة جديدة', badge1b: 'مهندس فضاء صغير',
      badge2a: 'تم رفع الكود', badge2b: 'الحساسات تعمل',
    },
    curriculum: {
      pill: 'مسار التعلم',
      title1: 'ثلاث مراحل.', title2: 'رحلة', titleHi: 'واحدة', title3: 'من تركيب القطع إلى تصميم الدوائر.',
      sub: 'مرّر فوق أي بطاقة لتلقي نظرة داخل الورشة. كل مستوى يبني على ما قبله — يتقدم الأطفال بالوتيرة التي تناسبهم، مع مرشد حقيقي بجانبهم.',
      progress: ['ابدأ بالفضول', 'ابنِ ثقتك', 'اصنع واقعك'],
      ages: 'الأعمار', toolkit: 'الأدوات', skills: 'المهارات المكتسبة', enroll: 'سجّل', watch: '▶ شاهدهم يبنون',
      programs: [
        { title: 'البنّاؤون الصغار', tagline: 'حيث يتحول الفضول إلى إبداع.', tools: ['LEGO® WeDo 2.0', 'ScratchJr', 'برمجة قصصية'], duration: '90 دقيقة · أسبوعياً', skills: ['التسلسل', 'السبب والنتيجة', 'سرد القصة'] },
        { title: 'المبدعون المتقدمون', tagline: 'من طقم التجميع إلى منصة المسابقة.', tools: ['SPIKE™ Prime', 'تحضير FLL', 'كتل + بايثون'], duration: 'ساعتان · أسبوعياً', skills: ['الميكانيك', 'الخوارزميات', 'استراتيجية الفريق'] },
        { title: 'المهندسون اليافعون', tagline: 'دارات حقيقية. مشاكل حقيقية. حلول حقيقية.', tools: ['Arduino UNO', 'حساسات ومحركات', 'C/C++'], duration: '2.5 ساعة · أسبوعياً', skills: ['الإلكترونيات', 'النمذجة', 'تفكير هندسي'] },
      ],
    },
    method: {
      pill: 'منهجيتنا', title1: 'ليس مجرد لعب.', title2: 'تفكير تصميمي', title3: 'للأطفال.',
      body1: 'كل ورشة تتبع نفس النهج المعتمد في أرقى مدارس التصميم — مُكيَّف للعقول الفضولية. يتعلم الأطفال',
      bodyBold: 'التعاطف، ابتكار الأفكار، النمذجة، والتطوير المستمر',
      body2: '. يخرجون بأكثر من روبوت — يخرجون بطريقة تفكير جديدة.',
      hi: 'مرحباً، أنا روبي!', roby: 'دليلك في كل مشروع.',
      tryIt: 'جرّب!', iterate: 'كرّر ⟳', make: 'اصنعه!',
      steps: [
        { title: 'التعاطف', desc: 'لِمن نبني؟ يحاور الأطفال بعضهم البعض ويتعلمون الإصغاء.' },
        { title: 'التخيّل', desc: 'رسومات عفوية، ملاحظات لاصقة، لا توجد فكرة سيئة. إطلاق العنان للخيال.' },
        { title: 'النمذجة', desc: 'ركّب. وصّل. ابنِ. النسخ الأولى فوضوية — وهذا هو المقصود.' },
        { title: 'الاختبار والتكرار', desc: 'ما الذي تعطّل؟ وما الذي نجح؟ المهندسون الحقيقيون يحبّون أخطاءهم.' },
      ],
    },
    social: {
      pill: '@robotics.center.ouz',
      title1: 'ورشة', titleHi: 'لا تنام أبداً.',
      sub: 'لحظات حقيقية من دفعاتنا — مسابقات، مشاريع، ووجبات خفيفة أثناء البرمجة ليلاً.',
      follow: 'تابعنا على إنستغرام',
      lockedTitle: 'ورشة مقفلة', lockedHint: 'مرّر للاستكشاف',
      posts: [
        { caption: 'أقمار اصطناعية ورادار', tag: 'فضاء · WeDo 2.0', desc: 'ابنِ هوائياً يدور وبرمج راداراً يمسح السماء — اكتشف كيف تستمع المركبات الفضائية إلى الكون.' },
        { caption: 'سيارات السرعة والسباق', tag: 'فيزياء · WeDo 2.0', desc: 'صمّم سيارات سباق انسيابية، اضبط التروس، واكتشف كيف يغيّر التصميم السرعة.' },
        { caption: 'كيمياء البركان', tag: 'كيمياء', desc: 'أطلق ثوراناً حقيقياً عبر تفاعل كيميائي آمن — حيث تلتقي الجيولوجيا بمتعة الحمم الفوّارة.' },
        { caption: 'هليكوبتر الإنقاذ', tag: 'ميكانيكا', desc: 'صمّم مروحية بنظام رفع للإنقاذ ونفّذ مهمة بحث وإنقاذ كاملة.' },
        { caption: 'روبوت متتبّع الخط', tag: 'WeDo · SPIKE Prime', desc: 'اضبط حساسات الضوء وبرمج روبوتاً يتبع الخط — وارتقِ من WeDo إلى SPIKE Prime.' },
        { caption: 'برمجة قصص بـ Scratch', tag: 'إبداع · برمجة', desc: 'حوّل فكرة إلى قصة متحركة — شخصيات وأصوات ومنطق، يبرمجها الأطفال بأنفسهم.' },
        { caption: 'يد روبوتية', tag: 'SPIKE Prime', desc: 'ابنِ يداً ميكانيكية تمسك وترفع — مقدمة عملية للمحركات والتحكم.' },
        { caption: 'وغيرها الكثير قادم', tag: 'قريباً', desc: 'كل موسم يحمل مهمات جديدة — سباقات الطائرات، أذرع هيدروليكية، رؤية بالذكاء الاصطناعي والمزيد. ترقّبوا.', more: true },
      ],
    },
    footer: {
      ctaPill: 'مقاعد محدودة — ربيع 2026',
      ctaTitle1: 'مستعد لإعداد', ctaTitle2: 'مهندس المستقبل؟',
      ctaSub: 'احجز ورشة تجريبية مجانية لمدة 30 دقيقة. لا تحتاج خبرة سابقة — فقط الفضول.',
      parent: 'اسم الوالد/ة', email: 'البريد أو واتساب', age: 'عمر الطفل',
      submit: 'احجز التجربة المجانية →', sending: 'جارٍ الإرسال…', thanks: 'شكراً! سنتواصل معك قريباً 🎉',
      errorSend: 'تعذّر الاتصال بنظامنا. تواصل معنا مباشرة عبر واتساب.',
      org: 'ورشة STEM غير ربحية تساعد أطفال جنوب المغرب على البناء، البرمجة، والتفكير بطموح.',
      visit: 'زرنا', addr1: '1174 شارع آيت ملول', addr2: 'ورزازات 45000', addr3: 'سوس ماسة درعة، المغرب', maps: 'افتح في الخرائط →',
      talk: 'تحدث معنا', hours: 'السبت–الأحد · 9:00–18:00',
      follow: 'تابعنا', legal: 'المنهج متوافق مع معايير FIRST® LEGO® League. LEGO® علامة تجارية لمجموعة LEGO.',
      copy: '© 2026 مركز الروبوتيات ورزازات · Robotics Center',
      privacy: 'الخصوصية', conduct: 'ميثاق السلوك', made: 'صُنع بـ ❤️ في المغرب',
    },
  },
};

window.TRANSLATIONS = TRANSLATIONS;
window.LangContext = React.createContext({ lang: 'en', t: TRANSLATIONS.en, setLang: () => {} });
window.useT = function () { return React.useContext(window.LangContext); };
