<!DOCTYPE html>
<html lang="en" class="scroll-smooth">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= (isset($title) ? $title : 'Framex Engine') ?></title>
    <link rel="stylesheet" href="<?= asset('css/style.css') ?>">

    <script>
      (function() {
        const stored = localStorage.getItem('theme');
        const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
        if (stored === 'dark' || (!stored && prefersDark)) {
          document.documentElement.classList.add('dark');
        }
      })();
    </script>
</head>

<body class="bg-gray-50 text-slate-900 dark:bg-slate-950 dark:text-slate-100">

    <main class="wrp">
        <?= $view ?>
    </main>

    <script src="<?= asset('js/init.js') ?>"></script>

</body>

</html>
