/* i18n V2 — native, idiomatic, broadcast-editorial tone */

const LOCALES = [
  { code: "en", label: "EN" },
  { code: "zh", label: "中文" },
  { code: "es", label: "ES" },
];

/* Each value is [en, zh, es]. EN is source-of-truth for V2 voice. */
const STRINGS = {
  /* Nav */
  "nav.work":     ["Customers", "客户", "Clientes"],
  "nav.how":      ["How it works", "流程", "Cómo funciona"],
  "nav.guardian": ["Compliance", "合规", "Cumplimiento"],
  "nav.pricing":  ["Pricing", "价格", "Precios"],
  "nav.faq":      ["FAQ", "FAQ", "FAQ"],
  "nav.login":    ["Log in", "登录", "Entrar"],
  "nav.logout":   ["Log out", "退出", "Salir"],
  "nav.cta":      ["Start a project", "开始项目", "Empezar"],

  /* Hero — SMB positioning: Scenera is the AI agency that gives small
     merchants what only big brands could buy before. H1 sets up the
     affordability gap; sub clarifies audience + process + price anchor. */
  "hero.h1.a":    [
    "The agency you couldn't afford,",
    "以前你买不起的 agency，",
    "La agencia que no podías permitirte,",
  ],
  "hero.h1.b":    [
    "now ships in 24 hours.",
    "现在 24 小时就交片。",
    "ahora entrega en 24 horas.",
  ],
  "hero.sub":     [
    "We're the AI video agency for small businesses heading into the World Cup. Send us your photos; we ship spots in three languages, FIFA-cleared — at a tenth of agency cost.",
    "我们是为中小商家做世界杯营销的 AI 视频 agency。发我们照片，我们交付三种语言的短片，过 FIFA 合规 —— 价格只是 agency 的一成。",
    "Somos la agencia de vídeo con IA para pymes en la temporada del Mundial. Mándanos tus fotos; entregamos cortes en tres idiomas, revisados contra la lista de protección de marca de la FIFA — al 10 % del coste de una agencia.",
  ],
  "hero.cta":     ["Brief us → delivery in 24h", "提交需求 → 24 小时交付", "Cuéntanos → entrega en 24 h"],

  /* Ticker */
  "tick.1": ["Match-day spots, ready before kickoff", "比赛日素材，开赛前到手", "Anuncios del día del partido, listos antes del pitazo"],
  "tick.2": ["Tier-1 + Tier-2 compliance on every cut", "每条都过两层合规审", "Cumplimiento Tier 1 + Tier 2 en cada corte"],
  "tick.3": ["Multi-language by default", "天然多语言交付", "Multi-idioma de serie"],
  "tick.4": ["AI pipeline. Human editors. No spaghetti.", "AI 流水线 + 真剪辑师，绝不糊弄", "Pipeline de IA, editores humanos, sin atajos"],

  /* Mosaic / Proof */
  /* (Proof keys removed — merged into Stories/Customers section above) */

  /* Customers — merged section (replaces old Proof + Stories duo).
     Four real shops, each card pairs the reel with the owner's quote
     and key metrics. No more "stories" / "proof" split — one block,
     visual + voice + numbers per case. */
  "st.eye":     ["Customers", "客户", "Clientes"],
  "st.title":   [
    "Four shops like yours, in their own words.",
    "四家和你一样的店，他们自己说。",
    "Cuatro negocios como el tuyo, en sus propias palabras.",
  ],
  "st.lede":    [
    "A café, a sports bar, a 12-venue bistro chain, a DTC brand. Same 24-hour pipeline, four different shapes of win.",
    "一家咖啡馆、一家球迷酒吧、一家 12 门店的连锁餐厅、一个 DTC 服饰品牌。同一条 24 小时流水线，四种不同形状的赢。",
    "Un café, un bar deportivo, una cadena de 12 bistrós, una marca DTC. Mismo pipeline de 24 horas, cuatro formas distintas de ganar.",
  ],

  "st.a.tag":   ["Single venue", "单店活动", "Local único"],
  "st.a.name":  ["Lena R.", "Lena R.", "Lena R."],
  "st.a.role":  ["Owner, Café Olé Kreuzberg · Berlin", "Café Olé Kreuzberg 店主 · 柏林", "Dueña, Café Olé Kreuzberg · Berlín"],
  "st.a.quote": ["I shot three iPhone photos on a Tuesday. By Wednesday I had a 30-second Reel in German and Spanish. Fully booked for the opening match.", "周二我用 iPhone 拍了三张照片。周三就拿到了德语 + 西语两版 30 秒 Reels。开赛日订位爆满。", "El martes hice tres fotos con el iPhone. El miércoles tenía un Reel de 30 segundos en alemán y español. Aforo completo para el partido inaugural."],
  "st.a.ctx":   ["Café Olé needed a watch-party promo without a marketing team. Scenera's photo_direct kept the venue recognizable; multi-language cuts ran natively on Reels and TikTok.", "Café Olé 没有营销团队，需要一支球迷夜预告片。Scenera 的 photo_direct 保留了门店辨识度，多语言版本直接发到 Reels 和 TikTok。", "Café Olé necesitaba promo para una noche de partido sin equipo de marketing. El photo_direct mantuvo el local reconocible; los cortes multilingües se publicaron directos en Reels y TikTok."],
  "st.a.s1.n":  ["+40%", "+40%", "+40%"],
  "st.a.s1.l":  ["bookings opening night", "开赛夜订位", "reservas la primera noche"],
  "st.a.s2.n":  ["24h", "24h", "24h"],
  "st.a.s2.l":  ["brief to live", "从需求到上线", "del brief al directo"],
  "st.a.s3.n":  ["€420", "€420", "€420"],
  "st.a.s3.l":  ["total spend", "项目总价", "coste total"],

  "st.b.tag":   ["Sports bar", "球迷酒吧", "Bar deportivo"],
  "st.b.name":  ["Carlos R.", "Carlos R.", "Carlos R."],
  "st.b.role":  ["Owner · El Banquillo, Buenos Aires", "El Banquillo 老板 · 布宜诺斯艾利斯", "Dueño · El Banquillo, Buenos Aires"],
  "st.b.quote": ["I was about to post 'official tournament partner — fan night' on Instagram. Guardian caught it. Three rewrites later, in Spanish and Portuguese. Sold out three Saturdays in a row.", "差点在 Instagram 发了「官方赛事合作伙伴 · 球迷夜」海报，Guardian 拦下来了。改了三版，西语 + 葡语两版一起出。连续三个周六满座。", "Estaba a punto de subir 'partner oficial del torneo — noche de aficionados' a Instagram. Guardian lo cazó. Tres reescrituras después, en español y portugués. Lleno tres sábados seguidos."],
  "st.b.ctx":   ["El Banquillo has no marketing team and no agency. Scenera flagged 4 trademark-bait phrases in the first draft, rewrote them, and delivered the spot the next day.", "El Banquillo 没有营销团队，也没 agency。Scenera 在初稿里揪出 4 处商标地雷，改完之后次日就交付了。", "El Banquillo no tiene equipo de marketing ni agencia. Scenera detectó 4 frases de cebo de marca en el primer borrador, las reescribió y lo entregó al día siguiente."],
  "st.b.s1.n":  ["0", "0", "0"],
  "st.b.s1.l":  ["legal letters received", "收到律师函", "cartas legales recibidas"],
  "st.b.s2.n":  ["3", "3", "3"],
  "st.b.s2.l":  ["sold-out Saturdays", "满座周六", "sábados llenos"],
  "st.b.s3.n":  ["€480", "€480", "€480"],
  "st.b.s3.l":  ["total spend", "项目总价", "coste total"],

  "st.c.tag":   ["Restaurant chain", "餐饮连锁", "Cadena de restaurantes"],
  "st.c.name":  ["Marie L.", "Marie L.", "Marie L."],
  "st.c.role":  ["Owner · 12 bistros, France", "12 家小餐厅老板 · 法国", "Dueña · 12 bistrós, Francia"],
  "st.c.quote": ["Twelve venues, twelve cuts, one weekend. Each one shows the right city, the right menu, the right language. That's what 'localized' actually means.", "12 家店，12 条片，一个周末搞定。每条都对得上当地的城市、菜单、语言。这才叫真本地化。", "Doce locales, doce cortes, un solo fin de semana. Cada uno con su ciudad, su carta, su idioma. Eso sí es 'localizado'."],
  "st.c.ctx":   ["Photo_direct kept each storefront recognizable; AI assembled twelve location-specific cuts overnight without manual edits. Posted simultaneously across all venue accounts.", "photo_direct 保留每家店的门头辨识度；AI 隔夜并行生成 12 条本地化版本。所有门店账号同步上线。", "Photo_direct mantuvo cada fachada reconocible; la IA generó doce cortes locales durante la noche. Todos los locales publicaron a la vez."],
  "st.c.s1.n":  ["12", "12", "12"],
  "st.c.s1.l":  ["venues, parallel cuts", "家店并行交付", "locales, cortes en paralelo"],
  "st.c.s2.n":  ["1 night", "1 晚", "1 noche"],
  "st.c.s2.l":  ["production window", "制作周期", "ventana de producción"],
  "st.c.s3.n":  ["+28%", "+28%", "+28%"],
  "st.c.s3.l":  ["foot traffic, match days", "比赛日到店", "tráfico los días de partido"],

  "st.d.tag":   ["E-commerce", "电商", "E-commerce"],
  "st.d.name":  ["Akira S.", "Akira S.", "Akira S."],
  "st.d.role":  ["Founder · DTC apparel, Tokyo", "DTC 服饰创始人 · 东京", "Fundador · DTC moda, Tokio"],
  "st.d.quote": ["We A/B tested four creative angles in the time our old agency would've delivered one. The winning cut tripled our ROAS on FIFA-window inventory.", "在以前 agency 出一条片的时间里，我们 A/B 测试了 4 个创意方向。胜出版本在世界杯窗口的 ROAS 翻了三倍。", "Hicimos test A/B con cuatro ángulos en el tiempo que la agencia anterior tardaba en uno. El ganador triplicó nuestro ROAS en el inventario del Mundial."],
  "st.d.ctx":   ["Four angle variants generated from a single brief; identical product shots, different hooks. Performance data fed back into the next batch within 72 hours.", "一份 brief 出 4 个 angle 变体——同一组产品图，不同切入点。投放数据 72 小时内反哺下一轮。", "Cuatro variantes de ángulo desde un solo brief — mismas fotos, distintos hooks. Los datos de rendimiento alimentaron la siguiente tanda en 72 horas."],
  "st.d.s1.n":  ["4 angles", "4 angle", "4 ángulos"],
  "st.d.s1.l":  ["tested in week one", "首周完成测试", "testeados la 1.ª semana"],
  "st.d.s2.n":  ["3×", "3×", "3×"],
  "st.d.s2.l":  ["ROAS on winning cut", "胜出版本 ROAS", "ROAS del ganador"],
  "st.d.s3.n":  ["72h", "72h", "72h"],
  "st.d.s3.l":  ["data → next iteration", "数据到下一版", "datos → siguiente iteración"],

  /* Workflow */
  "wf.eye":   ["How it works", "工作流", "Cómo funciona"],
  "wf.title": ["Four steps from brief to broadcast.", "从需求到上线，四步完成。", "Cuatro pasos del brief a la emisión."],
  "wf.lede":  ["Standard turnaround is 24 hours. A human signs off every transition.", "标准 24 小时交付。每一步切换都有人把关。", "El plazo estándar es de 24 horas. Cada transición la confirma una persona."],
  "wf.1.t":  ["Brief us", "你提交需求", "Cuéntanos"],
  "wf.1.d":  ["One form, your assets, done. No back-and-forth.", "一张表单 + 你的素材，搞定。不来回拉扯。", "Un formulario, tus archivos y listo. Sin idas y vueltas."],
  "wf.2.t":  ["We read intent", "我们解读意图", "Entendemos qué buscas"],
  "wf.2.d":  ["Auto research plus asset analysis. We figure out the angle.", "自动调研 + 素材分析。我们替你想清楚 angle。", "Investigación automática y análisis de material. Encontramos el ángulo."],
  "wf.3.t":  ["AI produces", "AI 生产", "Producción con IA"],
  "wf.3.d":  ["Clips, voiceover, subtitles, language variants — all generated in parallel.", "镜头、配音、字幕、多语言版本——并行生成。", "Clips, locución, subtítulos y variantes de idioma, todo en paralelo."],
  "wf.4.t":  ["Editor finishes", "剪辑师收尾", "El editor remata"],
  "wf.4.d":  ["Color, mix, final cut in an NLE. Then Guardian signs the compliance report.", "调色、混音、NLE 终剪。Guardian 出合规报告签名。", "Color, mezcla y corte final en un NLE. Después Guardian firma el informe de cumplimiento."],

  /* Workflow Step 2 demo — four intent tags surfaced from the photos.
     Hard ceiling: 6 ASCII chars (≈ 30px @ 7.5px mono uppercase + 0.06em)
     fits comfortably inside a 60-wide pill. Used in StepDemo2; lowercased
     here, the chip CSS applies text-transform: uppercase across locales. */
  "wf.d2.t1": ["warm",  "暖光", "cálido"],
  "wf.d2.t2": ["match", "比赛", "partido"],
  "wf.d2.t3": ["night", "夜场", "noche"],
  "wf.d2.t4": ["venue", "户外", "lugar"],

  /* Workflow Step 4 demo — the compliance stamp text. Keep ≤ 12 visual
     chars so it fits the 136-unit pill at 13px display font. */
  "wf.d4.stamp": ["Guardian ✓", "Guardian ✓", "Guardian ✓"],

  /* Guardian */
  "gd.eye":   ["Compliance · Guardian", "合规 · Guardian", "Cumplimiento · Guardian"],
  "gd.title": ["FIFA's lawyers won't be calling.", "FIFA 的律师不会找上门。", "Los abogados de la FIFA no van a llamar."],
  "gd.lede":  ["Every subtitle, voiceover and visual passes Tier 1 mechanical rules and Tier 2 LLM review. Anything flagged → the rewrite assistant proposes three safe options. The compliance report ships with the final cut.", "每条字幕、旁白、画面提示都过 Tier 1 机械规则 + Tier 2 LLM 整体判断。命中违规 → 改写助手给三个安全表达。合规报告随终片一起交付。", "Cada subtítulo, locución y elemento visual pasa por reglas mecánicas (Tier 1) y revisión por IA (Tier 2). Si algo se marca, el asistente sugiere tres alternativas seguras. El informe de cumplimiento llega con el corte final."],
  "gd.bad":   ["Blocked", "已拦截", "Bloqueado"],
  "gd.good":  ["Safe rewrites", "安全改写", "Reescrituras seguras"],
  "gd.arrow": ["Guardian rewrite", "Guardian 改写", "Reescribe con Guardian"],

  /* Guardian demo — use [[…]] to mark trademark-bait phrases.
     The "bad" example deliberately mimics over-eager merchant copy without
     literally naming the rights-holder; the "good" rewrites preserve intent
     and lose the trademark exposure. */
  "gd.demo.bad":    [
    "[[Cup fan night]] this Saturday — [[official tournament partner]] pricing!",
    "本周六 [[杯赛球迷夜]] —— [[官方赛事合作伙伴]] 价！",
    "[[Noche de aficionados de la Copa]] este sábado — precios de [[partner oficial del torneo]]!",
  ],
  "gd.demo.good.1": [
    "[[Match-day fan night]] Saturday — [[special menu]] pricing!",
    "周六 [[比赛日球迷夜]] —— [[特别菜单]] 价！",
    "[[Noche de aficionados de jornada]] el sábado — precios de [[menú especial]]!",
  ],
  "gd.demo.good.2": [
    "[[Big game watch night]] — [[early-bird]] pricing!",
    "[[大赛观赛之夜]] —— [[早鸟]] 价！",
    "[[Noche de gran partido]] — precios [[anticipados]]!",
  ],
  "gd.demo.good.3": [
    "[[Saturday football night]] — [[group booking]] discounts!",
    "[[周六足球之夜]] —— [[团体预订]] 优惠！",
    "[[Noche de fútbol del sábado]] — descuentos por [[reserva de grupo]]!",
  ],

  /* Reel captions — small chip inside each tile. reel.1-4 align with the
     four Customers cards (st.a-d) by index. reel.5-6 are Hero-only brand
     teasers without a dedicated case story. "Brand · langs · format". */
  "reel.1": ["Café Olé · DE/ES · 30s",       "Café Olé · 德/西 · 30s",       "Café Olé · DE/ES · 30s"],
  "reel.2": ["El Banquillo · ES/PT · 30s",   "El Banquillo · 西/葡 · 30s",   "El Banquillo · ES/PT · 30s"],
  "reel.3": ["Bistro 73 · FR · 12 cuts",     "Bistro 73 · 法 · 12 条",       "Bistro 73 · FR · 12 cortes"],
  "reel.4": ["Kasuri Threads · JP/EN · ×4",  "Kasuri Threads · 日/英 · ×4",  "Kasuri Threads · JP/EN · ×4"],
  "reel.5": ["Maracaná Goods · BR · 60s",    "Maracaná Goods · 巴 · 60s",    "Maracaná Goods · BR · 60s"],
  "reel.6": ["Volta Mercado · MX · 15s",     "Volta Mercado · 墨 · 15s",     "Volta Mercado · MX · 15s"],

  /* Pricing */
  "pr.eye":   ["Pricing", "价格", "Precios"],
  "pr.title": ["Honest pricing, billed by complexity.", "诚实定价 —— 按复杂度计费。", "Precios claros, según complejidad."],
  "pr.lede":  [
    "Two fixed-price tiers cover most projects. One custom track when yours doesn't.",
    "两档固定价覆盖多数项目；剩下的特殊需求走定制档。",
    "Dos niveles de precio fijo cubren la mayoría. Una vía personalizada cuando el tuyo no encaja.",
  ],
  "pr.flag":  ["Most teams pick this", "多数客户选这档", "La mayoría elige este"],

  "pr.l.lbl":  ["Light · 30s", "轻量 · 30s", "Ligero · 30s"],
  "pr.l.name": ["For a single post.", "单条投放即可。", "Para una sola publicación."],
  "pr.l.prc":  ["$59", "¥399", "$59"],
  "pr.l.desc": ["One platform, one language. Best for a quick venue promo or organic post.", "单平台 / 单语言。适合单店促销或自然帖。", "Una plataforma, un idioma. Ideal para promo de local o publicación orgánica."],
  "pr.l.1":    ["1 master cut", "1 条母版", "1 corte máster"],
  "pr.l.2":    ["1 deliverable", "1 个交付件", "1 entregable"],
  "pr.l.3":    ["2 revision rounds", "2 轮修改", "2 rondas de revisiones"],
  "pr.l.4":    ["Basic Guardian scan", "基础 Guardian 扫描", "Escaneo Guardian básico"],

  "pr.s.lbl":  ["Standard · 60s", "标准 · 60s", "Estándar · 60s"],
  "pr.s.name": ["For a real campaign.", "认真做一波 campaign。", "Para una campaña en serio."],
  "pr.s.prc":  ["$99", "¥699", "$99"],
  "pr.s.desc": ["Multi-language, multi-platform, full compliance report. The default choice.", "多语言 + 多平台 + 完整合规报告。多数客户的默认选择。", "Multi-idioma, multi-plataforma, informe de cumplimiento completo. La opción por defecto."],
  "pr.s.1":    ["1 master + 3 deliverables", "1 母版 + 3 交付件", "1 máster + 3 entregables"],
  "pr.s.2":    ["Up to 3 language cuts", "最多 3 个语言版本", "Hasta 3 cortes de idioma"],
  "pr.s.3":    ["Full compliance report", "完整合规报告", "Informe de cumplimiento completo"],
  "pr.s.4":    ["2 revisions · same-day rush available", "2 轮修改 · 可当日加急", "2 revisiones · entrega exprés el mismo día"],

  "pr.c.lbl":  ["Custom", "定制", "Personalizado"],
  "pr.c.name": ["For something different.", "需求不一样？", "¿Algo distinto?"],
  "pr.c.prc":  ["Talk to us", "详谈", "Hablemos"],
  "pr.c.desc": [
    "When your project doesn't slot into Light or Standard — longer formats, more language pairs, multi-venue rollouts, ongoing campaigns. We scope it and quote.",
    "项目放不进 Light 或 Standard —— 更长时长、更多语言、多店铺、月度投放，都走这一档。我们出方案 + 报价。",
    "Cuando tu proyecto no encaja en Ligero o Estándar — formatos más largos, más pares de idiomas, multi-local, campañas continuas. Lo definimos y cotizamos.",
  ],
  "pr.c.1":    ["Longer formats, more language pairs", "更长时长、更多语种对", "Formatos más largos, más idiomas"],
  "pr.c.2":    ["Multi-venue or franchise rollout", "多店或加盟统一投放", "Multi-local o franquicia"],
  "pr.c.3":    ["Monthly campaigns or retainer", "月度 campaign 或长期合作", "Campañas mensuales o continuas"],
  "pr.c.4":    ["Custom Guardian rules for your brand", "为你品牌定制 Guardian 规则", "Reglas Guardian a medida"],

  "pr.cta":    ["Pick this tier", "选这档", "Elegir nivel"],
  "pr.ctaC":   ["Talk to sales", "聊聊项目", "Hablar con ventas"],

  /* Form */
  "fm.eye":   ["Submit a project", "提交项目", "Enviar proyecto"],
  "fm.title": ["Fill it once. We start producing.", "一次填完，立即开始制作。", "Rellénalo una vez. Empezamos a producir."],
  /* Form section eyebrows — split long form into 3 visual groups */
  "fm.group.package": ["01 · Package",  "01 · 套餐",      "01 · Paquete"],
  "fm.group.contact": ["02 · Contact",  "02 · 联系方式",  "02 · Contacto"],
  "fm.group.project": ["03 · Project",  "03 · 项目",      "03 · Proyecto"],
  "fm.lede":  ["Two minutes if you know what you want. Five if you don't.", "知道要什么的 2 分钟，不知道的 5 分钟。", "Dos minutos si sabes qué quieres. Cinco si no."],
  "fm.tier":  ["Package", "套餐", "Paquete"],
  "fm.email": ["Email", "邮箱", "Email"],
  "fm.email.placeholder": ["We auto-fill this after login", "登录后自动填充", "Se rellena al iniciar sesión"],
  "fm.email.help":["The final video lands in this inbox.", "终片会发到这个邮箱。", "El vídeo final llegará aquí."],
  "fm.brand": ["Brand or venue", "品牌 / 店名", "Marca o local"],
  "fm.address":      ["Address", "门店地址", "Dirección"],
  "fm.address.help": [
    "Street-level address. We pull Google Street View from here as visual reference, so be precise.",
    "请填到门牌号级别。我们会根据这个地址抓 Google 街景作为出片参考，越精确越好。",
    "Dirección al nivel de calle. Extraemos Google Street View desde aquí como referencia visual — sé preciso.",
  ],
  "fm.website":      ["Website (optional)", "官网（可选）", "Sitio web (opcional)"],
  "fm.website.help": [
    "If you have one, we'll reuse the photos, logo and brand assets we find there.",
    "如果有官网，我们会复用上面的照片、Logo 和品牌素材。",
    "Si tienes uno, reutilizaremos las fotos, logo y elementos de marca que encontremos.",
  ],
  "fm.brief": ["What do you want to make?", "你想做什么视频？", "¿Qué quieres hacer?"],
  "fm.brief.placeholder": ["A sentence or a paragraph. e.g. 'June 14 watch party, want local fans to know we're showing the opener.'", "一句话或一段话都行。例：6 月 14 日观赛夜，想吸引本地球迷来店里。", "Una frase o un párrafo. Ej.: «Noche del 14 de junio, quiero que los aficionados sepan que retransmitimos el inaugural.»"],
  "fm.brief.help": ["More detail = sharper output. The AI reads this directly.", "越详细，AI 出片越贴近你想要的。", "Más detalle = mejor resultado. La IA lee esto directamente."],
  "fm.custom":["Tell us more", "定制需求", "Cuéntanos más"],
  "fm.custom.placeholder":["Length, platforms, language cuts, compliance needs, budget cap, links to past work — the more specific, the better.", "时长 / 平台 / 语言 / 合规 / 预算 / 历史素材链接……越具体越好。", "Duración, plataformas, idiomas, cumplimiento, presupuesto, enlaces a trabajos previos — cuanto más, mejor."],
  "fm.custom.help":["We use this to build your quote within 24 hours.", "我们 24 小时内基于这段出报价。", "Lo usamos para tu presupuesto en 24 horas."],
  "fm.deadline":["When do you need it?", "什么时候要？", "¿Para cuándo?"],
  "fm.deadline.help":["Leave blank for the standard 24-hour turnaround.", "空着即标准 24 小时交付。", "Déjalo en blanco para entrega estándar en 24 h."],
  "fm.deadline.help.c":["Custom turnaround depends on scope.", "定制项目周期视复杂度而定。", "El plazo personalizado depende del alcance."],
  "fm.upload.t":["Drop your assets", "上传你的素材", "Sube tus archivos"],
  "fm.upload.s":["Venue / product photos, logos, brand guides, references. The AI reuses them so the output feels like *you*.", "门店或产品照、Logo、品牌指南、参考素材。AI 会复用，让出片看起来就是你。", "Fotos de local o producto, logos, guías de marca, referencias. La IA los reutiliza para que el resultado sea *tú*."],
  "fm.submit": ["Submit project", "提交项目", "Enviar"],
  "fm.submit.c":["Send custom request", "提交定制需求", "Enviar solicitud personalizada"],
  "fm.submit.g":["Log in to submit", "登录后提交", "Inicia sesión para enviar"],
  "fm.foot.c": ["Sales replies within 24 hours with a quote and creative direction.", "销售在 24 小时内邮件回复报价和方向。", "Comercial responde en 24 h con presupuesto y dirección."],

  /* FAQ */
  "faq.eye":   ["FAQ", "FAQ", "FAQ"],
  "faq.title": ["Anything else?", "还有别的问题吗？", "¿Algo más?"],

  "faq.q1": ["How fast is delivery, really?", "到底多久能拿到？", "¿En cuánto tiempo, en serio?"],
  "faq.a1": ["24 hours from brief to final cut for Light and Standard. Custom timelines depend on scope — we confirm in the quote.", "Light 和 Standard 都是 24 小时——从提交到终片。定制看范围，报价里写明。", "24 horas, del brief al corte final, en Light y Estándar. En Personalizado depende del alcance — vendrá en el presupuesto."],
  "faq.q2": ["Can I request changes?", "能改吗？", "¿Puedo pedir cambios?"],
  "faq.a2": ["Every project includes two free revision rounds. Beyond that, we bill hourly at the editor's rate.", "每个项目含 2 轮免费修改；超出按剪辑师工时计费。", "Cada proyecto incluye dos rondas gratis. Más allá, se factura por hora del editor."],
  "faq.q3": ["What stops FIFA's lawyers from calling?", "凭什么 FIFA 律师不会找上门？", "¿Cómo se evita el aviso legal de la FIFA?"],
  "faq.a3": ["Guardian scans every line, the rewrite assistant cleans flagged phrasing, and a legal-reviewed compliance report ships with the deliverables. See the Compliance section above for a live demo.", "Guardian 扫描每一行，改写助手清理违规表述，附法务复核的合规报告随终片交付。上方有 demo。", "Guardian escanea cada línea, el asistente reescribe lo marcado, y se entrega un informe de cumplimiento revisado por legal. Demo arriba."],
  "faq.q4": ["Multi-language — does it cost a lot extra?", "多语言会贵很多吗？", "¿Multi-idioma es mucho más caro?"],
  "faq.a4": ["No. Spinning six variants from one master (three languages × two aspect ratios) costs a small fraction of the original — usually 20–40% the base price.", "不会。一条母版扩 6 个变体（3 语 × 2 比例）只在原价基础上加 20–40%。", "No. Generar seis variantes desde un máster (tres idiomas × dos formatos) cuesta solo entre un 20 y 40% del precio base."],
  "faq.q5": ["What if I have almost no assets?", "我素材很少怎么办？", "¿Y si casi no tengo material?"],
  "faq.a5": ["Three phone photos and one line of description is enough for a Light project. For brand work, a logo and a few product shots will do.", "Light 项目：三张手机照片 + 一句话就够。品牌项目：Logo + 几张产品照即可。", "Para Ligero, tres fotos de móvil y una línea bastan. Para marca, logo y unas fotos de producto."],
  "faq.q6": ["Will my real venue or product show up?", "我真实的店 / 产品会出现在视频里吗？", "¿Saldrá mi local o producto real?"],
  "faq.a6": ["Yes — that's the whole point. The pipeline prioritizes your actual photos so the output is recognizably yours.", "会，这是核心功能。流水线优先复用你的真实素材，让出片就是「你的」。", "Sí — es el punto. El pipeline prioriza tus fotos reales para que se reconozca como tuyo."],
  "faq.q7": ["Does a salesperson follow up after I submit?", "提交后销售会打电话来吗？", "¿Me llamará comercial tras enviar?"],
  "faq.a7": ["Only if it actually helps. The pipeline starts automatically the moment you submit — most projects never need a sales call.", "只在真正需要时联系。提交后 AI 流水线立即启动，多数项目根本不需要销售对接。", "Solo si aporta valor. El pipeline arranca al enviar — la mayoría de proyectos no necesita llamada comercial."],

  /* Footer */
  "ft.tag":     [
    "An agency for shops without one.",
    "世界杯营销，小店也配得上。",
    "El Mundial es de todos. Las campañas, también.",
  ],
  "ft.contact": ["Contact", "联系", "Contacto"],

  /* Login modal */
  "lg.title":   ["Log in to continue", "登录后继续", "Inicia sesión para continuar"],
  "lg.sub":     ["We bind your email so we can deliver. Either method works.", "登录绑定邮箱用于交付，两种方式任选。", "Vinculamos tu email para entregarte el vídeo. Cualquier método sirve."],
  "lg.google":  ["Continue with Google", "用 Google 继续", "Continuar con Google"],
  "lg.or":      ["or", "或", "o"],
  "lg.pass":    ["Password", "密码", "Contraseña"],
  "lg.in":      ["Log in", "登录", "Entrar"],
  "lg.up":      ["Sign up", "注册", "Registrarse"],
  "lg.loading":     ["Working…",         "处理中…",       "Procesando…"],
  "lg.err.invalid": ["Invalid email or password.", "邮箱或密码不正确。", "Email o contraseña incorrectos."],
  "lg.err.exists":  ["An account with that email already exists. Log in instead.", "这个邮箱已注册，请直接登录。", "Ya existe una cuenta con ese email. Inicia sesión."],
  "lg.err.weak":    ["Password too weak — use at least 8 characters.", "密码太弱——至少 8 位。", "Contraseña débil — usa al menos 8 caracteres."],
  "lg.err.network": ["Network error — check your connection and try again.", "网络错误，请检查连接后重试。", "Error de red — comprueba la conexión e inténtalo de nuevo."],

  /* Upload + Form */
  "fm.upload.pick":   ["Choose files",        "选择文件",       "Elegir archivos"],
  "fm.upload.empty":  ["No files yet — photos help us match your real venue.", "暂无文件——上传照片能更贴近你的真实场景。", "Sin archivos aún — las fotos ayudan a que coincida con tu local real."],
  "fm.upload.tooBig": ["{name} is too large ({size} MB). Max {max} MB.", "{name} 太大了（{size} MB），最多 {max} MB。", "{name} es demasiado grande ({size} MB). Máx {max} MB."],
  "fm.upload.tooMany":["Up to {max} files. Please remove some.", "最多 {max} 个文件，请删除一些。", "Máximo {max} archivos. Elimina algunos."],
  "fm.upload.remove": ["Remove",              "删除",          "Quitar"],
  "fm.submit.loading":["Submitting…",         "提交中…",       "Enviando…"],
  "fm.err.required":  ["Please fill the required fields marked *.", "请填写所有带 * 的必填字段。", "Rellena los campos obligatorios marcados con *."],
  "fm.err.upload":    ["Upload failed for {name}. Try removing and re-adding it.", "{name} 上传失败，请删除后重新加入。", "Fallo al subir {name}. Quítalo y vuelve a añadirlo."],
  "fm.err.submit":    ["We couldn't save your project. Please try again in a minute.", "无法保存项目，请稍后再试。", "No pudimos guardar tu proyecto. Inténtalo de nuevo en un minuto."],
  "fm.err.session":   ["Your session expired. Please log in again.", "登录已过期，请重新登录。", "Tu sesión ha caducado. Inicia sesión de nuevo."],
  "fm.err.payConfig": ["Payment is not configured. Please contact support@scenera.io.", "支付通道未配置，请联系 support@scenera.io。", "El pago no está configurado. Escribe a support@scenera.io."],
  "fm.err.payCreate": ["We couldn't open the payment page. Please try again or contact support.", "无法跳转到支付页，请重试或联系客服。", "No pudimos abrir la página de pago. Inténtalo de nuevo o contacta con soporte."],

  /* Success */
  "sc.title":   ["Got it — we're on it.", "已收到，开工了。", "Recibido — manos a la obra."],
  "sc.body1":   ["Your video lands in {email} within 24 hours.", "终片将在 24 小时内发到 {email}。", "Tu vídeo llegará a {email} en 24 horas."],
  "sc.body1.c": [
    "Your scoped quote lands in {email} within 24 hours.",
    "你的定制项目报价将在 24 小时内发到 {email}。",
    "Tu presupuesto a medida llegará a {email} en 24 h.",
  ],
  "sc.body2":   ["Watch your inbox — the subject line starts with [Scenera].", "请留意收件箱，邮件主题以 [Scenera] 开头。", "Atento a tu bandeja — el asunto empieza con [Scenera]."],
  "sc.foot":    ["Nothing to check on this site. If 72 hours pass with no email, write to", "无需在本页查询。72 小时内未收到任何邮件，请联系", "No hace falta volver aquí. Si en 72 horas no sabes nada, escribe a"],
  "sc.again":   ["Start another project", "再提交一个", "Enviar otro"],
  "sc.home":    ["Back to top", "返回顶部", "Volver arriba"],

  /* Toast */
  "toast.login":  ["Logged in", "登录成功", "Sesión iniciada"],
  "toast.logout": ["Logged out", "已退出", "Sesión cerrada"],
  "toast.paid":   ["Payment received — thanks!", "支付成功，谢谢！", "Pago recibido — ¡gracias!"],
  "toast.payCancelled": ["Payment cancelled. Your project is saved — pay anytime to start.", "支付已取消，项目已保存，随时可再次支付开工。", "Pago cancelado. Tu proyecto está guardado — paga cuando quieras."],
};

const LocaleCtx = React.createContext({ code: "en", t: (k)=>k, set: ()=>{} });

const LocaleProvider = ({ children }) => {
  const [code, setCode] = React.useState(() => localStorage.getItem("scenera.v2.locale") || "en");
  const idx = LOCALES.findIndex(l => l.code === code);
  const t = React.useCallback((key) => {
    const row = STRINGS[key];
    if (!row) return key;
    return row[idx] ?? row[0];
  }, [idx]);
  const set = (c) => { setCode(c); localStorage.setItem("scenera.v2.locale", c); document.documentElement.lang = c; };
  React.useEffect(() => { document.documentElement.lang = code; }, [code]);
  return <LocaleCtx.Provider value={{ code, t, set }}>{children}</LocaleCtx.Provider>;
};

const useLocale = () => React.useContext(LocaleCtx);

window.LOCALES = LOCALES;
window.LocaleProvider = LocaleProvider;
window.useLocale = useLocale;
