// Shared "is it late?" definition, used by both the companion's bedtime nag and
// the night-mode theme/starfall switch so they always agree. Local clock — the
// writer's own machine (millenia's timezone in deployment).

export const BEDTIME_FROM = 23 // local hour the night window opens (11pm)…
export const BEDTIME_TO = 4 //    …and closes (4am); past this we assume an early start

export function isBedtime(d: Date = new Date()): boolean {
  const h = d.getHours()
  return h >= BEDTIME_FROM || h < BEDTIME_TO
}
