/* ============================================================
   QUIZ DATA - single source of truth for the 12-question
   instrument and the 5 result narratives. Loaded by BOTH the
   desktop shell (index.html) and the mobile shell
   (m.endthepattern.com.html) so the two builds can never
   diagnose the same person differently.
   Scoring: each answer adds one point to one of 5 patterns
   (P/Pf/V/F/D = Peacekeeper, Performer, Vault, Forecaster,
   Disappearer).
   ============================================================ */

const QUIZ = [
  {
    q: 'When someone in your family was upset growing up, your first instinct was…',
    a: [
      { t: 'I felt it before they said anything.', p: 'P' },
      { t: 'I tried to fix it or distract them.', p: 'Pf' },
      { t: 'I went somewhere else inside my head.', p: 'V' },
      { t: 'I planned for what was coming next.', p: 'F' },
      { t: 'I quietly left the room.', p: 'D' },
    ],
  },
  {
    q: 'In your house, feelings were…',
    a: [
      { t: 'My job to manage.', p: 'P' },
      { t: 'A reason to perform - to earn relief.', p: 'Pf' },
      { t: 'Buried. Never opened.', p: 'V' },
      { t: 'A weather report. Always reading the room.', p: 'F' },
      { t: 'Dangerous. Best avoided entirely.', p: 'D' },
    ],
  },
  {
    q: 'When something is wrong now, your default move is…',
    a: [
      { t: 'Manage who needs what before I check in with myself.', p: 'P' },
      { t: 'Get back to producing - work fixes things.', p: 'Pf' },
      { t: 'Wait it out alone. Don\'t name it.', p: 'V' },
      { t: 'Plan for everything else that could go wrong.', p: 'F' },
      { t: 'Withdraw. Texts unread. Camera off.', p: 'D' },
    ],
  },
  {
    q: 'When you rest, you feel…',
    a: [
      { t: 'Anxious about who needs me.', p: 'P' },
      { t: 'Like I\'m falling behind.', p: 'Pf' },
      { t: 'Numb, mostly.', p: 'V' },
      { t: 'Suspicious of the quiet.', p: 'F' },
      { t: 'Fine, until I\'m supposed to come back.', p: 'D' },
    ],
  },
  {
    q: 'Conflict shows up. You…',
    a: [
      { t: 'Apologize first. Even when I\'m right.', p: 'P' },
      { t: 'Out-prepare it. Out-argue it. Out-work it.', p: 'Pf' },
      { t: 'Go quiet. Process it months later.', p: 'V' },
      { t: 'Catastrophize. This is the end of everything.', p: 'F' },
      { t: 'Vanish. Reappear when it\'s blown over.', p: 'D' },
    ],
  },
  {
    q: 'Praise lands as…',
    a: [
      { t: 'Relief - they\'re not upset with me.', p: 'P' },
      { t: 'A new floor. Now I have to maintain it.', p: 'Pf' },
      { t: 'Static. I don\'t really hear it.', p: 'V' },
      { t: 'Suspicion. What\'s the catch.', p: 'F' },
      { t: 'Pressure. Now they expect me to stay.', p: 'D' },
    ],
  },
  {
    q: 'Your most familiar body sensation under stress is…',
    a: [
      { t: 'Tight chest. Reading the room.', p: 'P' },
      { t: 'Locked jaw. Keep going.', p: 'Pf' },
      { t: 'Numbness. Floating.', p: 'V' },
      { t: 'Stomach flipping. Always one step ahead.', p: 'F' },
      { t: 'Heaviness. Want to disappear.', p: 'D' },
    ],
  },
  {
    q: 'A friend asks how you really are. You…',
    a: [
      { t: 'Pivot to them. "How are YOU."', p: 'P' },
      { t: 'List accomplishments. Skip the feelings.', p: 'Pf' },
      { t: 'Say "fine." Mean nothing.', p: 'V' },
      { t: 'Run through the worst-case list out loud.', p: 'F' },
      { t: 'Cancel before we meet.', p: 'D' },
    ],
  },
  {
    q: 'The phrase that most often plays in your head…',
    a: [
      { t: '"Don\'t make this worse."', p: 'P' },
      { t: '"You haven\'t done enough yet."', p: 'Pf' },
      { t: '"Don\'t feel that here."', p: 'V' },
      { t: '"What if it all collapses."', p: 'F' },
      { t: '"They\'d be fine without me."', p: 'D' },
    ],
  },
  {
    q: 'Your relationship to asking for help…',
    a: [
      { t: 'I help others as a way of avoiding it.', p: 'P' },
      { t: 'I\'ll outwork the problem first.', p: 'Pf' },
      { t: 'I don\'t notice I need it until I\'m underwater.', p: 'V' },
      { t: 'I\'ve already imagined every way they\'ll say no.', p: 'F' },
      { t: 'I disappear before they can.', p: 'D' },
    ],
  },
  {
    q: 'When a relationship gets close, you…',
    a: [
      { t: 'Become indispensable.', p: 'P' },
      { t: 'Become impressive.', p: 'Pf' },
      { t: 'Become unreadable.', p: 'V' },
      { t: 'Become vigilant.', p: 'F' },
      { t: 'Become unreachable.', p: 'D' },
    ],
  },
  {
    q: 'The pattern you\'d most like to end…',
    a: [
      { t: 'Reading rooms instead of reading myself.', p: 'P' },
      { t: 'Earning safety with output.', p: 'Pf' },
      { t: 'Knowing what I feel six months too late.', p: 'V' },
      { t: 'Living one disaster ahead of the present.', p: 'F' },
      { t: 'Leaving before I can be left.', p: 'D' },
    ],
  },
];

const PATTERNS = {
  P: {
    name: 'The Peacekeeper',
    short: 'You learned to manage everyone else\'s emotions before you knew you had your own.',
    long: 'You read rooms before you read yourself. Worth = utility. Other people\'s emotions live in your body. Rest feels dangerous because rest means uselessness. The story you carry: "If I stop managing them, something bad happens." It worked once. It\'s costing you now.',
    costs: [
      'You read rooms before you read yourself.',
      'You can\'t tell tired from depleted from done.',
      'Conflict registers as catastrophic before it\'s real.',
      'Your "no" comes out as a longer, softer "yes."',
    ],
    work: 'Six weeks of learning to interrupt the read-room reflex. You\'ll practice the pause before the apology, the small no, and the radical act of letting someone else be uncomfortable.',
  },
  Pf: {
    name: 'The Performer',
    short: 'Achievement as oxygen. Worth must be re-earned daily.',
    long: 'You learned that love was conditional and the conditions were performance. You don\'t feel safe - you feel productive. The story you carry: "If I stop, they\'ll see I\'m nothing." Your nervous system runs on output. Stillness reads as threat.',
    costs: [
      'You can\'t enjoy the win because the next thing is already the new floor.',
      'Rest registers as identity collapse, not recovery.',
      'You confuse self-worth with self-output.',
      'You\'re the most accomplished, most exhausted person you know.',
    ],
    work: 'Six weeks of decoupling worth from output. You\'ll practice doing things badly on purpose, receiving without earning, and noticing the body\'s "you haven\'t done enough" alarm without obeying it.',
  },
  V: {
    name: 'The Vault',
    short: 'Feelings filed under "later." Later never comes.',
    long: 'You learned that feelings are dangerous, indulgent, or pointless. So you compressed them. The story you carry: "If I open this, I won\'t be able to close it." You confuse calm with shutdown. Numb with regulated. The vault was a survival tool. Now it\'s a wall.',
    costs: [
      'You know what you felt about something six months later.',
      'Calm and shut-down feel identical from the inside.',
      'Intimacy slides off you. People say you\'re hard to reach.',
      'Your body holds what your mind won\'t.',
    ],
    work: 'Six weeks of inviting feeling back, slowly, with a guide. You\'ll learn the four bodily cues that something has been filed, and practice naming what you notice - out loud, to one person - every day.',
  },
  F: {
    name: 'The Forecaster',
    short: 'Anxiety dressed as preparation. Always one disaster ahead.',
    long: 'You learned that surprise meant pain, so you stopped being surprised. You don\'t live in the present - you live in the rehearsal of what could go wrong. The story you carry: "If I see it coming, it can\'t hurt me." Vigilance kept you safe. Now it\'s the cage.',
    costs: [
      'You\'ve already imagined every way it could go wrong.',
      'Calm registers as the eye of the storm, not the end of it.',
      'You confuse worry with care, planning with love.',
      'Your kid (or partner) reads your nervous system before they read the room.',
    ],
    work: 'Six weeks of learning to land in the present without bracing. You\'ll practice "name three things that are true right now," interrupt the catastrophe-loop mid-thought, and notice the difference between preparing and prosecuting the future.',
  },
  D: {
    name: 'The Disappearer',
    short: 'Conflict ends the relationship. So does almost everything else.',
    long: 'You learned that staying meant being seen meant being hurt. So you left first - physically, emotionally, attentionally. The story you carry: "They\'ll be fine without me. I\'ll be fine without them." It\'s a lie that worked. It\'s costing you the people you actually want.',
    costs: [
      'You vanish under stress and call it self-care.',
      'You leave relationships before you can be left.',
      'You confuse independence with avoidance.',
      'The people who love you describe you as "hard to find."',
    ],
    work: 'Six weeks of learning to stay. You\'ll practice the small return - texting back the same day, sitting through a hard conversation, telling someone you\'re overwhelmed instead of going dark.',
  },
};

window.QUIZ = QUIZ;
window.PATTERNS = PATTERNS;
