import { Html, Head, Main, NextScript } from "next/document";

export default function Document() {
  return (
    <Html lang="en">
      <Head>
        <meta charSet="utf-8" />
        {/* Primary SEO */}
        <meta name="description" content="Bone Lord Bob is an American Anime project — dark, brutal, beautiful. An original animated series unlike anything you've seen before." />
        <meta name="keywords" content="Bone Lord Bob, American Anime, indie animation, dark fantasy anime, animated series, original anime, BLB, dark fantasy, indie anime, anime art, American animation, bone lord" />
        <meta name="author" content="Mathison Projects Inc." />
        <meta name="robots" content="index, follow" />
        <meta name="theme-color" content="#0a0806" />

        {/* Open Graph */}
        <meta property="og:site_name" content="Bone Lord Bob" />
        <meta property="og:title" content="Bone Lord Bob — American Anime" />
        <meta property="og:description" content="American Anime. Dark. Brutal. Beautiful. An original animated series unlike anything you've seen before." />
        <meta property="og:image" content="https://www.bonelordbob.com/og-image.png" />
        <meta property="og:image:width" content="1536" />
        <meta property="og:image:height" content="1024" />
        <meta property="og:image:alt" content="Bone Lord Bob — American Anime" />
        <meta property="og:url" content="https://www.bonelordbob.com/" />
        <meta property="og:type" content="website" />
        <meta property="og:locale" content="en_US" />

        {/* Twitter / X Card */}
        <meta name="twitter:card" content="summary_large_image" />
        <meta name="twitter:site" content="@bonelordbob" />
        <meta name="twitter:creator" content="@bonelordbob" />
        <meta name="twitter:title" content="Bone Lord Bob — American Anime" />
        <meta name="twitter:description" content="American Anime. Dark. Brutal. Beautiful." />
        <meta name="twitter:image" content="https://www.bonelordbob.com/og-image.png" />
        <meta name="twitter:image:alt" content="Bone Lord Bob — American Anime" />

        {/* Icons */}
        <link rel="icon" href="/favicon.ico" sizes="any" />
        <link rel="icon" href="/icon-192.png" type="image/png" sizes="192x192" />
        <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
        <link rel="manifest" href="/manifest.json" />

        {/* Canonical */}
        <link rel="canonical" href="https://www.bonelordbob.com/" />

        {/* Google Analytics GA4 — G-6EJVCK4931 */}
        <script async src="https://www.googletagmanager.com/gtag/js?id=G-6EJVCK4931" />
        <script
          dangerouslySetInnerHTML={{
            __html: `
              window.dataLayer = window.dataLayer || [];
              function gtag(){dataLayer.push(arguments);}
              gtag('js', new Date());
              // Respect declined cookie consent
              var consent = typeof localStorage !== 'undefined' ? localStorage.getItem('blb_cookie_consent') : null;
              if (consent !== 'declined') {
                gtag('config', 'G-6EJVCK4931', { anonymize_ip: true });
              }
            `,
          }}
        />
      </Head>
      <body>
        <Main />
        <NextScript />
      </body>
    </Html>
  );
}
