/** Public site / legal placeholders — set via env when you have real details. */

export function getSiteUrl(): string {
  return (
    process.env.NEXT_PUBLIC_SITE_URL?.replace(/\/$/, "") ||
    "http://localhost:3000"
  );
}

export function getContactEmail(): string {
  return process.env.NEXT_PUBLIC_CONTACT_EMAIL || "contact@example.com";
}

export function getLegalEntity(): string {
  return process.env.NEXT_PUBLIC_LEGAL_ENTITY || "HollowCade Operator";
}

export function getLegalJurisdiction(): string {
  return (
    process.env.NEXT_PUBLIC_LEGAL_JURISDICTION ||
    "the laws of the operator’s jurisdiction"
  );
}

/**
 * Comma-separated usernames that may hold the admin role (client-side accounts).
 * Default: only `admin`. Example: `admin,jkupr`
 */
export function getAdminUsernames(): string[] {
  const raw = process.env.NEXT_PUBLIC_ADMIN_USERNAMES || "admin";
  return raw
    .split(",")
    .map((s) => s.trim().toLowerCase())
    .filter(Boolean);
}

export function isAdminUsername(username: string | undefined | null): boolean {
  if (!username) return false;
  return getAdminUsernames().includes(username.trim().toLowerCase());
}

/** Shown on legal pages — update when copy changes. */
export const LEGAL_EFFECTIVE_DATE = "August 6, 2026";

export const SITE_NAME = "HollowCade";

export const SKIP_SIGNUP_KEY = "hollowcade_skip_signup";
