/* ============================================
   Demo Page - True Precision AI
   ============================================ */

.demo-body {
  margin: 0;
  padding: 0;
  background: #0a0a0a;
  min-height: 100vh;
  font-family: var(--font-family, 'Inter', sans-serif);
  overflow: hidden;
}

/* Progress bar — electric blue to purple, matches logo */
.demo-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(99, 102, 241, 0.2);
  z-index: 9999;
  pointer-events: none;
}

.demo-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stage container - one scene visible at a time */
.demo-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* All scenes stacked, only active one visible */
.demo-scene {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 1;
  transition: opacity 0.8s ease;
}

.demo-scene.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Scene transition: opacity-based (avoid instant display:none during crossfade) */
.demo-scene.scene-exiting {
  opacity: 0;
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.demo-scene.scene-entering {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Scene 1: Lead Sources (Dark theme, dramatic arrival, sequential glow)
   ============================================ */
.demo-scene-leads {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: #0a0a0a;
  position: relative;
  min-height: 100vh;
}

/* Compact wrapper to keep flow centered in viewport */
.demo-scene-leads .demo-leads-content {
  flex: 0 0 auto;
}

/* Headlines wrapper - one visible at a time */
.demo-leads-headlines {
  position: relative;
  min-height: 3.5em;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

/* Dramatic headline - enters first, stays visible throughout */
.demo-leads-dramatic {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  transform: translateY(12px);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  color: white;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.03em;
  max-width: 90%;
  margin: 0 auto;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.6s;
}

.demo-leads-dramatic.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Second headline - "Process chaos at scale." */
.demo-leads-dramatic-2 {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.demo-leads-dramatic-2.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.demo-leads-dramatic-2.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

/* Third headline - "Thousands of conversations enter." */
.demo-leads-dramatic-3 {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.demo-leads-dramatic-3.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.demo-leads-dramatic-3.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

/* Fourth headline - "Appointments Exit." */
.demo-leads-dramatic-4 {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.demo-leads-dramatic-4.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.demo-leads-dramatic.fade-out {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fully hide headlines during/after swap - prevents overlap */
.demo-leads-dramatic.hidden {
  visibility: hidden;
  pointer-events: none;
}

/* Icons + flow content - appears after headline */
.demo-leads-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 640px;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-leads-content.visible {
  opacity: 1;
}

.demo-leads-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 540px;
}

.demo-leads-sources {
  display: flex;
  flex-direction: row;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
}

.demo-lead-card {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 160px;
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
  overflow: hidden;
}

/* Cards animate in only when content is visible - left to right with generous spacing */
.demo-leads-content.visible .demo-lead-card {
  animation: demo-lead-card-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.demo-leads-content.visible .demo-lead-card:nth-child(1) { animation-delay: 0s; }
.demo-leads-content.visible .demo-lead-card:nth-child(2) { animation-delay: 0.5s; }
.demo-leads-content.visible .demo-lead-card:nth-child(3) { animation-delay: 1s; }

@keyframes demo-lead-card-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* EMR-style sequential glow on cards */
.demo-lead-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 18px;
  background: linear-gradient(
    var(--card-glow-angle, 0deg),
    transparent 0%,
    transparent 40%,
    var(--card-glow-color, rgba(139, 92, 246, 0.5)) 45%,
    var(--card-glow-color-bright, rgba(168, 85, 247, 0.8)) 50%,
    var(--card-glow-color, rgba(139, 92, 246, 0.5)) 55%,
    transparent 60%,
    transparent 100%
  );
  opacity: 0;
  z-index: -2;
  transition: opacity 0.5s ease;
}

.demo-lead-card::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  bottom: 1px;
  border-radius: 16px;
  background: rgba(10, 10, 10, 0.9);
  z-index: -1;
}

.demo-lead-card.glow-active::before {
  opacity: 1;
  animation: demo-card-glow-rotate 2.5s linear infinite;
}

@property --card-glow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes demo-card-glow-rotate {
  0% { --card-glow-angle: 0deg; }
  100% { --card-glow-angle: 360deg; }
}

.demo-lead-meta {
  --card-glow-color: rgba(24, 119, 242, 0.5);
  --card-glow-color-bright: rgba(66, 133, 244, 0.9);
}

.demo-lead-meta.glow-active {
  border-color: rgba(24, 119, 242, 0.4);
  box-shadow: inset 0 0 50px rgba(24, 119, 242, 0.08), 0 0 25px rgba(24, 119, 242, 0.15);
}

.demo-lead-google {
  --card-glow-color: rgba(234, 67, 53, 0.45);
  --card-glow-color-bright: rgba(251, 188, 5, 0.85);
}

.demo-lead-google.glow-active {
  border-color: rgba(234, 67, 53, 0.35);
  box-shadow: inset 0 0 50px rgba(234, 67, 53, 0.06), 0 0 25px rgba(251, 188, 5, 0.12);
}

.demo-lead-database {
  --card-glow-color: rgba(139, 92, 246, 0.5);
  --card-glow-color-bright: rgba(168, 85, 247, 0.9);
}

.demo-lead-database.glow-active {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: inset 0 0 50px rgba(139, 92, 246, 0.08), 0 0 25px rgba(168, 85, 247, 0.15);
}

.demo-lead-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.demo-lead-icon svg {
  width: 28px;
  height: 28px;
}

.demo-lead-meta .demo-lead-icon {
  background: #1877f2;
}

.demo-lead-meta.glow-active .demo-lead-icon {
  box-shadow: 0 0 20px rgba(24, 119, 242, 0.6), inset 0 0 12px rgba(255, 255, 255, 0.15);
}

.demo-lead-icon-google {
  background: transparent !important;
  padding: 2px;
}

.demo-lead-icon-google svg {
  width: 34px;
  height: 34px;
}

.demo-lead-google.glow-active .demo-lead-icon-google {
  filter: drop-shadow(0 0 12px rgba(251, 188, 5, 0.5));
}

.demo-lead-database .demo-lead-icon {
  background: rgba(139, 92, 246, 0.9);
}

.demo-lead-database.glow-active .demo-lead-icon {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.6), inset 0 0 12px rgba(255, 255, 255, 0.15);
}

.demo-lead-label {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

/* Flow connector - downward into system, revealed after icons */
.demo-leads-connector {
  position: relative;
  width: 2px;
  height: 56px;
  margin: 0 auto;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.15) 15%, rgba(255,255,255,0.15) 85%, transparent);
  border-radius: 2px;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.6s cubic-bezier(0.34, 1.2, 0.64, 1),
              transform 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.demo-leads-connector.visible {
  opacity: 1;
  transform: translateY(0);
  animation: demo-connector-pulse 2s ease-in-out infinite;
}

.demo-leads-dots {
  position: absolute;
  inset: -4px;
  overflow: visible;
}

.demo-leads-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.95);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.6), 0 0 4px rgba(16, 185, 129, 0.9);
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  animation: demo-leads-dot-flow-down 2.2s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
}

.demo-leads-dot-1 { animation-delay: 0s; }
.demo-leads-dot-2 { animation-delay: 0.4s; }
.demo-leads-dot-3 { animation-delay: 0.8s; }
.demo-leads-dot-4 { animation-delay: 1.2s; }
.demo-leads-dot-5 { animation-delay: 1.6s; }
.demo-leads-dot-6 { animation-delay: 2s; }

@keyframes demo-leads-dot-flow-down {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

@keyframes demo-connector-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

/* Flow always downward - icons top, connector, hub bottom */
@media (min-width: 640px) {
  .demo-leads-flow {
    max-width: 560px;
    gap: 32px;
  }

  .demo-leads-sources {
    gap: 24px;
  }

  .demo-leads-connector {
    height: 64px;
  }
}

/* Destination hub - larger, dark theme, data processing effect */
.demo-leads-destination-hub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 280px;
  min-height: 140px;
  padding: 44px 56px;
  background: linear-gradient(160deg, rgba(10, 12, 18, 0.97), rgba(6, 8, 12, 0.99));
  border-radius: 20px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.34, 1.2, 0.64, 1),
              transform 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Animated border glow - data processing feel */
.demo-leads-destination-hub::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  padding: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(99, 102, 241, 0.4) 20%,
    rgba(139, 92, 246, 0.6) 40%,
    rgba(99, 102, 241, 0.4) 60%,
    transparent 80%
  );
  background-size: 200% 100%;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  animation: demo-hub-border-flow 2.5s linear infinite;
  pointer-events: none;
}

.demo-leads-destination-hub::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

/* Processing overlay elements */
.demo-leads-hub-processing {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 20px;
  pointer-events: none;
}

/* Horizontal scan line - data processing */
.demo-leads-hub-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(99, 102, 241, 0.6),
    rgba(139, 92, 246, 0.9),
    rgba(99, 102, 241, 0.6),
    transparent
  );
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
  animation: demo-hub-scan 2s ease-in-out infinite;
}

/* Subtle grid overlay */
.demo-leads-hub-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  animation: demo-hub-grid-pulse 4s ease-in-out infinite;
}

@keyframes demo-hub-border-flow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes demo-hub-scan {
  0%, 100% { top: 15%; opacity: 0.6; }
  50% { top: 85%; opacity: 1; }
}

@keyframes demo-hub-grid-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.demo-leads-destination-hub.visible {
  opacity: 1;
  transform: translateY(0);
  animation: demo-hub-breathe 2.5s ease-in-out 0.6s infinite;
}

.demo-leads-destination-hub.visible .demo-leads-hub-scan,
.demo-leads-destination-hub.visible .demo-leads-hub-grid {
  opacity: 1;
}

/* Pulsing, glowing processing effect when particles are active */
.demo-leads-destination-hub.processing-active {
  animation: demo-hub-processing-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.4), 0 0 80px rgba(139, 92, 246, 0.2);
}

.demo-leads-destination-hub.processing-active::before {
  animation: demo-hub-border-flow 1.2s linear infinite;
  opacity: 1;
}

.demo-leads-destination-hub.processing-active .demo-leads-hub-scan {
  animation: demo-hub-scan 1.2s ease-in-out infinite;
  opacity: 1;
}

.demo-leads-destination-hub.processing-active .demo-leads-hub-grid {
  animation: demo-hub-grid-pulse 1.5s ease-in-out infinite;
  opacity: 0.9;
}

@keyframes demo-hub-processing-pulse {
  0%, 100% {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.4), 0 0 80px rgba(139, 92, 246, 0.2);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.6), 0 0 120px rgba(139, 92, 246, 0.35);
    filter: brightness(1.08);
  }
}

/* Zoom transition: hub scales up and fills viewport */
.demo-leads-destination-hub {
  transform-origin: center center;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.demo-leads-destination-hub.demo-leads-hub-zooming {
  transform: scale(5);
  animation: none;
  box-shadow: none;
  filter: none;
  transition: transform 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.demo-leads-destination-hub.demo-leads-hub-zooming .demo-leads-hub-scan,
.demo-leads-destination-hub.demo-leads-hub-zooming .demo-leads-hub-grid,
.demo-leads-destination-hub.demo-leads-hub-zooming .demo-leads-hub-particles {
  opacity: 0;
}

/* Appointment cards exit: scale down in place, fade with staggered delay */
.demo-leads-hub-wrapper.zooming .demo-s1-appt-cloud .demo-s1-appt-card {
  opacity: 0;
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  animation: none;
}

.demo-leads-hub-wrapper.zooming .demo-s1-appt-cloud .demo-s1-appt-1 { transform: translate(-50%, -50%) scale(0.4) !important; transition-delay: 0s; }
.demo-leads-hub-wrapper.zooming .demo-s1-appt-cloud .demo-s1-appt-2 { transform: translate(50%, -50%) scale(0.4) !important; transition-delay: 0.04s; }
.demo-leads-hub-wrapper.zooming .demo-s1-appt-cloud .demo-s1-appt-3 { transform: translate(50%, 50%) scale(0.4) !important; transition-delay: 0.08s; }
.demo-leads-hub-wrapper.zooming .demo-s1-appt-cloud .demo-s1-appt-5 { transform: translate(-50%, 50%) scale(0.4) !important; transition-delay: 0.12s; }
.demo-leads-hub-wrapper.zooming .demo-s1-appt-cloud .demo-s1-appt-6 { transform: translate(-50%, -50%) scale(0.4) !important; transition-delay: 0.16s; }
.demo-leads-hub-wrapper.zooming .demo-s1-appt-cloud .demo-s1-appt-7 { transform: translate(50%, -50%) scale(0.4) !important; transition-delay: 0.2s; }
.demo-leads-hub-wrapper.zooming .demo-s1-appt-cloud .demo-s1-appt-8 { transform: translate(-50%, -50%) scale(0.4) !important; transition-delay: 0.24s; }

.demo-leads-hub-wrapper.zooming .demo-s1-appt-cloud {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease 0.5s;
}

.demo-leads-headlines.zoom-fade-out,
.demo-leads-content.zoom-fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/* Hub wrapper - contains chaos clouds + hub */
.demo-leads-hub-wrapper {
  position: relative;
}

/* Scene 1: Chaos clouds overlay outside True Precision hub - sit around it, shake, then enter */
.demo-s1-chaos-cloud {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160%;
  height: 160%;
  transform: translate(-50%, -50%);
  z-index: 20;
  pointer-events: none;
}

.demo-s1-chaos-item {
  position: absolute;
  width: 44px;
  height: 44px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: scale(0);
  transition: all 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Phase 1: Chaos clouds appear around outside of hub */
.demo-s1-chaos-cloud.active .demo-s1-chaos-item {
  opacity: 1;
  transform: scale(1);
}

/* Position chaos items outside the hub (percentages of 160% container) */
.demo-s1-chaos-cloud.active .demo-s1-chaos-phone {
  top: 2%;
  left: 12%;
  animation: demo-s1-chaos-ring 0.4s infinite;
}

.demo-s1-chaos-cloud.active .demo-s1-chaos-sms {
  top: 5%;
  right: 8%;
  animation: demo-s1-chaos-float 3s ease-in-out infinite;
}

.demo-s1-chaos-cloud.active .demo-s1-chaos-email {
  bottom: 12%;
  left: 8%;
  animation: demo-s1-chaos-float 4s ease-in-out infinite 0.5s;
}

.demo-s1-chaos-cloud.active .demo-s1-chaos-voicemail {
  bottom: 5%;
  right: 15%;
  animation: demo-s1-chaos-pulse 1.5s infinite;
}

/* Shake phase: chaos clouds vibrate before entering */
.demo-s1-chaos-cloud.shaking .demo-s1-chaos-item {
  animation: demo-s1-chaos-shake 0.15s ease-in-out infinite !important;
}

.demo-s1-chaos-cloud.shaking .demo-s1-chaos-phone { animation: demo-s1-chaos-shake 0.12s ease-in-out infinite !important; }
.demo-s1-chaos-cloud.shaking .demo-s1-chaos-sms { animation: demo-s1-chaos-shake 0.14s ease-in-out infinite 0.02s !important; }
.demo-s1-chaos-cloud.shaking .demo-s1-chaos-email { animation: demo-s1-chaos-shake 0.13s ease-in-out infinite 0.04s !important; }
.demo-s1-chaos-cloud.shaking .demo-s1-chaos-voicemail { animation: demo-s1-chaos-shake 0.16s ease-in-out infinite 0.01s !important; }

@keyframes demo-s1-chaos-shake {
  0%, 100% { transform: scale(1) translate(0, 0); }
  25% { transform: scale(1) translate(3px, -2px); }
  50% { transform: scale(1) translate(-3px, 2px); }
  75% { transform: scale(1) translate(2px, 3px); }
}

@keyframes demo-s1-chaos-ring {
  0%   { transform: scale(1) translate(0, 0); }
  25%  { transform: scale(1) translate(2px, 2px); }
  50%  { transform: scale(1) translate(-2px, -2px); }
  75%  { transform: scale(1) translate(2px, -2px); }
  100% { transform: scale(1) translate(0, 0); }
}

@keyframes demo-s1-chaos-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-8px) scale(1); }
}

@keyframes demo-s1-chaos-pulse {
  0%   { box-shadow: 0 4px 15px rgba(0,0,0,0.2), 0 0 0 0 rgba(99, 102, 241, 0.3); }
  70%  { box-shadow: 0 4px 15px rgba(0,0,0,0.2), 0 0 0 12px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 4px 15px rgba(0,0,0,0.2), 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Scene 1: Appointment cards pour out of the hub (overlay the card) */
.demo-s1-appt-cloud {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240%;
  height: 240%;
  transform: translate(-50%, -50%);
  z-index: 15;
  pointer-events: none;
  opacity: 1;
}

/* Appointment pills - hero-style, exact same size, all "Sarah M. booked" format */
.demo-s1-appt-card {
  position: absolute;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.05);
  /* Start: inside hub (center) */
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.demo-s1-appt-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  color: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.demo-s1-appt-icon-purple {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.demo-s1-appt-content {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  overflow: hidden;
}

.demo-s1-appt-title {
  font-size: 12px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 2px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-s1-appt-subtitle {
  font-size: 10px;
  color: #86868B;
  line-height: 1.3;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pour out: 8 cards emerge from center in a ring around the hub */
.demo-s1-appt-cloud.pouring .demo-s1-appt-card {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) translateY(0);
}

/* Positions for 8 cards - evenly distributed in a circle */
.demo-s1-appt-cloud.pouring .demo-s1-appt-1 { top: 8% !important; left: 50% !important; transform: translate(-50%, -50%) scale(1); transition-delay: 0.05s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-2 { top: 22% !important; right: 15% !important; left: auto !important; transform: translate(50%, -50%) scale(1); transition-delay: 0.1s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-3 { bottom: 22% !important; right: 15% !important; left: auto !important; transform: translate(50%, 50%) scale(1); transition-delay: 0.15s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-5 { bottom: 22% !important; left: 15% !important; transform: translate(-50%, 50%) scale(1); transition-delay: 0.2s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-6 { top: 22% !important; left: 15% !important; transform: translate(-50%, -50%) scale(1); transition-delay: 0.25s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-7 { top: 35% !important; right: 5% !important; left: auto !important; transform: translate(50%, -50%) scale(1); transition-delay: 0.3s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-8 { top: 35% !important; left: 5% !important; transform: translate(-50%, -50%) scale(1); transition-delay: 0.35s; }

/* Gentle float when poured out */
.demo-s1-appt-cloud.pouring .demo-s1-appt-card {
  animation: demo-s1-appt-float 3s ease-in-out infinite;
}

.demo-s1-appt-cloud.pouring .demo-s1-appt-1 { animation-delay: 0s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-2 { animation-delay: 0.2s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-3 { animation-delay: 0.4s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-5 { animation-delay: 0.6s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-6 { animation-delay: 0.8s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-7 { animation-delay: 1s; }
.demo-s1-appt-cloud.pouring .demo-s1-appt-8 { animation-delay: 1.2s; }

@keyframes demo-s1-appt-float {
  0%, 100% { transform: var(--appt-float-base) translateY(0); }
  50%      { transform: var(--appt-float-base) translateY(-6px); }
}

/* Base transform for each position */
.demo-s1-appt-cloud.pouring .demo-s1-appt-1,
.demo-s1-appt-cloud.pouring .demo-s1-appt-6,
.demo-s1-appt-cloud.pouring .demo-s1-appt-8 { --appt-float-base: translate(-50%, -50%) scale(1); }
.demo-s1-appt-cloud.pouring .demo-s1-appt-2,
.demo-s1-appt-cloud.pouring .demo-s1-appt-7 { --appt-float-base: translate(50%, -50%) scale(1); }
.demo-s1-appt-cloud.pouring .demo-s1-appt-3 { --appt-float-base: translate(50%, 50%) scale(1); }
.demo-s1-appt-cloud.pouring .demo-s1-appt-5 { --appt-float-base: translate(-50%, 50%) scale(1); }

/* Phase 2: Chaos clouds enter the hub (move to center, dissolve into particles) */
.demo-s1-chaos-cloud.entering .demo-s1-chaos-item {
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) scale(0.15);
  opacity: 0;
  animation: none;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Digital particles - inside hub */
.demo-leads-hub-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 20px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.demo-leads-hub-particles.visible {
  opacity: 1;
}

.demo-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(99, 102, 241, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.6);
  animation: demo-particle-float 3s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.18s);
}

/* Random-ish positions via CSS variables */
.demo-particle:nth-child(1)  { left: 15%; top: 20%; --i: 0; }
.demo-particle:nth-child(2)  { left: 85%; top: 25%; --i: 1; }
.demo-particle:nth-child(3)  { left: 25%; top: 70%; --i: 2; }
.demo-particle:nth-child(4)  { left: 75%; top: 65%; --i: 3; }
.demo-particle:nth-child(5)  { left: 45%; top: 15%; --i: 4; }
.demo-particle:nth-child(6)  { left: 55%; top: 80%; --i: 5; }
.demo-particle:nth-child(7)  { left: 10%; top: 50%; --i: 6; }
.demo-particle:nth-child(8)  { left: 90%; top: 45%; --i: 7; }
.demo-particle:nth-child(9)  { left: 30%; top: 40%; --i: 8; }
.demo-particle:nth-child(10) { left: 70%; top: 55%; --i: 9; }
.demo-particle:nth-child(11) { left: 50%; top: 35%; --i: 10; }
.demo-particle:nth-child(12) { left: 20%; top: 85%; --i: 11; }
.demo-particle:nth-child(13) { left: 80%; top: 12%; --i: 12; }
.demo-particle:nth-child(14) { left: 40%; top: 60%; --i: 13; }
.demo-particle:nth-child(15) { left: 60%; top: 30%; --i: 14; }
.demo-particle:nth-child(16) { left: 5%; top: 75%; --i: 15; }

@keyframes demo-particle-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.9;
  }
  25% {
    transform: translate(4px, -6px) scale(1.2);
    opacity: 1;
  }
  50% {
    transform: translate(-3px, 4px) scale(0.9);
    opacity: 0.7;
  }
  75% {
    transform: translate(5px, 2px) scale(1.1);
    opacity: 1;
  }
}

@keyframes demo-hub-breathe {
  0%, 100% {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(99, 102, 241, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }
  50% {
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4),
                0 0 60px rgba(99, 102, 241, 0.2),
                0 0 90px rgba(139, 92, 246, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

.demo-leads-hub-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demo-leads-hub-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.demo-leads-hub-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.demo-leads-hub-content .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: white;
  flex-shrink: 0;
}

.demo-leads-hub-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.98);
}

.demo-leads-hub-sub {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}

.demo-leads-hub-icon {
  margin-left: auto;
  color: rgba(16, 185, 129, 0.8);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .demo-leads-flow {
    max-width: 640px;
    gap: 32px;
  }

  .demo-lead-card {
    min-width: 175px;
    padding: 36px 42px;
  }

  .demo-leads-connector {
    height: 72px;
  }

  .demo-leads-destination-hub {
    min-width: 320px;
    min-height: 160px;
    padding: 52px 64px;
  }

  .demo-leads-hub-title {
    font-size: 1.75rem;
  }

  .demo-leads-hub-sub {
    font-size: 14px;
  }
}

/* ============================================
   Scene 2: Copy — black screen, calm inevitability
   ============================================ */
.demo-scene-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 60px;
  background: #000;
  overflow: hidden;
  position: relative;
  min-height: 100%;
}

.demo-copy-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 90%;
}

.demo-copy-line {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.demo-copy-line-1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  margin-bottom: 0.5em;
}

.demo-copy-line-2 {
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.demo-copy-line-3 {
  margin-top: 1.5em;
}

.demo-copy-line-7 {
  margin-top: 1.5em;
}

.demo-copy-line-8 {
  margin-top: 0.5em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.demo-copy-line.visible {
  opacity: 1;
}

/* ---- Legacy Scene 2 (kept for reference; scene now uses copy above) ---- */
.demo-s2-dramatic {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  color: white;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.03em;
  max-width: 90%;
  margin: clamp(48px, 8vh, 80px) 0 40px 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.demo-s2-dramatic.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Center stage: Interest | Bridge | Appointments ---- */
.demo-s2-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  max-width: 640px;
}

/* Glassmorphism cards — match demo-lead-card style */
.demo-s2-card {
  padding: 28px 36px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.demo-s2-card-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
}

.demo-s2-interest {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), 0 0 24px rgba(99, 102, 241, 0.08);
}

.demo-s2-interest.active {
  transform: scale(1.04);
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), 0 0 40px rgba(99, 102, 241, 0.2), 0 0 80px rgba(99, 102, 241, 0.08);
}

.demo-s2-appointments {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), 0 0 24px rgba(16, 185, 129, 0.06);
}

.demo-s2-appointments.reached {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), 0 0 40px rgba(16, 185, 129, 0.2), 0 0 80px rgba(16, 185, 129, 0.08);
}

/* Bridge between cards — flowing dots (like Scene 1's flow) */
.demo-s2-bridge {
  flex: 1;
  min-width: 100px;
  max-width: 200px;
  height: 64px;
  position: relative;
  margin: 0 -1px;
}

.demo-s2-bridge-dots {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.demo-s2-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.95);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.6), 0 0 4px rgba(139, 92, 246, 0.9);
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  animation: demo-s2-dot-flow 2.2s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
}

.demo-s2-dot-1 { animation-delay: 0s; }
.demo-s2-dot-2 { animation-delay: 0.4s; }
.demo-s2-dot-3 { animation-delay: 0.8s; }
.demo-s2-dot-4 { animation-delay: 1.2s; }
.demo-s2-dot-5 { animation-delay: 1.6s; }
.demo-s2-dot-6 { animation-delay: 2s; }

@keyframes demo-s2-dot-flow {
  0%   { left: 0; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* Lead signals (dots that stall or cross) */
.demo-s2-signal {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(139, 92, 246, 1), rgba(99, 102, 241, 0.8));
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.7), 0 0 20px rgba(99, 102, 241, 0.3);
  opacity: 0;
  left: 0;
}

.demo-s2-signal.stall {
  animation: demo-s2-sig-stall 1.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.demo-s2-signal.cross {
  animation: demo-s2-sig-cross 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes demo-s2-sig-stall {
  0%   { left: 0; opacity: 1; }
  40%  { left: 48%; opacity: 1; }
  60%  { left: 52%; opacity: 0.9; }
  100% { left: 50%; opacity: 0.25; transform: translateY(-50%) scale(0.6); }
}

@keyframes demo-s2-sig-cross {
  0%   { left: 0; opacity: 1; }
  100% { left: calc(100% - 10px); opacity: 1; }
}

.demo-s2-signal-success.visible {
  animation: demo-s2-sig-cross 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ---- iPhone from hero + Chaos clouds (Phase C) ---- */
.demo-s2-iphone-composition {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.demo-s2-iphone-composition.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Inner wrapper — matches hero iphone-composition structure */
.demo-s2-iphone-inner {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.demo-s2-iphone-frame-img {
  display: block;
  width: 100%;
  position: relative;
  z-index: 10;
  pointer-events: none;
}

/* Screen mask — clips OLivia chat to iPhone screen (hero dimensions) */
.demo-s2-screen-mask {
  position: absolute;
  z-index: 20;
  overflow: hidden;
  left: 19.5%;
  top: 1.15%;
  width: 58%;
  height: 95.75%;
  border-radius: 16% / 7%;
  background-color: #0a0a0a;
}

.demo-s2-screen-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  overflow-y: auto;
}

.demo-s2-iphone-header {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.demo-s2-iphone-time {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

.demo-s2-iphone-olivia {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.demo-s2-iphone-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(16, 185, 129, 0.4);
}

.demo-s2-iphone-name {
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.demo-s2-iphone-online {
  font-size: 10px;
  color: #10b981;
}

.demo-s2-iphone-chat {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.demo-s2-iphone-msg {
  max-width: 90%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 11px;
  line-height: 1.35;
}

.demo-s2-iphone-msg-user {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.demo-s2-iphone-msg-olivia {
  align-self: flex-end;
  background: #3b82f6;
  color: white;
}

/* Chaos clouds — 4 items, animated like user's example */
.demo-s2-chaos-cloud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
}

.demo-s2-chaos-item {
  position: absolute;
  width: 50px;
  height: 50px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: scale(0) translate(0, 0);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.demo-s2-chaos-cloud.active .demo-s2-chaos-item {
  opacity: 1;
}

/* Phone: top-left, vibrating/ringing */
.demo-s2-chaos-cloud.active .demo-s2-chaos-phone {
  top: 15%;
  left: -20px;
  transform: scale(1) rotate(-10deg);
  animation: demo-s2-chaos-ring 0.4s infinite;
}

/* SMS: top-right, floating */
.demo-s2-chaos-cloud.active .demo-s2-chaos-sms {
  top: 25%;
  right: -25px;
  transform: scale(1) rotate(10deg);
  animation: demo-s2-chaos-float-sms 3s ease-in-out infinite;
  animation-delay: 0.2s;
}

/* Email: bottom-left, floating */
.demo-s2-chaos-cloud.active .demo-s2-chaos-email {
  bottom: 30%;
  left: -15px;
  transform: scale(1) rotate(-5deg);
  animation: demo-s2-chaos-float-email 4s ease-in-out infinite;
  animation-delay: 0.5s;
}

/* Voicemail: bottom-right, pulsing */
.demo-s2-chaos-cloud.active .demo-s2-chaos-voicemail {
  bottom: 20%;
  right: -10px;
  transform: scale(1) rotate(5deg);
  animation: demo-s2-chaos-pulse 1.5s infinite;
}

@keyframes demo-s2-chaos-ring {
  0%   { transform: scale(1) rotate(-10deg) translate(0, 0); }
  25%  { transform: scale(1) rotate(10deg) translate(2px, 2px); }
  50%  { transform: scale(1) rotate(-10deg) translate(-2px, -2px); }
  75%  { transform: scale(1) rotate(10deg) translate(2px, -2px); }
  100% { transform: scale(1) rotate(-10deg) translate(0, 0); }
}

@keyframes demo-s2-chaos-float-sms {
  0%, 100% { transform: translateY(0) scale(1) rotate(10deg); }
  50%      { transform: translateY(-10px) scale(1) rotate(10deg); }
}

@keyframes demo-s2-chaos-float-email {
  0%, 100% { transform: translateY(0) scale(1) rotate(-5deg); }
  50%      { transform: translateY(-10px) scale(1) rotate(-5deg); }
}

@keyframes demo-s2-chaos-pulse {
  0%   { box-shadow: 0 4px 15px rgba(0,0,0,0.2), 0 0 0 0 rgba(255, 59, 48, 0.4); }
  70%  { box-shadow: 0 4px 15px rgba(0,0,0,0.2), 0 0 0 10px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 4px 15px rgba(0,0,0,0.2), 0 0 0 0 rgba(255, 59, 48, 0); }
}

@media (max-width: 768px) {
  .demo-s2-chaos-cloud.active .demo-s2-chaos-phone { left: -10px; }
  .demo-s2-chaos-cloud.active .demo-s2-chaos-sms { right: -10px; }
  .demo-s2-chaos-cloud.active .demo-s2-chaos-email { left: -5px; }
  .demo-s2-chaos-cloud.active .demo-s2-chaos-voicemail { right: -5px; }
}

/* Phase D: Engage → Qualify → Schedule */
.demo-s2-process {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.demo-s2-process.visible {
  opacity: 1;
}

.demo-s2-process-words {
  display: flex;
  gap: 24px;
}

.demo-s2-process-word {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.25);
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.demo-s2-process-word.active {
  color: rgba(139, 92, 246, 1);
  text-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

.demo-s2-inquiry-card {
  width: 90px;
  height: 28px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.demo-s2-inquiry-card.visible {
  opacity: 1;
  animation: demo-s2-inquiry-enter 0.5s ease;
}

@keyframes demo-s2-inquiry-enter {
  0% { transform: translateX(-30px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.demo-s2-appt-confirmed {
  font-size: 0.95rem;
  font-weight: 700;
  color: #10b981;
  padding: 14px 24px;
  background: rgba(16, 185, 129, 0.12);
  backdrop-filter: blur(16px);
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.demo-s2-appt-confirmed.visible {
  opacity: 1;
}

/* Phase E: X-ray overlay */
.demo-s2-xray {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 300px;
  padding: 18px 22px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 12px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  box-shadow: 0 0 32px rgba(139, 92, 246, 0.12);
}

.demo-s2-xray.visible {
  opacity: 1;
}

.demo-s2-xray-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.demo-s2-xray-row {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.demo-s2-xray-key {
  color: rgba(139, 92, 246, 0.7);
  margin-right: 4px;
}

.demo-s2-xray-cues {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-s2-xray-waveform {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}

.demo-s2-xray-waveform span {
  width: 3px;
  min-height: 5px;
  background: rgba(139, 92, 246, 0.6);
  border-radius: 2px;
  animation: demo-s2-wave 1s ease-in-out infinite;
}

.demo-s2-xray-waveform span:nth-child(1) { animation-delay: 0s; }
.demo-s2-xray-waveform span:nth-child(2) { animation-delay: 0.12s; }
.demo-s2-xray-waveform span:nth-child(3) { animation-delay: 0.24s; }
.demo-s2-xray-waveform span:nth-child(4) { animation-delay: 0.36s; }
.demo-s2-xray-waveform span:nth-child(5) { animation-delay: 0.48s; }

@keyframes demo-s2-wave {
  0%, 100% { height: 5px; }
  50% { height: 15px; }
}

.demo-s2-xray-bubble {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================
   Scene 3: SMS Conversation
   ============================================ */
.demo-scene-sms {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #0a0a0a;
}

.demo-sms-eyebrow {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 24px;
}

.demo-sms-phone {
  width: 100%;
  max-width: 360px;
  background: #1a1a1a;
  border-radius: 28px;
  overflow: hidden;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.demo-sms-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-sms-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.demo-sms-name {
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.demo-sms-online {
  font-size: 12px;
  color: #10b981;
  margin-left: auto;
}

.demo-sms-chat {
  flex: 1;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.demo-sms-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.demo-sms-msg.visible {
  opacity: 1;
  transform: translateY(0);
}

.demo-sms-user {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.demo-sms-olivia {
  align-self: flex-end;
  background: #3b82f6;
  color: white;
}

/* ============================================
   Scene 4: Voice Demo
   ============================================ */
.demo-scene-voice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: #0a0a0a;
}

.demo-voice-eyebrow {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
}

.demo-voice-headline {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 48px;
}

.demo-voice-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}

.demo-voice-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.demo-voice-waveform {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
}

.demo-voice-waveform span {
  width: 4px;
  height: 12px;
  background: linear-gradient(180deg, #8b5cf6, #3b82f6);
  border-radius: 2px;
  animation: demo-waveform 1s ease-in-out infinite;
}

.demo-voice-waveform span:nth-child(1) { animation-delay: 0s; }
.demo-voice-waveform span:nth-child(2) { animation-delay: 0.1s; }
.demo-voice-waveform span:nth-child(3) { animation-delay: 0.2s; }
.demo-voice-waveform span:nth-child(4) { animation-delay: 0.1s; }
.demo-voice-waveform span:nth-child(5) { animation-delay: 0s; }
.demo-voice-waveform span:nth-child(6) { animation-delay: 0.1s; }
.demo-voice-waveform span:nth-child(7) { animation-delay: 0.2s; }
.demo-voice-waveform span:nth-child(8) { animation-delay: 0.1s; }
.demo-voice-waveform span:nth-child(9) { animation-delay: 0s; }
.demo-voice-waveform span:nth-child(10) { animation-delay: 0.1s; }

@keyframes demo-waveform {
  0%, 100% { height: 12px; }
  50% { height: 28px; }
}

.demo-voice-transcript {
  max-width: 400px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-voice-line {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 8px;
  line-height: 1.5;
}

.demo-voice-line:last-child {
  margin-bottom: 0;
}

/* ============================================
   Scene 5: Referral View
   ============================================ */
.demo-scene-referral {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(48px, 8vh, 80px) 20px clamp(48px, 6vh, 64px);
  background: #0a0a0a;
  position: relative;
  min-height: 100vh;
  overflow-y: auto;
}

.demo-referral-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 100%;
  max-width: 100%;
}

.demo-referral-stage.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Bridge headline — dark screen between cards and login */
.demo-referral-bridge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.demo-referral-bridge.visible {
  opacity: 1;
}

.demo-referral-bridge-headline {
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 90%;
}

/* Headline above notifications */
.demo-referral-eyebrow {
  font-size: clamp(1.1rem, 3vw, 1.75rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.97);
  text-align: center;
  margin: 0 0 clamp(32px, 5vh, 48px) 0;
  letter-spacing: -0.025em;
  line-height: 1.3;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.demo-referral-eyebrow.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Each item: headline + card */
.demo-referral-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: clamp(24px, 4vh, 36px);
}

.demo-referral-item:last-child {
  margin-bottom: 0;
}

/* Card headline — appears first, Apple-style typography */
.demo-referral-headline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.demo-referral-headline.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Notification cards container */
.demo-referral-notifications {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 480px;
  width: 100%;
  margin-bottom: 32px;
}

.demo-notification-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left-width: 3px;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
  will-change: opacity, transform;
}

/* Colored accent per card type */
.demo-notification-1 { border-left-color: rgba(59, 130, 246, 0.6); }
.demo-notification-2 { border-left-color: rgba(139, 92, 246, 0.6); }
.demo-notification-3 { border-left-color: rgba(16, 185, 129, 0.6); }
.demo-notification-4 { border-left-color: rgba(245, 158, 11, 0.6); }

/* Glow on reveal — refined pulse when card becomes visible */
.demo-notification-card.glow-active {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 32px rgba(99, 102, 241, 0.12), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}
.demo-notification-1.glow-active { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 28px rgba(59, 130, 246, 0.18), 0 1px 0 rgba(255, 255, 255, 0.08) inset; }
.demo-notification-2.glow-active { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 28px rgba(139, 92, 246, 0.18), 0 1px 0 rgba(255, 255, 255, 0.08) inset; }
.demo-notification-3.glow-active { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 28px rgba(16, 185, 129, 0.18), 0 1px 0 rgba(255, 255, 255, 0.08) inset; }
.demo-notification-4.glow-active { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 28px rgba(245, 158, 11, 0.18), 0 1px 0 rgba(255, 255, 255, 0.08) inset; }

.demo-notification-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.demo-notification-card:not(.visible) {
  opacity: 0 !important;
  pointer-events: none;
}

.demo-notification-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 0;
}

.demo-notification-field {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.demo-notification-field strong {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  margin-right: 6px;
}

.demo-notification-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  line-height: 1.45;
}

/* Mobile: compact cards to fit viewport */
@media (max-width: 640px) {
  .demo-scene-referral {
    padding: clamp(32px, 6vh, 48px) 16px 32px;
  }

  .demo-referral-eyebrow {
    font-size: 1.1rem;
    margin-bottom: 24px;
    padding-bottom: 12px;
  }

  .demo-referral-item {
    margin-bottom: 20px;
  }

  .demo-referral-headline {
    font-size: 1rem;
  }

  .demo-referral-notifications {
    max-width: 100%;
    margin-bottom: 24px;
  }

  .demo-notification-card {
    padding: 14px 16px;
    gap: 6px;
    border-radius: 10px;
  }

  .demo-notification-fields {
    gap: 5px;
  }

  .demo-notification-field {
    font-size: 11px;
  }

  .demo-notification-note {
    font-size: 10px;
  }

  /* GHL UI — mobile optimizations (desktop/tablet unchanged) */
  .demo-scene-ghl .demo-sidebar {
    display: none;
  }

  .demo-scene-ghl .demo-main {
    flex: 1;
    min-width: 0;
  }

  .demo-header {
    padding: 12px 16px;
  }

  .demo-header-right .demo-header-icon-circle:nth-child(n+4) {
    display: none;
  }

  .demo-content {
    padding: 16px;
  }

  .demo-content-header {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }

  .demo-add-btn {
    width: 100%;
  }

  .demo-table-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .demo-toolbar-spacer {
    display: none;
  }

  .demo-table-search {
    width: 100%;
  }

  .demo-ghl-view.demo-tour-active.demo-tour-focus-table,
  .demo-ghl-view.demo-tour-active.demo-tour-focus-sidebar {
    transform: none !important;
  }

  .demo-table th:nth-child(n+6),
  .demo-table td:nth-child(n+6) {
    display: none;
  }

  .demo-table th,
  .demo-table td {
    padding: 10px 12px;
    font-size: 12px;
  }

  .demo-edit-panel {
    width: 100%;
  }

  .demo-edit-fields {
    padding: 16px;
  }
}

.referral-header {
  background: #1a1a1a;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.referral-header .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: white;
}

.referral-header .logo-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.referral-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
  padding: 24px 24px 8px;
  margin: 0;
}

.referral-action {
  color: #ef4444;
  font-weight: 600;
  padding: 0 24px 8px;
  margin: 0;
}

.referral-intro {
  color: #666;
  font-size: 14px;
  padding: 0 24px 20px;
  margin: 0;
  line-height: 1.5;
}

.referral-section {
  padding: 16px 24px;
  border-top: 1px solid #eee;
}

.referral-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #000;
  margin: 0 0 12px;
}

.referral-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.referral-field {
  font-size: 14px;
  color: #333;
}

.referral-section-highlight {
  background: #fef9e7;
}

.referral-note {
  font-size: 13px;
  color: #555;
  margin: 8px 0 0;
  line-height: 1.5;
}

.referral-checklist {
  margin: 0;
  padding-left: 20px;
  list-style: none;
}

.referral-checklist li {
  font-size: 14px;
  color: #333;
  margin-bottom: 6px;
}

.referral-checklist li::before {
  content: '[] ';
  font-weight: 500;
}

/* ============================================
   Scene 2: Login Page
   ============================================ */
.demo-scene-login {
  display: flex;
  flex-direction: column;
  background: #f5f8fa;
  position: relative;
  min-height: 100%;
}

/* Floating narrative card - above login form, clear of form fields */
.demo-login-narrative {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.72) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06), 0 2px 12px rgba(0, 0, 0, 0.04), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 340px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
  z-index: 10;
}

.demo-login-narrative.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.demo-login-narrative-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #34C759 0%, #2da84a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(52, 199, 89, 0.3), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.demo-login-narrative-content {
  flex: 1;
  min-width: 0;
}

.demo-login-narrative-title {
  font-size: 13px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 3px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.demo-login-narrative-headline {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  color: #1D1D1F;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 0;
}

.demo-login-narrative-text {
  font-size: 12px;
  color: #86868B;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.demo-login-page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.demo-login-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: #ffffff;
}

.demo-login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-login-logo-icon {
  width: 40px;
  height: 40px;
  background: #1a1a1a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
}

.demo-login-logo-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a1a1a;
}

.demo-login-lang {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #4a5568;
}

.demo-login-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  font-size: 14px;
}

.demo-login-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.demo-login-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 32px;
  text-align: center;
}

.demo-login-field {
  width: 100%;
  max-width: 380px;
  margin-bottom: 20px;
}

.demo-login-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
  margin-bottom: 8px;
}

.demo-login-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  background: white;
  box-sizing: border-box;
}

.demo-login-password-wrap {
  position: relative;
}

.demo-login-password-wrap .demo-login-input {
  padding-right: 44px;
}

.demo-login-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.6;
}

.demo-login-forgot {
  display: block;
  text-align: right;
  max-width: 380px;
  width: 100%;
  margin-bottom: 24px;
  font-size: 14px;
  color: #3b82f6;
  text-decoration: none;
}

.demo-login-btn {
  width: 100%;
  max-width: 380px;
  padding: 14px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.demo-login-terms {
  margin-top: 24px;
  font-size: 13px;
  color: #718096;
  text-align: center;
}

.demo-login-terms a {
  color: #3b82f6;
  text-decoration: none;
}

/* ============================================
   GHL UI View — Epic Premium Reveal
   ============================================ */
.demo-scene-ghl {
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  opacity: 0;
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.demo-scene-ghl.reveal-active {
  opacity: 1;
}

.demo-scene-ghl .demo-ghl-view {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Staggered reveal: sidebar slides in, then main content — premium easing */
.demo-scene-ghl .demo-sidebar {
  transform: translateX(-100%);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-scene-ghl.reveal-active .demo-sidebar {
  transform: translateX(0);
}

.demo-scene-ghl .demo-main {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.25s cubic-bezier(0.16, 1, 0.3, 1) 0.4s,
              transform 1.25s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}

.demo-scene-ghl.reveal-active .demo-main {
  opacity: 1;
  transform: translateY(0);
}

/* Scale-in container for premium feel */
.demo-scene-ghl .demo-ghl-view {
  transform: scale(0.985);
  transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-scene-ghl.reveal-active .demo-ghl-view {
  transform: scale(1);
}

/* Delay sidebar/main until container is visible */
.demo-scene-ghl .demo-sidebar {
  transition-delay: 0.2s;
}

.demo-scene-ghl.reveal-active .demo-sidebar {
  transition-delay: 0s;
}

.demo-scene-ghl .demo-main {
  transition-delay: 0.5s, 0.5s;
}

.demo-scene-ghl.reveal-active .demo-main {
  transition-delay: 0.45s, 0.45s;
}

/* Sidebar - Dark theme consistent with website */
.demo-sidebar {
  width: 220px;
  background: #0a0a0a;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.demo-sidebar-profile {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-profile-location {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.demo-sidebar-search {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.04);
  margin: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-search-icon {
  font-size: 12px;
  opacity: 0.7;
}

.demo-search-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.demo-search-plus {
  color: #10b981;
  font-weight: 600;
}

.demo-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
}

.demo-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 12px;
  margin-bottom: 4px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.95);
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.demo-nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.2);
}

.demo-nav-icon {
  font-size: 15px;
  opacity: 0.9;
}

/* Main Content Area */
.demo-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
}

.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.demo-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.demo-header-left .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: white;
}

.demo-header-left .logo-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a202c;
}

.demo-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-header-icon {
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.demo-header-icon svg {
  flex-shrink: 0;
}

/* Colored circular icon backgrounds */
.demo-header-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.demo-header-icon-phone {
  background: #22c55e;
}

.demo-header-icon-sparkle {
  background: #3b82f6;
}

.demo-header-icon-megaphone {
  background: #14b8a6;
}

.demo-header-icon-bell {
  background: #f97316;
}

.demo-header-icon-help {
  background: #38bdf8;
}

.demo-header-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid white;
}

.demo-header-badge-red {
  background: #ef4444;
}

.demo-header-badge-yellow {
  background: #eab308;
}

.demo-avatar {
  width: 36px;
  height: 36px;
  background: #a855f7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.demo-content {
  flex: 1;
  padding: 24px;
  overflow: auto;
}

.demo-content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.demo-content-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 4px;
}

.demo-content-count {
  font-size: 14px;
  color: #718096;
  margin: 0;
}

.demo-add-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-add-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.demo-table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.demo-toolbar-btn {
  padding: 8px 14px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-toolbar-btn:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-color: rgba(99, 102, 241, 0.2);
}

.demo-toolbar-spacer {
  flex: 1;
}

.demo-table-search {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  width: 200px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-table-search:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.demo-table-wrapper {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 200px;
}

.demo-table-wrapper:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}


.demo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.demo-table th {
  text-align: left;
  padding: 12px 16px;
  background: #f7fafc;
  font-weight: 600;
  color: #4a5568;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

/* New appointment arrival animation */
.demo-table-wrapper.demo-appt-arrivals-active .demo-table-row:not(.demo-appt-new-arrival) {
  filter: blur(4px);
  opacity: 0.4;
  transition: filter 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-table-wrapper.demo-appt-arrivals-active.demo-appt-refocused .demo-table-row:not(.demo-appt-new-arrival) {
  filter: blur(0);
  opacity: 1;
}

/* Premium arrival — slow, deliberate, elegant */
.demo-appt-new-arrival {
  opacity: 0;
  transform: translateY(-24px) scale(0.98);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-appt-new-arrival.demo-appt-arrived {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.demo-appt-new-arrival.demo-appt-arrived.demo-appt-highlight {
  background: rgba(99, 102, 241, 0.1) !important;
  box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.3), 0 4px 20px rgba(99, 102, 241, 0.08);
  transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Status column — one line */
.demo-table th:nth-child(2),
.demo-table td:nth-child(2) {
  min-width: 140px;
}

/* DOB column slightly wider */
.demo-table th:nth-child(7),
.demo-table td:nth-child(7) {
  min-width: 110px;
}

/* Premium clarity highlight — Updated By, Notes, Updated At (soft, visible, no hard edges) */
.demo-table td.demo-tour-clarity-highlight {
  background: rgba(99, 102, 241, 0.1) !important;
  box-shadow: inset 0 0 32px rgba(99, 102, 241, 0.08);
  transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: #2d3748;
}

.demo-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.demo-table tbody tr {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.04);
}

.demo-table-row {
  cursor: pointer;
}

.demo-table-row.selected {
  background: rgba(99, 102, 241, 0.08) !important;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

/* Status dots */
.demo-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.demo-status-green { background: #22c55e; }
.demo-status-yellow { background: #eab308; }
.demo-status-purple { background: #a855f7; }
.demo-status-red { background: #ef4444; }
.demo-status-blue { background: #3b82f6; }

/* ============================================
   Edit Sidebar
   ============================================ */
.demo-edit-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  pointer-events: none;
}

.demo-edit-sidebar:not(.hidden) {
  pointer-events: auto;
}

.demo-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-edit-sidebar:not(.hidden) .demo-edit-overlay {
  opacity: 1;
}

.demo-edit-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100%;
  height: 100%;
  background: #2d3748;
  color: #e2e8f0;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.demo-edit-sidebar:not(.hidden) .demo-edit-panel {
  transform: translateX(0);
}

.demo-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-edit-close {
  background: none;
  border: none;
  color: #e2e8f0;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.demo-edit-more {
  font-size: 20px;
  cursor: pointer;
}

.demo-edit-title {
  font-size: 1.25rem;
  font-weight: 600;
  padding: 16px 20px;
  margin: 0;
  color: white;
}

.demo-edit-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-edit-field-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.demo-edit-add-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.demo-edit-tabs {
  padding: 12px 20px;
}

.demo-edit-tab {
  font-size: 14px;
  color: #63b3ed;
  cursor: pointer;
}

.demo-edit-tab.active {
  font-weight: 600;
}

.demo-edit-checkbox {
  display: block;
  padding: 8px 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.demo-edit-fields {
  padding: 20px;
  flex: 1;
}

.demo-edit-field-group {
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin: 0 0 16px;
}

.demo-edit-field {
  margin-bottom: 16px;
}

.demo-edit-field label {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}

.demo-edit-field .required {
  color: #ef4444;
}

.demo-edit-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: white;
  font-size: 14px;
}

.demo-edit-input:focus {
  outline: none;
  border-color: #63b3ed;
}

.demo-edit-textarea {
  resize: vertical;
  min-height: 72px;
}

/* Status dropdown */
.demo-status-dropdown {
  position: relative;
}

.demo-status-trigger {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-status-trigger:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.demo-status-arrow {
  margin-left: auto;
  font-size: 10px;
  opacity: 0.7;
}

.demo-status-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #1a202c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10;
  max-height: 240px;
  overflow-y: auto;
}

.demo-status-menu.hidden {
  display: none !important;
}

.demo-status-option {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.demo-status-option:last-child {
  border-bottom: none;
}

.demo-status-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.demo-edit-actions {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-edit-cancel {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 14px;
  cursor: pointer;
}

.demo-edit-save {
  flex: 1;
  padding: 12px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-edit-save:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

/* ============================================
   Advanced Filters Sidebar
   ============================================ */
.demo-filters-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1002;
  pointer-events: none;
}

.demo-filters-sidebar:not(.hidden) {
  pointer-events: auto;
}

.demo-filters-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-filters-sidebar:not(.hidden) .demo-filters-overlay {
  opacity: 1;
}

.demo-filters-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100%;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.demo-filters-sidebar:not(.hidden) .demo-filters-panel {
  transform: translateX(0);
}

.demo-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.demo-filters-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a202c;
  margin: 0;
}

.demo-filters-close {
  background: none;
  border: none;
  color: #4a5568;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.demo-filters-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.demo-filters-search-icon {
  font-size: 14px;
  opacity: 0.6;
}

.demo-filters-search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
}

.demo-filters-section {
  padding: 20px;
  flex: 1;
  overflow: visible;
}

.demo-filters-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  margin: 0 0 12px;
}

.demo-filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-filters-field-label {
  font-size: 13px;
  color: #4a5568;
  min-width: 80px;
}

.demo-filters-select {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}

.demo-filters-dropdown-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
  overflow: visible;
}

.demo-filters-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #2d3748;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-filters-trigger:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.demo-filters-arrow {
  font-size: 10px;
  opacity: 0.6;
}

.demo-filters-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 100;
  max-height: none;
  overflow: visible;
  min-width: 100%;
}

.demo-filters-menu.hidden {
  display: none !important;
}

.demo-filters-option {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-size: 14px;
  color: #2d3748;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.demo-filters-option:last-child {
  border-bottom: none;
}

.demo-filters-option:hover {
  background: #f7fafc;
}

.demo-filters-option .demo-status {
  flex-shrink: 0;
  margin-right: 10px;
}

.demo-filters-delete {
  font-size: 14px;
  cursor: pointer;
  opacity: 0.5;
}

.demo-filters-actions {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid #e2e8f0;
}

.demo-filters-clear {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #4a5568;
  font-size: 14px;
  cursor: pointer;
}

.demo-filters-cancel {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #4a5568;
  font-size: 14px;
  cursor: pointer;
}

.demo-filters-apply {
  flex: 1;
  padding: 10px 16px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-filters-apply:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

/* Filtered rows — collapse with no whitespace */
.demo-table.demo-filter-active .demo-table-row.demo-filtered-out {
  display: none;
}

/* ============================================
   Demo Cursor (guided tour) — Professional: slow, deliberate, intentional
   ============================================ */
.demo-cursor {
  position: fixed;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 1300;
  /* Slow, deliberate movement with ease-out (settles into place) */
  transition: left 1s cubic-bezier(0.33, 1, 0.68, 1), top 1s cubic-bezier(0.33, 1, 0.68, 1);
  left: 50%;
  top: 50%;
}

.demo-cursor::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background: #1a1a1a;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  transition: transform 0.2s ease-out;
}

/* Subtle click: very light scale, no frantic snap */
.demo-cursor.clicking::before {
  animation: demo-cursor-click 0.3s ease-out;
}

@keyframes demo-cursor-click {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.94); }
}

/* ============================================
   Guided Tour — Dim & Zoom (Premium: Soft Vignette Spotlight)
   ============================================ */
.demo-tour-dim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1001;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  /* Stronger vignette: focused area clearly lit, dimmed area saturated for focal contrast */
  --spotlight-x: 50%;
  --spotlight-y: 45%;
  --spotlight-radius: 50%;
  mask-image: radial-gradient(
    ellipse var(--spotlight-radius) calc(var(--spotlight-radius) * 0.85) at var(--spotlight-x) var(--spotlight-y),
    transparent 0%,
    transparent 22%,
    rgba(255, 255, 255, 0.12) 40%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0.85) 80%,
    white 100%
  );
  -webkit-mask-image: radial-gradient(
    ellipse var(--spotlight-radius) calc(var(--spotlight-radius) * 0.85) at var(--spotlight-x) var(--spotlight-y),
    transparent 0%,
    transparent 22%,
    rgba(255, 255, 255, 0.12) 40%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0.85) 80%,
    white 100%
  );
  mask-mode: luminance;
  -webkit-mask-mode: luminance;
}

.demo-tour-dim.visible {
  opacity: 1;
}

/* Guided tour narrative — Ultra premium, above appointment table */
.demo-tour-narrative {
  position: fixed;
  top: 8%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  z-index: 1200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.demo-tour-narrative.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.demo-tour-narrative-text {
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.98);
  letter-spacing: -0.035em;
  line-height: 1.35;
  text-align: center;
  max-width: 88vw;
  padding: 14px 32px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

/* Zoom/spotlight for focused area — premium, smooth, no jumpiness */
.demo-ghl-view.demo-tour-active {
  transition: transform 1.1s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.demo-ghl-view.demo-tour-active.demo-tour-focus-table {
  transform: scale(1.03) translate(-2%, -1%);
  transform-origin: center center;
}

.demo-ghl-view.demo-tour-active.demo-tour-focus-sidebar {
  transform: scale(1.02) translate(-10%, -1%);
  transform-origin: right center;
}

.demo-edit-panel.demo-tour-spotlight {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4), -4px 0 24px rgba(0, 0, 0, 0.2);
}

/* Header icons — subtle parallax on hover */
.demo-header-icon-circle {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-header-icon-circle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Hotspot Tooltip
   ============================================ */
.demo-hotspot-tooltip {
  position: fixed;
  max-width: 280px;
  padding: 12px 16px;
  background: #1a202c;
  color: white;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 1100;
  pointer-events: none;
}

.demo-hotspot-tooltip.hidden {
  display: none !important;
}

.demo-hotspot-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: #1a202c;
  transform: rotate(45deg);
}

/* ============================================
   End Card — Apple-style, single CTA
   ============================================ */
.demo-end-card {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.demo-end-card.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Logo — top-left, home link */
.demo-end-logo {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.demo-end-logo:hover {
  color: rgba(255, 255, 255, 1);
  opacity: 0.9;
}

.demo-end-logo .logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.demo-end-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 0;
}

.demo-end-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  max-width: 420px;
}

.demo-end-headline {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.98);
  letter-spacing: -0.04em;
  line-height: 1.25;
  text-align: center;
  margin: 0;
}

.demo-end-cta {
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: -0.02em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.demo-end-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.demo-end-cta:active {
  transform: translateY(0);
}

.demo-end-replay {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.demo-end-replay:hover {
  color: rgba(255, 255, 255, 0.65);
}

/* Utility */
.hidden {
  display: none !important;
}
