/* Ez Studio – i18n strings + bandeiras (BR / US / ES) */
/* eslint-disable */

const I18N = {
  pt: {
    nav: { about: 'Sobre', projects: 'Projetos', apps: 'Apps', contact: 'Contato' },
    hero: {
      eyebrow: 'MOBILE · GAMES · APPS',
      eyebrowEst: 'EST. 2024 · RIO DE JANEIRO',
      eyebrowMin: 'EZ STUDIO — ESTÚDIO MOBILE · RIO',
      h1a: ['Produtos modernos.', 'Experiências reais.'],
      h1b: ['Software', 'que ', 'cabe', 'no bolso.'],
      h1c: ['Experiências mobile', 'feitas à mão.'],
      h1e: 'mobile · games · apps',
      sub: 'Estúdio independente focado em experiências mobile, aplicativos inteligentes e produtos digitais modernos.',
      ctaProjects: 'Ver projetos',
      ctaTalk: 'Fale com a gente',
      ctaSend: 'Enviar mensagem',
      ctaMore: '↓ saiba mais',
    },
    about: {
      label: 'SOBRE NÓS',
      title: 'Construindo produtos\npara o mundo moderno.',
      tag: 'MOBILE · REAL-TIME · AI SYSTEMS',
      body: [
        'O Ez Studio desenvolve produtos digitais modernos combinando design, tecnologia e experiência do usuário.',
        'Trabalhamos com aplicativos mobile, sistemas em tempo real, integrações inteligentes e interfaces premium voltadas para performance e usabilidade.',
        'Nosso foco é construir produtos que pareçam simples para o usuário, mas sejam sólidos, rápidos e bem estruturados por trás.',
      ],
      bodyHl: [
        'produtos digitais modernos',
        'sistemas em tempo real',
        'sólidos, rápidos e bem estruturados',
      ],
      scroll: '↓ rola pra ver o que a gente faz',
    },
    stats: {
      label: 'STATS',
      active: 'Projetos ativos',
      cross: 'Multiplataforma',
      years: 'Integrações',
      city: 'Em todo o mundo',
      crossShort: 'flutter + firebase',
      cityShort: 'Em todo o mundo',
    },
    projects: {
      label: 'PROJETOS',
      title: 'O que estamos\nconstruindo.',
      featured: 'SELECIONADOS · 2024–26',
      featuredTitle: 'Projetos em destaque',
      seeAll: 'ver todos →',
      kindGame: 'JOGO MOBILE',
      kindApp: 'APP UTILITÁRIO',
      kindDigital: 'PRODUTO DIGITAL',
      name: 'Projeto',
      cardDesc: 'Adicione aqui a descrição.',
      list: ['jogo casual', 'app utilitário', 'produto digital'],
      timeline: '2024 — agora',
    },
    contact: {
      label: 'CONTATO',
      title: 'Tem uma ideia? Vamos conversar.',
      titleBreak: ['Tem uma ideia?', 'Vamos conversar.'],
      bodyOpen: 'Aberto para parcerias, projetos sob demanda e colaborações criativas.',
      city: 'Rio de Janeiro · Brasil',
      nameP: 'Seu nome',
      emailP: 'Seu e-mail',
      msgP: 'Conte sobre seu projeto…',
      send: 'Enviar mensagem',
      sendArrow: 'Enviar →',
      mailIntro: 'Manda um e-mail.',
      noForm: '(sem formulário — a gente responde melhor por e-mail)',
    },
    footer: { rights: '© 2026 Ez Studio', made: 'Made in Rio' },
    ed: {
      tag: 'REAL-TIME MOBILITY ECOSYSTEM',
      title: 'Easy Driver',
      desc: 'Plataforma de mobilidade com aplicativos dedicados para passageiros e motoristas, incluindo rastreamento em tempo real, GPS em background e integração inteligente de pagamentos.',
      passengerName: 'Easy Driver',
      passengerRole: 'Passageiro',
      partnerName: 'Easy Driver Partner',
      partnerRole: 'Motorista',
      features: ['Rastreamento em tempo real', 'GPS em background', 'Pagamentos integrados'],
      connect: 'um único ecossistema',
      live: 'Online · produção',
    },
    er: {
      kind: 'PLATAFORMA FITNESS',
      title: 'Ez Runner',
      tagline: 'Transformar movimento em evolução.',
      desc: 'Plataforma de corrida com rastreamento em tempo real, métricas inteligentes, gamificação e comunidade.',
      chips: ['Running', 'Tracking', 'Social'],
      status: 'em desenvolvimento',
    },
    dc: {
      kind: 'APP UTILITÁRIO · IA',
      title: 'Descomplica',
      tagline: 'Transformando burocracia em simplicidade.',
      desc: 'Entenda qualquer documento em segundos. A IA detecta cláusulas abusivas, calcula impacto financeiro e gera resumos claros para você decidir com segurança.',
      chips: ['IA', 'Contratos', 'Proteção'],
      status: 'Online · +100k',
    },
    ecosystem: {
      label: 'ECOSSISTEMA · EZ CORP',
      titleA: '10+ apps.',
      titleB: 'no ar.',
      sub: 'Além dos produtos em destaque, o ecossistema Ez Corp reúne mais de 10 aplicativos publicados — jogos, utilitários e apps de saúde que alcançam centenas de milhares de usuários.',
    },
  },

  en: {
    nav: { about: 'About', projects: 'Projects', apps: 'Apps', contact: 'Contact' },
    hero: {
      eyebrow: 'MOBILE · GAMES · APPS',
      eyebrowEst: 'EST. 2024 · RIO DE JANEIRO',
      eyebrowMin: 'EZ STUDIO — MOBILE STUDIO · RIO',
      h1a: ['Modern products.', 'Real experiences.'],
      h1b: ['Software', 'that ', 'fits', 'in your pocket.'],
      h1c: ['Mobile experiences', 'handcrafted.'],
      h1e: 'mobile · games · apps',
      sub: 'Independent mobile development studio. Utility apps, casual games and digital products.',
      ctaProjects: 'See projects',
      ctaTalk: 'Get in touch',
      ctaSend: 'Send message',
      ctaMore: '↓ learn more',
    },
    about: {
      label: 'ABOUT US',
      title: 'Building products\nfor the modern world.',
      tag: 'MOBILE · REAL-TIME · AI SYSTEMS',
      body: [
        'Ez Studio builds modern digital products by combining design, technology and user experience.',
        'We work with mobile apps, real-time systems, intelligent integrations and premium interfaces focused on performance and usability.',
        'Our focus is building products that feel simple to the user, while being solid, fast and well-structured underneath.',
      ],
      bodyHl: [
        'modern digital products',
        'real-time systems',
        'solid, fast and well-structured',
      ],
      scroll: '↓ scroll to see what we make',
    },
    stats: {
      label: 'STATS',
      active: 'Active projects',
      cross: 'Cross-platform',
      years: 'Integrations',
      city: 'Worldwide',
      crossShort: 'flutter + firebase',
      cityShort: 'Worldwide',
    },
    projects: {
      label: 'PROJECTS',
      title: 'What we\'re\nbuilding.',
      featured: 'SELECTED · 2024–26',
      featuredTitle: 'Featured projects',
      seeAll: 'see all →',
      kindGame: 'MOBILE GAME',
      kindApp: 'UTILITY APP',
      kindDigital: 'DIGITAL PRODUCT',
      name: 'Project',
      cardDesc: 'Add the description here.',
      list: ['casual game', 'utility app', 'digital product'],
      timeline: '2024 — now',
    },
    contact: {
      label: 'CONTACT',
      title: 'Got an idea? Let\'s talk.',
      titleBreak: ['Got an idea?', 'Let\'s talk.'],
      bodyOpen: 'Open to partnerships, contract work and creative collaborations.',
      city: 'Rio de Janeiro · Brazil',
      nameP: 'Your name',
      emailP: 'Your email',
      msgP: 'Tell us about your project…',
      send: 'Send message',
      sendArrow: 'Send →',
      mailIntro: 'Drop us an email.',
      noForm: '(no form — we reply better over email)',
    },
    footer: { rights: '© 2026 Ez Studio', made: 'Made in Rio' },
    ed: {
      tag: 'REAL-TIME MOBILITY ECOSYSTEM',
      title: 'Easy Driver',
      desc: 'Mobility platform with dedicated apps for passengers and drivers, featuring real-time tracking, background GPS, and intelligent payment integration.',
      passengerName: 'Easy Driver',
      passengerRole: 'Passenger',
      partnerName: 'Easy Driver Partner',
      partnerRole: 'Driver',
      features: ['Real-time tracking', 'Background GPS', 'Integrated payments'],
      connect: 'one ecosystem',
      live: 'Online · production',
    },
    er: {
      kind: 'FITNESS PLATFORM',
      title: 'Ez Runner',
      tagline: 'Turn movement into progress.',
      desc: 'Running platform with real-time tracking, smart metrics, gamification and community.',
      chips: ['Running', 'Tracking', 'Social'],
      status: 'in development',
    },
    dc: {
      kind: 'UTILITY APP · AI',
      title: 'Descomplica',
      tagline: 'Turning bureaucracy into simplicity.',
      desc: 'Understand any document in seconds. AI that detects abusive clauses, calculates financial impact and generates clear summaries so you decide with confidence.',
      chips: ['AI', 'Contracts', 'Protection'],
      status: 'Online · +100k',
    },
    ecosystem: {
      label: 'ECOSYSTEM · EZ CORP',
      titleA: '10+ apps.',
      titleB: 'live.',
      sub: 'Beyond the featured products, the Ez Corp ecosystem includes 10+ published apps — games, utilities and health tools reaching hundreds of thousands of users.',
    },
  },

  es: {
    nav: { about: 'Acerca', projects: 'Proyectos', apps: 'Apps', contact: 'Contacto' },
    hero: {
      eyebrow: 'MÓVIL · JUEGOS · APPS',
      eyebrowEst: 'EST. 2024 · RÍO DE JANEIRO',
      eyebrowMin: 'EZ STUDIO — ESTUDIO MÓVIL · RÍO',
      h1a: ['Productos modernos.', 'Experiencias reales.'],
      h1b: ['Software', 'que ', 'cabe', 'en el bolsillo.'],
      h1c: ['Experiencias móviles', 'hechas a mano.'],
      h1e: 'móvil · juegos · apps',
      sub: 'Estudio independiente de desarrollo móvil. Apps útiles, juegos casuales y productos digitales.',
      ctaProjects: 'Ver proyectos',
      ctaTalk: 'Háblanos',
      ctaSend: 'Enviar mensaje',
      ctaMore: '↓ saber más',
    },
    about: {
      label: 'ACERCA',
      title: 'Construyendo productos\npara el mundo moderno.',
      tag: 'MÓVIL · TIEMPO REAL · SISTEMAS DE IA',
      body: [
        'Ez Studio desarrolla productos digitales modernos combinando diseño, tecnología y experiencia de usuario.',
        'Trabajamos con aplicaciones móviles, sistemas en tiempo real, integraciones inteligentes e interfaces premium enfocadas en rendimiento y usabilidad.',
        'Nuestro enfoque es construir productos que parezcan simples para el usuario, pero sean sólidos, rápidos y bien estructurados por dentro.',
      ],
      bodyHl: [
        'productos digitales modernos',
        'sistemas en tiempo real',
        'sólidos, rápidos y bien estructurados',
      ],
      scroll: '↓ desplázate para ver lo que hacemos',
    },
    stats: {
      label: 'STATS',
      active: 'Proyectos activos',
      cross: 'Multiplataforma',
      years: 'Integraciones',
      city: 'En todo el mundo',
      crossShort: 'flutter + firebase',
      cityShort: 'En todo el mundo',
    },
    projects: {
      label: 'PROYECTOS',
      title: 'Lo que estamos\nconstruyendo.',
      featured: 'SELECCIONADOS · 2024–26',
      featuredTitle: 'Proyectos destacados',
      seeAll: 'ver todos →',
      kindGame: 'JUEGO MÓVIL',
      kindApp: 'APP ÚTIL',
      kindDigital: 'PRODUCTO DIGITAL',
      name: 'Proyecto',
      cardDesc: 'Añade aquí la descripción.',
      list: ['juego casual', 'app útil', 'producto digital'],
      timeline: '2024 — ahora',
    },
    contact: {
      label: 'CONTACTO',
      title: '¿Tienes una idea? Hablemos.',
      titleBreak: ['¿Tienes una idea?', 'Hablemos.'],
      bodyOpen: 'Abiertos a alianzas, proyectos a medida y colaboraciones creativas.',
      city: 'Río de Janeiro · Brasil',
      nameP: 'Tu nombre',
      emailP: 'Tu e-mail',
      msgP: 'Cuéntanos sobre tu proyecto…',
      send: 'Enviar mensaje',
      sendArrow: 'Enviar →',
      mailIntro: 'Mándanos un e-mail.',
      noForm: '(sin formulario — respondemos mejor por e-mail)',
    },
    footer: { rights: '© 2026 Ez Studio', made: 'Made in Rio' },
    ed: {
      tag: 'REAL-TIME MOBILITY ECOSYSTEM',
      title: 'Easy Driver',
      desc: 'Plataforma de movilidad con aplicaciones dedicadas para pasajeros y conductores, con rastreo en tiempo real, GPS en segundo plano e integración inteligente de pagos.',
      passengerName: 'Easy Driver',
      passengerRole: 'Pasajero',
      partnerName: 'Easy Driver Partner',
      partnerRole: 'Conductor',
      features: ['Rastreo en tiempo real', 'GPS en segundo plano', 'Pagos integrados'],
      connect: 'un único ecosistema',
      live: 'Online · producción',
    },
    er: {
      kind: 'PLATAFORMA FITNESS',
      title: 'Ez Runner',
      tagline: 'Transformar movimiento en evolución.',
      desc: 'Plataforma de carrera con rastreo en tiempo real, métricas inteligentes, gamificación y comunidad.',
      chips: ['Running', 'Tracking', 'Social'],
      status: 'en desarrollo',
    },
    dc: {
      kind: 'APP ÚTIL · IA',
      title: 'Descomplica',
      tagline: 'Convirtiendo burocracia en simplicidad.',
      desc: 'Entiende cualquier documento en segundos. IA que detecta cláusulas abusivas, calcula impacto financiero y genera resúmenes claros para que decidas con seguridad.',
      chips: ['IA', 'Contratos', 'Protección'],
      status: 'Online · +100k',
    },
    ecosystem: {
      label: 'ECOSISTEMA · EZ CORP',
      titleA: '10+ apps.',
      titleB: 'en vivo.',
      sub: 'Más allá de los productos destacados, el ecosistema Ez Corp incluye más de 10 apps publicadas — juegos, utilidades y herramientas de salud que llegan a cientos de miles de usuarios.',
    },
  },
};

function t() {
  const lang = window.__ezLang || 'pt';
  return I18N[lang] || I18N.pt;
}

/* ---------- flag SVGs (circular masks) ---------- */

function FlagBR({ size = 20 }) {
  const id = 'mbr-' + size;
  return (
    <svg width={size} height={size} viewBox="0 0 20 20" aria-label="Português">
      <defs><clipPath id={id}><circle cx="10" cy="10" r="10"/></clipPath></defs>
      <g clipPath={`url(#${id})`}>
        <rect width="20" height="20" fill="#009c3b"/>
        <polygon points="10,2.6 17.4,10 10,17.4 2.6,10" fill="#ffdf00"/>
        <circle cx="10" cy="10" r="3.4" fill="#002776"/>
        <path d="M 6.6 10.2 Q 10 8.6 13.4 10.2" stroke="#fff" strokeWidth="0.6" fill="none"/>
      </g>
    </svg>
  );
}

function FlagUS({ size = 20 }) {
  const id = 'mus-' + size;
  return (
    <svg width={size} height={size} viewBox="0 0 20 20" aria-label="English">
      <defs><clipPath id={id}><circle cx="10" cy="10" r="10"/></clipPath></defs>
      <g clipPath={`url(#${id})`}>
        <rect width="20" height="20" fill="#bf0a30"/>
        {[1.5, 4.5, 7.5, 10.5, 13.5, 16.5].map((y) => (
          <rect key={y} y={y} width="20" height="1.5" fill="#fff"/>
        ))}
        <rect width="9" height="9" fill="#002868"/>
        <g fill="#fff">
          {[1.5, 4, 6.5].map((y) =>
            [1, 3.5, 6, 8.5].map((x) => (
              <circle key={`${x}-${y}`} cx={x} cy={y} r="0.4"/>
            ))
          )}
        </g>
      </g>
    </svg>
  );
}

function FlagES({ size = 20 }) {
  const id = 'mes-' + size;
  return (
    <svg width={size} height={size} viewBox="0 0 20 20" aria-label="Español">
      <defs><clipPath id={id}><circle cx="10" cy="10" r="10"/></clipPath></defs>
      <g clipPath={`url(#${id})`}>
        <rect width="20" height="20" fill="#aa151b"/>
        <rect y="5" width="20" height="10" fill="#f1bf00"/>
        <rect x="5" y="8" width="2.5" height="4" fill="#aa151b" opacity="0.65"/>
      </g>
    </svg>
  );
}

const LANGS = [
  { code: 'pt', Flag: FlagBR, label: 'PT' },
  { code: 'en', Flag: FlagUS, label: 'EN' },
  { code: 'es', Flag: FlagES, label: 'ES' },
];

function LangSwitcher({ tone = 'light' }) {
  const cur = window.__ezLang || 'pt';
  // tone: 'light' for paper bg wireframes, 'dark' for dark bands
  const ringActive = '#a78bfa';
  const ringIdle = tone === 'dark' ? 'rgba(246,243,236,0.18)' : 'rgba(26,25,22,0.18)';
  return (
    <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
      {LANGS.map(({ code, Flag, label }) => {
        const active = code === cur;
        return (
          <button
            key={code}
            onClick={() => { window.__ezSetLang && window.__ezSetLang(code); }}
            title={label}
            style={{
              display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
              width: 28, height: 28, borderRadius: 999,
              border: `1.5px solid ${active ? ringActive : ringIdle}`,
              background: 'transparent', padding: 0, cursor: 'pointer',
              opacity: active ? 1 : 0.55,
              transition: 'opacity 0.15s, border-color 0.15s',
              boxShadow: active ? `0 0 0 2px rgba(167,139,250,0.18)` : 'none',
            }}
          >
            <Flag size={18} />
          </button>
        );
      })}
    </div>
  );
}

Object.assign(window, { I18N, t, FlagBR, FlagUS, FlagES, LangSwitcher, LANGS });
