///|
/// A compact semantic version for generated brand guides.
pub fn version() -> String {
  "0.2.1"
}

///|
/// Build the bundled MoonBit brand book example.
pub fn moonbit_brandbook() -> BrandBook {
  BrandBook::{
    name: "MoonBit Brandbook",
    tagline: "A practical brand manual generated from reusable design tokens.",
    voice: Voice::{
      tone: "clear, compact, engineering-minded",
      writing_principles: [
        "Prefer precise examples over abstract claims.", "Keep generated artifacts readable in plain text.",
        "Make every visual decision traceable to a token.",
      ],
    },
    assets: AssetSet::{
      primary_logo: Logo::{
        name: "MoonBit wordmark",
        path: "assets/moonbit-wordmark.svg",
        min_width_px: 128,
        clear_space: Space::Multiplier(1.0),
        background: BackgroundRule::LightOrDark,
      },
      alternate_logos: [
        Logo::{
          name: "MoonBit symbol",
          path: "assets/moonbit-symbol.svg",
          min_width_px: 48,
          clear_space: Space::Multiplier(0.75),
          background: BackgroundRule::LightOnly,
        },
        Logo::{
          name: "MoonBit reversed mark",
          path: "assets/moonbit-reversed.svg",
          min_width_px: 96,
          clear_space: Space::Pixels(24),
          background: BackgroundRule::DarkOnly,
        },
        Logo::{
          name: "MoonBit mono stamp",
          path: "assets/moonbit-mono.svg",
          min_width_px: 64,
          clear_space: Space::Pixels(16),
          background: BackgroundRule::Monochrome,
        },
      ],
      imagery_style: "Use crisp product or interface imagery; avoid vague decorative scenes.",
    },
    palette: Palette::{
      colors: [
        ColorToken::hex("rabbit-blue", "#4F7CFF", role="primary action"),
        ColorToken::hex("ink", "#151A24", role="body text"),
        ColorToken::hex("paper", "#F7F9FC", role="surface"),
        ColorToken::hex("mint", "#39C6A3", role="success accent"),
        ColorToken::hex("amber", "#F5A623", role="warning accent"),
        ColorToken::hex("rose", "#E15A7C", role="critical accent"),
      ],
      gradients: [
        GradientToken::{
          name: "quiet launch",
          stops: ["#4F7CFF", "#39C6A3"],
          angle: 135,
          usage: "small callout backgrounds only",
        },
      ],
    },
    typography: Typography::{
      families: [
        FontToken::{
          name: "Inter",
          fallback: "system-ui, sans-serif",
          usage: "interface and documentation",
        },
        FontToken::{
          name: "JetBrains Mono",
          fallback: "Consolas, monospace",
          usage: "code blocks and token tables",
        },
      ],
      scale: [
        TypeStep::{ name: "caption", size_px: 12, line_height_px: 16 },
        TypeStep::{ name: "body", size_px: 16, line_height_px: 24 },
        TypeStep::{ name: "title", size_px: 28, line_height_px: 36 },
        TypeStep::{ name: "display", size_px: 44, line_height_px: 52 },
      ],
    },
    components: [
      ComponentSpec::{
        name: "Primary button",
        purpose: "Start a build, export, or validation task.",
        anatomy: ["label", "optional icon", "focus ring"],
        tokens: ["rabbit-blue", "paper", "body"],
        states: ["default", "hover", "pressed", "disabled", "focus-visible"],
      },
      ComponentSpec::{
        name: "Token table",
        purpose: "Compare token name, value, usage, and accessibility notes.",
        anatomy: ["header", "token swatch", "value cell", "guidance cell"],
        tokens: ["paper", "ink", "caption"],
        states: ["default", "row hover"],
      },
      ComponentSpec::{
        name: "Logo lockup",
        purpose: "Show logo variants with clear-space and size constraints.",
        anatomy: ["asset preview", "minimum size", "background guidance"],
        tokens: ["paper", "ink"],
        states: ["light", "dark", "mono"],
      },
    ],
    forbidden: [
      MisuseRule::{
        title: "Do not stretch the logo",
        reason: "Aspect ratio changes make the mark look untrustworthy.",
        replacement: "Scale proportionally and respect minimum width.",
      },
      MisuseRule::{
        title: "Do not put the blue wordmark on a similar blue field",
        reason: "Low contrast hides the brand mark.",
        replacement: "Use the white or monochrome variant.",
      },
      MisuseRule::{
        title: "Do not invent one-off accent colors",
        reason: "Untracked accents fragment recognition across artifacts.",
        replacement: "Choose the closest palette token or add a reviewed token.",
      },
    ],
    metadata: Meta::{
      source: "Bundled MoonBit sample tokens for documentation and integration tests.",
      maintainer: "cyypyhon123",
      license: "Apache-2.0",
    },
  }
}

///|
/// Build the bundled example with a custom name and tagline.
pub fn moonbit_brandbook_with(name~ : String, tagline~ : String) -> BrandBook {
  BrandBook::{ ..moonbit_brandbook(), name, tagline }
}