{
  "$defs": {
    "BackgroundType": {
      "description": "Background type for logo color expressions.",
      "enum": [
        "white",
        "black",
        "brand-color",
        "dark",
        "transparent"
      ],
      "type": "string"
    },
    "ClearSpace": {
      "description": "Clear space requirements around the logo.",
      "properties": {
        "formula": {
          "type": "string"
        },
        "minimum_mm": {
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "minimum_px": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "reference_element": {
          "type": "string"
        }
      },
      "required": [
        "formula",
        "reference_element"
      ],
      "type": "object"
    },
    "FaviconSize": {
      "description": "Favicon size specification.",
      "properties": {
        "file_ref": {
          "type": [
            "string",
            "null"
          ]
        },
        "platform": {
          "type": [
            "string",
            "null"
          ]
        },
        "px": {
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "px"
      ],
      "type": "object"
    },
    "FaviconSpec": {
      "description": "Favicon specification.",
      "properties": {
        "background_color": {
          "type": [
            "string",
            "null"
          ]
        },
        "sizes": {
          "items": {
            "$ref": "#/$defs/FaviconSize"
          },
          "type": "array"
        }
      },
      "required": [
        "sizes"
      ],
      "type": "object"
    },
    "LogoAnimation": {
      "description": "Logo animation specification.",
      "properties": {
        "entry_duration_ms": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "exit_duration_ms": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "file_refs": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "hold_duration_ms": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "loop_animation": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "LogoColorExpression": {
      "description": "Logo color expression for a given background.",
      "properties": {
        "background_type": {
          "$ref": "#/$defs/BackgroundType"
        },
        "foreground_colors": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "id": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "background_type",
        "foreground_colors"
      ],
      "type": "object"
    },
    "LogoComposition": {
      "description": "Logo composition type.",
      "enum": [
        "horizontal",
        "stacked",
        "symbol-only",
        "wordmark-only",
        "full"
      ],
      "type": "string"
    },
    "LogoMark": {
      "description": "Primary or variant logo mark.",
      "properties": {
        "composition": {
          "$ref": "#/$defs/LogoComposition"
        },
        "file_refs": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "minimum_size_mm": {
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "minimum_size_px": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "composition"
      ],
      "type": "object"
    },
    "LogoSizingTier": {
      "description": "Logo sizing tier with variant requirements.",
      "properties": {
        "max_px": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "min_px": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "name": {
          "type": "string"
        },
        "required_variant": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "LogoUsageRules": {
      "description": "Logo usage rules and prohibitions.",
      "properties": {
        "approved_background_contrast_minimum": {
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "prohibited": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "prohibited"
      ],
      "type": "object"
    },
    "LogoVariant": {
      "description": "Logo variant for specific use cases.",
      "properties": {
        "composition": {
          "$ref": "#/$defs/LogoComposition"
        },
        "contexts_approved": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "contexts_prohibited": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "file_refs": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "use_case": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "composition",
        "use_case"
      ],
      "type": "object"
    },
    "PathRef": {
      "description": "Path-based cross-reference relative to .corpospec/ root.\nPattern: `^[a-z0-9_-]+(/[a-z0-9_.-]+)+$`",
      "pattern": "^[a-z0-9_-]+(/[a-z0-9_.-]+)+$",
      "type": "string"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.7.1/brand-logo.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Brand logo definition.",
  "properties": {
    "animation": {
      "anyOf": [
        {
          "$ref": "#/$defs/LogoAnimation"
        },
        {
          "type": "null"
        }
      ]
    },
    "clear_space": {
      "anyOf": [
        {
          "$ref": "#/$defs/ClearSpace"
        },
        {
          "type": "null"
        }
      ]
    },
    "color_expressions": {
      "default": [],
      "items": {
        "$ref": "#/$defs/LogoColorExpression"
      },
      "type": "array"
    },
    "favicon": {
      "anyOf": [
        {
          "$ref": "#/$defs/FaviconSpec"
        },
        {
          "type": "null"
        }
      ]
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "primary": {
      "$ref": "#/$defs/LogoMark"
    },
    "sizing_tiers": {
      "default": [],
      "items": {
        "$ref": "#/$defs/LogoSizingTier"
      },
      "type": "array"
    },
    "usage_rules": {
      "anyOf": [
        {
          "$ref": "#/$defs/LogoUsageRules"
        },
        {
          "type": "null"
        }
      ]
    },
    "variants": {
      "default": [],
      "items": {
        "$ref": "#/$defs/LogoVariant"
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "primary"
  ],
  "title": "BrandLogo",
  "type": "object"
}