{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "SGCA Year 7-8 Theory Book",
  "type": "object",
  "properties": {
    "theory_book": {
      "type": "object",
      "properties": {
        "year_range": { "type": "string", "enum": ["7-8"] },
        "age_band": { "type": "string", "enum": ["11-13"] },
        "visualtier": { "type": "string", "enum": ["Stage3StylisedHybrid"] },
        "lighting_stage": { "type": "integer", "enum": [2] },
        "drifttolerancepercent": { "type": "integer", "minimum": 0, "maximum": 5 },
        "poseregistryversion": { "type": "string", "enum": ["2.0"] },
        "hairevolutionversion": { "type": "string", "enum": ["2.x"] },
        "chipgovernanceversion": { "type": "string", "enum": ["2.x"] },
        "page_count": { "type": "integer", "minimum": 1 },
        "trim_size": { "type": "string", "pattern": "^\\d+\\.\\d+x\\d+\\.\\d+$" },
        "units": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "unitid": { "type": "string" },
              "conceptfamily": { "type": "string" },
              "diagramcomplexity": { "type": "string", "enum": ["mediumhigh"] }
            },
            "required": ["unitid", "conceptfamily", "diagramcomplexity"]
          }
        },
        "visual_constraints": {
          "type": "object",
          "properties": {
            "maxrealismstage": { "type": "string", "enum": ["stylised"] },
            "forbidden_elements": {
              "type": "array",
              "items": { "type": "string", "enum": ["gritty_realism", "dystopian_mood", "weapon_metaphors"] }
            }
          },
          "required": ["maxrealismstage", "forbidden_elements"]
        },
        "rotation_window": { "type": "integer", "enum": [5] },
        "interioranchorrequired": { "type": "boolean" }
      },
      "required": ["year_range", "age_band", "visualtier", "lighting_stage", "drifttolerancepercent", "poseregistryversion", "hairevolutionversion", "chipgovernanceversion", "page_count", "trim_size", "units", "visual_constraints", "rotation_window", "interioranchorrequired"]
    }
  },
  "required": ["theory_book"]
}
