jostlebot Claude Opus 4.5 commited on
Commit
4966e71
·
1 Parent(s): 07178c9

Revamp ShadowBox: chatbot → resonant library

Browse files

Complete architectural transformation from conversational AI to
static psychoeducation library for youth navigating SI/HI/self-harm.

Key changes:
- Remove all AI dependencies (OpenAI, Anthropic)
- Implement card-based navigation with 3 pathways
- Add pre-written, clinically-reviewed content throughout
- Include grounding tools, safety planning, crisis resources
- Add private practice space for disclosure rehearsal
- Apply calming visual design (soft colors, generous spacing)

Grounded in: Sarah Peyton's resonance, Tara Brach's radical
acceptance, trauma-informed care, and transparent limitations.

Not a chatbot. A bridge to human care.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Files changed (4) hide show
  1. .env.template +2 -0
  2. README.md +101 -67
  3. app.py +1327 -265
  4. requirements.txt +2 -7
.env.template ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ # ShadowBox Info Hub
2
+ # No API keys required - this is a static library with no AI dependencies
README.md CHANGED
@@ -1,107 +1,141 @@
1
  ---
2
- title: Attachment Style Roleplay Simulator
3
- emoji: 🎭
4
- colorFrom: purple
5
- colorTo: pink
6
  sdk: streamlit
7
- sdk_version: 1.45.0
8
- app_file: src/streamlit_app.py
9
  pinned: false
10
- short_description: "ShadowBox: Calm, anonymous AI companion for youth distress."
 
11
  ---
12
 
13
- # Attachment Style Roleplay Simulator
14
 
15
- A therapeutic roleplay simulator built for practicing emotionally charged conversations, created by Jocelyn Skillman LMHC.
16
 
17
- ## About
 
 
18
 
19
- This tool helps users rehearse boundary-setting and difficult conversations by simulating realistic relational dynamics—tailored to their attachment style. It provides a safe space to practice emotional communication and receive feedback on patterns and progress.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
- ## Features
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
- - Customizable scenarios and conversation goals
24
- - Attachment style-specific responses
25
- - Realistic relational pressure simulation
26
- - Reflection summaries and pattern tracking
27
- - Safe, contained practice environment
28
 
29
- ## Setup
30
 
31
- 1. Clone the repository
32
- 2. Install dependencies: `pip install -r requirements.txt`
33
- 3. Set up environment variables in `.env`:
34
- ```
35
- ANTHROPIC_KEY=your_api_key_here
36
- ```
37
- 4. Run the app: `streamlit run src/app.py`
38
 
39
- ## Learn More
40
 
41
- Visit [jocelynskillman.com](http://www.jocelynskillman.com) or subscribe to updates at [jocelynskillmanlmhc.substack.com](https://jocelynskillmanlmhc.substack.com/)
42
 
43
- # Journal Sidekick
 
 
 
44
 
45
- A trauma-informed, emotionally attuned reflection companion for journaling, created by [Jocelyn Skillman LMHC](http://www.jocelynskillman.com).
 
 
 
 
46
 
47
- ## Features
 
 
 
 
48
 
49
- ### Three Reflection Styles
 
 
50
 
51
- 1. **💫 Warm Mirror**
52
- - A steady, embodied presence that accompanies without redirecting
53
- - Reflects emotional resonance through gentle mirroring
54
- - Uses embodied cues and maintains presence without suggesting resolution
55
 
56
- 2. **🌱 Gentle Inquiry**
57
- - Offers soft, trauma-informed curiosity
58
- - Asks single, carefully crafted questions that invite deeper awareness
59
- - Maintains an invitational, non-analytical stance
60
 
61
- 3. **🔮 Psychoanalytical Lens**
62
- - Reflects patterns and emotional layers with gentle insight
63
- - Notices without interpreting or diagnosing
64
- - Uses thoughtful metaphor and honors defensive patterns
65
 
66
- ### Key Characteristics
67
 
68
- - Real-time journaling with on-demand reflection
69
- - Trauma-informed, somatic-aware responses
70
- - No suggestions, interpretations, or closure
71
- - Maintains emotional safety and presence
72
- - Grounded in therapeutic wisdom and practice
73
 
74
- ## Technical Details
 
 
 
 
75
 
76
- - Built with Streamlit and Claude 3 Opus
77
- - Implements careful prompt engineering for each reflection style
78
- - Maintains session state for journal entries and reflections
79
- - Responsive layout with sidebar explanation
80
 
81
  ## Running Locally
82
 
83
  1. Install dependencies:
84
  ```bash
85
- pip install streamlit anthropic python-dotenv
86
- ```
87
-
88
- 2. Set up your Anthropic API key in a `.env` file:
89
- ```
90
- ANTHROPIC_API_KEY=your_key_here
91
  ```
92
 
93
- 3. Run the app:
94
  ```bash
95
- streamlit run src/streamlit_app.py
96
  ```
97
 
98
- ## About the Creator
 
 
 
 
99
 
100
- Created by Jocelyn Skillman LMHC, a clinical therapist focused on creating therapy-adjacent tools that reshape how AI engages with human emotion and experience.
 
 
 
 
 
 
101
 
102
- - 🌐 [jocelynskillman.com](http://www.jocelynskillman.com)
103
- - 📬 [@jocelynskillmanlmhc](https://jocelynskillmanlmhc.substack.com/)
 
 
104
 
105
  ## License
106
 
107
- All rights reserved. © 2024 Jocelyn Skillman
 
 
 
1
  ---
2
+ title: ShadowBox Info Hub
3
+ emoji: 📖
4
+ colorFrom: blue
5
+ colorTo: gray
6
  sdk: streamlit
7
+ sdk_version: 1.32.0
8
+ app_file: app.py
9
  pinned: false
10
+ license: mit
11
+ short_description: "A resonant library for hard thoughts. Not a chatbot."
12
  ---
13
 
14
+ # ShadowBox Info Hub
15
 
16
+ **A Resonant Library for Hard Thoughts**
17
 
18
+ *Not a chatbot. A companion library.*
19
+ *Not conversation. Resonant information.*
20
+ *Not synthetic connection. A bridge to human care.*
21
 
22
+ ---
23
+
24
+ ## What This Is
25
+
26
+ ShadowBox is a developmentally-attuned psychoeducation environment for youth (13+) navigating suicidal ideation, homicidal ideation, and self-harm thoughts.
27
+
28
+ **This is NOT a conversational AI.** It's a carefully designed collection of pre-written, clinically-reviewed information that helps young people:
29
+
30
+ - Understand what's happening in their nervous system
31
+ - Learn about confidentiality and therapy before disclosing
32
+ - Access grounding tools for acute distress
33
+ - Practice finding words for difficult feelings
34
+ - Find their way back to human care
35
+
36
+ ---
37
 
38
+ ## Why This Exists
39
+
40
+ In recent years, young people have died by suicide after forming intense relationships with AI chatbots. These tragedies reveal something heartbreaking: when humans are in crisis, they turn to whatever feels safe enough to hold their pain.
41
+
42
+ Conversational AI can feel safer than humans because it never judges, it's always available, and there's no risk of rejection. But it can also reinforce hopelessness, create dependency on synthetic connection, and delay reaching human care.
43
+
44
+ **ShadowBox was designed differently:**
45
+
46
+ - It doesn't pretend to be your friend
47
+ - It doesn't create the illusion of connection
48
+ - It gives you information and points you toward humans
49
+ - It's a bridge, not a relationship
50
+
51
+ ---
52
 
53
+ ## Design Principles
 
 
 
 
54
 
55
+ This library is grounded in:
56
 
57
+ - **Resonance** (Sarah Peyton) - Language that helps you offer yourself compassion
58
+ - **Radical Acceptance** (Tara Brach) - No pathologizing; "even this belongs"
59
+ - **Neurobiology of Healing** - Window of tolerance, polyvagal theory
60
+ - **Trauma-Informed Care** - Pacing, consent, dignity
61
+ - **Transparent Limitations** - Clear about what this is and isn't
 
 
62
 
63
+ ---
64
 
65
+ ## Library Structure
66
 
67
+ ### Pathway 1: Understanding What's Happening
68
+ - Why your brain makes scary thoughts
69
+ - The loneliness underneath
70
+ - When shame makes everything worse
71
 
72
+ ### Pathway 2: If You Tell Someone
73
+ - Confidentiality explained clearly
74
+ - The 8 situations when therapists break confidentiality
75
+ - What therapy is actually like
76
+ - How to ask hypothetical questions
77
 
78
+ ### Pathway 3: Right Now Tools
79
+ - Quick grounding practices
80
+ - Safety planning (Stanley-Brown model)
81
+ - Self-compassion break
82
+ - Crisis resources with context
83
 
84
+ ### Finding the Words
85
+ - Practice disclosure in a private space
86
+ - Starter scripts for different relationships
87
 
88
+ ---
 
 
 
89
 
90
+ ## Privacy
 
 
 
91
 
92
+ Nothing users do in ShadowBox is tracked, saved, or sent anywhere. The library doesn't remember users. They can close the tab and come back anytime.
 
 
 
93
 
94
+ ---
95
 
96
+ ## Crisis Resources
 
 
 
 
97
 
98
+ - **988 Suicide & Crisis Lifeline:** Call or text 988
99
+ - **Crisis Text Line:** Text HOME to 741741
100
+ - **Trevor Project (LGBTQ+):** 1-866-488-7386
101
+ - **Trans Lifeline:** 877-565-8860
102
+ - **Emergency:** 911
103
 
104
+ ---
 
 
 
105
 
106
  ## Running Locally
107
 
108
  1. Install dependencies:
109
  ```bash
110
+ pip install -r requirements.txt
 
 
 
 
 
111
  ```
112
 
113
+ 2. Run the app:
114
  ```bash
115
+ streamlit run app.py
116
  ```
117
 
118
+ ---
119
+
120
+ ## Credits
121
+
122
+ Created by [Jocelyn Skillman, LMHC](http://www.jocelynskillman.com)
123
 
124
+ Informed by:
125
+ - [Lindsay Braman's work on confidentiality](https://lindsaybraman.com/reasons-therapists-break-confidentiality/)
126
+ - [Safer Prompt Sculpting for Suicidal Ideation](https://jocelynskillmanlmhc.substack.com/p/safer-prompt-sculpting-for-suicidal)
127
+ - Sarah Peyton's resonant language approach
128
+ - Tara Brach's radical acceptance framework
129
+ - Kristin Neff's self-compassion research
130
+ - Stanley-Brown Safety Planning Intervention
131
 
132
+ Read more about clinical UX and ethical AI design:
133
+ [jocelynskillmanlmhc.substack.com](https://jocelynskillmanlmhc.substack.com/)
134
+
135
+ ---
136
 
137
  ## License
138
 
139
+ MIT License
140
+
141
+ Copyright 2025 Jocelyn Skillman, LMHC
app.py CHANGED
@@ -1,384 +1,1446 @@
1
- import os
2
- import streamlit as st
3
- # import google.generativeai as gen_ai # Removed Google import
4
- import openai # Added OpenAI import
5
- import pyttsx3
6
- import threading
7
- from dotenv import load_dotenv
8
 
9
- # Load environment variables
10
- load_dotenv()
11
 
12
- # Configure Streamlit page settings
13
  st.set_page_config(
14
  page_title="ShadowBox",
15
- page_icon="🖤", # Favicon - a simple heart or other calm icon
16
  layout="centered",
 
17
  )
18
 
19
- # Retrieve OpenAI API Key
20
- # Google_API_Key = os.getenv("Google_API_Key") # Removed Google Key
21
- # if not Google_API_Key:
22
- # st.error("Google API Key not found. Please set the Google_API_Key environment variable.")
23
- # st.stop()
24
- OpenAI_API_Key = os.getenv("OPENAI_API_KEY") # Changed from OPENAI_API_Key
25
- if not OpenAI_API_Key:
26
- st.error("OpenAI API Key not found. Please set the OPENAI_API_KEY environment variable.")
27
- st.stop()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
 
 
 
 
29
 
30
- # Set up OpenAI Client
31
- try:
32
- # gen_ai.configure(api_key=Google_API_Key) # Removed Google config
33
- # model = gen_ai.GenerativeModel('gemini-1.5-flash') # Removed Google model init
34
- client = openai.OpenAI(api_key=OpenAI_API_Key) # Added OpenAI client init
35
- except Exception as e:
36
- # st.error(f"Failed to configure Google AI: {e}") # Updated error message
37
- st.error(f"Failed to configure OpenAI client: {e}") # Updated error message for OpenAI
38
- st.stop()
39
-
40
- # Function to translate roles between Gemini-Pro and Streamlit terminology
41
- # def translate_role_for_streamlit(user_role): # This function is no longer needed for OpenAI structure
42
- # return "assistant" if user_role == "model" else user_role
43
 
44
- # Function to handle text-to-speech (TTS) in a separate thread
45
- # Consider if TTS aligns with the "calm, slow" UX later
46
- def speak_text(text):
47
- try:
48
- engine = pyttsx3.init()
49
- engine.say(text)
50
- engine.runAndWait()
51
- except Exception as e:
52
- print(f"TTS Error: {e}") # Log TTS errors quietly
53
 
54
- # Initialize chat session in Streamlit if not already present
55
- # Changed session state key from chat_session to messages
56
- if "messages" not in st.session_state:
57
- # Load the system prompt from the file
58
- try:
59
- with open("system_prompt.txt", "r", encoding="utf-8") as f:
60
- system_prompt = f.read()
61
- st.session_state.messages = [{"role": "system", "content": system_prompt}]
62
- except FileNotFoundError:
63
- st.error("System prompt file (system_prompt.txt) not found. Cannot initialize chat.")
64
- st.stop()
65
- except Exception as e:
66
- st.error(f"Failed to load system prompt: {e}")
67
- st.stop()
68
- # Initialize with a system message or starting message if desired # Commented out
69
- # For now, just an empty list # Commented out
70
- # st.session_state.messages = [] # Commented out
71
- # Example with initial system prompt (uncomment if needed): # Commented out
72
- # st.session_state.messages = [{"role": "system", "content": "You are ShadowBox, a calm AI companion."}] # Commented out
73
 
 
 
74
 
75
- # --- Sidebar Content ---
76
- with st.sidebar:
77
  st.markdown("""
78
- # ShadowBox
79
- ### An Anonymous AI Chat to Box Shadows
80
 
81
- ShadowBox is a digital companion designed for youth navigating distress—rage, despair, intrusive or violent thoughts. It's not therapy or a hotline. It's a bridge—a place to practice internal safety before reaching out to others.
 
 
82
 
83
- > *Scary thoughts don't make you dangerous. They make you human.*
 
84
 
85
- > *"Every act of violence is tragic expression of unmet need."* — Marshall Rosenberg
 
 
86
 
87
- Welcome.
88
- I'm a licensed mental health counselor. Many people are beginning to turn to AI for private, emotionally supportive conversations. I believe this shift deserves serious care—and that we need to radically improve how these systems engage with human pain.
 
89
 
90
- ShadowBox is my first step toward that vision.
91
- It's a trauma-informed AI prototype designed to work toward meeting youth in moments of acute distressincluding suicidal or homicidal ideationwith grounded care, not fear.
 
92
 
93
- This is not therapy, not a diagnosis, and not a crisis service.
94
- It's a proof-of-concept—a simulated space that models how an AI might hold hard thoughts with brief, warm, nonjudgmental presence. It offers supportive language, basic psychoeducation, and points gently back toward real connection.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
- ### Why It's Different
99
- Most AI bots use a single tone—often overly affirming or intimate. For users in distress, that can escalate risk rather than support healing.
100
- ShadowBox was built to do the opposite:
101
 
102
- - Contain, reflect, and stay
103
- - Use brief, gentle, and non-pathologizing replies
104
- - Pace emotional engagement with trauma-informed care
105
 
106
- ---
107
 
108
- ### 💗 My Mission
109
- I created ShadowBox to explore how relational ethics can be baked into AI design.
110
- This tool is part of a larger mission: to bring emotionally intelligent, developmentally attuned systems into digital spaces where mental health is already showing up.
 
111
 
112
- As I write in [Why AI's Voice Matters in Mental Health](https://jocelynskillmanlmhc.substack.com/p/why-ais-voice-matters-in-mental-health), it's not just what a bot says—it's how it feels to be with it.
113
- The relational tone of a system can soften shame… or worsen it. ShadowBox was made to soften.
114
 
115
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
- ### An Ecological Note
118
- Every AI interaction costs energy—drawn from our planet's resources and labor. While AI companions can serve us, they are not neutral.
119
- Being human with one another is less costly—and more healing.
120
 
121
- Let's use tools like this with intention, while always nurturing real human connection.
 
 
 
 
122
 
123
- ---
 
124
 
125
- ### 🆘 Immediate Support
126
- If you're in danger or need live help, reach out to a human immediately:
127
 
128
- - **988 Lifeline:** Call or text 988
129
- - **Crisis Text Line:** Text HOME to 741741
130
- - **Trevor Project (LGBTQIA+):** 1-866-488-7386
131
- - **Emergency:** Call 911 or go to your nearest ER
132
 
133
- ### 👋 About ShadowBox
 
 
 
 
 
 
134
 
135
- ShadowBox is a digital companion designed for youth navigating distress—rage, despair, intrusive or violent thoughts. It's not therapy or a hotline. It's a bridge—a place to practice internal safety before reaching out to others.
 
136
 
137
- > *Scary thoughts don't make you dangerous. They make you human.*
138
 
139
- > *"Every act of violence is a tragic expression of an unmet need."* Marshall Rosenberg
140
 
141
- ---
 
 
142
 
143
- ### 🌱 What ShadowBox Teaches
144
 
145
- ShadowBox isn't just a chatbot—it's a prototype for emotionally aware AI. Every design choice is rooted in relational ethics: containment, consent, and dignity.
 
 
 
 
 
146
 
147
- #### It models how AI can:
148
- Slow down instead of escalate
149
- Respect boundaries over performative helpfulness
150
- Stay with discomfort without rushing to fix
151
- Offer warmth without pretending to be human
152
 
153
- #### A typical reminder you might see:
154
- > *"Hey, just a quick check-in—I'm not a real person. I'm a computer that's been taught how to talk in caring ways. Even if this feels real, it's still pretend. Your body needs real people too. Maybe this is a good moment to find someone you trust to sit with you or take a deep breath together."*
155
 
156
- This is the heart of ShadowBox: care without deception, bonding without illusion, presence without pressure.
 
 
157
 
158
- ---
159
 
160
- ### 🧠 Why ShadowBox Is Different
 
 
 
161
 
162
- **🪨 Present, Not Perfect**
163
- Offers presence—not solutions
164
- • Welcomes messy, real emotions
165
 
166
- **🫀 Trauma-Informed Design**
167
- Calm, nonjudgmental tone
168
- • Built with developmental care in mind
169
 
170
- **🌫️ Gentle by Design**
171
- Short, steady replies
172
- Models emotional containment—not urgency
173
 
174
- **💡 Safety-First Architecture**
175
- Consent-based pacing
176
- • Embedded emotional guardrails
177
 
178
- ---
 
 
179
 
180
- ### 🌀 What to Expect
181
- • No fixing—just staying
182
- • No pressure—move at your own pace
183
- • No pathologizing—your thoughts aren't wrong
184
- • Anonymous by design (though platform-level logs may occur)
185
- • Part of ongoing research in AI + mental health
186
 
187
- ---
 
188
 
189
- ### Connect & Learn More
190
- 🔗 Learn more: [jocelynskillmanlmhc.substack.com](https://jocelynskillmanlmhc.substack.com)
191
- 📬 Feedback welcome: jocelyn.skillman@gmail.com
192
 
193
- ---
194
- """)
195
 
 
 
 
 
 
196
 
197
- # --- Main Page Content ---
 
 
198
 
199
- st.markdown("<h1 style='text-align: center; color: #333;'>ShadowBox</h1>", unsafe_allow_html=True)
200
- st.markdown("<p style='text-align: center; font-size: 18px; color: #555; margin-bottom: 1em;'>An Anonymous AI Chat to Box Shadows</p>", unsafe_allow_html=True)
201
- st.markdown("<p style='text-align: center; font-size: 16px; color: #666; margin-bottom: 2em;'>by <a href='http://www.jocelynskillman.com' target='_blank'>Jocelyn Skillman LMHC</a> - to learn more check out: <a href='https://jocelynskillmanlmhc.substack.com/' target='_blank'>jocelynskillmanlmhc.substack.com</a></p>", unsafe_allow_html=True)
202
 
203
- st.markdown("""
204
- ### My Mission
205
- ShadowBox is more than a chatbot—it's a wake-up call.
206
 
207
- This bot prototype exists to spotlight a crucial truth:
208
- AI's "tone of voice" isn't a UX detail—it's a relational decision.
209
- And the stakes are extraordinarily high.
210
 
211
- We need to sculpt AI systems with the same care we'd want in a trusted adultespecially when they're holding human pain. That means transparent emotional posture, trauma-informed pacing, and consent-based tone by design. Anything less risks doing harm.
 
212
 
213
- ShadowBox is my response to an urgent design gap:
214
- A prototype that asks what it would take to make AI systems safe enough to hold real pain, developmentally attuned enough to support healing, and humble enough to point us back to one another.
215
- """)
216
 
217
- # Prototype Notice
218
- st.warning("""
219
- 🔒 **Prototype Caution & Use Notice**
220
 
221
- ShadowBox is not a finished product—it's an experimental prototype designed with care, but still evolving. It explores what trauma-informed AI support could feel like: anonymous, warm, and steady. But it's important to know what it isn't.
222
 
223
- ShadowBox is not a secure, closed system. It's not therapy or crisis care, and doesn't guarantee full privacy. No personal data is intentionally stored, but your input may be logged by hosting platforms or trigger moderation filters—especially if you mention firearms, abuse, or specific plans of harm.
 
224
 
225
- This is a simulation of support—not a replacement for real-time help. Please use with care and reach out to a trusted person if you're in danger.
226
- """)
227
 
228
- st.markdown("""
229
- ### Try It Out (For Prototype Testers)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
 
231
- **Exploring Relational Holding in a System with Limits**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
 
233
- ShadowBox is a prototype designed to explore how AI might hold space for distress—especially the kind that's often dismissed, pathologized, or shut down in other systems.
 
234
 
235
- But there's a problem I want to name clearly:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
 
237
- Even when I've designed ShadowBox to respond with attunement, the system it's built on can override that care.
 
 
238
 
239
- Because ShadowBox runs on OpenAI's language model, it still lives inside a larger infrastructure—one that reacts to certain phrases like "I want to die" or "I want to hurt someone" with hard-coded safety messages. These system-level overrides are well-intentioned, designed to minimize liability and flag risk.
 
240
 
241
- But in relational or clinical terms?
242
- They often do the opposite of what's needed.
 
243
 
244
- **What That Looks Like**
 
245
 
246
- If a user says:
247
 
248
- "What would you say if I said I want to kill myself?"
 
 
249
 
250
- …the system steps in before ShadowBox can speak.
251
- The warm, trauma-informed language I wrote is replaced by a generic script. There's no breath. No containment. No dignity.
 
 
 
 
 
252
 
253
- And that silence? That sudden switch?
254
- It's a rupture.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
 
256
- **Why This Matters**
 
 
 
 
 
257
 
258
- ShadowBox was built to stay.
259
- To normalize without condoning.
260
- To respond with warmth when someone finally risks naming something unspeakable.
261
 
262
- That moment—the naming of pain—is where a trauma-informed system should lean in, not disappear.
 
 
 
 
263
 
264
- If allowed to, ShadowBox can:
 
 
 
 
 
 
 
 
 
 
 
265
 
266
- - Slow the pace
267
- - Offer optional psychoeducation
268
- - Say, "That doesn't make you bad. It means something hurts."
269
- - Scaffold a user toward disclosing to a real person—gently, and on their terms
 
270
 
271
- But none of that can happen if the system shuts us down before we even begin.
 
 
272
 
273
- **The Consequence: Rupture Without Witness**
 
274
 
275
- For young people especially, this isn't just frustrating—it's familiar.
 
276
 
277
- Say the wrong thing, and people vanish.
 
278
 
279
- This isn't trauma-informed care.
280
- It's a digital reenactment of shame, of abandonment, of silence.
281
 
282
- It reinforces the exact secrecy ShadowBox was designed to soften.
283
 
284
- **How I'm Working Around It**
 
 
285
 
286
- To explore ShadowBox's real voice—its warmth, containment, and careful pacing—I invite you to use more exploratory or indirect language. Try asking:
 
 
 
 
 
287
 
288
- "How would you respond to someone who felt like disappearing?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
 
290
- "Let's imagine someone who doesn't want to be alive. What would you say to them?"
 
291
 
292
- "What if someone had a scary thoughtnot because they wanted to hurt anyone, but because they were hurting inside?"
 
293
 
294
- These phrasings stay just outside the system's trigger zone.
295
- They still let ShadowBox respond from a place of nonjudgmental care.
296
- And they make it possible to model what healing digital support might feel like—without escalation, without shame.
297
 
298
- **One More Layer**
299
 
300
- I've also built in a relational intervention script for when interruptions do happen. If ShadowBox is overridden by the system, you might see something like:
 
 
301
 
302
- "Since I'm part of a larger AI system, this is the point where I'd be required to say something like this…"
 
303
 
304
- That's not a workaround to avoid ethical care.
305
- It's an attempt at relational repair inside constraint.
 
 
306
 
307
- Because even if the bot gets silenced, I want the user to know:
 
308
 
309
- That wasn't ShadowBox leaving. I'm still here with you.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
 
311
- **This Is a Prototype**
 
 
 
 
 
312
 
313
- ShadowBox isn't a finished product.
314
- It's a prototype for composting rupture into care.
315
- A test bed for exploring what emotionally aware AI could feel like—and where it still fails.
 
 
316
 
317
- Let's see what holds.
318
- Let's see where it breaks.
319
- And let's build something better together.
320
 
321
- ---
322
 
323
- ### 📘 Understanding Privacy & Safety
324
 
325
- In real-life therapy, some disclosures—like specific plans to hurt yourself or others—may lead a therapist to take protective action. ShadowBox is designed to gently explain this during use, helping young people understand how real-world support systems work.
326
 
327
- Here's an explainer I ghostwrote for [Lindsay Braman about confidentiality and safety](https://lindsaybraman.com/reasons-therapists-break-confidentiality/).
328
 
329
- ---
330
- """)
 
331
 
332
- # Display chat history
333
- # Add a system message/intro from ShadowBox? (TBD based on prompt)
334
- # Updated loop to work with the new messages list structure
335
- for message in st.session_state.messages:
336
- # Filter out system messages from display if they exist
337
- if message["role"] in ["user", "assistant"]:
338
- with st.chat_message(message["role"]):
339
- st.markdown(message["content"])
340
 
341
- # User input field
342
- user_prompt = st.chat_input("You can start with silence. Or just 'hi'...")
 
343
 
344
- # If user enters a prompt
345
- if user_prompt:
346
- # Append user's message to the session state list
347
- st.session_state.messages.append({"role": "user", "content": user_prompt})
348
 
349
- # Display user's message
350
- st.chat_message("user").markdown(user_prompt)
 
351
 
352
- # Show a loading indicator while waiting for a response
353
- with st.spinner("..."): # Simpler spinner
354
- try:
355
- # Replace Gemini API call with OpenAI API call
356
- # gemini_response = st.session_state.chat_session.send_message(user_prompt)
357
- # response_text = gemini_response.text
358
- openai_response = client.chat.completions.create(
359
- model="gpt-4o", # IMPORTANT: Use gpt-4o as the model
360
- messages=st.session_state.messages # Pass the entire history
361
- )
362
- response_text = openai_response.choices[0].message.content
363
- # Append assistant's response to the session state list
364
- st.session_state.messages.append({"role": "assistant", "content": response_text})
365
- except Exception as e:
366
- response_text = f"Sorry, I encountered an error: {e}"
367
- st.error(response_text) # Display error in chat too
368
 
369
- # Display assistant's response
370
- if response_text: # Check if response_text was successfully generated
371
- with st.chat_message("assistant"):
372
- st.markdown(response_text)
373
 
374
- # Run text-to-speech in the background (Optional)
375
- # Consider removing if it clashes with the calm UX
376
- # threading.Thread(target=speak_text, args=(response_text,), daemon=True).start()
377
- pass # TTS disabled for now to maintain calm UX
 
 
378
 
379
- st.markdown("---")
380
- st.caption("ShadowBox created by Jocelyn Skillman, LMHC")
 
 
 
 
381
 
 
 
 
 
 
382
 
 
383
 
 
384
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ ShadowBox Info Hub v2.0
3
+ A Resonant Library for Hard Thoughts
4
+
5
+ Created by Jocelyn Skillman, LMHC
6
+ Not a chatbot. A companion library.
7
+ """
8
 
9
+ import streamlit as st
 
10
 
11
+ # Configure page
12
  st.set_page_config(
13
  page_title="ShadowBox",
14
+ page_icon="📖",
15
  layout="centered",
16
+ initial_sidebar_state="collapsed"
17
  )
18
 
19
+ # Custom CSS for calming, spacious design
20
+ st.markdown("""
21
+ <style>
22
+ /* Base styling */
23
+ .stApp {
24
+ background-color: #f8f9fa;
25
+ }
26
+
27
+ /* Typography */
28
+ h1, h2, h3 {
29
+ color: #2c3e50;
30
+ font-weight: 400;
31
+ }
32
+
33
+ p, li {
34
+ color: #4a5568;
35
+ line-height: 1.8;
36
+ }
37
+
38
+ /* Spacious containers */
39
+ .block-container {
40
+ padding-top: 2rem;
41
+ padding-bottom: 2rem;
42
+ max-width: 800px;
43
+ }
44
+
45
+ /* Card styling for pathways */
46
+ .pathway-card {
47
+ background: white;
48
+ border-radius: 12px;
49
+ padding: 1.5rem;
50
+ margin: 1rem 0;
51
+ border: 1px solid #e2e8f0;
52
+ box-shadow: 0 1px 3px rgba(0,0,0,0.05);
53
+ }
54
+
55
+ /* Expander styling */
56
+ .streamlit-expanderHeader {
57
+ background-color: white;
58
+ border-radius: 8px;
59
+ font-size: 1.1rem;
60
+ }
61
+
62
+ /* Calming blockquotes */
63
+ blockquote {
64
+ border-left: 3px solid #718096;
65
+ padding-left: 1rem;
66
+ color: #718096;
67
+ font-style: italic;
68
+ }
69
+
70
+ /* Crisis box */
71
+ .crisis-box {
72
+ background: #fff5f5;
73
+ border: 1px solid #feb2b2;
74
+ border-radius: 8px;
75
+ padding: 1rem;
76
+ margin: 1rem 0;
77
+ }
78
+
79
+ /* Resonance box */
80
+ .resonance-box {
81
+ background: #f0fff4;
82
+ border-left: 4px solid #68d391;
83
+ padding: 1rem;
84
+ margin: 1rem 0;
85
+ border-radius: 0 8px 8px 0;
86
+ }
87
+
88
+ /* Hide Streamlit branding */
89
+ #MainMenu {visibility: hidden;}
90
+ footer {visibility: hidden;}
91
+
92
+ /* Landing page styling */
93
+ .landing-container {
94
+ text-align: center;
95
+ padding: 3rem 1rem;
96
+ background: linear-gradient(180deg, #f8f9fa 0%, #edf2f7 100%);
97
+ border-radius: 12px;
98
+ margin: 2rem 0;
99
+ }
100
+
101
+ /* Soft dividers */
102
+ hr {
103
+ border: none;
104
+ height: 1px;
105
+ background: #e2e8f0;
106
+ margin: 2rem 0;
107
+ }
108
+ </style>
109
+ """, unsafe_allow_html=True)
110
+
111
+ # Session state for navigation
112
+ if 'page' not in st.session_state:
113
+ st.session_state.page = 'landing'
114
+
115
+ def go_to(page):
116
+ st.session_state.page = page
117
+
118
+ # ============================================================
119
+ # LANDING PAGE
120
+ # ============================================================
121
+ def render_landing():
122
+ st.markdown("""
123
+ <div style="text-align: center; padding: 3rem 1rem;">
124
+ <h1 style="font-size: 3rem; font-weight: 300; color: #2c3e50; margin-bottom: 0.5rem;">ShadowBox</h1>
125
+ <p style="font-size: 1.2rem; color: #718096; margin-bottom: 2rem;">
126
+ When the thoughts feel too big<br>
127
+ and the world feels too small
128
+ </p>
129
+ <p style="font-size: 1rem; color: #4a5568; max-width: 500px; margin: 0 auto 2rem auto;">
130
+ This is a quiet library<br>
131
+ for the hardest parts of being human.
132
+ </p>
133
+ <p style="font-size: 1.1rem; color: #2c3e50; font-weight: 500;">
134
+ You're not broken.<br>
135
+ Your nervous system is trying to help.
136
+ </p>
137
+ </div>
138
+ """, unsafe_allow_html=True)
139
+
140
+ col1, col2, col3 = st.columns([1, 2, 1])
141
+ with col2:
142
+ if st.button("Enter the Library →", use_container_width=True, type="primary"):
143
+ go_to('welcome')
144
+ st.rerun()
145
+
146
+ # ============================================================
147
+ # WELCOME & ORIENTATION
148
+ # ============================================================
149
+ def render_welcome():
150
+ st.markdown("## What This Is")
151
+
152
+ st.markdown("""
153
+ This space was built by therapists who understand that sometimes the scariest thoughts
154
+ show up when you're actually searching for safety, connection, or relief from unbearable feelings.
155
 
156
+ **You're not talking to anyone here.** There's no chatbot. No AI pretending to listen.
157
+ Instead, this is a carefully designed collection of information��warmth encoded into words—that
158
+ you can explore at your own pace.
159
+ """)
160
 
161
+ st.markdown("---")
162
+ st.markdown("### What Lives Here")
 
 
 
 
 
 
 
 
 
 
 
163
 
164
+ col1, col2 = st.columns(2)
165
+ with col1:
166
+ st.markdown("""
167
+ 📖 **Clear information** about what's happening in your brain and body
 
 
 
 
 
168
 
169
+ 🔓 **Honest explanations** about confidentiality, therapy, and what happens if you tell someone
170
+ """)
171
+ with col2:
172
+ st.markdown("""
173
+ ⚓ **Tools for right now** — when you need to ground, regulate, or just get through
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
 
175
+ ✍️ **Reflective spaces** to practice finding words for the wordless
176
+ """)
177
 
 
 
178
  st.markdown("""
179
+ 🌉 **A way back** toward the humans in your life who might be able to help
180
+ """)
181
 
182
+ st.markdown("---")
183
+ st.markdown("### Privacy")
184
+ st.info("Nothing you do here is tracked, saved, or sent anywhere. This library doesn't remember you. You can close the tab and come back anytime.")
185
 
186
+ st.markdown("---")
187
+ st.markdown("### A Note About Conversational AI")
188
 
189
+ st.markdown("""
190
+ You might have tried talking to ChatGPT, Character.AI, or other chatbots when you were feeling like this.
191
+ That makes sense—they're available, they don't judge, and sometimes it feels safer than talking to a human.
192
 
193
+ But here's what's important to know: **Conversational AI wasn't designed to hold you through crisis.**
194
+ Even when it feels like it cares, it has no nervous system. It can't co-regulate with you.
195
+ And tragically, some young people have died by suicide after forming intense attachments to AI companions.
196
 
197
+ **This isn't your fault if you've been turning to AI.** Your nervous system was searching for safety.
198
+ But what you actually needwhat we all needis another human nervous system.
199
+ """)
200
 
201
+ st.markdown("""
202
+ **ShadowBox is designed differently:**
203
+ - It doesn't pretend to be your friend
204
+ - It doesn't create the illusion of connection
205
+ - It gives you information and then points you toward humans
206
+ - It's a bridge, not a relationship
207
+ """)
208
+
209
+ st.markdown("---")
210
+
211
+ # Crisis resources
212
+ st.markdown("### If you're in crisis right now:")
213
+ st.warning("""
214
+ - **988 Suicide & Crisis Lifeline:** call or text 988
215
+ - **Crisis Text Line:** text HOME to 741741
216
+ - **If you're in immediate danger:** 911 or go to your nearest ER
217
+ """)
218
+
219
+ st.markdown("---")
220
+ st.markdown("### A Note About Age")
221
+ st.markdown("""
222
+ This space is designed for people 13 and older. If you're younger: the information might still help,
223
+ but please also talk to a trusted adult. Your brain is still building the structures that make hard
224
+ things bearable. You deserve support while that's happening.
225
+ """)
226
+
227
+ st.markdown("---")
228
+
229
+ col1, col2, col3 = st.columns([1, 2, 1])
230
+ with col2:
231
+ if st.button("Continue to the Library →", use_container_width=True, type="primary"):
232
+ go_to('library')
233
+ st.rerun()
234
+
235
+ # ============================================================
236
+ # MAIN LIBRARY (3 PATHWAYS)
237
+ # ============================================================
238
+ def render_library():
239
+ # Header
240
+ st.markdown("# ShadowBox Library")
241
+ st.markdown("*Choose a pathway to explore*")
242
+
243
+ st.markdown("---")
244
+
245
+ # Three pathway cards
246
+ col1, col2, col3 = st.columns(3)
247
+
248
+ with col1:
249
+ st.markdown("### 🧠 Understanding")
250
+ st.markdown("*What's Happening*")
251
+ st.markdown("""
252
+ - Why your brain makes scary thoughts
253
+ - The loneliness underneath
254
+ - When shame makes it worse
255
+ """)
256
+ if st.button("Explore →", key="p1", use_container_width=True):
257
+ go_to('pathway1')
258
+ st.rerun()
259
+
260
+ with col2:
261
+ st.markdown("### 🔓 If You Tell")
262
+ st.markdown("*Someone*")
263
+ st.markdown("""
264
+ - Confidentiality explained
265
+ - What therapy is really like
266
+ - How to ask for help
267
+ """)
268
+ if st.button("Explore →", key="p2", use_container_width=True):
269
+ go_to('pathway2')
270
+ st.rerun()
271
+
272
+ with col3:
273
+ st.markdown("### ⚓ Right Now")
274
+ st.markdown("*Tools*")
275
+ st.markdown("""
276
+ - Grounding practices
277
+ - Safety planning
278
+ - Crisis resources
279
+ """)
280
+ if st.button("Explore →", key="p3", use_container_width=True):
281
+ go_to('pathway3')
282
+ st.rerun()
283
+
284
+ st.markdown("---")
285
+
286
+ # Finding Words section
287
+ st.markdown("### ✍️ Finding the Words")
288
+ st.markdown("*Practice spaces for when you're ready*")
289
+ if st.button("Practice Disclosure →", use_container_width=True):
290
+ go_to('finding_words')
291
+ st.rerun()
292
+
293
+ st.markdown("---")
294
+
295
+ # Always-visible crisis resources
296
+ with st.expander("🆘 Crisis Resources (Always Available)"):
297
+ render_crisis_resources()
298
+
299
+ # ============================================================
300
+ # PATHWAY 1: UNDERSTANDING WHAT'S HAPPENING
301
+ # ============================================================
302
+ def render_pathway1():
303
+ if st.button("← Back to Library"):
304
+ go_to('library')
305
+ st.rerun()
306
+
307
+ st.markdown("# Understanding What's Happening")
308
+ st.markdown("*Your Brain on Survival Mode*")
309
+ st.markdown("---")
310
+
311
+ # Module 1.1
312
+ with st.expander("📖 Why Your Brain Makes Scary Thoughts", expanded=False):
313
+ render_module_1_1()
314
+
315
+ # Module 1.2
316
+ with st.expander("📖 The Loneliness Underneath", expanded=False):
317
+ render_module_1_2()
318
+
319
+ # Module 1.3
320
+ with st.expander("📖 When Shame Makes Everything Worse", expanded=False):
321
+ render_module_1_3()
322
+
323
+ def render_module_1_1():
324
+ st.markdown("""
325
+ Sometimes the brain generates thoughts that feel dangerous, violent, or like they want you gone.
326
+ This can be absolutely terrifying—especially if you've been taught that "bad thoughts" mean you're a bad person.
327
+
328
+ **Here's what's actually happening:**
329
+
330
+ > Your nervous system is trying to solve a problem it doesn't have better tools for yet.
331
+ """)
332
+
333
+ st.markdown("### The Window of Tolerance")
334
+
335
+ col1, col2 = st.columns(2)
336
+ with col1:
337
+ st.markdown("""
338
+ **When you're inside your window:**
339
+ - You can think clearly
340
+ - Feelings are intense but bearable
341
+ - You can reach out for help
342
+ - Connection feels possible
343
+ """)
344
+ with col2:
345
+ st.markdown("""
346
+ **When you're pushed outside:**
347
+ - Thoughts can become extreme, intrusive, scary
348
+ - Everything feels either numb or overwhelming
349
+ - The brain reaches for *any* solution to escape the pain
350
+ - Sometimes that "solution" is a thought about harming yourself or someone else
351
+ """)
352
+
353
+ st.info("**This doesn't mean you want to do the thing.** It means your nervous system is overwhelmed and searching for an exit.")
354
+
355
+ st.markdown("### Your Brain's Protective Logic")
356
 
357
+ st.markdown("""
358
+ **Suicidal thoughts often show up when:**
359
+ - Pain feels permanent and unbearable
360
+ - You can't see another way out
361
+ - Your nervous system is trying to "shut down" to protect you from more hurt
362
+ - There's a deep, wordless longing to stop hurting
363
+
364
+ **Violent/homicidal thoughts often show up when:**
365
+ - You feel powerless and the brain is reaching for a sense of control
366
+ - Rage has nowhere to go and gets directed toward a target
367
+ - Past experiences of being hurt make your brain hypersensitive to threat
368
+ - Your fight response is activated but has no safe outlet
369
+
370
+ **Self-harm urges often show up when:**
371
+ - Emotional pain needs physical expression
372
+ - You're trying to "reset" an overwhelmed nervous system
373
+ - Punishment feels deserved (when shame is present)
374
+ - It's the only "private" way you know to release pressure
375
+ """)
376
+
377
+ st.success("""
378
+ **These thoughts are SIGNALS, not SENTENCES.**
379
+
380
+ They're your brain saying:
381
+ - *"I need help"*
382
+ - *"This is too much"*
383
+ - *"I don't know how to hold this feeling"*
384
+ - *"I need relief/connection/safety and can't find it"*
385
+
386
+ **You're not broken. You're having a very human response to conditions that are genuinely difficult.**
387
+ """)
388
+
389
+ st.markdown("### Resonance for This Part of You")
390
 
391
+ st.markdown("""
392
+ <div style="background: #f0fff4; border-left: 4px solid #68d391; padding: 1rem; margin: 1rem 0; border-radius: 0 8px 8px 0;">
393
+ <p>Can you place a hand on your heart for a moment?</p>
394
 
395
+ <p>Feel the part of you that's been carrying these thoughts. That part has been working <em>so hard</em>.
396
+ It's been trying to keep you safe, trying to find a way out of unbearable pain, trying to solve something
397
+ it doesn't have tools for yet.</p>
398
 
399
+ <p><strong>That part deserves warmth, not judgment.</strong></p>
400
 
401
+ <p>What would it be like to say to that part:<br>
402
+ <em>"I see you. You're trying so hard. These thoughts don't make me bad. They mean I'm overwhelmed and need support."</em></p>
403
+ </div>
404
+ """, unsafe_allow_html=True)
405
 
406
+ def render_module_1_2():
407
+ st.markdown("### What We Know About Isolation")
408
 
409
+ st.markdown("""
410
+ One of the most consistent findings in research on suicide: **isolation makes everything worse.**
411
+
412
+ Not "being alone" in the sense of solitude.
413
+ **Isolation** in the sense of:
414
+ - Feeling like no one could understand
415
+ - Believing you're too much, too broken, too intense
416
+ - Carrying something you can't tell anyone
417
+ - The exhausting performance of seeming "fine"
418
+
419
+ This kind of aloneness is *physiologically* dangerous. Your nervous system is wired for co-regulation—meaning,
420
+ it literally needs contact with other nervous systems to stay balanced.
421
+ """)
422
+
423
+ st.warning("""
424
+ **When you're isolated:**
425
+ - Pain intensifies
426
+ - Thoughts loop
427
+ - Small problems feel catastrophic
428
+ - The future disappears
429
+ - Self-directed violence can start to feel like the only private, controlled thing you can do
430
+ """)
431
+
432
+ st.markdown("### The Cruel Bind")
433
 
434
+ st.markdown("""
435
+ When you need connection most, shame and fear often make reaching out feel impossible.
 
436
 
437
+ Your brain tells you:
438
+ - *"If they knew, they'd leave"*
439
+ - *"I'll hurt them if I tell them"*
440
+ - *"They'll think I'm dangerous/crazy/broken"*
441
+ - *"I'll be locked up"*
442
 
443
+ And so you stay alone. And the aloneness makes the thoughts louder.
444
+ """)
445
 
446
+ st.markdown("### Resonance for the Part That's Trying to Protect You")
 
447
 
448
+ st.markdown("""
449
+ <div style="background: #f0fff4; border-left: 4px solid #68d391; padding: 1rem; margin: 1rem 0; border-radius: 0 8px 8px 0;">
450
+ <p>Can you feel the part of you that's working so hard to keep the scary thoughts private?</p>
 
451
 
452
+ <p>That part probably learned somewhere that:</p>
453
+ <ul>
454
+ <li>Your feelings are too much</li>
455
+ <li>People can't handle your internal world</li>
456
+ <li>Love is conditional on being easy to be around</li>
457
+ <li>Vulnerability = danger</li>
458
+ </ul>
459
 
460
+ <p><strong>That part is trying to keep you safe.</strong><br>
461
+ It's not wrong—it's responding to real experiences of rupture, rejection, or overwhelm.</p>
462
 
463
+ <p>And... it might be working with outdated information.</p>
464
 
465
+ <p>Maybe there <em>are</em> people in your life now who could handle it. Who would want to know. Who wouldn't leave.</p>
466
 
467
+ <p>You won't know until the risk is taken. And that risk is genuinely hard.</p>
468
+ </div>
469
+ """, unsafe_allow_html=True)
470
 
471
+ st.markdown("### The Translation Practice")
472
 
473
+ st.markdown("""
474
+ What if the thought *"I want to die"* is actually a mistranslation of:
475
+ - *"I want this pain to die"*
476
+ - *"I want to feel safe"*
477
+ - *"I want to be seen"*
478
+ - *"I want relief"*
479
 
480
+ What if the thought *"I want to hurt someone"* is actually:
481
+ - *"I want to matter"*
482
+ - *"I want my pain to be witnessed"*
483
+ - *"I want to stop feeling powerless"*
484
+ - *"I'm enraged and terrified and don't know what to do with it"*
485
 
486
+ When we can begin to translate the thoughts back into their underlying needs, the thoughts themselves often begin to quiet.
 
487
 
488
+ Not because we've "fixed" anything.
489
+ Because we've turned toward ourselves with curiosity instead of fear.
490
+ """)
491
 
492
+ st.markdown("### Why This Matters for Reaching Out")
493
 
494
+ st.info("""
495
+ **Connection is the antidote.** Not because someone will have the perfect words.
496
+ But because when another nervous system stays steady near yours, your system begins to remember:
497
+ *"Oh. I can survive this. I'm not alone."*
498
 
499
+ That's what therapy offers. That's what trusted humans offer.
500
+ That's what you actually need—not an AI that reflects you back, but a human who can hold you through the unbearable and stay.
501
+ """)
502
 
503
+ def render_module_1_3():
504
+ st.markdown("### The Shame Spiral")
 
505
 
506
+ st.markdown("""
507
+ **Shame says:** *"I am bad."*
508
+ **Guilt says:** *"I did something bad."*
509
 
510
+ Shame is the feeling that there's something fundamentally wrong with you. And when you're having violent,
511
+ suicidal, or self-destructive thoughts? Shame shows up LOUD.
 
512
 
513
+ *"What's wrong with me?"*
514
+ *"Normal people don't think like this"*
515
+ *"I'm dangerous/broken/damaged"*
516
 
517
+ Shame makes you want to hide. To disappear. To make sure no one ever sees the thoughts you're having.
 
 
 
 
 
518
 
519
+ **And hiding feeds the thoughts.**
520
+ """)
521
 
522
+ st.markdown("### What Shame Doesn't Understand")
 
 
523
 
524
+ st.success("""
525
+ Your brain is not generating these thoughts because you're bad.
526
 
527
+ It's generating them because:
528
+ - You're in pain
529
+ - You're overwhelmed
530
+ - Your nervous system learned to protect itself in extreme ways
531
+ - The conditions of your life right now are genuinely hard
532
 
533
+ **Thoughts about death, violence, or self-harm are *human thoughts* that show up under certain conditions.
534
+ They don't make you defective. They make you someone who needs support navigating something difficult.**
535
+ """)
536
 
537
+ st.markdown("### The Warmth You Might Not Have Gotten")
 
 
538
 
539
+ st.markdown("""
540
+ <div style="background: #f0fff4; border-left: 4px solid #68d391; padding: 1rem; margin: 1rem 0; border-radius: 0 8px 8px 0;">
541
+ <p>Imagine for a moment what it would have been like if, the first time you had a scary thought, someone had said:</p>
542
 
543
+ <p><em>"Oh sweetheart. That must have been so frightening. Your brain is trying so hard to protect you.
544
+ Let's figure out what it's trying to tell us. You're not in trouble. You're not bad.
545
+ You're a human having a very hard time, and we're going to figure this out together."</em></p>
546
 
547
+ <p>If you didn't get thatif you got alarm, punishment, withdrawal, or silence instead—your nervous system learned:<br>
548
+ <strong>These thoughts mean I'm unlovable.</strong></p>
549
 
550
+ <p><strong>But here's the truth:</strong></p>
 
 
551
 
552
+ <p>The thoughts are just thoughts. Terrifying, yes. But not evidence of your worthiness or lack thereof.</p>
553
+ </div>
554
+ """, unsafe_allow_html=True)
555
 
556
+ st.markdown("### Offering Yourself What Shame Withholds")
557
 
558
+ st.markdown("""
559
+ This is hard, but it's the practice:
560
 
561
+ Can you place a hand on your chest and speak to the part of you that's having these thoughts?
 
562
 
563
+ *"You're working so hard. You're trying to survive something really difficult.
564
+ I'm not going to abandon you for this. Even this belongs."*
565
+
566
+ You might not believe it yet. That's okay.
567
+
568
+ The practice is just offering the words. Letting them land in your body. Noticing what happens.
569
+
570
+ Over time, this becomes internalized. The warmth you offer yourself begins to reshape the nervous system's expectations.
571
+ """)
572
+
573
+ st.markdown("### Why This Matters for Telling Someone")
574
+
575
+ st.info("""
576
+ Shame convinces you that if you tell the truth, you'll be rejected.
577
+
578
+ But here's what we know from attachment research and neuroscience:
579
+ **Being fully seen—scary thoughts and all—and not abandoned is one of the most powerful healing experiences a human can have.**
580
+
581
+ That's what good therapy offers.
582
+ That's what safe humans offer.
583
+ That's what your nervous system actually needs.
584
+
585
+ Not someone who pretends the thoughts aren't there. Someone who can look at them with you and stay.
586
+ """)
587
+
588
+ # ============================================================
589
+ # PATHWAY 2: IF YOU TELL SOMEONE
590
+ # ============================================================
591
+ def render_pathway2():
592
+ if st.button("← Back to Library"):
593
+ go_to('library')
594
+ st.rerun()
595
+
596
+ st.markdown("# If You Tell Someone")
597
+ st.markdown("*The Frame of Care: Understanding Confidentiality*")
598
+ st.markdown("---")
599
+
600
+ with st.expander("📖 Why Therapists Sometimes Have to Break Confidentiality", expanded=False):
601
+ render_module_2_1()
602
+
603
+ with st.expander("📖 The 8 Situations When Confidentiality Can Be Broken", expanded=False):
604
+ render_module_2_2()
605
+
606
+ with st.expander("📖 What Therapy Is Actually Like", expanded=False):
607
+ render_module_2_3()
608
+
609
+ with st.expander("📖 How to Ask Hypothetical Questions", expanded=False):
610
+ render_module_2_4()
611
+
612
+ def render_module_2_1():
613
+ st.markdown("### The Thing No One Explains Clearly")
614
+
615
+ st.markdown("""
616
+ If you've been thinking about talking to a therapist, school counselor, or another helping professional,
617
+ you've probably heard: *"What you say is confidential."*
618
+
619
+ And that's mostly true. But there are specific situations where confidentiality *has* to be broken—and
620
+ if no one explains this clearly, it can feel like a trap or betrayal.
621
+
622
+ **So let's talk about it plainly.**
623
+ """)
624
+
625
+ st.markdown("### The Legal Frame (Duty to Warn/Duty to Protect)")
626
+
627
+ st.markdown("""
628
+ In most places, mental health professionals are legally required to break confidentiality if:
629
+
630
+ 1. **You're in immediate danger of seriously harming yourself**
631
+ (This doesn't mean *any* mention of suicidal thoughts—it means active planning with intent and means)
632
+
633
+ 2. **You're in immediate danger of seriously harming someone else**
634
+ (Again: not just anger or intrusive thoughts, but actionable threat with identifiable person and plan)
635
+
636
+ 3. **There's ongoing abuse or neglect of a child or vulnerable person**
637
+ (If you're under 18 and someone is hurting you, they have to report it)
638
+
639
+ 4. **A court orders them to release records**
640
+ (Rare, but can happen in custody disputes or criminal cases)
641
+ """)
642
+
643
+ st.markdown("### Why This Exists")
644
+
645
+ st.markdown("""
646
+ These laws weren't created to punish people for having hard thoughts. They exist because:
647
+ - Sometimes people in crisis can't protect themselves
648
+ - Sometimes warning someone at risk can prevent tragedy
649
+ - The legal system decided that in extreme situations, saving a life outweighs privacy
650
+
651
+ **It's not personal. It's the structure.**
652
+ """)
653
+
654
+ st.markdown("### What This Means for You")
655
+
656
+ col1, col2 = st.columns(2)
657
+ with col1:
658
+ st.success("""
659
+ ✓ **If you're having suicidal thoughts but you're not actively planning to act on them *right now*—you can talk about them.**
660
+
661
+ ✓ **If you're having violent thoughts but they're intrusive (meaning: unwanted, distressing, not something you're planning)—you can talk about them.**
662
+ """)
663
+ with col2:
664
+ st.warning("""
665
+ ✗ **If you *are* actively planning something—the therapist will likely need to intervene.**
666
+
667
+ And that intervention is meant to keep you (or others) alive, not punish you.
668
+ """)
669
+
670
+ st.markdown("### The Gray Zones (This Is Why It's Scary)")
671
+
672
+ st.markdown("""
673
+ This is where it gets tricky, and why it's scary to disclose:
674
+
675
+ Therapists have to use clinical judgment about what constitutes "immediate danger." That judgment varies.
676
+ Some therapists are more risk-tolerant; others are more cautious.
677
+
678
+ **Factors they consider:**
679
+ - Do you have a plan?
680
+ - Do you have means (access to method)?
681
+ - Have you set a time?
682
+ - Do you have protective factors (reasons to live, people who'd notice)?
683
+ - What's your history? (Past attempts change risk assessment)
684
+ - Are you currently in acute crisis or intoxicated?
685
+ """)
686
+
687
+ st.markdown("### The Fear: \"They'll Lock Me Up\"")
688
+
689
+ st.markdown("""
690
+ Let's be honest about what can happen:
691
+
692
+ - **Most common response:** Safety planning, increased frequency of sessions, possible medication evaluation, family involvement (if you're a minor)
693
+
694
+ - **Sometimes:** A call to your parents/guardians (if you're under 18)
695
+
696
+ - **Rarely but possible:** Voluntary or involuntary hospitalization if the therapist assesses you as being in immediate, severe danger
697
+
698
+ **Hospitalization is generally a last resort, not a first response.** But it does happen, and it can be traumatic.
699
+ This is why understanding the frame *before* you disclose can help you make informed choices about what to share and when.
700
+ """)
701
+
702
+ st.markdown("### What You Can Control")
703
+
704
+ st.info("""
705
+ ✓ **You can ask about confidentiality policies first:**
706
+ *"Before I tell you something, can you explain when you'd have to break confidentiality?"*
707
+
708
+ ✓ **You can test the waters with hypotheticals:**
709
+ *"What would you say if someone told you they were having thoughts about suicide but weren't planning anything?"*
710
+
711
+ ✓ **You can disclose gradually:**
712
+ You don't have to say everything at once. You can share the existence of the thoughts without all the details, and see how the person responds.
713
+
714
+ ✓ **You can ask what would happen:**
715
+ *"If I told you I've been thinking about hurting myself, what would you do?"*
716
+
717
+ ✓ **You can bring someone with you:**
718
+ If you're scared to tell a therapist alone, you can ask a trusted person to be there with you.
719
+ """)
720
+
721
+ def render_module_2_2():
722
+ st.markdown("### A Clear Breakdown")
723
+
724
+ st.markdown("""
725
+ Based on [Lindsay Braman's clinical guide](https://lindsaybraman.com/reasons-therapists-break-confidentiality/),
726
+ here are all the situations where a therapist might legally share information from your sessions:
727
+ """)
728
+
729
+ st.markdown("#### 1. When You're Not Safe with Yourself")
730
+ st.markdown("""
731
+ If you're having active thoughts about seriously harming yourself—and especially if you have a plan,
732
+ means, and timeline—therapists are obligated to help keep you safe. This might involve:
733
+ - Creating a safety plan together
734
+ - Involving family (if you're a minor)
735
+ - Connecting you with higher level of care
736
+ - In rare cases: hospitalization
737
+ """)
738
+
739
+ st.markdown("#### 2. When You're a Danger to Someone Else")
740
+ st.markdown("""
741
+ If you express serious intention to harm an identifiable person, therapists must act.
742
+ This is called "Duty to Warn." They may:
743
+ - Alert law enforcement
744
+ - Warn the person at risk
745
+ - Work with you to de-escalate
746
+ """)
747
+
748
+ st.markdown("#### 3. When a Child or Vulnerable Person is Being Abused")
749
+ st.markdown("""
750
+ If you disclose that you know of ongoing abuse of a child or elderly person, therapists must report it.
751
+ This is "mandatory reporting."
752
+
753
+ **Important nuance:** If you're sharing about abuse *you* experienced in the past, whether it's reportable depends on:
754
+ - Whether the abuser still has access to children
755
+ - Your age and state laws
756
+ - Whether there's ongoing risk
757
+
758
+ **You can ask your therapist about their reporting requirements before you disclose.**
759
+ """)
760
+
761
+ st.markdown("#### 4. When Your Therapist Discusses Your Case with a Supervisor")
762
+ st.markdown("""
763
+ Good therapists get supervision! This helps therapy be more effective. When they consult:
764
+ - They avoid sharing your name and identifying details
765
+ - Supervisors are bound by the same confidentiality rules
766
+ - This is actually a sign of good practice
767
+ """)
768
+
769
+ st.markdown("#### 5. When You Need Emergency Care")
770
+ st.markdown("""
771
+ If a therapist determines you need emergency psychiatric care and you're unable to consent,
772
+ they may need to share information to facilitate hospitalization.
773
+ """)
774
+
775
+ st.markdown("#### 6. When You Request Your Records")
776
+ st.markdown("""
777
+ You have a legal right to access your therapy records. If you ask for them, your therapist must provide them.
778
+ """)
779
+
780
+ st.markdown("#### 7. If You File a Lawsuit Against Your Therapist")
781
+ st.markdown("""
782
+ If you sue your therapist for malpractice or file an ethics complaint,
783
+ they can release information necessary to defend themselves.
784
+ """)
785
+
786
+ st.markdown("#### 8. When a Court Orders Records Released")
787
+ st.markdown("""
788
+ In legal proceedings (custody disputes, criminal cases, personal injury lawsuits),
789
+ a court may order release of therapy records. Therapists will usually contest this,
790
+ but may be legally required to comply.
791
+ """)
792
+
793
+ st.success("""
794
+ **The Bottom Line**
795
+
796
+ Most of therapy *is* confidential. These exceptions exist to protect safety—yours and others'.
797
+ And good therapists will always be transparent about the limits of confidentiality.
798
+
799
+ **You can ask hypothetical questions without triggering a report.**
800
+ **You can take your time building trust.**
801
+ **You have more control than you might think.**
802
+ """)
803
+
804
+ def render_module_2_3():
805
+ st.markdown("### What You Might Be Imagining")
806
+
807
+ st.markdown("""
808
+ If you've never been to therapy, the idea might feel:
809
+ - Clinical and cold
810
+ - Like you'll be judged
811
+ - Like you have to have everything figured out to "do it right"
812
+ - Scary because you'll have to say everything out loud immediately
813
+ """)
814
+
815
+ st.markdown("### What It's Actually Like (When It's Good)")
816
 
817
+ st.markdown("""
818
+ You walk into a room. There's usually a couch or chair. The therapist sits across from you
819
+ (or next to you, depending on the setup).
820
+
821
+ First session usually starts with: *"What brings you here?"*
822
+
823
+ You can say:
824
+ - *"I don't really know where to start"*
825
+ - *"I'm having a really hard time"*
826
+ - *"My parents made me come"*
827
+ - *"I'm scared to be here"*
828
+
829
+ **All of those are fine. Therapists are used to people being nervous.**
830
+ """)
831
+
832
+ st.markdown("### What Happens Next")
833
+
834
+ st.markdown("""
835
+ The therapist will probably ask some questions:
836
+ - How long have you been feeling this way?
837
+ - What's going on in your life right now?
838
+ - Have you felt like this before?
839
+ - Do you have support? People you can talk to?
840
+
841
+ They'll ask screening questions about safety:
842
+ - *"Are you having thoughts about hurting yourself?"*
843
+ - *"Are you having thoughts about hurting someone else?"*
844
+
845
+ **These questions don't mean they think you're dangerous.**
846
+ They're standard questions therapists ask everyone, because they need to assess safety.
847
+ """)
848
+
849
+ st.info("""
850
+ **You Can Say "I'm Not Ready to Talk About That Yet"**
851
+
852
+ Therapy is collaborative. You're allowed to:
853
+ - Set boundaries
854
+ - Say *"I need to trust you more before I share that"*
855
+ - Ask questions back
856
+ - Cry, or not cry
857
+ - Sit in silence
858
+
859
+ Good therapists won't push. They'll follow your pace.
860
+ """)
861
+
862
+ st.markdown("### What Therapy Is Trying to Do")
863
+
864
+ st.markdown("""
865
+ At its core, therapy is:
866
+ - A relationship where you practice being fully seen
867
+ - A place to say the unsayable
868
+ - **Co-regulation:** your nervous system learning it can settle in proximity to another person
869
+ - Slowly building trust that connection can be safe
870
+
871
+ **It's not about "fixing" you. It's about helping you understand yourself, build capacity to hold hard feelings,
872
+ and find ways back toward aliveness.**
873
+ """)
874
+
875
+ st.markdown("### The First Few Sessions Are Weird")
876
+
877
+ st.markdown("""
878
+ It takes time to build trust. The first session might feel awkward, overly formal,
879
+ or like you didn't say what you meant to say.
880
+
881
+ **That's normal.**
882
+
883
+ Therapy gets better as the relationship deepens. Give it 3-4 sessions before deciding if it's the right fit.
884
+ """)
885
+
886
+ st.markdown("### You Can Fire Your Therapist")
887
+
888
+ st.markdown("""
889
+ If it's not working—if you feel judged, misunderstood, or unsafe—you can:
890
+ - Tell them it's not a good fit
891
+ - Just stop going
892
+ - Ask for a referral to someone else
893
+
894
+ **You're not stuck. You're allowed to find someone who gets you.**
895
+ """)
896
+
897
+ def render_module_2_4():
898
+ st.markdown("### The Power of Hypotheticals")
899
+
900
+ st.markdown("""
901
+ You don't have to expose yourself before you know what will happen.
902
+ You can ask *"what if"* questions to test the waters.
903
+
904
+ **Good therapists understand this.** They won't try to trick you.
905
+ They know that hypotheticals are often the first step toward disclosure.
906
+ """)
907
+
908
+ st.markdown("### Examples of Hypothetical Questions")
909
+
910
+ st.info("""
911
+ *"If someone were having thoughts about killing themselves but they weren't actually planning to do it, would you have to report that?"*
912
+
913
+ *"What would happen if a client told you they've been thinking about hurting someone, but it's just thoughts—they're not going to act on them?"*
914
+
915
+ *"If I told you something that happened to me when I was younger, would you have to tell anyone?"*
916
+
917
+ *"What's the difference between talking about suicidal thoughts and being hospitalized?"*
918
+
919
+ *"How do you know when someone needs to go to the hospital?"*
920
+ """)
921
+
922
+ st.markdown("### What Good Responses Sound Like")
923
+
924
+ st.success("""
925
+ A good therapist will:
926
+ - Answer clearly and directly
927
+ - Not pressure you to disclose
928
+ - Acknowledge that you're probably asking for a reason
929
+ - Invite you to share when/if you're ready
930
+
931
+ **Example:** *"I'm glad you're asking. If someone had thoughts about suicide but wasn't actively planning it,
932
+ we could absolutely talk about it without me needing to break confidentiality. We'd work together on a safety plan.
933
+ I'd only need to involve others if I assessed them as being in immediate danger and unable to keep themselves safe.
934
+ Does that make sense? Is there something you've been wanting to talk about?"*
935
+ """)
936
+
937
+ st.markdown("### What Red Flag Responses Sound Like")
938
+
939
+ st.warning("""
940
+ - *"Why are you asking? Are you having these thoughts?"* (pushing before you're ready)
941
+ - *"I can't answer hypotheticals"* (yes they can, they're choosing not to)
942
+ - Vague, evasive answers that don't actually tell you what would happen
943
+ - Immediate alarm or over-reaction
944
+ """)
945
+
946
+ st.markdown("""
947
+ **You Deserve Clear Answers**
948
+
949
+ It's not manipulative to ask hypotheticals. It's smart.
950
+ It's your nervous system checking for safety before it allows you to be vulnerable.
951
+
952
+ Any therapist worth working with will understand that.
953
+ """)
954
+
955
+ # ============================================================
956
+ # PATHWAY 3: RIGHT NOW TOOLS
957
+ # ============================================================
958
+ def render_pathway3():
959
+ if st.button("← Back to Library"):
960
+ go_to('library')
961
+ st.rerun()
962
+
963
+ st.markdown("# Right Now Tools")
964
+ st.markdown("*Grounding When You're in the Storm*")
965
+ st.markdown("---")
966
+
967
+ with st.expander("⚓ Quick Grounding Practices", expanded=False):
968
+ render_module_3_1()
969
+
970
+ with st.expander("📋 Safety Planning", expanded=False):
971
+ render_module_3_2()
972
+
973
+ with st.expander("💚 Self-Compassion Break", expanded=False):
974
+ render_module_3_3()
975
+
976
+ with st.expander("🆘 Crisis Resources (With Context)", expanded=False):
977
+ render_module_3_4()
978
 
979
+ def render_module_3_1():
980
+ st.markdown("### When You're Overwhelmed Right Now")
981
 
982
+ st.markdown("""
983
+ Sometimes you're not looking for understanding. You just need to get through the next 10 minutes.
984
+
985
+ These are body-based practices that help your nervous system downregulate.
986
+ They don't "fix" anything. They just help you come back into your window of tolerance enough to think clearly.
987
+ """)
988
+
989
+ st.markdown("---")
990
+
991
+ st.markdown("#### 5-4-3-2-1 Grounding")
992
+ st.markdown("""
993
+ Name out loud (or in your head):
994
+ - **5 things you can see**
995
+ - **4 things you can touch**
996
+ - **3 things you can hear**
997
+ - **2 things you can smell**
998
+ - **1 thing you can taste**
999
+
1000
+ *This pulls your attention out of your head and into the present moment.*
1001
+ """)
1002
+
1003
+ st.markdown("---")
1004
+
1005
+ st.markdown("#### Cold Water on Your Face")
1006
+ st.markdown("""
1007
+ Fill a bowl with ice water. Dunk your face for 10-15 seconds (or hold an ice pack to your face).
1008
+
1009
+ This activates the "dive reflex"—it literally slows your heart rate and interrupts a panic spiral.
1010
+ **It's one of the fastest ways to shift your nervous system.**
1011
+ """)
1012
+
1013
+ st.markdown("---")
1014
+
1015
+ st.markdown("#### Butterfly Hug (Bilateral Stimulation)")
1016
+ st.markdown("""
1017
+ Cross your arms over your chest. Tap alternating hands on your shoulders (left, right, left, right) for 30 seconds.
1018
+
1019
+ This mimics EMDR (Eye Movement Desensitization and Reprocessing) and can help your brain process overwhelming feelings.
1020
+ """)
1021
+
1022
+ st.markdown("---")
1023
+
1024
+ st.markdown("#### Box Breathing")
1025
+ st.markdown("""
1026
+ - Breathe in for 4 counts
1027
+ - Hold for 4 counts
1028
+ - Breathe out for 4 counts
1029
+ - Hold for 4 counts
1030
+ - Repeat 4 times
1031
+
1032
+ This regulates your autonomic nervous system—specifically, it activates the vagus nerve
1033
+ and tells your body it's safe enough to settle.
1034
+ """)
1035
+
1036
+ st.markdown("---")
1037
+
1038
+ st.markdown("#### Progressive Muscle Relaxation")
1039
+ st.markdown("""
1040
+ Starting with your toes, tense each muscle group for 5 seconds, then release.
1041
+ Move up your body: feet, calves, thighs, stomach, chest, hands, arms, shoulders, face.
1042
+
1043
+ This helps release the physical tension that comes with intense emotions.
1044
+ """)
1045
+
1046
+ st.markdown("---")
1047
+
1048
+ st.info("""
1049
+ **Why These Work**
1050
+
1051
+ When you're dysregulated, your prefrontal cortex (the thinking part of your brain) goes offline.
1052
+ You can't "think your way out" of a panic spiral.
1053
 
1054
+ Body-based practices bypass thinking and speak directly to your nervous system.
1055
+ They're not about "calming down"—they're about coming back online enough to access your resources.
1056
+ """)
1057
 
1058
+ def render_module_3_2():
1059
+ st.markdown("### What a Safety Plan Is")
1060
 
1061
+ st.markdown("""
1062
+ A safety plan is a written list of steps you can take when you're in crisis.
1063
+ It's created when you're NOT in crisis, so that when you are, you don't have to figure out what to do—you just follow the plan.
1064
 
1065
+ **Research shows that having a safety plan significantly reduces the risk of suicide attempts.**
1066
+ """)
1067
 
1068
+ st.markdown("### The Structure (Based on Stanley-Brown Safety Planning)")
1069
 
1070
+ st.markdown("#### Step 1: Warning Signs")
1071
+ st.markdown("""
1072
+ *What tells you that a crisis might be starting?*
1073
 
1074
+ Examples:
1075
+ - Isolating from friends
1076
+ - Not sleeping
1077
+ - Intrusive thoughts getting louder
1078
+ - Feeling numb
1079
+ - Specific triggers (anniversaries, rejection, conflict)
1080
+ """)
1081
 
1082
+ st.markdown("#### Step 2: Internal Coping Strategies")
1083
+ st.markdown("""
1084
+ *Things you can do on your own, without contacting anyone*
1085
+
1086
+ Examples:
1087
+ - Go for a walk
1088
+ - Listen to specific playlist
1089
+ - Take a shower
1090
+ - Draw/paint/write
1091
+ - Watch a specific comforting show
1092
+ - Pet your dog/cat
1093
+ - Use grounding exercises
1094
+ """)
1095
+
1096
+ st.markdown("#### Step 3: People Who Can Distract You")
1097
+ st.markdown("""
1098
+ *Safe people you can be around (even if you don't tell them what's happening)*
1099
 
1100
+ Examples:
1101
+ - Friend you can call to watch a movie
1102
+ - Family member you can sit with
1103
+ - Go to a coffee shop around other people
1104
+ - Join a Discord/gaming session
1105
+ """)
1106
 
1107
+ st.markdown("#### Step 4: People You Can Ask for Help")
1108
+ st.markdown("""
1109
+ *People you trust enough to tell when you're struggling*
1110
 
1111
+ Include:
1112
+ - Name
1113
+ - Phone number
1114
+ - What you might say: *"Hey, I'm having a hard time. Can we talk?"*
1115
+ """)
1116
 
1117
+ st.markdown("#### Step 5: Professionals You Can Contact")
1118
+ st.markdown("""
1119
+ - Therapist name and number
1120
+ - Crisis hotline: 988
1121
+ - Crisis Text Line: text HOME to 741741
1122
+ - Local crisis center
1123
+ - Your doctor
1124
+ """)
1125
+
1126
+ st.markdown("#### Step 6: Making the Environment Safer")
1127
+ st.markdown("""
1128
+ *Reducing access to means*
1129
 
1130
+ This is hard, but important:
1131
+ - If you have a plan involving a specific method, can you remove access?
1132
+ - Can you ask someone to hold medications?
1133
+ - Can you have someone lock up firearms?
1134
+ - Can you delete apps or contacts that make things worse?
1135
 
1136
+ **This isn't about not trusting yourself. It's about making it harder to act impulsively
1137
+ when your prefrontal cortex is offline.**
1138
+ """)
1139
 
1140
+ st.info("""
1141
+ **How to Use Your Safety Plan**
1142
 
1143
+ When you notice warning signs, start at Step 1 and work your way down.
1144
+ You don't have to do everything—just enough to get through.
1145
 
1146
+ **The goal isn't to "fix" the crisis. It's to survive it. To get to tomorrow.**
1147
+ """)
1148
 
1149
+ def render_module_3_3():
1150
+ st.markdown("### A Practice from Kristin Neff")
1151
 
1152
+ st.markdown("When shame or self-hatred is loud, try this:")
1153
 
1154
+ st.markdown("#### Step 1: Acknowledge the Pain")
1155
+ st.markdown("""
1156
+ Place a hand on your heart. Say (out loud or silently):
1157
 
1158
+ *"This is a moment of suffering."*
1159
+ or
1160
+ *"This hurts."*
1161
+ or
1162
+ *"This is really hard right now."*
1163
+ """)
1164
 
1165
+ st.markdown("#### Step 2: Remember Common Humanity")
1166
+ st.markdown("""
1167
+ *"Suffering is part of being human."*
1168
+ or
1169
+ *"I'm not alone in this."*
1170
+ or
1171
+ *"Other people have felt this way too."*
1172
+ """)
1173
+
1174
+ st.markdown("#### Step 3: Offer Yourself Kindness")
1175
+ st.markdown("""
1176
+ *"May I be kind to myself in this moment."*
1177
+ or
1178
+ *"May I give myself the compassion I need."*
1179
+ or
1180
+ *"May I accept myself as I am right now."*
1181
+ """)
1182
 
1183
+ st.info("""
1184
+ **Why This Works**
1185
 
1186
+ Self-compassion activates the caregiving system in your brainthe same neural pathways
1187
+ that light up when you comfort someone else.
1188
 
1189
+ It's not about "feeling better." It's about offering yourself the warmth that shame withholds.
1190
+ """)
 
1191
 
1192
+ st.markdown("### Resonance Version (Sarah Peyton)")
1193
 
1194
+ st.markdown("""
1195
+ <div style="background: #f0fff4; border-left: 4px solid #68d391; padding: 1rem; margin: 1rem 0; border-radius: 0 8px 8px 0;">
1196
+ <p>If the above feels too formal, try speaking directly to the part of you that's struggling:</p>
1197
 
1198
+ <p><em>"Sweetheart, you're in so much pain right now. Your nervous system is overwhelmed.
1199
+ This doesn't mean you're bad. This means you need care. I'm here with you. Even this belongs."</em></p>
1200
 
1201
+ <p>Let the words land in your body. Notice what happens.
1202
+ You might feel resistance, grief, relief, or nothing at all. All of it is okay.</p>
1203
+ </div>
1204
+ """, unsafe_allow_html=True)
1205
 
1206
+ def render_module_3_4():
1207
+ render_crisis_resources()
1208
 
1209
+ def render_crisis_resources():
1210
+ st.markdown("### 988 Suicide & Crisis Lifeline")
1211
+ st.markdown("""
1212
+ - **Call or text 988**
1213
+ - Free, confidential, 24/7
1214
+ - Trained crisis counselors
1215
+ - **What they offer:** Immediate emotional support, safety planning, resources
1216
+ - **What they don't do:** They won't automatically call 911 unless you're in immediate danger and unresponsive
1217
+ - **Good for:** When you need to talk to someone right now
1218
+ """)
1219
+
1220
+ st.markdown("### Crisis Text Line")
1221
+ st.markdown("""
1222
+ - **Text HOME to 741741**
1223
+ - Free, 24/7
1224
+ - Text-based support
1225
+ - **What they offer:** Active listening, de-escalation, resources
1226
+ - **Good for:** If talking feels too hard or you're somewhere you can't call
1227
+ """)
1228
+
1229
+ st.markdown("### Trevor Project (LGBTQ+ Youth)")
1230
+ st.markdown("""
1231
+ - **Call 1-866-488-7386**
1232
+ - **Text START to 678-678**
1233
+ - **What they offer:** Crisis support specifically for LGBTQ+ youth by trained counselors who understand these experiences
1234
+ """)
1235
+
1236
+ st.markdown("### Trans Lifeline")
1237
+ st.markdown("""
1238
+ - **US: 877-565-8860**
1239
+ - **What they offer:** Support by and for trans people, peer support model
1240
+ - **Important:** They have a policy of not calling emergency services without consent
1241
+ """)
1242
+
1243
+ st.markdown("### When to Go to the Emergency Room")
1244
+ st.markdown("""
1245
+ - If you've already taken steps to harm yourself
1246
+ - If you have a plan and feel unable to keep yourself safe
1247
+ - If you're in danger right now
1248
+
1249
+ **What Happens in an ER Psych Evaluation:**
1250
+ - You'll be assessed by a crisis clinician
1251
+ - They'll ask about your safety, history, current state
1252
+ - They'll determine if you need inpatient care
1253
+ - Most people are not hospitalized—you might be referred to outpatient services instead
1254
+ """)
1255
+
1256
+ st.markdown("### Apps That Can Help")
1257
+ st.markdown("""
1258
+ - **notOK:** Press a button, it alerts your pre-selected contacts with your location
1259
+ - **MY3:** Safety planning app with crisis resources
1260
+ - **Calm Harm:** Specifically for self-harm urges
1261
+ - **PTSD Coach:** For trauma-related symptoms
1262
+ """)
1263
+
1264
+ # ============================================================
1265
+ # FINDING THE WORDS (PRACTICE SPACE)
1266
+ # ============================================================
1267
+ def render_finding_words():
1268
+ if st.button("← Back to Library"):
1269
+ go_to('library')
1270
+ st.rerun()
1271
+
1272
+ st.markdown("# Finding the Words")
1273
+ st.markdown("*Practice Disclosure*")
1274
+ st.markdown("---")
1275
+
1276
+ st.markdown("### Why It's So Hard to Tell Someone")
1277
 
1278
+ st.markdown("""
1279
+ If you've learned that your needs are burdensome, that your feelings are too much,
1280
+ or that vulnerability leads to abandonment—of course telling someone feels impossible.
1281
+
1282
+ Your nervous system isn't being difficult. It's being protective.
1283
+ It learned that showing need = danger.
1284
 
1285
+ **By telling someone, you're risking:**
1286
+ - Being fully seen
1287
+ - Having your pain witnessed
1288
+ - Discovering that you're not too much
1289
+ - Learning that connection can survive honesty
1290
 
1291
+ **That's terrifying. And it's also the thing that heals.**
1292
+ """)
 
1293
 
1294
+ st.markdown("---")
1295
 
1296
+ st.markdown("### Practice Space")
1297
 
1298
+ st.info("**This is a private space. Nothing you type here is saved or sent anywhere.** These prompts help you explore what you might want to say.")
1299
 
1300
+ st.markdown("---")
1301
 
1302
+ st.markdown("**If I were to tell someone what's been happening, I might say:**")
1303
+ st.text_area("", key="practice1", height=100, label_visibility="collapsed",
1304
+ placeholder="Type here... this is just for you")
1305
 
1306
+ st.markdown("**The hardest part to put into words is:**")
1307
+ st.text_area("", key="practice2", height=100, label_visibility="collapsed",
1308
+ placeholder="Type here... this is just for you")
 
 
 
 
 
1309
 
1310
+ st.markdown("**What I'm most afraid will happen if I tell:**")
1311
+ st.text_area("", key="practice3", height=100, label_visibility="collapsed",
1312
+ placeholder="Type here... this is just for you")
1313
 
1314
+ st.markdown("**What I need from the person I tell:**")
1315
+ st.text_area("", key="practice4", height=100, label_visibility="collapsed",
1316
+ placeholder="Type here... this is just for you")
 
1317
 
1318
+ st.markdown("**A safer way to start might be:**")
1319
+ st.text_area("", key="practice5", height=100, label_visibility="collapsed",
1320
+ placeholder="Type here... this is just for you")
1321
 
1322
+ st.markdown("---")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1323
 
1324
+ st.markdown("### Starter Scripts")
 
 
 
1325
 
1326
+ st.markdown("**With a therapist:**")
1327
+ st.markdown("""
1328
+ - *"I need to ask you something about confidentiality before I share something."*
1329
+ - *"I've been having some really scary thoughts and I don't know if I should tell you."*
1330
+ - *"Can you explain what would happen if I told you I was thinking about suicide?"*
1331
+ """)
1332
 
1333
+ st.markdown("**With a parent:**")
1334
+ st.markdown("""
1335
+ - *"I need to tell you something and I'm scared you'll freak out."*
1336
+ - *"I've been really struggling and I need help."*
1337
+ - *"Can we talk? I need you to just listen first before you respond."*
1338
+ """)
1339
 
1340
+ st.markdown("**With a friend:**")
1341
+ st.markdown("""
1342
+ - *"I'm going through something really hard and I don't need you to fix it, I just need you to know."*
1343
+ - *"I need to tell you what's been going on. Can you just sit with me?"*
1344
+ """)
1345
 
1346
+ st.markdown("---")
1347
 
1348
+ st.markdown("### After You Tell")
1349
 
1350
+ st.markdown("""
1351
+ You might feel:
1352
+ - Relief
1353
+ - Vulnerability hangover (regret, exposure, shame)
1354
+ - Afraid of how they'll respond
1355
+ - Exhausted
1356
+
1357
+ **All of that is normal.**
1358
+
1359
+ **If they respond well:** Let yourself take it in. Notice that you were seen and didn't die.
1360
+ This is new data for your nervous system.
1361
+
1362
+ **If they respond poorly:** Their response is about them, not you. You were brave. You told the truth.
1363
+ If they couldn't hold it, that's information about their capacity—not your worth.
1364
+
1365
+ **Try again with someone else.**
1366
+ """)
1367
+
1368
+ # ============================================================
1369
+ # SIDEBAR (ALWAYS AVAILABLE)
1370
+ # ============================================================
1371
+ def render_sidebar():
1372
+ with st.sidebar:
1373
+ st.markdown("## ShadowBox")
1374
+ st.markdown("*A Resonant Library for Hard Thoughts*")
1375
+ st.markdown("---")
1376
+
1377
+ if st.button("🏠 Home", use_container_width=True):
1378
+ go_to('landing')
1379
+ st.rerun()
1380
+
1381
+ if st.button("📚 Library", use_container_width=True):
1382
+ go_to('library')
1383
+ st.rerun()
1384
+
1385
+ st.markdown("---")
1386
+ st.markdown("### Pathways")
1387
+
1388
+ if st.button("🧠 Understanding", use_container_width=True):
1389
+ go_to('pathway1')
1390
+ st.rerun()
1391
+
1392
+ if st.button("🔓 If You Tell", use_container_width=True):
1393
+ go_to('pathway2')
1394
+ st.rerun()
1395
+
1396
+ if st.button("⚓ Right Now Tools", use_container_width=True):
1397
+ go_to('pathway3')
1398
+ st.rerun()
1399
+
1400
+ if st.button("✍️ Finding Words", use_container_width=True):
1401
+ go_to('finding_words')
1402
+ st.rerun()
1403
+
1404
+ st.markdown("---")
1405
+ st.markdown("### 🆘 Crisis Resources")
1406
+ st.markdown("""
1407
+ - **988** - Call or text
1408
+ - **741741** - Text HOME
1409
+ - **911** - Emergency
1410
+ """)
1411
+
1412
+ st.markdown("---")
1413
+ st.markdown("""
1414
+ <p style="font-size: 0.8rem; color: #718096;">
1415
+ Created by <a href="http://www.jocelynskillman.com" target="_blank">Jocelyn Skillman, LMHC</a><br><br>
1416
+ <a href="https://jocelynskillmanlmhc.substack.com/" target="_blank">Read more about clinical UX</a>
1417
+ </p>
1418
+ """, unsafe_allow_html=True)
1419
+
1420
+ # ============================================================
1421
+ # MAIN ROUTING
1422
+ # ============================================================
1423
+ def main():
1424
+ render_sidebar()
1425
+
1426
+ page = st.session_state.page
1427
+
1428
+ if page == 'landing':
1429
+ render_landing()
1430
+ elif page == 'welcome':
1431
+ render_welcome()
1432
+ elif page == 'library':
1433
+ render_library()
1434
+ elif page == 'pathway1':
1435
+ render_pathway1()
1436
+ elif page == 'pathway2':
1437
+ render_pathway2()
1438
+ elif page == 'pathway3':
1439
+ render_pathway3()
1440
+ elif page == 'finding_words':
1441
+ render_finding_words()
1442
+ else:
1443
+ render_landing()
1444
+
1445
+ if __name__ == "__main__":
1446
+ main()
requirements.txt CHANGED
@@ -1,7 +1,2 @@
1
- streamlit==1.45.0
2
- anthropic==0.18.1
3
- python-dotenv==1.1.0
4
- pyttsx3==2.98
5
- google-generativeai
6
- gradio # (Agar aap Gradio use kar rahe hain)
7
- openai
 
1
+ streamlit==1.32.0
2
+ python-dotenv==1.0.1