import type { Metadata, Viewport } from 'next'
import './globals.css'
import { SWRegister } from '@/components/sw-register'
import { PullToRefresh } from '@/components/pull-to-refresh'
import { IdleReset } from '@/components/idle-reset'
import { HomeHotkey } from '@/components/home-hotkey'

export const metadata: Metadata = {
  title: 'Steward',
  description: 'Talk to it — voice & photo capture that sorts into reminders, calendar events, and thoughts.',
  manifest: '/manifest.json',
  icons: {
    icon: '/icons/icon-192.png',
    apple: '/apple-touch-icon.png',
  },
  appleWebApp: {
    capable: true,
    statusBarStyle: 'black-translucent',
    title: 'Steward',
  },
}

export const viewport: Viewport = {
  width: 'device-width',
  initialScale: 1,
  maximumScale: 5,
  userScalable: true,
  themeColor: '#6d4aff',
  viewportFit: 'cover',
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="en">
      <body className="antialiased overscroll-y-none">
        <SWRegister />
        <PullToRefresh />
        <IdleReset />
        <HomeHotkey />
        {children}
      </body>
    </html>
  )
}
