{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gini.iq/schemas/brand-manifest.json",
  "title": "GINI Brand Manifest",
  "description": "Schema for the machine-readable GINI brand manifest served at https://gini.iq/brand.json (and the English mirror at /en/brand.json). Documents every public field a designer, journalist, partner, or AI agent might consume to render a GINI-faithful product, pitch deck, or press release. The shape is stable — `manifestVersion` follows semver and only bumps on breaking changes.",
  "type": "object",
  "required": [
    "manifestVersion",
    "generatedAt",
    "brand",
    "identity",
    "palette",
    "typography",
    "logo",
    "voice",
    "press",
    "license",
    "version",
    "endpoints"
  ],
  "additionalProperties": true,
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri",
      "description": "Reference to this JSON Schema document."
    },
    "manifestVersion": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$",
      "description": "Semver of the manifest shape (not the brand). Bumps only when fields are renamed or removed."
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO-8601 timestamp the document was rendered."
    },
    "brand": {
      "type": "object",
      "description": "Top-level identity, naming, contact, and trademark facts.",
      "required": ["name", "url", "locale", "tagline", "description", "headquarters"],
      "properties": {
        "name": {
          "type": "object",
          "required": ["primary", "legal", "bilingual"],
          "properties": {
            "primary": { "type": "string" },
            "legal": { "type": "string" },
            "bilingual": { "type": "string" }
          }
        },
        "localizedName": {
          "type": "object",
          "properties": {
            "ar": { "type": "string" },
            "en": { "type": "string" }
          }
        },
        "slug": { "type": "string" },
        "url": { "type": "string", "format": "uri" },
        "canonical": { "type": "string", "format": "uri" },
        "alternates": {
          "type": "object",
          "properties": {
            "ar": { "type": "string", "format": "uri" },
            "en": { "type": "string", "format": "uri" }
          }
        },
        "locale": { "type": "string", "enum": ["ar", "en"] },
        "supportedLocales": { "type": "array", "items": { "type": "string" } },
        "tagline": {
          "type": "object",
          "required": ["primary"],
          "properties": {
            "primary": { "type": "string" },
            "localized": {
              "type": "object",
              "properties": {
                "ar": { "type": "string" },
                "en": { "type": "string" }
              }
            }
          }
        },
        "description": {
          "type": "object",
          "required": ["short", "long"],
          "properties": {
            "short": { "type": "string" },
            "long": { "type": "string" }
          }
        },
        "industry": { "type": "string" },
        "foundedYear": { "type": "integer", "minimum": 1900 },
        "headquarters": {
          "type": "object",
          "required": ["city", "country", "countryCode"],
          "properties": {
            "city": { "type": "string" },
            "country": { "type": "string" },
            "countryCode": { "type": "string", "minLength": 2, "maxLength": 2 }
          }
        },
        "contact": {
          "type": "object",
          "properties": {
            "website": { "type": "string", "format": "uri" },
            "press": { "type": "string" },
            "pressEmail": { "type": "string", "format": "email" },
            "social": { "type": "object", "additionalProperties": true }
          }
        },
        "trademark": {
          "type": "object",
          "properties": {
            "status": { "type": "string", "enum": ["registered", "pending", "common-law"] },
            "marks": { "type": "array", "items": { "type": "string" } }
          }
        }
      }
    },
    "identity": {
      "type": "object",
      "description": "Strategic foundation — mission, vision, principles, what GINI is and is not.",
      "properties": {
        "principles": { "type": "array", "items": { "$ref": "#/$defs/Principle" } },
        "attributes": {
          "type": "object",
          "properties": {
            "are": { "type": "array", "items": { "$ref": "#/$defs/Attribute" } },
            "areNot": { "type": "array", "items": { "$ref": "#/$defs/Attribute" } }
          }
        }
      }
    },
    "palette": {
      "type": "array",
      "description": "Brand colour palette — each entry exposes HEX, RGB, CMYK, HSL, and (where relevant) Pantone.",
      "items": { "$ref": "#/$defs/PaletteColor" }
    },
    "accessibility": {
      "type": "array",
      "description": "Pre-validated foreground-on-background pairings with measured WCAG ratios.",
      "items": { "$ref": "#/$defs/AccessibilityPair" }
    },
    "typography": {
      "type": "object",
      "description": "Typeface stack and full type scale.",
      "properties": {
        "primaryFamily": { "type": "string" },
        "monospaceFamily": { "type": "string" },
        "scale": {
          "type": "array",
          "items": { "$ref": "#/$defs/TypeStep" }
        }
      }
    },
    "logo": {
      "type": "object",
      "description": "Logo variants, anatomy, and do/don't rules.",
      "properties": {
        "variants": { "type": "array", "items": { "$ref": "#/$defs/LogoVariant" } },
        "anatomy": { "type": "array", "items": { "$ref": "#/$defs/AnatomyMetric" } },
        "rules": { "type": "array", "items": { "$ref": "#/$defs/LogoRule" } }
      }
    },
    "voice": {
      "type": "object",
      "description": "Voice, tone, and writing examples.",
      "properties": {
        "bullets": { "type": "array" },
        "examples": { "type": "array" }
      }
    },
    "press": {
      "type": "object",
      "description": "Boilerplate paragraph + quick facts journalists can copy."
    },
    "faq": { "type": "array" },
    "license": {
      "type": "object",
      "description": "Permitted and restricted uses of GINI brand assets.",
      "properties": {
        "summary": { "type": "string" },
        "permitted": { "type": "array", "items": { "type": "string" } },
        "restricted": { "type": "array", "items": { "type": "string" } },
        "contact": { "type": "string" }
      }
    },
    "version": {
      "type": "object",
      "description": "Brand-kit version and changelog (separate from the manifest schema version).",
      "properties": {
        "current": { "type": "string" },
        "updated": { "type": "string" },
        "changelog": { "type": "array" }
      }
    },
    "endpoints": {
      "type": "object",
      "description": "Sibling URLs that expose the same data in other formats.",
      "properties": {
        "json": { "type": "string", "format": "uri" },
        "markdown": { "type": "string", "format": "uri" },
        "css": { "type": "string", "format": "uri" },
        "tailwind": { "type": "string", "format": "uri" },
        "tokens": { "type": "string", "format": "uri" },
        "prompt": { "type": "string", "format": "uri" },
        "cursorrules": { "type": "string", "format": "uri" },
        "agentsMd": { "type": "string", "format": "uri" },
        "schema": { "type": "string", "format": "uri" }
      }
    },
    "localized": {
      "type": "object",
      "description": "Bilingual mirror of every translatable field, in case the consumer wants both languages at once."
    }
  },
  "$defs": {
    "Principle": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "label": { "type": "string" },
        "title": { "type": "string" },
        "body": { "type": "string" }
      }
    },
    "Attribute": {
      "type": "object",
      "properties": {
        "text": { "type": "string" }
      }
    },
    "PaletteColor": {
      "type": "object",
      "required": ["id", "name", "hex", "rgb"],
      "properties": {
        "id": { "type": "string" },
        "name": { "type": "string" },
        "role": { "type": "string" },
        "hex": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" },
        "rgb": {
          "type": "object",
          "properties": {
            "r": { "type": "integer", "minimum": 0, "maximum": 255 },
            "g": { "type": "integer", "minimum": 0, "maximum": 255 },
            "b": { "type": "integer", "minimum": 0, "maximum": 255 }
          }
        },
        "cmyk": {
          "type": "object",
          "properties": {
            "c": { "type": "integer" },
            "m": { "type": "integer" },
            "y": { "type": "integer" },
            "k": { "type": "integer" }
          }
        },
        "hsl": {
          "type": "object",
          "properties": {
            "h": { "type": "integer" },
            "s": { "type": "integer" },
            "l": { "type": "integer" }
          }
        },
        "pantone": { "type": "string" }
      }
    },
    "AccessibilityPair": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "foreground": { "type": "string" },
        "background": { "type": "string" },
        "ratio": { "type": "string" },
        "rating": { "type": "string", "enum": ["AA", "AAA"] },
        "use": { "type": "string" }
      }
    },
    "TypeStep": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "label": { "type": "string" },
        "size": { "type": "string" },
        "weight": { "type": "string" },
        "leading": { "type": "string" },
        "usage": { "type": "string" }
      }
    },
    "LogoVariant": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "kind": { "type": "string", "enum": ["wordmark", "monogram"] },
        "title": { "type": "string" },
        "usage": { "type": "string" },
        "background": { "type": "string" },
        "mode": { "type": "string" },
        "downloadSvg": { "type": "string", "format": "uri" }
      }
    },
    "AnatomyMetric": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "label": { "type": "string" },
        "value": { "type": "string" },
        "note": { "type": "string" }
      }
    },
    "LogoRule": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "kind": { "type": "string", "enum": ["do", "dont"] },
        "rule": { "type": "string" }
      }
    }
  }
}
