/* Sample data for the horror short — used across all screens. */

const SAMPLE = {
  project: {
    id: "p_horror_001",
    title: "Room 4B",
    concept: "A night-shift nurse keeps hearing a child humming inside a locked hospital room that was demolished years ago.",
    format: "short_cinematic_episode",
    runtime_target: 180,
    runtime_estimate: 174,
    genre: "horror.v1",
    subgenre: "supernatural",
    canon_version: "1.3.0",
    created: "2026-04-22",
  },

  brief: {
    logline: "A night-shift nurse becomes haunted by a child's humming behind a locked door that, according to records, hasn't existed for nine years.",
    fear_engine: "A place that should not be there, listening back.",
    threat_type: "spirit",
    threat_visibility: "unseen",
    dread_style: "slow_burn",
    violence_level: "implied",
    gore_level: "none",
    ending_type: "unresolved",
    avoid: ["jump scare clichés", "explicit gore", "child harm onscreen"],
  },

  characters: [
    {
      id: "char_mara",
      name: "Mara Voss",
      role: "Protagonist",
      archetype: "reluctant_witness",
      age: 32,
      pronouns: "she/her",
      summary: "Night-shift nurse, six months sober, working a ward she requested to be reassigned to.",

      motivation: "To stay useful. To not hear the name she walked away from spoken back to her.",
      flaw: "Mistakes attentiveness for control. Won't ask for help.",
      backstory: "Worked pediatrics at a different hospital until an event she's stopped describing in her own words. Took the night ward at St. Albans because no one is awake to ask her about it.",
      arc: "From a person managing absence to a person being addressed by it.",
      vulnerability: "Sobriety is six months in. Sound carries her back to a hallway she still hears in dreams.",

      voice: "Quiet, observant, dry. Won't ask twice.",
      dialect: "American English, faint Midwestern flatness in vowels.",
      speech_pace: "Measured. Long pauses between her own sentences.",
      vocabulary: "Clinical when working, plain everywhere else. Avoids the word 'fine'.",
      quirks: ["finishes other people's lists silently", "writes left-handed but charts right-handed"],
      catchphrases: ["'I heard you.'", "'Mark it.'"],

      appearance: {
        height: "5'7\"",
        build: "lean, square shoulders",
        hair: "black, cropped to the jaw, parted left",
        eyes: "grey-green",
        skin: "warm-pale, freckles on bridge of nose",
        identifying_marks: "small surgical scar above right eyebrow, 1.5cm",
      },
      costume: {
        primary: "navy scrubs, top tucked into bottoms; lanyard with three keys and a worn ID; white sneakers, scuffed at the toe",
        cold_weather: "rust-colored cardigan over scrubs, sleeves pushed to forearm",
        signature_item: "an analog watch on her right wrist, face on the inside",
      },

      props: [
        "patient ledger (paper, blue cover, dog-eared at Room 4B)",
        "penlight clipped to lanyard",
        "thermos of black coffee, never finished",
      ],
      signature_moves: [
        "checks her watch by turning her wrist toward herself, never her face",
        "presses her thumb against the corner of a doorframe before entering",
        "exhales once, audibly, before speaking",
      ],

      relationships: [
        { with: "char_orderly", role: "uneasy ally", note: "trusts him professionally; suspects he's lying about the east wing" },
      ],

      voice_asset_id: "voice_mara_v3",
      voice_provider: "partner_audio_default",
      voice_reference: "low-mid alto, dry-room recording, 24kHz, 6 reference takes",
      lip_sync_target: "neutral_close",

      reference_image_id: "ref_mara_001",
      continuity_notes: [
        "watch always on right wrist with face inside",
        "left hand always free when crossing thresholds",
        "scrub top stays tucked through scenes 1–4; untucked in final scene",
      ],
      forbidden_changes: [
        "no real-person likeness",
        "do not change hair length between shots",
        "no makeup beyond on-shift baseline",
      ],
      negative_prompt: "no nurse-uniform stereotypes, no white scrubs, no stethoscope, no badge clearly readable",

      tags: ["protagonist", "skeptic", "addressed-by-name"],
    },
    {
      id: "char_orderly",
      name: "Hess",
      role: "Supporting",
      archetype: "knowing_warden",
      age: 58,
      pronouns: "he/him",
      summary: "Janitor on the same shift for 22 years. Knows the building. Won't go near the east wing.",

      motivation: "To make sure no one else has to know what he knows.",
      flaw: "Misreads avoidance as kindness.",
      backstory: "Started the year of the renovation. Was the one who found the original Room 4B sealed before plans were redrawn.",
      arc: "From evasion to a single, exact warning.",
      vulnerability: "Believes the building is owed a particular silence; breaks his rule once to help Mara, then regrets it.",

      voice: "Folksy, evasive. Speaks around the thing.",
      dialect: "American English, lower register, soft consonants.",
      speech_pace: "Slow. Lots of soft 'mm-hm' affirmations.",
      vocabulary: "Avoids proper nouns when describing the east wing. Calls it 'over there.'",
      quirks: ["never says the word 'door'", "writes with a green pen"],
      catchphrases: ["'You don't mark what isn't.'"],

      appearance: {
        height: "5'10\"",
        build: "stooped, broad",
        hair: "iron-grey, thinning at the crown, kept short",
        eyes: "brown",
        skin: "weathered, sun-damaged at the temples",
        identifying_marks: "missing tip of left index finger",
      },
      costume: {
        primary: "grey work pants, navy zip-up jacket with name patch sun-faded to 'HE-S', steel-toe boots",
        signature_item: "ring of 18 keys clipped at the right hip, one always missing",
      },

      props: [
        "mop and bucket cart, wheels squeak in pattern",
        "ledger (separate from Mara's, leather, no markings)",
      ],
      signature_moves: [
        "wipes the same spot on his jacket sleeve when uncomfortable",
        "won't make eye contact when lying; makes prolonged eye contact when being honest",
      ],

      relationships: [
        { with: "char_mara", role: "reluctant guide", note: "respects her work; guards her from his knowledge" },
      ],

      voice_asset_id: "voice_hess_v2",
      voice_provider: "partner_audio_default",
      voice_reference: "weathered baritone, breath-forward",
      lip_sync_target: "wide_medium",

      reference_image_id: "ref_hess_001",
      continuity_notes: [
        "name patch always sun-faded to 'HE-S'",
        "key ring always on right hip",
        "left index finger always shown short — keep hand below frame if reference image lost",
      ],
      forbidden_changes: [
        "no name patch correction in any shot",
        "no replacement of green pen",
      ],
      negative_prompt: "no janitor-uniform stereotypes, no overalls, no mop on shoulder",

      tags: ["supporting", "knower", "rule-keeper"],
    },
  ],
  threat: {
    id: "threat_humming_child",
    name: "The Humming",
    type: "spirit",
    motivation: "Re-occupies the volume of a room that has been erased.",
    visibility_strategy: "Heard, never seen. Implied via shadow under door, breath on glass, and a single reflection in a polished floor.",
    escalation: "Volume → proximity → addressing Mara by a name she hasn't used in years.",
    rule: "It only sings when the floor is empty.",
  },
  location: {
    id: "loc_eastwing",
    name: "St. Albans Memorial — East Wing, Floor 4",
    summary: "Decommissioned ward. Renovated 2017. Architectural plans show no Room 4B; doorway exists.",
    motifs: ["fluorescent flicker", "wax-yellow exit signs", "tile seams that don't align"],
  },

  outline: [
    { id: "sc_01", n: 1, title: "COLD OPEN — Hallway, 02:14", in: 0, dur: 22, function: "Hook", curve: [1,2,2,3,5,4,3], beat: "Mara rounds the corridor. Distant humming stops the moment she stops.", finalframe: "Her shadow on the wall stays still after she walks past." },
    { id: "sc_02", n: 2, title: "STATION — 03:01", in: 22, dur: 36, function: "Unease", curve: [2,2,3,3,2,3,4], beat: "Hess warns her not to mark Room 4B in the ledger. Says the room was taken out years ago.", finalframe: "Hess's coffee cup vibrates without anyone touching it." },
    { id: "sc_03", n: 3, title: "DOOR — 03:42", in: 58, dur: 42, function: "Rule violation", curve: [3,4,5,5,6,6,7], beat: "Mara checks the door. Number plate gone. She hears humming. Listens. Knocks.", finalframe: "Shadow stops directly beneath the door." },
    { id: "sc_04", n: 4, title: "ECHO — 04:24", in: 100, dur: 40, function: "Escalation", curve: [4,5,5,6,7,6,8], beat: "She walks the floor. Every monitor pings, then silences in sequence — toward Room 4B.", finalframe: "A child's name written on a fogged window. Her own." },
    { id: "sc_05", n: 5, title: "FINAL IMAGE — 05:04", in: 140, dur: 34, function: "Final sting", curve: [5,6,7,8,7,6,9], beat: "She presses an ear to the door. The humming stops. From inside, very softly, her name — in her own voice.", finalframe: "Door knob turns once, on its own, then stops." },
  ],

  shots: [
    { id: "sh_001", scene: "sc_01", n: 1, dur: 4, type: "static_wide", desc: "Empty corridor at night, fluorescent flicker, single exit sign", camera: "locked-off", visibility: "unseen" },
    { id: "sh_002", scene: "sc_01", n: 2, dur: 5, type: "tracking_back", desc: "Mara walking toward camera, shoes on tile", camera: "dolly back, slow", visibility: "unseen" },
    { id: "sh_003", scene: "sc_01", n: 3, dur: 4, type: "static_medium", desc: "Mara stops, listens; her shadow is half a beat behind", camera: "locked-off, side angle", visibility: "unseen" },
    { id: "sh_004", scene: "sc_01", n: 4, dur: 6, type: "static_wide", desc: "Wide of empty corridor; Mara exits frame; her shadow remains", camera: "locked-off", visibility: "unseen" },
    { id: "sh_005", scene: "sc_02", n: 5, dur: 5, type: "static_medium", desc: "Hess at the nurse's station, writing in paper ledger", camera: "low angle", visibility: "unseen" },
    { id: "sh_006", scene: "sc_02", n: 6, dur: 6, type: "static_close", desc: "CU: Hess's hand draws a line through 'Room 4B'", camera: "macro insert", visibility: "unseen" },
    { id: "sh_007", scene: "sc_02", n: 7, dur: 7, type: "two_shot", desc: "Mara questions Hess; he won't meet her eyes", camera: "static, eye-level", visibility: "unseen" },
    { id: "sh_008", scene: "sc_02", n: 8, dur: 6, type: "insert", desc: "Coffee cup at edge of desk, surface vibrating", camera: "tabletop macro", visibility: "unseen" },
    { id: "sh_009", scene: "sc_03", n: 9, dur: 7, type: "static_wide", desc: "Long hallway, locked door at far end, no number plate", camera: "locked-off", visibility: "unseen" },
    { id: "sh_010", scene: "sc_03", n: 10, dur: 5, type: "tracking_in", desc: "Slow push toward the door", camera: "dolly in, glacial", visibility: "unseen" },
    { id: "sh_011", scene: "sc_03", n: 11, dur: 6, type: "static_close", desc: "Mara's ear at the door, eyes shifting", camera: "tight CU", visibility: "heard" },
    { id: "sh_012", scene: "sc_03", n: 12, dur: 8, type: "static_wide", desc: "Knock. Pause. Shadow appears beneath door.", camera: "locked-off, low", visibility: "shadow" },
    { id: "sh_013", scene: "sc_04", n: 13, dur: 5, type: "static_medium", desc: "Mara at station; first monitor pings", camera: "static", visibility: "heard" },
    { id: "sh_014", scene: "sc_04", n: 14, dur: 6, type: "tracking_lat", desc: "Lateral track past four monitors as they ping in sequence", camera: "side dolly, steady", visibility: "heard" },
    { id: "sh_015", scene: "sc_04", n: 15, dur: 7, type: "static_wide", desc: "End of corridor — pings stop at Room 4B", camera: "locked-off", visibility: "heard" },
    { id: "sh_016", scene: "sc_04", n: 16, dur: 6, type: "static_close", desc: "Fogged window — child's handwriting forms 'MARA'", camera: "tight CU on glass", visibility: "partial" },
    { id: "sh_017", scene: "sc_05", n: 17, dur: 6, type: "static_close", desc: "Mara presses ear to the door, breath shallow", camera: "tight CU", visibility: "heard" },
    { id: "sh_018", scene: "sc_05", n: 18, dur: 8, type: "static_close", desc: "Long held silence. From inside: her own voice, whispering her name.", camera: "tight CU, no movement", visibility: "heard" },
    { id: "sh_019", scene: "sc_05", n: 19, dur: 6, type: "static_close", desc: "Door knob turns once, ¼ rotation, stops.", camera: "macro on knob", visibility: "partial" },
    { id: "sh_020", scene: "sc_05", n: 20, dur: 8, type: "static_wide", desc: "Wide of corridor, single light dies above Mara, hold for black.", camera: "locked-off", visibility: "unseen" },
  ],

  // The currently selected shot's full prompt packet (sh_012)
  packet: {
    shot_id: "horror_s003_sh012",
    scene_id: "horror_s003",
    duration_seconds: 8,
    aspect_ratio: "2.39:1",
    visual_style: "slow-cinema horror; long lens compression, deep negative space, motivated practicals only",
    subject: "A young woman standing at the end of a dark hospital corridor, facing a closed door with no number plate.",
    setting: "St. Albans Memorial East Wing, Floor 4. Decommissioned but power is on. 02:47 AM.",
    action: "She knocks once on the door. A pause of three seconds. A shadow moves into place underneath the door and stops directly beneath her hand.",
    camera: "locked-off frame, low angle, hallway perspective, no camera movement",
    lens: "85mm equivalent",
    composition: "subject small in frame; heavy negative space; door perfectly centered; floor reflects the exit sign",
    lighting: "single flickering ceiling fluorescent four meters out; bathroom light leaking under the door (warm); dim green glow from far exit sign",
    color_palette: "desaturated cyans and bone-yellow exit-sign green; warm spill under door is the only saturated note",
    motion: "barely perceptible shadow moves into place beneath the door at 0:06; holds at 0:07; brief flicker of overhead light at 0:07.5",
    continuity_refs: ["loc_eastwing#corridor_4_east", "char_mara#scrubs_pale_blue", "threat_humming_child#shadow_under_door"],
    negative_constraints: ["no gore", "no extra characters", "no text overlays", "no brand logos", "no on-screen face of the threat", "no music, only diegetic"],
    dialogue_line_ids: [],
    sound_cue_ids: ["sfx_knock_03", "amb_corridor_room_tone", "sfx_pipe_knock_distant"],
    genre_modifiers: {
      threat_visibility: "shadow",
      scare_type: "dread",
      tension_peak: 7,
      final_frame: "shadow stops directly beneath the door",
    },
    provider_params: {
      provider: "seedance_2_0",
      route: "byteplus_modelark",
      model: "dreamina-seedance-2.0",
      mode: "text_to_video",
      resolution: "1080p",
      seconds: 8,
    },
  },

  // Cost
  cost: {
    estimate_id: "est_2026_04_28_001",
    total_shots: 20,
    total_seconds: 174,
    resolution: "1080p",
    provider: "seedance_2_0",
    route: "byteplus_modelark",
    input_mix: { text_only_shots: 16, image_reference_shots: 4, video_reference_shots: 0 },
    estimated_provider_cost_usd: 41.85,
    estimated_partner_audio_cost_usd: 12.40,
    estimated_total_cost_usd: 54.25,
    pricing_basis: "byteplus_modelark_price_table",
    valid_until: "2026-04-28T23:59Z",
  },

  // Render jobs
  jobs: [
    { id: "sh_001", status: "complete", progress: 100, eta: "—", cost: 1.85, asset: "asset_v_001.mp4" },
    { id: "sh_002", status: "complete", progress: 100, eta: "—", cost: 2.10, asset: "asset_v_002.mp4" },
    { id: "sh_003", status: "complete", progress: 100, eta: "—", cost: 1.85, asset: "asset_v_003.mp4" },
    { id: "sh_004", status: "rendering", progress: 67, eta: "00:42", cost: 2.40 },
    { id: "sh_005", status: "rendering", progress: 24, eta: "01:15", cost: 2.10 },
    { id: "sh_006", status: "queued", progress: 0, eta: "—", cost: 2.40 },
    { id: "sh_007", status: "queued", progress: 0, eta: "—", cost: 2.65 },
    { id: "sh_008", status: "queued", progress: 0, eta: "—", cost: 2.40 },
    { id: "sh_009", status: "queued", progress: 0, eta: "—", cost: 2.65 },
    { id: "sh_010", status: "queued", progress: 0, eta: "—", cost: 2.10 },
    { id: "sh_011", status: "queued", progress: 0, eta: "—", cost: 2.40 },
    { id: "sh_012", status: "queued", progress: 0, eta: "—", cost: 2.95 },
    { id: "sh_013", status: "queued", progress: 0, eta: "—", cost: 2.10 },
    { id: "sh_014", status: "queued", progress: 0, eta: "—", cost: 2.40 },
    { id: "sh_015", status: "failed",  progress: 0, eta: "—", cost: 2.65, error: "prompt_validation: lighting field below 8 chars" },
    { id: "sh_016", status: "queued", progress: 0, eta: "—", cost: 2.40 },
    { id: "sh_017", status: "queued", progress: 0, eta: "—", cost: 2.40 },
    { id: "sh_018", status: "queued", progress: 0, eta: "—", cost: 2.95 },
    { id: "sh_019", status: "queued", progress: 0, eta: "—", cost: 2.40 },
    { id: "sh_020", status: "queued", progress: 0, eta: "—", cost: 2.95 },
  ],

  validation: [
    { kind: "ok",   label: "Schema valid", detail: "All required fields present." },
    { kind: "ok",   label: "Continuity refs resolve", detail: "3/3 references resolve to canon v1.3.0." },
    { kind: "ok",   label: "Horror QA — Dread", detail: "Threat distance + visibility consistent with scene function." },
    { kind: "ok",   label: "Horror QA — Restraint", detail: "Threat remains unseen; final frame is implication." },
    { kind: "warn", label: "Renderability — long held shadow", detail: "Seedance 2.0 may stochastically animate shadow before second 6. Recommend reference image." },
    { kind: "ok",   label: "Provider constraint check", detail: "Within Seedance 2.0 max duration (10s) and resolution support." },
    { kind: "warn", label: "Cost variance", detail: "Estimate may shift ±8% after route refresh (last refresh 32 min ago)." },
    { kind: "muted", label: "Rights / likeness", detail: "No real-person likeness detected. No copyrighted lyrics in dialogue." },
  ],

  // Render history for the selected shot
  history: [
    { v: 3, ts: "2026-04-28 11:42", outcome: "current", note: "Added shadow-stop continuity ref; tightened lighting." },
    { v: 2, ts: "2026-04-28 09:18", outcome: "superseded", note: "Removed ambient music cue (genre QA: restraint)." },
    { v: 1, ts: "2026-04-27 22:04", outcome: "superseded", note: "Initial generation from scene card." },
  ],

  stages: [
    { key: "projects", num: "00", label: "Projects",  stat: "library" },
    { key: "concept",  num: "01", label: "Concept",   stat: "Approved" },
    { key: "bible",    num: "02", label: "Bible",     stat: "v1.3.0" },
    { key: "outline",  num: "03", label: "Outline",   stat: "5 scenes" },
    { key: "script",   num: "04", label: "Script",    stat: "00:02:54" },
    { key: "shots",    num: "05", label: "Shots",     stat: "20 / 20" },
    { key: "prompts",  num: "06", label: "Prompts",   stat: "19 ✓ · 1 ⚠" },
    { key: "render",   status: "warn", num: "07", label: "Render",    stat: "Cost approval" },
    { key: "review",   num: "08", label: "Review",    stat: "—" },
    { key: "export",   num: "09", label: "Export",    stat: "—" },
  ],
};

window.SAMPLE = SAMPLE;
