// chapters-meta.jsx — Ashfall — Chapter 1 only
// Sélène Moreau · Eden Veyr · 22 chapters

const BOOK = {
  title: "Ashfall",
  author: "V. Drancourt",
  publisher: "Éditions de la Marge Noire",
  warning: "Dark psychological romance — not recommended for sensitive readers.",
};

const CONTENT_WARNINGS = [
  "Parental death (car accident)",
  "Arson, death of a loved one",
  "Mafia violence, firearms, psychological torture",
  "Stalking, surveillance, home invasion",
  "Explicit erotic scenes with consensual breathplay and knifeplay",
  "Toxic power dynamics, obsessive relationships",
  "Police, medical and political corruption",
  "Kidnapping, blackmail, threats",
  "Violent interrogation scenes",
  "Anxiety attacks, nightmares, self-destructive behavior",
];

const SCENTS = [
  { id: "baies", name: "Berries", range: [1, 2], notes: "Crushed red fruits · dark wood · cold metal · immediate danger", wax: "#1a0508", glow: "#c41e3a", moment: "Provocation, menace, psychological bite, rising tension." },
  { id: "roses", name: "Roses", range: [3, 4], notes: "Dark red · pepper · oud · vetiver · obsession", wax: "#1f0a12", glow: "#c91e4a", moment: "Romantic obsession, jealousy, toxic seduction." },
  { id: "figuier", name: "Fig Tree", range: [5, 7], notes: "Fig milk · white wood · warm skin · sweet lies", wax: "#1a1410", glow: "#8a7a5a", moment: "False refuge, deceptive intimacy, calm before violence." },
  { id: "tubereuse", name: "Tuberose", range: [8, 9], notes: "Flesh white · amber · musk · closed heat", wax: "#1a0a0f", glow: "#c96a7a", moment: "Desire, closed room, consensual loss of control." },
  { id: "lys", name: "Lily", range: [10, 11], notes: "White petal · wax · incense · wet earth", wax: "#0e0a12", glow: "#a0a0b8", moment: "Death, grief, revelation, cold truth." },
];

function scentForChapter(n) {
  return SCENTS.find(s => n >= s.range[0] && n <= s.range[1]) || SCENTS[0];
}

const ACTS = [
  { id: 1, name: "Entry into the Cage", range: [1, 7] },
  { id: 2, name: "The Scent of Traitors", range: [8, 14] },
  { id: 3, name: "The Consumption of Chaos", range: [15, 22] },
];

const AUDIO = {
  1: "Concrete Silence.mp3",
};

const audioSrc = (n) => `uploads/${encodeURIComponent(AUDIO[n])}`;

const ROMAN = ["", "I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX","XXI","XXII"];

const actOf = (n) => n <= 7 ? 1 : n <= 14 ? 2 : 3;
const actLabel = (n) => `Act ${["I","II","III"][actOf(n)-1]} · ${ACTS[actOf(n)-1].name}`;

const CHAPTERS = [
  {
    n: 1,
    name: "The House Beneath the Rain",
    epigraph: "The first thing she saw of Ashfall was the light.",
    audioTitle: "Concrete Silence",
    soundDesign: "Night rain, engine slowing down, tires on gravel, massive door, silence too rich.",
    spice: "Deep visceral. Knot in the throat. Tachycardia of anticipation.",
    synopsis: [
      "Selene arrives at Ashfall, Eden Veyr's private club, for a launch contract. The house is magnificent, unsettling, and seems to have been waiting for her before it even knew her name.",
      "Eden Veyr descends the staircase without hurrying. He is calm, elegant, cold. Their first conversation is a negotiation disguised as a welcome.",
    ],
    written: true,
  },
];

window.BOOK = BOOK;
window.CONTENT_WARNINGS = CONTENT_WARNINGS;
window.SCENTS = SCENTS;
window.scentForChapter = scentForChapter;
window.ACTS = ACTS;
window.CHAPTERS = CHAPTERS;
window.AUDIO = AUDIO;
window.audioSrc = audioSrc;
window.ROMAN = ROMAN;
window.actOf = actOf;
window.actLabel = actLabel;
