import type { Metadata } from "next";
import { IBM_Plex_Mono, Inter } from "next/font/google";

import { RouteGuard } from "@/components/auth/RouteGuard";

import "./globals.css";
import { Providers } from "./providers";

// App UI typeface (Inter). next/font is bundled — no package.json change.
// Cyrillic + latin subsets so RU labels render correctly across the app.
const inter = Inter({
  subsets: ["latin", "cyrillic"],
  weight: ["400", "500", "600", "700"],
  variable: "--font-inter",
  display: "swap",
});

// ПТИЦА cockpit numerals (mono). next/font is bundled — no package.json change.
// Cyrillic + latin subsets so mono digits/labels render in the dark cockpit.
const plexMono = IBM_Plex_Mono({
  subsets: ["latin", "cyrillic"],
  weight: ["400", "500", "600"],
  variable: "--font-plex-mono",
  display: "swap",
});

export const metadata: Metadata = {
  title: "GenDesign",
  description: "Generative Design + Site Finder",
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="ru" className={`${inter.variable} ${plexMono.variable}`}>
      <body>
        <Providers>
          <RouteGuard>{children}</RouteGuard>
        </Providers>
      </body>
    </html>
  );
}
