{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jsoncut.com/schemas/v2/cut.schema.json",
  "title": "JsonCut cut.md frontmatter",
  "type": "object",
  "required": ["cut", "id", "name", "status", "scope", "kind", "intent", "output", "governance", "style", "media", "quality", "technical"],
  "properties": {
    "cut": { "const": "jsoncut.cut/1" },
    "id": { "$ref": "#/$defs/id" },
    "name": { "type": "string", "minLength": 1, "maxLength": 160 },
    "status": { "enum": ["draft", "approved"] },
    "scope": { "enum": ["project", "template"] },
    "kind": { "enum": ["image", "video"] },
    "intent": { "$ref": "#/$defs/intent" },
    "output": { "$ref": "#/$defs/output" },
    "governance": { "$ref": "#/$defs/governance" },
    "style": { "$ref": "#/$defs/style" },
    "motion": { "$ref": "#/$defs/motion" },
    "media": { "$ref": "#/$defs/media" },
    "quality": { "$ref": "#/$defs/quality" },
    "technical": { "$ref": "#/$defs/technical" },
    "structure": { "$ref": "#/$defs/structure" },
    "references": { "type": "array", "items": { "$ref": "#/$defs/reference" } }
  },
  "allOf": [
    { "if": { "properties": { "kind": { "const": "video" } } }, "then": { "required": ["motion"] } },
    { "if": { "properties": { "kind": { "const": "image" } } }, "then": { "not": { "required": ["structure"] } } }
  ],
  "$defs": {
    "id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$", "maxLength": 160 },
    "strings": { "type": "array", "maxItems": 100, "items": { "type": "string", "minLength": 1, "maxLength": 500 } },
    "intent": {
      "type": "object", "required": ["audience", "message", "outcome", "destination", "tone"],
      "properties": { "audience": { "type": "string" }, "message": { "type": "string" }, "outcome": { "type": "string" }, "destination": { "enum": ["tiktok", "instagram-reels", "youtube-shorts", "website", "presentation", "other"] }, "tone": { "$ref": "#/$defs/strings" } }
    },
    "output": {
      "type": "object", "required": ["width", "height", "background"],
      "properties": { "width": { "type": "number", "minimum": 16, "maximum": 7680 }, "height": { "type": "number", "minimum": 16, "maximum": 7680 }, "background": { "enum": ["opaque", "transparent"] }, "fps": { "type": "number", "minimum": 1, "maximum": 120 }, "duration": { "$ref": "#/$defs/duration" }, "audio": { "enum": ["none", "optional", "required"] } }
    },
    "duration": { "type": "object", "required": ["target", "min", "max"], "properties": { "target": { "type": "number", "exclusiveMinimum": 0 }, "min": { "type": "number", "exclusiveMinimum": 0 }, "max": { "type": "number", "exclusiveMinimum": 0 } } },
    "governance": { "type": "object", "required": ["locked", "adaptable", "forbidden"], "properties": { "locked": { "$ref": "#/$defs/strings" }, "adaptable": { "$ref": "#/$defs/strings" }, "forbidden": { "$ref": "#/$defs/strings" } } },
    "palette": { "type": "object", "required": ["id", "value", "roles"], "properties": { "id": { "$ref": "#/$defs/id" }, "value": { "type": "string" }, "roles": { "$ref": "#/$defs/strings" } } },
    "typography": { "type": "object", "required": ["id", "family", "weight", "sizePx", "lineHeight", "tracking", "case", "roles"], "properties": { "id": { "$ref": "#/$defs/id" }, "family": { "type": "string" }, "weight": { "type": "number", "minimum": 100, "maximum": 900 }, "sizePx": { "type": "object", "required": ["min", "max"], "properties": { "min": { "type": "number" }, "max": { "type": "number" } } }, "lineHeight": { "type": "number", "minimum": 0.5, "maximum": 3 }, "tracking": { "type": "string" }, "case": { "enum": ["sentence", "upper", "lower", "preserve"] }, "roles": { "$ref": "#/$defs/strings" } } },
    "style": { "type": "object", "required": ["concept", "density", "hierarchy", "palette", "typography", "layout", "surfaces", "imagery"], "properties": { "concept": { "type": "string" }, "density": { "enum": ["minimal", "restrained", "layered", "maximal"] }, "hierarchy": { "type": "object" }, "palette": { "type": "array", "minItems": 2, "maxItems": 24, "items": { "$ref": "#/$defs/palette" } }, "typography": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "$ref": "#/$defs/typography" } }, "layout": { "type": "object" }, "surfaces": { "type": "object" }, "imagery": { "type": "object" }, "components": { "type": "object" } } },
    "motion": { "type": "object", "required": ["character", "tempo", "entrances", "exits", "transitions", "text", "ambient", "forbidden"], "properties": { "character": { "$ref": "#/$defs/strings" }, "tempo": { "type": "object", "required": ["pace", "build", "breathe", "resolve"], "properties": { "pace": { "enum": ["slow", "medium", "fast", "mixed"] }, "build": { "type": "number", "minimum": 0, "maximum": 1 }, "breathe": { "type": "number", "minimum": 0, "maximum": 1 }, "resolve": { "type": "number", "minimum": 0, "maximum": 1 } } }, "entrances": { "type": "object" }, "exits": { "type": "object" }, "transitions": { "type": "object" }, "text": { "type": "object" }, "ambient": { "type": "object" }, "forbidden": { "$ref": "#/$defs/strings" } } },
    "media": { "type": "object", "required": ["uniqueness", "inspiration", "generation", "stock", "provenanceRequired"], "properties": { "uniqueness": { "type": "object", "required": ["scope", "reuse"], "properties": { "scope": { "enum": ["project", "batch"] }, "batchId": { "$ref": "#/$defs/id" }, "reuse": { "enum": ["forbidden", "allowed"] } } }, "inspiration": { "enum": ["style-only", "style-and-structure", "unrestricted"] }, "generation": { "enum": ["allowed", "forbidden"] }, "stock": { "enum": ["allowed", "forbidden"] }, "provenanceRequired": { "type": "boolean" } } },
    "quality": { "type": "object", "required": ["alignmentTolerancePx", "minBodyFontPx", "contrast", "maxUnintendedStaticSec", "emptyFirstFrame", "emptyLastFrame", "review", "assertions"], "properties": { "alignmentTolerancePx": { "type": "number", "minimum": 0, "maximum": 32 }, "minBodyFontPx": { "type": "number", "minimum": 1, "maximum": 300 }, "contrast": { "enum": ["wcag-aa", "wcag-aaa", "custom"] }, "maxUnintendedStaticSec": { "type": "number", "minimum": 0, "maximum": 30 }, "emptyFirstFrame": { "type": "boolean" }, "emptyLastFrame": { "type": "boolean" }, "review": { "type": "object" }, "assertions": { "type": "array", "maxItems": 100, "items": { "type": "object", "required": ["kind", "target"] } } } },
    "technical": { "type": "object", "required": ["nativeFirst", "customBlock", "finalQuality"], "properties": { "nativeFirst": { "type": "boolean" }, "customBlock": { "enum": ["forbidden", "exception-only", "allowed"] }, "finalQuality": { "enum": ["draft", "standard", "high"] } } },
    "structure": { "type": "object", "required": ["narrative", "beats"], "properties": { "narrative": { "type": "string" }, "beats": { "type": "array", "minItems": 1, "maxItems": 100, "items": { "type": "object", "required": ["id", "role", "durationSec", "message", "visualWorld", "focal", "motion", "transitionOut"] } } } },
    "reference": { "type": "object", "required": ["id", "uri", "kind", "use", "assetReuse"], "properties": { "id": { "$ref": "#/$defs/id" }, "uri": { "type": "string" }, "kind": { "enum": ["image", "video", "template", "component", "brand", "url"] }, "use": { "$ref": "#/$defs/strings" }, "assetReuse": { "type": "boolean" }, "note": { "type": "string" } } }
  }
}
