{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://yaml.sh/schema/landing-page-v1.json",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "version",
    "page",
    "hero"
  ],
  "properties": {
    "version": {
      "const": 1
    },
    "design": {
      "$ref": "#/$defs/design"
    },
    "page": {
      "$ref": "#/$defs/page"
    },
    "navigation": {
      "$ref": "#/$defs/navigation"
    },
    "hero": {
      "$ref": "#/$defs/hero"
    },
    "sections": {
      "type": "array",
      "maxItems": 12,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {},
          "heading": {},
          "text": {},
          "items": {},
          "quote": {},
          "author": {},
          "role": {},
          "plans": {},
          "action": {}
        },
        "discriminator": {
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/$defs/featuresSection"
          },
          {
            "$ref": "#/$defs/statsSection"
          },
          {
            "$ref": "#/$defs/logosSection"
          },
          {
            "$ref": "#/$defs/quoteSection"
          },
          {
            "$ref": "#/$defs/pricingSection"
          },
          {
            "$ref": "#/$defs/faqSection"
          },
          {
            "$ref": "#/$defs/ctaSection"
          }
        ]
      }
    },
    "footer": {
      "$ref": "#/$defs/footer"
    }
  },
  "$defs": {
    "design": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "preset": {
          "enum": [
            "editorial"
          ]
        },
        "accent": {
          "type": "string",
          "pattern": "^#[0-9A-Fa-f]{6}$"
        }
      }
    },
    "page": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "title"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "pattern": "\\S"
        },
        "title": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "pattern": "\\S"
        },
        "description": {
          "type": "string",
          "maxLength": 2000
        },
        "language": {
          "type": "string",
          "maxLength": 35,
          "format": "language-tag"
        },
        "canonical": {
          "type": "string",
          "maxLength": 2048,
          "format": "https-url"
        }
      }
    },
    "navigation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "links": {
          "type": "array",
          "maxItems": 6,
          "items": {
            "$ref": "#/$defs/link"
          }
        },
        "action": {
          "$ref": "#/$defs/link"
        }
      }
    },
    "hero": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "heading"
      ],
      "properties": {
        "eyebrow": {
          "type": "string",
          "maxLength": 80
        },
        "heading": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "pattern": "\\S"
        },
        "text": {
          "type": "string",
          "maxLength": 2000
        },
        "actions": {
          "type": "array",
          "maxItems": 2,
          "items": {
            "$ref": "#/$defs/action"
          }
        },
        "image": {
          "$ref": "#/$defs/image"
        }
      }
    },
    "image": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "src",
        "alt"
      ],
      "properties": {
        "src": {
          "type": "string",
          "maxLength": 2048,
          "format": "safe-image-url"
        },
        "alt": {
          "type": "string",
          "maxLength": 300,
          "minLength": 1,
          "pattern": "\\S"
        }
      }
    },
    "link": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "label",
        "href"
      ],
      "properties": {
        "label": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "pattern": "\\S"
        },
        "href": {
          "type": "string",
          "maxLength": 2048,
          "format": "safe-href"
        }
      }
    },
    "action": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "label",
        "href"
      ],
      "properties": {
        "label": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "pattern": "\\S"
        },
        "href": {
          "type": "string",
          "maxLength": 2048,
          "format": "safe-href"
        },
        "style": {
          "enum": [
            "primary",
            "secondary"
          ]
        }
      }
    },
    "featuresSection": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "items"
      ],
      "properties": {
        "type": {
          "const": "features"
        },
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "heading": {
          "type": "string",
          "maxLength": 160
        },
        "text": {
          "type": "string",
          "maxLength": 2000
        },
        "items": {
          "type": "array",
          "maxItems": 6,
          "items": {
            "$ref": "#/$defs/featureItem"
          }
        }
      }
    },
    "featureItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "title",
        "text"
      ],
      "properties": {
        "icon": {
          "enum": [
            "bolt",
            "camera",
            "chart",
            "check",
            "clock",
            "code",
            "compass",
            "globe",
            "heart",
            "layers",
            "lock",
            "refresh",
            "shield",
            "spark",
            "star"
          ]
        },
        "title": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "pattern": "\\S"
        },
        "text": {
          "type": "string",
          "maxLength": 2000
        }
      }
    },
    "statsSection": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "items"
      ],
      "properties": {
        "type": {
          "const": "stats"
        },
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "items": {
          "type": "array",
          "maxItems": 6,
          "items": {
            "$ref": "#/$defs/statItem"
          }
        }
      }
    },
    "statItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "label"
      ],
      "properties": {
        "value": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "pattern": "\\S"
        },
        "label": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "pattern": "\\S"
        }
      }
    },
    "logosSection": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "items"
      ],
      "properties": {
        "type": {
          "const": "logos"
        },
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "heading": {
          "type": "string",
          "maxLength": 160
        },
        "items": {
          "type": "array",
          "maxItems": 12,
          "items": {
            "type": "string",
            "maxLength": 80,
            "minLength": 1,
            "pattern": "\\S"
          }
        }
      }
    },
    "quoteSection": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "quote",
        "author"
      ],
      "properties": {
        "type": {
          "const": "quote"
        },
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "quote": {
          "type": "string",
          "maxLength": 2000,
          "minLength": 1,
          "pattern": "\\S"
        },
        "author": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "pattern": "\\S"
        },
        "role": {
          "type": "string",
          "maxLength": 160
        }
      }
    },
    "pricingSection": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "plans"
      ],
      "properties": {
        "type": {
          "const": "pricing"
        },
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "heading": {
          "type": "string",
          "maxLength": 160
        },
        "plans": {
          "type": "array",
          "maxItems": 4,
          "items": {
            "$ref": "#/$defs/plan"
          }
        }
      }
    },
    "plan": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "price"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "pattern": "\\S"
        },
        "price": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "pattern": "\\S"
        },
        "period": {
          "type": "string",
          "maxLength": 80
        },
        "features": {
          "type": "array",
          "maxItems": 12,
          "items": {
            "type": "string",
            "maxLength": 160,
            "minLength": 1,
            "pattern": "\\S"
          }
        },
        "featured": {
          "type": "boolean"
        },
        "action": {
          "$ref": "#/$defs/link"
        }
      }
    },
    "faqSection": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "items"
      ],
      "properties": {
        "type": {
          "const": "faq"
        },
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "heading": {
          "type": "string",
          "maxLength": 160
        },
        "items": {
          "type": "array",
          "maxItems": 12,
          "items": {
            "$ref": "#/$defs/faqItem"
          }
        }
      }
    },
    "faqItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "question",
        "answer"
      ],
      "properties": {
        "question": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "pattern": "\\S"
        },
        "answer": {
          "type": "string",
          "maxLength": 2000,
          "minLength": 1,
          "pattern": "\\S"
        }
      }
    },
    "ctaSection": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "heading",
        "action"
      ],
      "properties": {
        "type": {
          "const": "cta"
        },
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "heading": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "pattern": "\\S"
        },
        "text": {
          "type": "string",
          "maxLength": 2000
        },
        "action": {
          "$ref": "#/$defs/link"
        }
      }
    },
    "footer": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "text": {
          "type": "string",
          "maxLength": 2000
        },
        "links": {
          "type": "array",
          "maxItems": 6,
          "items": {
            "$ref": "#/$defs/link"
          }
        }
      }
    }
  }
}
