<script>
  import { page } from '$app/state';
  import { imageBaseUrl } from '$lib/config/imageCdn.js';
  import { t } from '$lib/translations';
  import Header from '$lib/components/Header.svelte';
  import Head from '$lib/components/Head.svelte';
  import About from '$lib/sections/About.svelte';
  import Contact from '$lib/sections/Contact.svelte';
  import Brands from '$lib/sections/Brands.svelte';
  import FeaturedWork from '$lib/sections/FeaturedWork.svelte';
  import Hero from '$lib/sections/Hero.svelte';

  const ogImage = $derived(
    `${imageBaseUrl}/t/f_webp,w_1200,h_630,c_fill/leomurca/hero.webp`,
  );

  const homeJsonLd = $derived(
    JSON.stringify({
      '@context': 'https://schema.org',
      '@graph': [
        {
          '@type': 'WebSite',
          '@id': `${page.url.origin}/#website`,
          url: `${page.url.origin}/`,
          name: 'Leonardo Murça',
          description: $t('metaHome.description'),
          inLanguage: ['en-US', 'pt-BR'],
          publisher: { '@id': `${page.url.origin}/#person` },
        },
        {
          '@type': 'Person',
          '@id': `${page.url.origin}/#person`,
          name: 'Leonardo Murça',
          url: `${page.url.origin}/`,
          email: 'leo@leomurca.xyz',
          sameAs: [
            'https://linkedin.com/in/leonardoamurca',
            'https://git.leomurca.xyz/',
          ],
          jobTitle: 'Senior Software Engineer',
        },
      ],
    }),
  );
</script>

<Head
  title={$t('metaHome.title')}
  description={$t('metaHome.description')}
  keywords={$t('metaHome.keywords')}
  ogTitle={$t('metaHome.ogTitle')}
  ogDescription={$t('metaHome.ogDescription')}
  ogImage={ogImage}
  twitterDescription={$t('metaHome.twitterDescription')}
  ogImageAlt={$t('metaHome.ogTitle')}
  jsonLd={homeJsonLd}
/>

<Header />
<Hero />
<Brands />
<FeaturedWork />
<About />
<Contact />
