// Single source of truth for the landing page's *non-translatable* config:
// domains, URLs, theme, launcher files, and the structural shape of the
// stat/feature lists. Translatable copy lives in src/i18n/ui.ts.
// BASE_DOMAIN is read at build time; falls back to ulicraft.local.
const BASE_DOMAIN = process.env.BASE_DOMAIN ?? "ulicraft.local";

// REGISTRATION_MODE (invite|open) is read at build time, same .env as Drasl's
// render-config.sh. "invite" => the register form must collect an invite code.
const REGISTRATION_MODE = process.env.REGISTRATION_MODE ?? "invite";

// Minecraft / pack facts, surfaced in a few places.
const MC_VERSION = "1.21.1";

export const site = {
  name: "Ulicraft",
  baseDomain: BASE_DOMAIN,
  mcVersion: MC_VERSION,

  // Register form behaviour, driven by REGISTRATION_MODE in .env.
  //   true  => show the invite-code field (Drasl RequireInvite = true)
  //   false => open self-registration
  registrationRequiresInvite: REGISTRATION_MODE === "invite",

  // Design knobs (replace the design's in-browser TweaksPanel). Baked at build.
  //   mood:     "grass" | "nether" | "end"
  //   hero:     "centered" | "split" | "spotlight"
  //   headFont: "pixelify" | "8bit" | "silkscreen"
  //   dust:     floating pixel particles in the hero
  theme: {
    mood: "grass",
    hero: "centered",
    headFont: "pixelify",
    dust: true,
  },

  // Connect target shown to guests. No port needed (defaults to 25565).
  serverAddress: `${BASE_DOMAIN}`,

  // Drasl auth web UI + authlib-injector API root (public HTTPS).
  authUrl: `https://auth.${BASE_DOMAIN}`,
  authlibUrl: `https://auth.${BASE_DOMAIN}/authlib-injector`,
  // Drasl REST API v2 root — the /register form calls this from the browser.
  // Requires CORSAllowOrigins to include the apex in drasl config.toml.
  draslApiUrl: `https://auth.${BASE_DOMAIN}/drasl/api/v2`,

  // packwiz modpack entrypoint (public HTTPS, pack. subdomain).
  packwizUrl: `https://pack.${BASE_DOMAIN}/pack.toml`,

  // NMSR avatar renderer root. Player heads come from OUR Drasl skins, not
  // Mojang/Crafatar — head URL is `${avatarUrl}/headiso/<uuid>?size=64`.
  avatarUrl: `https://avatar.${BASE_DOMAIN}`,

  // Live server card (ServerCard.astro). `slots` is the SSG fallback cap shown
  // before/without JS; live data comes from our SELF-HOSTED mc-status service
  // (docker/mc-status, mcutil wrapper) reverse-proxied same-origin at the apex
  // /api/mcstatus/* path — no CORS, no third-party calls. It emits mcstatus.io
  // v2 JSON, so the URL stays drop-in compatible. Uptime Kuma stays the history
  // + alerting backend (plan/10).
  status: {
    slots: 10,
    statusApi: `/api/mcstatus/v2/status/java/${BASE_DOMAIN}`,
  },

  // Honest stat tiles. Keys (numbers/versions) are language-neutral; labels
  // come from ui.ts (same order).
  stats: [
    { key: "50+" },
    { key: MC_VERSION },
    { key: "10" },
    { key: "6h" },
  ],

  // Feature cards. glyph ∈ shield|diamond|orb|heart; gold = gold pixel fill.
  // Text (h/p) comes from ui.ts (same order).
  features: [
    { glyph: "diamond", gold: true },
    { glyph: "shield", gold: false },
    { glyph: "orb", gold: false },
    { glyph: "heart", gold: true },
  ],

  // Launcher downloads. Stable filenames are symlinks created by
  // tooling/fetch-launcher.sh — keep these in sync with that script. OS names
  // and hints are technical, kept language-neutral here.
  launcher: {
    name: "Fjord Launcher",
    base: "/launcher/latest",
    downloads: [
      { os: "Windows", file: "fjord-windows-setup.exe", hint: "x64 installer" },
      { os: "macOS", file: "fjord-macos.dmg", hint: "Apple Silicon / Intel" },
      { os: "Linux", file: "fjord-linux-x86_64.AppImage", hint: "x86_64 AppImage" },
    ],
  },
} as const;

// Product / in-game UI literals — never translated (they match what guests see
// on screen or type verbatim).
export const LITERALS = {
  authlib: "authlib-injector",
  multiplayer: "Multiplayer",
  addServer: "Add Server",
} as const;

// Head-font CSS stacks, keyed by theme.headFont.
export const HEAD_FONTS: Record<string, string> = {
  pixelify: "'Pixelify Sans', system-ui, sans-serif",
  "8bit": "'Press Start 2P', monospace",
  silkscreen: "'Silkscreen', system-ui, sans-serif",
};
