// Package branding is the single source of truth for the firm name that
// Paliad's UI, emails, and download metadata render. Paliad is firm-agnostic
// (per the project CLAUDE.md — "survives firm renames"); reading the name
// through this package keeps every surface in sync and lets a redeploy with
// a different FIRM_NAME repoint the whole product without code changes.
//
// Default is "HLC" (current firm). Override with the FIRM_NAME env var.
//
// History: until 2026-04-16 this codebase shipped "Hogan Lovells" / "HL"
// hard-coded across server templates and the frontend. The merger announced
// that month made those references stale and the rebrand to Paliad-the-name
// + branding.Name-as-runtime-value followed (t-paliad-065).
package branding

import (
	"os"
	"strings"
)

// Name is the firm Paliad is being branded for in this deployment. Read once
// at process start so handler hot paths don't pay the env-lookup cost.
//
// Consumers must treat it as a constant for the lifetime of the process — if
// FIRM_NAME changes on disk, that's a redeploy, not a hot-reload.
var Name = resolveName()

func resolveName() string {
	if v := strings.TrimSpace(os.Getenv("FIRM_NAME")); v != "" {
		return v
	}
	return "HLC"
}
