import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import { DotBackground } from "@/app/components/dotbackground";
import { Navbar } from './components/nav'
import Footer from './components/footer'
import { LenisProvider } from "./providers/LenisProvider";
import { MotionConfigProvider } from "./providers/MotionConfigProvider";
import { baseUrl } from './sitemap';

const geistSans = Geist({
  variable: "--font-geist-sans",
  subsets: ["latin"],
});

const geistMono = Geist_Mono({
  variable: "--font-geist-mono",
  subsets: ["latin"],
});


export const metadata: Metadata = {
  metadataBase: new URL(baseUrl),
  title: {
    default: "Nicholai",
    template: "%s · Nicholai",
  },
  description: "Professional portfolio of Nicholai — VFX Supervisor & Developer",
  openGraph: {
    title: "Nicholai",
    description: "Professional portfolio of Nicholai — VFX Supervisor & Developer",
    url: baseUrl,
    siteName: "Nicholai",
    images: ["/images/profile.jpg"],
    locale: "en_US",
    type: "website",
  },
  alternates: {
    canonical: baseUrl,
  },
  icons: {
    icon: "/favicon.ico",
  },
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <head>
        <link rel="preconnect" href="https://fonts.googleapis.com" />
        <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
        <link
          href="https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400..700;1,400..700&display=swap"
          rel="stylesheet"
        />
      </head>
      <body
        className={`${geistSans.variable} ${geistMono.variable} antialiased`}
      >
        <MotionConfigProvider>
          <LenisProvider>
            <Navbar />
            <DotBackground />
            <main className="flex-auto min-w-0 mt-6 flex flex-col px-2 md:px-0">
              {children}
              <Footer />
            </main>
          </LenisProvider>
        </MotionConfigProvider>
      </body>
    </html>
  );
}
