import type { Metadata } from "next";
import { Space_Grotesk, Inter } from "next/font/google";
import "./globals.css";

const spaceGrotesk = Space_Grotesk({
  subsets: ["latin"],
  weight: ["400", "500", "700"],
  variable: "--font-headline",
  display: "swap",
});

const inter = Inter({
  subsets: ["latin"],
  weight: ["400", "500", "600", "700"],
  variable: "--font-body",
  display: "swap",
});

export const metadata: Metadata = {
  metadataBase: new URL(
    process.env.NEXT_PUBLIC_SITE_URL ?? "http://localhost:3000",
  ),
  title: {
    default: "Jason Woltje",
    template: "%s — Jason Woltje",
  },
  description:
    "A multidisciplinary architect of digital ecosystems. Engineering growth through technological mastery and strategic leadership.",
};

const BUILD_SHA = process.env.NEXT_PUBLIC_BUILD_SHA ?? "dev";
const BUILD_REV = process.env.NEXT_PUBLIC_BUILD_REV ?? "local";

export default function FrontendLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html
      lang="en"
      className={`dark ${spaceGrotesk.variable} ${inter.variable}`}
      style={{ ["--font-label" as string]: "var(--font-headline)" }}
      suppressHydrationWarning
    >
      <body>
        {children}
        <div
          aria-hidden
          className="pointer-events-none fixed bottom-3 right-4 z-50 font-label text-[10px] uppercase tracking-[0.2em] text-tertiary/80"
        >
          REV: {BUILD_REV} · SHA: {BUILD_SHA}
        </div>
      </body>
    </html>
  );
}
