// ─────────────────────────────────────────────────────────
// ChefVerse · sample data + i18n strings
// Three markets: en (US), de (Germany), id (Indonesia)
// ─────────────────────────────────────────────────────────

const I18N = {
  en: {
    locale: "English (US)",
    flag: "🇺🇸",
    market: "United States",
    nav: {
      platform: "Platform",
      dashboard: "Dashboard",
      learning: "Menu",
      briefs: "Briefs",
      community: "Community",
      account: "Account",
      profile: "Profile",
      settings: "Settings",
      help: "Help",
    },
    dash: {
      hi: "Welcome back",
      sub: "Your training, your briefs, and what's worth your hour today.",
      continue: "Continue learning",
      open_briefs: "Open briefs",
      your_progress: "Your progress",
      streak: "Day streak",
      modules_done: "Modules complete",
      briefs_won: "Briefs claimed",
      avg_score: "Avg. submission score",
      pickup_brief: "Pick up a brief",
      browse_courses: "Browse courses",
      next_up: "Next up in your path",
      live_briefs: "Live briefs",
      community: "From the community",
      view_all: "View all",
      brand_voice: "Built by chefs, for chefs — to grow your audience without losing your edge.",
    },
    onboard: {
      step: "Step",
      of: "of",
      next: "Continue",
      back: "Back",
      finish: "Enter ChefVerse",
      market_q: "Where do you cook?",
      market_sub: "We tailor briefs, modules, and captions to your market.",
      profile_q: "Tell us about your kitchen",
      profile_sub: "It helps us route the right briefs your way.",
      socials_q: "Connect your channels",
      socials_sub: "Optional, but unlocks reach analytics on your submissions.",
      goals_q: "What are you here for?",
      goals_sub: "Pick all that apply. We'll surface a starter path.",
      welcome_q: "You're in.",
      welcome_sub: "Your starter path is ready. First module is 6 minutes.",
      role_chef: "Chef de cuisine",
      role_sous: "Sous chef",
      role_owner: "Chef-owner",
      role_pastry: "Pastry chef",
      role_consult: "Consultant",
      goal_audience: "Grow my audience",
      goal_brand: "Build a personal brand",
      goal_skills: "Improve my video skills",
      goal_paid: "Pick up paid briefs",
      goal_network: "Network with other chefs",
    },
    course: {
      heading: "Learning paths",
      sub: "Structured tracks taught by working chefs and content directors.",
      filter: "Filter",
      all: "All",
      starter: "Starter",
      growth: "Growth",
      mastery: "Mastery",
      modules: "modules",
      hours: "hr",
      level: "Level",
      enroll: "Enroll",
      enrolled: "Continue",
      featured: "Featured path",
    },
    player: {
      transcript: "Transcript",
      notes: "Notes",
      resources: "Resources",
      chapters: "Chapters",
      cc: "Captions",
      add_note: "Add a note at this timestamp",
      saved_notes: "Your notes",
      mark_complete: "Mark module complete",
      next_module: "Next module",
      speed: "Speed",
      bookmark: "Bookmark",
      brief_cta: "Apply this lesson — open a matching brief",
    },
    briefs: {
      heading: "Content briefs",
      sub: "Open briefs from UFS brand teams. Pick one, film it, submit before the deadline.",
      open: "Open",
      claimed: "Claimed",
      submitted: "Submitted",
      paid: "Paid",
      payout: "Payout",
      deadline: "Deadline",
      submissions: "submissions",
      apply: "Submit to brief",
      details: "View brief",
      market: "Market",
      pillar: "Pillar",
      duration: "Duration",
      filter_market: "Markets",
      filter_pillar: "Pillars",
      filter_payout: "Payout",
      featured_brief: "Featured brief",
    },
  },
  de: {
    locale: "Deutsch (DE)",
    flag: "🇩🇪",
    market: "Deutschland",
    nav: {
      platform: "Plattform",
      dashboard: "Übersicht",
      learning: "Speisekarte",
      briefs: "Briefings",
      community: "Community",
      account: "Konto",
      profile: "Profil",
      settings: "Einstellungen",
      help: "Hilfe",
    },
    dash: {
      hi: "Willkommen zurück",
      sub: "Deine Trainings, deine Briefings — und was sich heute lohnt.",
      continue: "Weiterlernen",
      open_briefs: "Offene Briefings",
      your_progress: "Dein Fortschritt",
      streak: "Tage in Folge",
      modules_done: "Module abgeschlossen",
      briefs_won: "Briefings übernommen",
      avg_score: "Ø Bewertung Einreichungen",
      pickup_brief: "Briefing übernehmen",
      browse_courses: "Kurse durchsuchen",
      next_up: "Als Nächstes auf deinem Pfad",
      live_briefs: "Aktive Briefings",
      community: "Aus der Community",
      view_all: "Alle ansehen",
      brand_voice: "Von Köchen für Köche — bau dir Reichweite auf, ohne dein Handwerk zu verraten.",
    },
    onboard: {
      step: "Schritt",
      of: "von",
      next: "Weiter",
      back: "Zurück",
      finish: "ChefVerse betreten",
      market_q: "Wo kochst du?",
      market_sub: "Wir passen Briefings, Module und Untertitel an deinen Markt an.",
      profile_q: "Erzähl uns von deiner Küche",
      profile_sub: "Damit wir dir die passenden Briefings schicken.",
      socials_q: "Verbinde deine Kanäle",
      socials_sub: "Optional — schaltet Reichweiten-Analysen für deine Einreichungen frei.",
      goals_q: "Wofür bist du hier?",
      goals_sub: "Mehrfachauswahl. Wir bauen daraus deinen Startpfad.",
      welcome_q: "Du bist drin.",
      welcome_sub: "Dein Startpfad ist bereit. Erstes Modul: 6 Minuten.",
      role_chef: "Küchenchef:in",
      role_sous: "Sous-Chef:in",
      role_owner: "Chef-Inhaber:in",
      role_pastry: "Patissier:e",
      role_consult: "Berater:in",
      goal_audience: "Reichweite aufbauen",
      goal_brand: "Persönliche Marke aufbauen",
      goal_skills: "Video-Skills verbessern",
      goal_paid: "Bezahlte Briefings übernehmen",
      goal_network: "Mit Köchen vernetzen",
    },
    course: {
      heading: "Lernpfade",
      sub: "Strukturierte Tracks von aktiven Köchen und Content-Direktor:innen.",
      filter: "Filter",
      all: "Alle",
      starter: "Einstieg",
      growth: "Wachstum",
      mastery: "Meisterschaft",
      modules: "Module",
      hours: "Std",
      level: "Niveau",
      enroll: "Einschreiben",
      enrolled: "Weiter",
      featured: "Empfohlener Pfad",
    },
    player: {
      transcript: "Transkript",
      notes: "Notizen",
      resources: "Ressourcen",
      chapters: "Kapitel",
      cc: "Untertitel",
      add_note: "Notiz an dieser Stelle hinzufügen",
      saved_notes: "Deine Notizen",
      mark_complete: "Modul abschließen",
      next_module: "Nächstes Modul",
      speed: "Tempo",
      bookmark: "Lesezeichen",
      brief_cta: "Wende es an — passendes Briefing öffnen",
    },
    briefs: {
      heading: "Content-Briefings",
      sub: "Offene Briefings der UFS-Markenteams. Auswählen, drehen, vor Deadline einreichen.",
      open: "Offen",
      claimed: "Übernommen",
      submitted: "Eingereicht",
      paid: "Bezahlt",
      payout: "Honorar",
      deadline: "Deadline",
      submissions: "Einreichungen",
      apply: "Einreichen",
      details: "Briefing ansehen",
      market: "Markt",
      pillar: "Säule",
      duration: "Dauer",
      filter_market: "Märkte",
      filter_pillar: "Säulen",
      filter_payout: "Honorar",
      featured_brief: "Empfohlenes Briefing",
    },
  },
  id: {
    locale: "Bahasa Indonesia",
    flag: "🇮🇩",
    market: "Indonesia",
    nav: {
      platform: "Platform",
      dashboard: "Beranda",
      learning: "Menu",
      briefs: "Brief",
      community: "Komunitas",
      account: "Akun",
      profile: "Profil",
      settings: "Pengaturan",
      help: "Bantuan",
    },
    dash: {
      hi: "Selamat datang kembali",
      sub: "Pelatihan, brief, dan yang layak untuk satu jammu hari ini.",
      continue: "Lanjut belajar",
      open_briefs: "Brief terbuka",
      your_progress: "Progres kamu",
      streak: "Hari berturut",
      modules_done: "Modul selesai",
      briefs_won: "Brief diambil",
      avg_score: "Rata-rata skor submisi",
      pickup_brief: "Ambil brief",
      browse_courses: "Lihat kursus",
      next_up: "Berikutnya di jalurmu",
      live_briefs: "Brief aktif",
      community: "Dari komunitas",
      view_all: "Lihat semua",
      brand_voice: "Dibangun oleh chef untuk chef — agar audiensmu tumbuh tanpa kehilangan jati diri.",
    },
    onboard: {
      step: "Langkah",
      of: "dari",
      next: "Lanjut",
      back: "Kembali",
      finish: "Masuk ke ChefVerse",
      market_q: "Di mana kamu memasak?",
      market_sub: "Kami sesuaikan brief, modul, dan subtitle dengan pasarmu.",
      profile_q: "Ceritakan dapurmu",
      profile_sub: "Agar kami arahkan brief yang tepat untukmu.",
      socials_q: "Hubungkan kanalmu",
      socials_sub: "Opsional — buka analitik jangkauan untuk submisimu.",
      goals_q: "Untuk apa kamu di sini?",
      goals_sub: "Pilih semua yang sesuai. Kami susun jalur awalmu.",
      welcome_q: "Kamu siap.",
      welcome_sub: "Jalur awalmu sudah siap. Modul pertama: 6 menit.",
      role_chef: "Chef de cuisine",
      role_sous: "Sous chef",
      role_owner: "Chef-pemilik",
      role_pastry: "Chef pastry",
      role_consult: "Konsultan",
      goal_audience: "Tumbuhkan audiens",
      goal_brand: "Bangun personal brand",
      goal_skills: "Tingkatkan skill video",
      goal_paid: "Ambil brief berbayar",
      goal_network: "Berjejaring dengan chef",
    },
    course: {
      heading: "Jalur belajar",
      sub: "Trek terstruktur dari chef aktif dan direktur konten.",
      filter: "Filter",
      all: "Semua",
      starter: "Pemula",
      growth: "Berkembang",
      mastery: "Mahir",
      modules: "modul",
      hours: "jam",
      level: "Level",
      enroll: "Daftar",
      enrolled: "Lanjut",
      featured: "Jalur pilihan",
    },
    player: {
      transcript: "Transkrip",
      notes: "Catatan",
      resources: "Sumber",
      chapters: "Bab",
      cc: "Subtitle",
      add_note: "Tambah catatan di waktu ini",
      saved_notes: "Catatanmu",
      mark_complete: "Tandai modul selesai",
      next_module: "Modul berikutnya",
      speed: "Kecepatan",
      bookmark: "Bookmark",
      brief_cta: "Praktikkan — buka brief yang cocok",
    },
    briefs: {
      heading: "Brief konten",
      sub: "Brief terbuka dari tim brand UFS. Pilih, syuting, kirim sebelum deadline.",
      open: "Terbuka",
      claimed: "Diambil",
      submitted: "Dikirim",
      paid: "Dibayar",
      payout: "Bayaran",
      deadline: "Deadline",
      submissions: "submisi",
      apply: "Kirim submisi",
      details: "Lihat brief",
      market: "Pasar",
      pillar: "Pilar",
      duration: "Durasi",
      filter_market: "Pasar",
      filter_pillar: "Pilar",
      filter_payout: "Bayaran",
      featured_brief: "Brief pilihan",
    },
  },
};

// ─────────────────────────────────────────────────────────
// Course catalog (multi-market)
// ─────────────────────────────────────────────────────────
const COURSES = [
  {
    id: "fundamentals",
    title: { en: "Camera fundamentals for chefs", de: "Kamera-Grundlagen für Köche", id: "Dasar kamera untuk chef" },
    desc: {
      en: "Frame food the way it tastes — light, lens, and angle for a working kitchen.",
      de: "Essen so framen, wie es schmeckt — Licht, Linse und Winkel in der Profiküche.",
      id: "Bingkai makanan sesuai rasanya — cahaya, lensa, sudut di dapur kerja.",
    },
    track: "starter",
    modules: 8,
    hours: 1.6,
    level: { en: "Starter", de: "Einstieg", id: "Pemula" },
    instructor: "Marco Rivera",
    progress: 0,
    enrolled: false,
    cover: "linear-gradient(135deg,#ff8a3d 0%,#cc4400 100%)",
    pillar: "borderless",
  },
  {
    id: "story",
    title: { en: "Telling a recipe story in 30 seconds", de: "Eine Rezept-Story in 30 Sekunden", id: "Cerita resep dalam 30 detik" },
    desc: {
      en: "Hooks, beats, payoffs — short-form structure that lands without gimmicks.",
      de: "Hooks, Beats, Pointen — Short-Form-Struktur, die ohne Gimmicks zündet.",
      id: "Hook, beat, payoff — struktur short-form yang nendang tanpa gimik.",
    },
    track: "growth",
    modules: 8,
    hours: 2.0,
    level: { en: "Growth", de: "Wachstum", id: "Berkembang" },
    instructor: "Ines Park",
    progress: 0.25,
    enrolled: true,
    cover: "linear-gradient(135deg,#dc4d8b 0%,#5b3657 100%)",
    pillar: "streetfood",
  },
  {
    id: "voice",
    title: { en: "Finding your on-camera voice", de: "Die eigene On-Camera-Stimme finden", id: "Menemukan suaramu di kamera" },
    desc: {
      en: "From line cook to host — speak to the lens like you speak to your team.",
      de: "Vom Posten an die Kamera — sprich zur Linse wie zu deinem Team.",
      id: "Dari line cook ke host — bicara ke lensa seperti ke timmu.",
    },
    track: "growth",
    modules: 5,
    hours: 1.5,
    level: { en: "Growth", de: "Wachstum", id: "Berkembang" },
    instructor: "Tom Hartley",
    progress: 0,
    enrolled: false,
    cover: "linear-gradient(135deg,#00aeba 0%,#10002d 100%)",
    pillar: "roots",
  },
  {
    id: "edit",
    title: { en: "Editing on the line", de: "Schneiden zwischen den Services", id: "Editing di sela service" },
    desc: {
      en: "A working chef's edit workflow — phone-first, ten minutes, ready to post.",
      de: "Edit-Workflow für aktive Köche — Handy-first, zehn Minuten, postbereit.",
      id: "Workflow edit chef aktif — handphone, sepuluh menit, siap posting.",
    },
    track: "starter",
    modules: 4,
    hours: 0.8,
    level: { en: "Starter", de: "Einstieg", id: "Pemula" },
    instructor: "Lila Tanaka",
    progress: 1.0,
    enrolled: true,
    cover: "linear-gradient(135deg,#a1b83b 0%,#679641 100%)",
    pillar: "diner",
  },
  {
    id: "brand",
    title: { en: "Building a chef brand that sells", de: "Eine Chef-Marke aufbauen, die verkauft", id: "Membangun brand chef yang menjual" },
    desc: {
      en: "Positioning, voice, and the long arc — past viral, into a career.",
      de: "Positionierung, Stimme, langer Atem — über viral hinaus zur Karriere.",
      id: "Positioning, suara, jangka panjang — lewati viral menuju karier.",
    },
    track: "mastery",
    modules: 10,
    hours: 3.4,
    level: { en: "Mastery", de: "Meisterschaft", id: "Mahir" },
    instructor: "Élise Laurent",
    progress: 0,
    enrolled: false,
    cover: "linear-gradient(135deg,#221d37 0%,#5b3657 100%)",
    pillar: "roots",
  },
  {
    id: "analytics",
    title: { en: "Reading the numbers", de: "Die Zahlen lesen", id: "Membaca angka" },
    desc: {
      en: "Watch-time, saves, follows — what each metric tells you about your kitchen.",
      de: "Watch-Time, Saves, Follows — was jede Metrik über deine Küche verrät.",
      id: "Watch-time, save, follow — apa arti tiap metrik bagi dapurmu.",
    },
    track: "mastery",
    modules: 6,
    hours: 1.8,
    level: { en: "Mastery", de: "Meisterschaft", id: "Mahir" },
    instructor: "Sara Halim",
    progress: 0,
    enrolled: false,
    cover: "linear-gradient(135deg,#f9b000 0%,#ed6c00 100%)",
    pillar: "borderless",
  },
];

// ─────────────────────────────────────────────────────────
// Active module — used in player
// ─────────────────────────────────────────────────────────
const ACTIVE_MODULE = {
  course: "fundamentals",
  index: 4,
  total: 6,
  title: {
    en: "Side-light, top-down, and the 30° hero angle",
    de: "Seitenlicht, Top-Down und der 30°-Hero-Winkel",
    id: "Cahaya samping, top-down, dan sudut hero 30°",
  },
  duration: 384, // seconds
  chapters: [
    { t: 0, en: "Why kitchen light is hard", de: "Warum Küchenlicht schwierig ist", id: "Kenapa cahaya dapur sulit" },
    { t: 48, en: "Side-lighting a plated dish", de: "Seitenlicht für ein angerichtetes Gericht", id: "Cahaya samping untuk plating" },
    { t: 124, en: "Top-down for process shots", de: "Top-Down für Prozess-Shots", id: "Top-down untuk shot proses" },
    { t: 212, en: "The 30° hero angle", de: "Der 30°-Hero-Winkel", id: "Sudut hero 30°" },
    { t: 298, en: "On-the-line cheats", de: "Tricks im laufenden Service", id: "Trik saat service jalan" },
    { t: 348, en: "Practice brief", de: "Übungsbriefing", id: "Brief latihan" },
  ],
  transcript: {
    en: [
      { t: 0, s: "Most kitchens are lit for safety, not for camera. So the first thing we do isn't reach for a phone — it's read the room." },
      { t: 12, s: "If your overhead is fluorescent, your hero shot will look green. That's not creative. That's chemistry." },
      { t: 28, s: "Walk the pass. Find one window, one warm bulb, one reflective surface. That's your studio." },
      { t: 48, s: "For a plated dish, side-light beats every other angle. The shadow is what tells me there's depth on the plate." },
      { t: 72, s: "Hold your phone at the height of the rim of the plate. Now tilt down, ten degrees. Stop. That's the shot." },
      { t: 124, s: "Top-down is for process. Hands moving. A pan filling. The viewer needs to learn something they can repeat tomorrow." },
      { t: 158, s: "Your tripod is whatever holds the phone steady. A stack of menus. A plate weight. Don't let perfection stop the shot." },
      { t: 212, s: "The 30° hero angle is the most reused shot in food media for a reason — it shows the rim, the surface, and the height." },
      { t: 248, s: "Set it once. Light it once. Then plate three things into the same frame. You just made a series." },
      { t: 298, s: "On the line, you'll have ninety seconds, max. So pre-frame your shot before service. Tape on the counter if you need to." },
      { t: 332, s: "If you only remember one thing: the camera doesn't see what you see. It sees what you light." },
      { t: 348, s: "Try the practice brief — film a thirty-second top-down of a sauce coming together, in your own kitchen, before the next module." },
    ],
    de: [
      { t: 0, s: "Die meisten Küchen sind auf Sicherheit ausgeleuchtet, nicht auf Kamera. Also greifst du nicht zuerst zum Handy — du liest den Raum." },
      { t: 12, s: "Hängt oben Leuchtstoff, wird dein Hero-Shot grün. Das ist nicht kreativ. Das ist Chemie." },
      { t: 28, s: "Geh den Pass ab. Such ein Fenster, eine warme Birne, eine reflektierende Fläche. Das ist dein Studio." },
      { t: 48, s: "Für ein Tellergericht schlägt Seitenlicht jeden anderen Winkel. Der Schatten zeigt, dass es Tiefe gibt." },
      { t: 72, s: "Handy auf Höhe des Tellerrandes. Jetzt zehn Grad nach unten kippen. Stopp. Das ist der Shot." },
      { t: 124, s: "Top-Down ist für Prozesse. Hände in Bewegung. Eine Pfanne, die sich füllt. Der Zuschauer soll morgen etwas nachkochen können." },
      { t: 158, s: "Dein Stativ ist alles, was das Handy ruhig hält. Ein Stapel Speisekarten. Ein Tellergewicht. Lass Perfektion den Shot nicht verhindern." },
      { t: 212, s: "Der 30°-Hero-Winkel ist der meistgenutzte Foodshot — und das aus gutem Grund: Rand, Fläche, Höhe — alles drin." },
      { t: 248, s: "Einmal einstellen. Einmal ausleuchten. Drei Gerichte in denselben Frame plattieren. Schon hast du eine Serie." },
      { t: 298, s: "Im Service hast du maximal neunzig Sekunden. Frame deshalb vorab. Klebeband auf der Theke, wenn nötig." },
      { t: 332, s: "Wenn du dir nur eins merkst: Die Kamera sieht nicht, was du siehst. Sie sieht, was du beleuchtest." },
      { t: 348, s: "Mach das Übungsbriefing — film dreißig Sekunden Top-Down einer Sauce, die entsteht, in deiner Küche, vor dem nächsten Modul." },
    ],
    id: [
      { t: 0, s: "Kebanyakan dapur dipasang lampu untuk keselamatan, bukan untuk kamera. Jadi langkah pertama bukan ambil HP — tapi baca ruangannya." },
      { t: 12, s: "Kalau lampu atasmu fluorescent, hero shot bakal hijau. Itu bukan kreatif. Itu kimia." },
      { t: 28, s: "Susuri pass. Cari satu jendela, satu bohlam hangat, satu permukaan reflektif. Itu studiomu." },
      { t: 48, s: "Untuk plating, cahaya samping mengalahkan sudut lain. Bayangannya yang nunjukkin kedalaman piring." },
      { t: 72, s: "HP di setinggi bibir piring. Tilt sepuluh derajat ke bawah. Stop. Itu shot-nya." },
      { t: 124, s: "Top-down untuk proses. Tangan bergerak. Wajan terisi. Penonton harus bisa pelajari sesuatu yang besok dia ulangi." },
      { t: 158, s: "Tripod-mu apa pun yang nahan HP stabil. Tumpukan menu. Pemberat piring. Jangan biarkan ide sempurna ngehalangin shot." },
      { t: 212, s: "Sudut hero 30° paling sering dipakai di media kuliner — sebab kelihatan: bibir piring, permukaan, dan tingginya." },
      { t: 248, s: "Set sekali. Cahaya sekali. Plating tiga benda di frame yang sama. Kamu udah bikin satu seri." },
      { t: 298, s: "Saat service, paling sembilan puluh detik. Jadi frame dulu sebelum buka. Tempel selotip di meja kalau perlu." },
      { t: 332, s: "Kalau cuma satu yang diingat: kamera nggak lihat yang kamu lihat. Dia lihat apa yang kamu cahayai." },
      { t: 348, s: "Coba brief latihan — syuting tiga puluh detik top-down saus jadi, di dapurmu sendiri, sebelum modul berikutnya." },
    ],
  },
};

// ─────────────────────────────────────────────────────────
// Briefs marketplace data
// ─────────────────────────────────────────────────────────
const BRIEFS = [
  {
    id: "knorr-broth",
    brand: "Knorr Professional",
    title: { en: "Bring a 30-second broth ritual to life", de: "Ein 30-Sekunden-Brüh-Ritual zum Leben erwecken", id: "Hidupkan ritual kaldu 30 detik" },
    desc: {
      en: "Show the morning ritual of building a broth from the Knorr Professional Bouillon — process shots, top-down, warmth in the frame.",
      de: "Zeige das Morgenritual einer Brühe aus dem Knorr Professional Bouillon — Prozess, Top-Down, Wärme im Bild.",
      id: "Tunjukkan ritual pagi membuat kaldu dari Knorr Professional Bouillon — proses, top-down, kehangatan dalam frame.",
    },
    pillar: "roots",
    market: ["en", "de", "id"],
    payout: { en: "$450", de: "€420", id: "Rp 6.500.000" },
    deadline_days: 12,
    duration: "30s",
    submissions: 14,
    status: "open",
    featured: true,
    tone: "Warm, observational, no voiceover",
    deliverables: ["1× 30s vertical reel", "3× 9:16 stills", "Captions in market language"],
  },
  {
    id: "hellmanns-mayo",
    brand: "Hellmann's Foodservice",
    title: { en: "The 'one sauce, three plates' challenge", de: "'Eine Sauce, drei Teller' — die Challenge", id: "Tantangan 'satu saus, tiga piring'" },
    desc: {
      en: "Take the Hellmann's Real mayonnaise and build three distinct plates that fit your local menu.",
      de: "Nimm Hellmann's Real Mayonnaise und baue drei unterschiedliche Teller, die zu deiner Speisekarte passen.",
      id: "Ambil Hellmann's Real mayonnaise dan susun tiga piring berbeda yang cocok dengan menumu.",
    },
    pillar: "diner",
    market: ["en", "de"],
    payout: { en: "$600", de: "€560", id: "—" },
    deadline_days: 8,
    duration: "60s",
    submissions: 22,
    status: "open",
    featured: false,
    tone: "Playful, fast cuts, on-camera voice",
    deliverables: ["1× 60s reel", "1× behind-the-pass cut", "Caption + 5 hashtags"],
  },
  {
    id: "lipton-iced",
    brand: "Lipton Foodservice",
    title: { en: "A streetside iced-tea moment", de: "Ein Eistee-Moment auf der Straße", id: "Momen es teh pinggir jalan" },
    desc: {
      en: "Capture the streetfood-couture energy of a brewed Lipton iced tea — color, condensation, hands.",
      de: "Fang die Streetfood-Couture-Energie eines aufgebrühten Lipton-Eistees ein — Farbe, Kondens, Hände.",
      id: "Tangkap energi streetfood couture es teh Lipton — warna, embun, tangan.",
    },
    pillar: "streetfood",
    market: ["id", "en"],
    payout: { en: "$380", de: "—", id: "Rp 5.500.000" },
    deadline_days: 21,
    duration: "15s",
    submissions: 7,
    status: "open",
    featured: false,
    tone: "Loud, bright, locale-specific",
    deliverables: ["1× 15s vertical", "1× still hero shot"],
  },
  {
    id: "knorr-rice",
    brand: "Knorr Professional",
    title: { en: "Rice that tells a story of place", de: "Reis, der vom Ort erzählt", id: "Nasi yang bercerita tentang tempat" },
    desc: {
      en: "A regional rice dish using Knorr Aromat — anchored in your market, served on your line.",
      de: "Ein regionales Reisgericht mit Knorr Aromat — verankert im Markt, ausgegeben an deinem Pass.",
      id: "Nasi khas daerah dengan Knorr Aromat — berakar di pasarmu, disajikan di line-mu.",
    },
    pillar: "borderless",
    market: ["id", "en", "de"],
    payout: { en: "$520", de: "€480", id: "Rp 7.200.000" },
    deadline_days: 30,
    duration: "45s",
    submissions: 31,
    status: "open",
    featured: false,
    tone: "Grounded, local, sound-on",
    deliverables: ["1× 45s reel", "Recipe card (PDF)", "3 stills"],
  },
  {
    id: "hellmanns-burger",
    brand: "Hellmann's Foodservice",
    title: { en: "Your house burger, your house sauce", de: "Dein Hausburger, deine Haussauce", id: "Burger andalanmu, sausnya juga" },
    desc: {
      en: "Build the burger you actually serve. Hellmann's mayo as the base of your house sauce.",
      de: "Bau den Burger, den du wirklich servierst. Hellmann's als Basis deiner Haussauce.",
      id: "Bikin burger yang benar-benar kamu jual. Hellmann's jadi basis saus rumahanmu.",
    },
    pillar: "diner",
    market: ["en", "de", "id"],
    payout: { en: "$700", de: "€650", id: "Rp 9.000.000" },
    deadline_days: 5,
    duration: "60s",
    submissions: 48,
    status: "open",
    featured: false,
    tone: "Confident, pacey, no music required",
    deliverables: ["1× 60s landscape + vertical", "Sauce-build inset"],
  },
  {
    id: "future-menus-2026",
    brand: "UFS Future Menus 2026",
    title: { en: "Cook the trend: borderless brunch", de: "Den Trend kochen: Borderless Brunch", id: "Masak trennya: brunch tanpa batas" },
    desc: {
      en: "Pick one borderless-cuisine brunch dish from the Future Menus 2026 trend report and bring it to your line.",
      de: "Wähle ein Borderless-Brunch-Gericht aus dem Future-Menus-2026-Report und bring es auf deine Karte.",
      id: "Pilih satu hidangan brunch borderless dari laporan Future Menus 2026 dan bawakan ke line-mu.",
    },
    pillar: "borderless",
    market: ["en", "de", "id"],
    payout: { en: "$900", de: "€840", id: "Rp 12.500.000" },
    deadline_days: 18,
    duration: "90s",
    submissions: 63,
    status: "open",
    featured: false,
    tone: "Editorial, slow-burn, narrative",
    deliverables: ["1× 90s long-form", "1× 30s short-cut", "Behind-the-line photos"],
  },
];

const PILLARS = {
  borderless: { name: { en: "Borderless Cuisine", de: "Borderless Cuisine", id: "Borderless Cuisine" }, color: "#ed6c00", soft: "#fff7e6" },
  streetfood: { name: { en: "Street Food Couture", de: "Street Food Couture", id: "Street Food Couture" }, color: "#dc4d8b", soft: "#fde6ef" },
  roots: { name: { en: "Culinary Roots", de: "Culinary Roots", id: "Culinary Roots" }, color: "#00aeba", soft: "#d8f4f6" },
  diner: { name: { en: "Diner Designed", de: "Diner Designed", id: "Diner Designed" }, color: "#679641", soft: "#eef3da" },
};

// ─────────────────────────────────────────────────────────
// Sample chef profiles
// ─────────────────────────────────────────────────────────
const PROFILES = {
  new: {
    name: "Amaya Reyes",
    initials: "AR",
    role_key: "role_sous",
    location: { en: "Brooklyn, NY", de: "Brooklyn, NY", id: "Brooklyn, NY" },
    streak: 0,
    modules_done: 0,
    briefs_won: 0,
    avg_score: 0,
    member_since: { en: "March 2026", de: "März 2026", id: "Maret 2026" },
  },
  experienced: {
    name: "Marco Rivera",
    initials: "MR",
    role_key: "role_chef",
    location: { en: "Austin, TX", de: "Austin, TX", id: "Austin, TX" },
    streak: 41,
    modules_done: 18,
    briefs_won: 9,
    avg_score: 4.6,
    member_since: { en: "October 2024", de: "Oktober 2024", id: "Oktober 2024" },
  },
};

window.I18N = I18N;
window.COURSES = COURSES;
window.ACTIVE_MODULE = ACTIVE_MODULE;
window.BRIEFS = BRIEFS;
window.PILLARS = PILLARS;
window.PROFILES = PROFILES;

// ─────────────────────────────────────────────────────────
// V2 · Rewards milestones (catalog)
// ─────────────────────────────────────────────────────────
const REWARDS = [
  { id: "kit-starter", trigger: "module_1", kind: "physical", title: { en: "Starter content kit", de: "Starter-Content-Kit", id: "Starter content kit" }, sub: { en: "Phone tripod, ring light, 2 lavalier mics", de: "Handy-Stativ, Ringlicht, 2 Ansteckmikros", id: "Tripod HP, ring light, 2 mic clip" }, points: 50, threshold: 1, total: 500, claimed: 342 },
  { id: "badge-pilot", trigger: "module_3", kind: "digital", title: { en: "Pilot badge", de: "Pilot-Abzeichen", id: "Lencana Pilot" }, sub: { en: "Profile flair · 3 modules complete", de: "Profil-Flair · 3 Module abgeschlossen", id: "Flair profil · 3 modul selesai" }, points: 100, threshold: 3, total: 2000, claimed: 1287 },
  { id: "kit-knife", trigger: "module_5", kind: "physical", title: { en: "UFS chef knife", de: "UFS Kochmesser", id: "Pisau chef UFS" }, sub: { en: "8″ Damascus, engraved", de: "20 cm Damaskus, graviert", id: "8″ Damascus, ukir nama" }, points: 250, threshold: 5, total: 300, claimed: 156 },
  { id: "badge-graduate", trigger: "module_8", kind: "digital", title: { en: "Graduate badge", de: "Graduate-Abzeichen", id: "Lencana Graduate" }, sub: { en: "All 8 modules complete", de: "Alle 8 Module abgeschlossen", id: "Semua 8 modul selesai" }, points: 500, threshold: 8, total: 5000, claimed: 892 },
  { id: "kit-brief1", trigger: "brief_1", kind: "physical", title: { en: "First-brief box", de: "Erstes-Briefing-Paket", id: "Paket brief pertama" }, sub: { en: "Apron, recipe deck, hand-written note", de: "Schürze, Rezeptdeck, handgeschriebene Karte", id: "Celemek, kartu resep, surat tulisan tangan" }, points: 200, threshold: 1, total: 800, claimed: 534 },
  { id: "kit-paid", trigger: "brief_3", kind: "physical", title: { en: "Featured-chef bundle", de: "Featured-Chef-Paket", id: "Bundle chef pilihan" }, sub: { en: "UFS jacket, business cards, IG shoutout", de: "UFS-Jacke, Visitenkarten, IG-Shoutout", id: "Jaket UFS, kartu nama, shoutout IG" }, points: 750, threshold: 3, total: 150, claimed: 67 },
];

// V2 · Sequential modules within the camera-fundamentals course
const COURSE_MODULES = [
  { idx: 0, title: { en: "Why kitchen light is hard", de: "Warum Küchenlicht schwierig ist", id: "Kenapa cahaya dapur sulit" }, dur: 360, status: "done" },
  { idx: 1, title: { en: "Reading your room", de: "Den Raum lesen", id: "Membaca ruangmu" }, dur: 420, status: "done" },
  { idx: 2, title: { en: "Phone settings for chefs", de: "Handy-Einstellungen für Köche", id: "Pengaturan HP untuk chef" }, dur: 540, status: "done" },
  { idx: 3, title: { en: "Stabilising on the line", de: "Stabilisieren am Pass", id: "Menstabilkan di line" }, dur: 480, status: "current" },
  { idx: 4, title: { en: "Side-light, top-down, 30° hero", de: "Seitenlicht, Top-Down, 30°-Hero", id: "Side-light, top-down, 30° hero" }, dur: 384, status: "next" },
  { idx: 5, title: { en: "Cutting on the line in 10 minutes", de: "Schneiden am Pass in 10 Minuten", id: "Edit di line dalam 10 menit" }, dur: 600, status: "locked" },
  { idx: 6, title: { en: "Captions for three markets", de: "Untertitel für drei Märkte", id: "Subtitle untuk tiga pasar" }, dur: 420, status: "locked" },
  { idx: 7, title: { en: "Your first submission", de: "Deine erste Einreichung", id: "Submisi pertamamu" }, dur: 540, status: "locked" },
];

// V2 · Notification feed (milestones, brief activity, captions ready)
const NOTIFICATIONS = [
  { id: "n1", kind: "reward",  read: false, time: { en: "2m", de: "2m", id: "2m" },
    title: { en: "Module 3 complete — reward shipping", de: "Modul 3 abgeschlossen — Belohnung unterwegs", id: "Modul 3 selesai — hadiah dikirim" },
    sub:   { en: "Pilot badge unlocked. Starter kit shipping in 3–5 days.", de: "Pilot-Abzeichen freigeschaltet. Starter-Kit in 3–5 Tagen unterwegs.", id: "Lencana Pilot terbuka. Starter kit dikirim 3–5 hari." } },
  { id: "n2", kind: "brief",   read: false, time: { en: "1h", de: "1 Std", id: "1j" },
    title: { en: "Knorr broth brief — accepted", de: "Knorr-Brühe-Briefing — angenommen", id: "Brief kaldu Knorr — diterima" },
    sub:   { en: "Tracked in My briefs. Deadline in 12 days.", de: "Geführt unter Meine Briefings. Deadline in 12 Tagen.", id: "Tercatat di Brief saya. Deadline 12 hari." } },
  { id: "n3", kind: "captions", read: true, time: { en: "yesterday", de: "gestern", id: "kemarin" },
    title: { en: "Captions ready in 3 languages", de: "Untertitel in 3 Sprachen bereit", id: "Subtitle siap dalam 3 bahasa" },
    sub:   { en: "Module 4 · EN, DE, ID auto-generated and reviewed.", de: "Modul 4 · EN, DE, ID erzeugt und geprüft.", id: "Modul 4 · EN, DE, ID dibuat & diperiksa." } },
  { id: "n4", kind: "milestone", read: true, time: { en: "2d", de: "2T", id: "2h" },
    title: { en: "3-day streak — keep going", de: "3-Tage-Streak — weiter so", id: "Streak 3 hari — lanjutkan" },
    sub:   { en: "Hit 7 days for a featured-path unlock.", de: "Erreiche 7 Tage für einen Featured-Path.", id: "Capai 7 hari untuk unlock featured-path." } },
];

// V2 · Brief claim/acceptance state by chef
const BRIEF_CLAIMS = {
  // briefId: { status, claimed_at, deadline_in, others_claimed }
  "knorr-broth":     { status: "claimed",   when: "today",    others: 5 },
  "hellmanns-mayo":  { status: "open",      when: null,        others: 0 },
  "lipton-iced":     { status: "open",      when: null,        others: 0 },
  "knorr-rice":      { status: "submitted", when: "3d ago",    others: 8 },
  "hellmanns-burger":{ status: "open",      when: null,        others: 0 },
  "future-menus-2026":{ status: "open",      when: null,       others: 0 },
};

// V2 · Per-course module lists. Statuses derived from the course's `progress` field
// done   → already completed
// current → in progress (the one to "Resume")
// next    → unlocked & ready to start (the next module after current)
// locked  → not yet unlocked (must complete prior modules first)
const COURSE_SYLLABI = {
  fundamentals: [
    { en: "Why kitchen light is hard",        de: "Warum Küchenlicht schwierig ist", id: "Kenapa cahaya dapur sulit" },
    { en: "Reading your room",                de: "Den Raum lesen",                  id: "Membaca ruangmu" },
    { en: "Phone settings for chefs",         de: "Handy-Einstellungen für Köche",   id: "Pengaturan HP untuk chef" },
    { en: "Stabilising on the line",          de: "Stabilisieren am Pass",           id: "Menstabilkan di line" },
    { en: "Side-light, top-down, 30° hero",   de: "Seitenlicht, Top-Down, 30°-Hero", id: "Side-light, top-down, 30° hero" },
    { en: "Captions for three markets",       de: "Untertitel für drei Märkte",      id: "Subtitle untuk tiga pasar" },
    { en: "Hook, beat, payoff",               de: "Hook, Beat, Pointe",              id: "Hook, beat, payoff" },
    { en: "Practice brief: your first reel",  de: "Übungs-Brief: dein erstes Reel",  id: "Brief latihan: reel pertamamu" },
  ],
  story: [
    { en: "Hook, beat, payoff",               de: "Hook, Beat, Pointe",              id: "Hook, beat, payoff" },
    { en: "The first 3 seconds",              de: "Die ersten 3 Sekunden",           id: "Tiga detik pertama" },
    { en: "Building tension in 12 frames",    de: "Spannung in 12 Frames",           id: "Membangun tensi di 12 frame" },
    { en: "Voice-over vs on-camera",          de: "Voice-Over vs vor der Kamera",    id: "Voice-over vs on-camera" },
    { en: "Choosing the right pace",          de: "Das richtige Tempo wählen",       id: "Memilih pace yang pas" },
    { en: "When to break the rules",          de: "Wann Regeln brechen",             id: "Kapan langgar aturan" },
    { en: "End on a save-worthy moment",      de: "Mit einem Save-Moment enden",     id: "Akhiri dengan momen layak save" },
    { en: "Practice brief: 30s recipe story", de: "Übungs-Brief: 30s Rezeptstory",   id: "Brief latihan: cerita resep 30d" },
  ],
  voice: [
    { en: "Speak to one viewer",              de: "Zu einer Person sprechen",        id: "Bicara ke satu orang" },
    { en: "Drop the script, keep the structure", de: "Skript loslassen, Struktur halten", id: "Lepas naskah, jaga struktur" },
    { en: "Breathing & pacing on camera",     de: "Atmen & Tempo vor der Kamera",    id: "Napas & tempo di kamera" },
    { en: "Sounding like yourself",           de: "Wie du selbst klingen",           id: "Tetap terdengar 'kamu'" },
    { en: "Recovering from a stumble",        de: "Sich nach einem Patzer fangen",   id: "Pulih dari terbata-bata" },
  ],
  edit: [
    { en: "The 10-minute edit ritual",        de: "Das 10-Minuten-Edit-Ritual",      id: "Ritual edit 10 menit" },
    { en: "Cuts on the beat",                 de: "Schnitte auf den Beat",           id: "Potong di beat" },
    { en: "Audio sync without thinking",      de: "Audio-Sync ohne Denken",          id: "Sync audio tanpa mikir" },
    { en: "Export-ready presets",             de: "Export-fertige Presets",          id: "Preset siap export" },
  ],
  brand: [
    { en: "Position against three competitors", de: "Gegen drei Wettbewerber positionieren", id: "Posisikan vs tiga kompetitor" },
    { en: "Find your one promise",            de: "Dein eines Versprechen finden",   id: "Temukan janji satu-satunya" },
    { en: "Visual system in 5 decisions",     de: "Visuelles System in 5 Entscheidungen", id: "Sistem visual dalam 5 keputusan" },
    { en: "The content pillar plan",          de: "Der Content-Säulen-Plan",         id: "Rencana pilar konten" },
    { en: "Pricing your kitchen's voice",     de: "Den Küchen-Preis bestimmen",      id: "Tentukan harga suara dapurmu" },
    { en: "Building the wait-list",           de: "Die Warteliste aufbauen",         id: "Membangun waiting list" },
    { en: "Collaborations that scale",        de: "Kollaborationen, die skalieren",  id: "Kolaborasi yang skala" },
    { en: "Press, awards, festival circuits", de: "Presse, Awards, Festivals",       id: "Pers, awards, festival" },
    { en: "From freelance to studio",         de: "Von Freelance zum Studio",        id: "Dari freelance ke studio" },
    { en: "Year-one growth playbook",         de: "Erstes-Jahr-Playbook",            id: "Playbook tahun pertama" },
  ],
  analytics: [
    { en: "Reading watch-time like a ticket", de: "Watch-Time lesen wie einen Bon", id: "Baca watch-time seperti ticket" },
    { en: "The first hour signal",            de: "Das Signal der ersten Stunde",   id: "Sinyal jam pertama" },
    { en: "Saves vs follows vs shares",       de: "Saves vs Follows vs Shares",     id: "Save vs follow vs share" },
    { en: "Killing what doesn't work",        de: "Beenden, was nicht funktioniert", id: "Buang yang tidak jalan" },
    { en: "Reading a 28-day trend",           de: "Einen 28-Tage-Trend lesen",      id: "Baca tren 28 hari" },
    { en: "Building your own dashboard",      de: "Dein eigenes Dashboard bauen",   id: "Buat dashboard sendiri" },
  ],
};

// Build full module objects with status, duration, and (optional) summary
function _buildModules(courseId) {
  const course = COURSES.find(c => c.id === courseId);
  const titles = COURSE_SYLLABI[courseId] || [];
  const total = titles.length;
  const doneCount = course.progress >= 1 ? total : Math.floor(course.progress * total);
  const currentIdx = course.progress > 0 && course.progress < 1 ? doneCount : -1; // module in progress
  const nextUnlockedIdx = course.progress >= 1 ? -1 : (currentIdx >= 0 ? currentIdx + 1 : 0);
  return titles.map((title, idx) => {
    let status;
    if (course.progress >= 1) status = "done";
    else if (idx < doneCount) status = "done";
    else if (idx === currentIdx) status = "current";
    else if (idx === nextUnlockedIdx) status = "next";
    else status = "locked";
    return {
      idx,
      title,
      dur: 360 + (idx % 4) * 90, // 6–10.5 min
      status,
    };
  });
}

const COURSE_MODULES_BY_ID = Object.fromEntries(
  COURSES.map(c => [c.id, _buildModules(c.id)])
);

window.COURSE_SYLLABI = COURSE_SYLLABI;
window.COURSE_MODULES_BY_ID = COURSE_MODULES_BY_ID;
window.REWARDS = REWARDS;
window.COURSE_MODULES = COURSE_MODULES;
window.NOTIFICATIONS = NOTIFICATIONS;
window.BRIEF_CLAIMS = BRIEF_CLAIMS;
