// engine.jsx — stub for window.JungleNatal.compute
// Article VIII note: in production, astronomy-engine runs locally.
// This stub matches the engine's return shape so UI wires up cleanly.

const PERSONAS = {
  DJ: {
    label: "DJ BROMFIELD",
    meta: "Toronto · 1994-12-28 · 15:30 EST",
    birthIso: "1994-12-28",
    birthTime: "15:30",
    tz: "America/Toronto",
    place: "Toronto, ON",
    lat: 43.7615, lon: -79.4111,
    weekday: "Wednesday",
    absolute_longitudes: {
      sun: 276.8824, moon: 226.9643, asc: 80.1079,
      mercury: 294.15, venus: 305.42, mars: 218.71,
      jupiter: 233.06, saturn: 343.88
    },
    decan: {
      sun:     { name: "KHENMU",  hi: "𓆓𓈖𓅓𓅱", index: 28, range: [270, 280], gloss: "the one who rises · threshold of the reborn sun" },
      moon:    { name: "SARIT",   hi: "𓊃𓂋𓇋𓏏", index: 22, range: [220, 230], gloss: "watcher of the southern gate" },
      asc:     { name: "KENMUT",  hi: "𓎡𓈖𓅓𓏏", index: 8,  range: [80, 90],   gloss: "the twin, the returning breath" },
      mercury: { name: "TEPY-A",  hi: "𓏏𓊪𓇋𓄿", index: 29, range: [290, 300], gloss: "first of the ancestors, the speaker" },
      venus:   { name: "WENET",   hi: "𓃹𓈖𓏏",   index: 30, range: [300, 310], gloss: "the hare · quickness of the heart" },
      mars:    { name: "SESHMU",  hi: "𓊃𓈙𓐝𓏌", index: 21, range: [210, 220], gloss: "the press · oil of becoming" },
      jupiter: { name: "SHERAT",  hi: "𓈙𓂋𓇋𓏏", index: 23, range: [230, 240], gloss: "small one rising · the student" },
      saturn:  { name: "HERU-KA", hi: "𓉔𓂋𓎡𓄿", index: 34, range: [340, 350], gloss: "the double-soul of the elder" }
    },
    odu: {
      ifa_cast: "OGBE-IROSUN",
      binary: [1,1,0,1,1,0,0,1],
      variants: { fon: "Gbe-Losu", ewe: "Gbe-Lòsu", lucumi: "Ogbe-Iroso" },
      canon: "Where the path of light meets the knee of the earth — the wanderer learns to kneel before rising again."
    },
    bahere: {
      liturgical_year: 7487,
      era: "Amätä Alam (E.A.A.)",
      tabot: "Qiddus Gabriel",
      tabot_ge: "ቅዱስ ገብርኤል",
      season: "Tsome Gənā (ጾመ ገና · the Fast of the Nativity)",
      day_ge: "ረቡዕ",
      day_en: "Wednesday",
      month_ge: "ታኅሣሥ",
      month_en: "Tahsas",
      date_ge: "፲፱",
      date_ar: "19"
    },
    manzil: {
      mansion: "Dhanab al-Asad",
      arabic: "ذنب الأسد",
      swahili: "Manzili Dhanabu",
      english: "Tail of the Lion",
      index: 10,
      asterism: "β Leonis · Denebola",
      range: [168.57, 181.43]
    },
    orisha: {
      guardian: "Ọbàtálá",
      yoruba: "Ọbàtálá",
      lucumi: "Obatalá",
      vodou: "Damballa (parallel · serpent of the pale)",
      palo: "Tiembla-Tierra",
      day_of_week: "Wednesday",
      element: "white cloth · chalk · the clear mind",
      temperament: "cool · deliberative · the sculptor of heads"
    },
    synthesis: "You arrive on the threshold decan — KHENMU, where the sun is reborn from the stone gate. Ifá reads your path as OGBE-IROSUN, the wanderer who must learn to kneel. The Baḥrä Ḥasab names your day under Qiddus Gabriel in Tahsas, the fast before the nativity. Your Moon slept at Dhanab al-Asad, the lion's tail — a navigator's star. And Ọbàtálá, the cool head, the sculptor of foreheads, claims the Wednesday of your birth. Five tongues, one ledger: the wanderer who returns. Kneel, then rise. Speak only what the chalk has set.",
    meta: { engine: "astronomy-engine", version: "2.x-stub", article_viii: true }
  },

  MARLEY: {
    label: "BOB MARLEY",
    meta: "Nine Mile · 1945-02-06 · 14:30 EST",
    birthIso: "1945-02-06",
    birthTime: "14:30",
    tz: "America/Jamaica",
    place: "Nine Mile, JM",
    lat: 18.3333, lon: -77.0833,
    weekday: "Tuesday",
    absolute_longitudes: {
      sun: 317.42, moon: 232.11, asc: 145.66,
      mercury: 306.18, venus: 292.44, mars: 195.82,
      jupiter: 190.22, saturn: 122.77
    },
    decan: {
      sun:     { name: "BAIU",    hi: "𓃀𓄿𓇋𓅱", index: 32, range: [310, 320], gloss: "the ram · ancestral horn of return" },
      moon:    { name: "SESHMU",  hi: "𓊃𓈙𓐝𓏌", index: 24, range: [230, 240], gloss: "the press · oil of becoming" },
      asc:     { name: "APET",    hi: "𓊪𓏏𓆇",    index: 15, range: [140, 150], gloss: "the hippo-mother · guardian of the inner room" },
      mercury: { name: "WENET",   hi: "𓃹𓈖𓏏",    index: 31, range: [300, 310], gloss: "the hare · quickness of the heart" },
      venus:   { name: "TEPY-A",  hi: "𓏏𓊪𓇋𓄿", index: 30, range: [290, 300], gloss: "first of the ancestors, the speaker" },
      mars:    { name: "SEBCHU",  hi: "𓊃𓃀𓄡",    index: 20, range: [190, 200], gloss: "the jackal · walker of the in-between" },
      jupiter: { name: "BERET",   hi: "𓃀𓂋𓏏",    index: 20, range: [190, 200], gloss: "the seed · carrier of the field" },
      saturn:  { name: "QAD",     hi: "𓈎𓂧",       index: 13, range: [120, 130], gloss: "the measuring rod · order of the rows" }
    },
    odu: {
      ifa_cast: "OSA-OGUNDA",
      binary: [0,1,1,0,1,1,1,1],
      variants: { fon: "Sa-Guda", ewe: "Sa-Gùdà", lucumi: "Osa-Ogundá" },
      canon: "Where iron meets the wind — the word that cuts also clears the path."
    },
    bahere: {
      liturgical_year: 7437,
      era: "Amätä Alam (E.A.A.)",
      tabot: "Qiddus Giyorgis",
      tabot_ge: "ቅዱስ ጊዮርጊስ",
      season: "Tərr (ጥር · the month of waters)",
      day_ge: "ማክሰኞ",
      day_en: "Tuesday",
      month_ge: "ጥር",
      month_en: "Ṭərr",
      date_ge: "፳፱",
      date_ar: "29"
    },
    manzil: {
      mansion: "Al-Zubana",
      arabic: "الزبانى",
      swahili: "Manzili Zubana",
      english: "The Claws (of the Scorpion)",
      index: 15,
      asterism: "α & β Librae",
      range: [192.85, 205.71]
    },
    orisha: {
      guardian: "Ògún",
      yoruba: "Ògún",
      lucumi: "Ogún",
      vodou: "Ogou (parallel · iron & fire)",
      palo: "Sarabanda",
      day_of_week: "Tuesday",
      element: "iron · machete · the cleared path",
      temperament: "forger · opener of roads · the working hand"
    },
    synthesis: "Your Sun rose in BAIU, the ram — the ancestral horn of return. Ifá names you OSA-OGUNDA: where iron meets the wind, the word that cuts also clears the path. The Ethiopian sky knew your day as Qiddus Giyorgis — the dragon-slayer in the month of waters. The lunar mansion was Al-Zubana, the scorpion's claws — justice of the scale. And Ògún, the forger, the opener of roads, holds your Tuesday. The word is iron. The song clears the road. Walk.",
    meta: { engine: "astronomy-engine", version: "2.x-stub", article_viii: true }
  },

  BALDWIN: {
    label: "JAMES BALDWIN",
    meta: "Harlem · 1924-08-02 · 00:10 EST",
    birthIso: "1924-08-02",
    birthTime: "00:10",
    tz: "America/New_York",
    place: "Harlem, NY",
    lat: 40.8116, lon: -73.9465,
    weekday: "Saturday",
    absolute_longitudes: {
      sun: 129.44, moon: 338.12, asc: 68.21,
      mercury: 118.56, venus: 164.22, mars: 214.07,
      jupiter: 263.11, saturn: 203.44
    },
    decan: {
      sun:     { name: "SEBSHSEN",hi: "𓊃𓃀𓈙𓈖", index: 14, range: [120, 130], gloss: "the witness · watcher at the gate of Leo" },
      moon:    { name: "KHERU",   hi: "𓊵𓂋𓅱",   index: 34, range: [330, 340], gloss: "the voice · speech of the deep water" },
      asc:     { name: "SAH",     hi: "𓋴𓄿𓉔",   index: 7,  range: [60, 70],   gloss: "Orion · the striding one" },
      mercury: { name: "KHEMET",  hi: "𓆎𓏏𓊖",    index: 12, range: [110, 120], gloss: "black-land · the keeper of ledgers" },
      venus:   { name: "APET",    hi: "𓊪𓏏𓆇",    index: 17, range: [160, 170], gloss: "the hippo-mother · guardian of the inner room" },
      mars:    { name: "SESHMU",  hi: "𓊃𓈙𓐝𓏌", index: 22, range: [210, 220], gloss: "the press · oil of becoming" },
      jupiter: { name: "KHENTI",  hi: "𓍘𓈖𓏏𓇋", index: 27, range: [260, 270], gloss: "the foremost · keeper of the prow" },
      saturn:  { name: "ANI",     hi: "𓂝𓈖𓇋",    index: 21, range: [200, 210], gloss: "the scribe · reader of the rope" }
    },
    odu: {
      ifa_cast: "IWORI-OTURA",
      binary: [0,1,0,1,1,0,1,0],
      variants: { fon: "Wori-Tula", ewe: "Wòli-Túlà", lucumi: "Iwori-Otura" },
      canon: "The witness who writes the witness — where sight becomes the page, and the page becomes the door."
    },
    bahere: {
      liturgical_year: 7416,
      era: "Amätä Alam (E.A.A.)",
      tabot: "Qiddus Abba Gärima",
      tabot_ge: "ቅዱስ አባ ገሪማ",
      season: "Nähase (ነሐሴ · the month of light)",
      day_ge: "ቅዳሜ",
      day_en: "Saturday",
      month_ge: "ሐምሌ",
      month_en: "Ḥamlē",
      date_ge: "፳፮",
      date_ar: "26"
    },
    manzil: {
      mansion: "Al-Sarfa",
      arabic: "الصرفة",
      swahili: "Manzili Sarifa",
      english: "The Changer (of Weather)",
      index: 11,
      asterism: "β Leonis region",
      range: [180.00, 192.85]
    },
    orisha: {
      guardian: "Babalú Ayé",
      yoruba: "Babalú Ayé · Ṣọ̀pọ̀nọ̀nà",
      lucumi: "Babalú Ayé · San Lázaro parallel",
      vodou: "Sobo / Azaka (parallel · earth & suffering)",
      palo: "Pata en Llaga",
      day_of_week: "Saturday",
      element: "straw · palm wine · the healed wound",
      temperament: "the wounded healer · patron of those who have been pushed outside the gate"
    },
    synthesis: "Your Sun stood in SEBSHSEN, the witness at the gate of Leo. Ifá names you IWORI-OTURA: the witness who writes the witness, where sight becomes the page and the page becomes the door. The Ge'ez sky names Qiddus Abba Gärima in the month of light — he who stopped the sun to finish his gospel. Your Moon rested at Al-Sarfa, the changer of weather. And Babalú Ayé, the wounded healer, the patron of those pushed outside the gate, keeps your Saturday. Write because you were the one pushed outside. Write so the gate cannot close.",
    meta: { engine: "astronomy-engine", version: "2.x-stub", article_viii: true }
  }
};

window.JungleNatal = {
  compute: (input) => {
    // Stub: ignore input and return by key (or DJ default)
    return PERSONAS[input?.persona || "DJ"];
  },
  personas: PERSONAS
};
