:root {
  --bg-dark: #050505;
  --bg-void: #0a0a0a;
  --bg-toxic: #1a0505;
  --bg-clarity: #020617;
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(15, 23, 42, 0.4);
}
body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-dark);
  color: #e5e5e5;
  overflow-x: hidden;
  line-height: 1.8;
}
h1,
h2,
h3,
h4,
.serif {
  font-family: "Cormorant Garamond", serif;
}
/* Custom Scrollbar for Phone Mockup & Closure Wall */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Typing Indicator Animation (Chat Simulator) */
.typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #9ca3af;
  border-radius: 50%;
  margin: 0 1.5px;
  animation: typing 1.4s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}
.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Red Flag Interactive Term */
.red-flag-term {
  border-bottom: 1.5px double #ef4444;
  cursor: help;
  transition:
    color 0.2s,
    background-color 0.2s;
  padding: 0 2px;
  border-radius: 2px;
}
.red-flag-term:hover {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Zen Mode (Distraction-Free) Overrides */
body.zen-mode {
  background-color: #000000 !important;
}
body.zen-mode .decorative-bg,
body.zen-mode .glow-text,
body.zen-mode #progress-container,
body.zen-mode #audio-toggle {
  display: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
body.zen-mode .glass-panel {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

/* Heart vs Logic Highlights */
.mode-logic-active {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  padding: 2px 6px;
  border-radius: 4px;
  border-left: 2px solid #ef4444;
  font-family: "Inter", sans-serif;
  font-size: 0.9em;
  font-style: normal;
}
.mode-heart-active {
  background-color: rgba(168, 85, 247, 0.15);
  color: #e9d5ff;
  padding: 2px 6px;
  border-radius: 4px;
  border-left: 2px solid #a855f7;
}

/* Blocked Banner Animation */
@keyframes slamIn {
  0% {
    transform: scale(2);
    opacity: 0;
  }
  70% {
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.animate-slam {
  animation: slamIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 1s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
.delay-100 {
  transition-delay: 100ms;
}
.delay-200 {
  transition-delay: 200ms;
}
.delay-300 {
  transition-delay: 300ms;
}
.delay-400 {
  transition-delay: 400ms;
}

.narrative-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 1.5rem;
  position: relative;
}

/* Deep, Dark Storymatic Background Phases */
.bg-phase-intro {
  background: linear-gradient(to bottom, #000000, #0a0a0a);
}
.bg-phase-1 {
  background: linear-gradient(to bottom, #0a0a0a, #111111);
}
.bg-phase-2 {
  background: linear-gradient(to bottom, #111111, #1a0f14);
}
.bg-phase-3 {
  background: linear-gradient(to bottom, #1a0f14, #2a0808);
}
.bg-phase-4 {
  background: linear-gradient(to bottom, #2a0808, #110c22);
}
.bg-phase-5 {
  background: linear-gradient(to bottom, #110c22, #020617);
}
.bg-phase-6 {
  background: linear-gradient(to bottom, #020617, #0f172a);
}
.bg-phase-7 {
  background: linear-gradient(to bottom, #0f172a, #050505);
}

/* Elegant Glass UI Elements */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glow-text {
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.phone-mockup {
  border: 8px solid #111;
  border-radius: 2.5rem;
  background: #000;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}
.message-bubble {
  border-radius: 1.2rem;
  padding: 0.85rem 1.2rem;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.5;
  max-width: 85%;
}
.message-sent {
  background: #3b82f6;
  color: white;
  border-bottom-right-radius: 0.2rem;
  margin-left: auto;
}
.message-received {
  background: #27272a;
  color: #f4f4f5;
  border-bottom-left-radius: 0.2rem;
  margin-right: auto;
  border: 1px solid #3f3f46;
}

.poetry-block {
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  padding-left: 2rem;
  margin: 2rem 0;
  font-style: italic;
}

/* Audio Toggle Button */
#audio-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 50;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}
#audio-toggle:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.playing-indicator {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #3b82f6;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

.quote-mark {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.05);
  position: absolute;
  top: -1rem;
  left: -1rem;
  line-height: 1;
  pointer-events: none;
}


