{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://kiduna.ai/schemas/isometric/component.schema.json",
  "title": "Kiduna Isometric Component",
  "type": "object",
  "additionalProperties": false,
  "required": ["id", "version", "canonicalName", "category", "subtype", "description", "asset", "dimensions", "footprint", "anchors", "orientation", "layer", "detailTier", "occlusion", "materials", "paletteRoles", "receivesLight", "emittedLight", "shadow", "animation", "states", "stateTransitions", "interactions", "portalDestination", "accessibility", "tags", "provenance"],
  "properties": {
    "id": { "type": "string", "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)+$" },
    "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
    "canonicalName": { "type": "string", "minLength": 2 },
    "category": { "enum": ["Background", "Terrain", "Tile", "Wall", "Architecture", "Object", "Entity", "Avatar", "Ally", "Actor", "Portal", "Light", "Vegetation", "Fauna", "Effect", "Panel", "Overlay", "Chrome", "Interactive Component"] },
    "subtype": { "type": "string", "minLength": 2 },
    "description": { "type": "string", "minLength": 10 },
    "asset": { "$ref": "#/$defs/asset" },
    "dimensions": { "$ref": "#/$defs/dimensions" },
    "footprint": { "$ref": "#/$defs/footprint" },
    "anchors": { "$ref": "#/$defs/anchors" },
    "orientation": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["N", "NE", "E", "SE", "S", "SW", "W", "NW", "omnidirectional"] } },
    "layer": { "type": "object", "additionalProperties": false, "required": ["band", "localDepthBias"], "properties": { "band": { "type": "integer", "minimum": 0, "maximum": 110 }, "localDepthBias": { "type": "integer", "minimum": -999, "maximum": 999 } } },
    "detailTier": { "enum": ["focal", "interactive", "supporting", "distant"] },
    "occlusion": { "$ref": "#/$defs/occlusion" },
    "materials": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } },
    "paletteRoles": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
    "receivesLight": { "type": "boolean" },
    "emittedLight": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/light" }] },
    "shadow": { "$ref": "#/$defs/shadow" },
    "animation": { "type": "array", "items": { "$ref": "#/$defs/animation" } },
    "states": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["idle", "available", "focused", "selected", "active", "occupied", "changed", "urgent", "completed", "locked", "unavailable", "new", "connected", "absent"] } },
    "stateTransitions": { "type": "array", "items": { "$ref": "#/$defs/transition" } },
    "interactions": { "type": "array", "items": { "$ref": "#/$defs/interaction" } },
    "portalDestination": { "oneOf": [{ "type": "null" }, { "type": "object", "additionalProperties": false, "required": ["type", "id"], "properties": { "type": { "enum": ["Scene", "Realm", "Archetype", "Action", "Experience"] }, "id": { "type": "string" } } }] },
    "accessibility": { "$ref": "#/$defs/accessibility" },
    "tags": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
    "provenance": { "$ref": "#/$defs/provenance" }
  },
  "$defs": {
    "vec2": { "type": "object", "additionalProperties": false, "required": ["x", "y"], "properties": { "x": { "type": "number" }, "y": { "type": "number" } } },
    "vec3": { "type": "object", "additionalProperties": false, "required": ["x", "y", "z"], "properties": { "x": { "type": "number" }, "y": { "type": "number" }, "z": { "type": "number" } } },
    "asset": { "type": "object", "additionalProperties": false, "required": ["file", "mimeType", "transparent"], "properties": { "file": { "type": "string", "pattern": "\\.png$" }, "mimeType": { "const": "image/png" }, "transparent": { "type": "boolean" }, "sheetRegion": { "type": "object", "additionalProperties": false, "required": ["row", "column", "rows", "columns"], "properties": { "row": { "type": "integer", "minimum": 0 }, "column": { "type": "integer", "minimum": 0 }, "rows": { "type": "integer", "minimum": 1 }, "columns": { "type": "integer", "minimum": 1 } } } } },
    "dimensions": { "type": "object", "additionalProperties": false, "required": ["worldUnits", "pixelBounds"], "properties": { "worldUnits": { "$ref": "#/$defs/vec3" }, "pixelBounds": { "type": "object", "additionalProperties": false, "required": ["width", "height"], "properties": { "width": { "type": "integer", "minimum": 1 }, "height": { "type": "integer", "minimum": 1 } } } } },
    "footprint": { "type": "object", "additionalProperties": false, "required": ["shape", "size", "traversable"], "properties": { "shape": { "enum": ["rectangle", "circle", "polygon", "none"] }, "size": { "$ref": "#/$defs/vec2" }, "traversable": { "type": "boolean" } } },
    "anchors": { "type": "object", "additionalProperties": { "$ref": "#/$defs/vec3" }, "required": ["placement", "interaction", "shadow"], "properties": { "placement": { "$ref": "#/$defs/vec3" }, "interaction": { "$ref": "#/$defs/vec3" }, "shadow": { "$ref": "#/$defs/vec3" }, "focus": { "$ref": "#/$defs/vec3" }, "light": { "$ref": "#/$defs/vec3" }, "portal.entry": { "$ref": "#/$defs/vec3" }, "portal.exit": { "$ref": "#/$defs/vec3" }, "portal.preview": { "$ref": "#/$defs/vec3" } } },
    "light": { "type": "object", "additionalProperties": false, "required": ["colorRole", "intensity", "rangeWU", "falloff"], "properties": { "colorRole": { "type": "string" }, "intensity": { "type": "number", "minimum": 0, "maximum": 1 }, "rangeWU": { "type": "number", "exclusiveMinimum": 0 }, "falloff": { "enum": ["inverse-square", "soft-linear", "volume"] } } },
    "shadow": { "type": "object", "additionalProperties": false, "required": ["contact", "cast", "separable"], "properties": { "contact": { "type": "boolean" }, "cast": { "type": "boolean" }, "separable": { "type": "boolean" }, "opacity": { "type": "number", "minimum": 0, "maximum": 1 } } },
    "occlusion": { "type": "object", "additionalProperties": false, "required": ["mode", "fadeOpacity", "cutawayMarginWU"], "properties": { "mode": { "enum": ["opaque", "fade", "cutaway", "silhouette", "pass-through"] }, "fadeOpacity": { "type": "number", "minimum": 0, "maximum": 1 }, "cutawayMarginWU": { "type": "number", "minimum": 0 } } },
    "transition": { "type": "object", "additionalProperties": false, "required": ["from", "to", "trigger", "durationMs", "reducedMotion"], "properties": { "from": { "type": "string" }, "to": { "type": "string" }, "trigger": { "type": "string" }, "durationMs": { "type": "integer", "minimum": 0 }, "reducedMotion": { "type": "string" } } },
    "animation": { "type": "object", "additionalProperties": false, "required": ["id", "trigger", "durationMs", "loop", "amplitude", "channels", "interruptionPolicy", "reducedMotion"], "properties": { "id": { "type": "string" }, "trigger": { "enum": ["ambient", "focus", "activate", "state-enter", "state-exit"] }, "durationMs": { "type": "integer", "minimum": 80 }, "loop": { "type": "boolean" }, "amplitude": { "type": "number", "minimum": 0 }, "channels": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["position", "rotation", "scale", "opacity", "emission", "material", "particles", "sound"] } }, "interruptionPolicy": { "enum": ["finish", "blend", "snap", "cancel"] }, "reducedMotion": { "type": "string" } } },
    "interaction": { "type": "object", "additionalProperties": false, "required": ["action", "anchor", "permission"], "properties": { "action": { "type": "string" }, "anchor": { "type": "string" }, "permission": { "type": "string" }, "effect": { "type": "string" } } },
    "accessibility": { "type": "object", "additionalProperties": false, "required": ["name", "role", "focusAnchor", "nonColorCue"], "properties": { "name": { "type": "string" }, "role": { "type": "string" }, "description": { "type": "string" }, "focusAnchor": { "type": "string" }, "nonColorCue": { "type": "string" } } },
    "provenance": { "type": "object", "additionalProperties": false, "required": ["status", "createdBy", "sourceReferences", "license"], "properties": { "status": { "enum": ["reference", "draft", "accepted", "superseded"] }, "createdBy": { "type": "string" }, "sourceReferences": { "type": "array", "items": { "type": "string" } }, "license": { "type": "string" }, "validationRecord": { "type": ["string", "null"] } } }
  }
}
