๐Ÿ“ฆ tobinsouth / hcp-demo

๐Ÿ“„ page.tsx ยท 764 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764"use client"
import { useState, useEffect } from "react"
import { Card } from "@/components/ui/card"
import { ChatComponent } from "@/components/chat-component"
import { PreferenceDatabaseUI } from "@/components/preference-database-ui"
import { AgentNegotiation } from "@/components/agent-negotiation"
import { GrantAuthorityUI } from "@/components/grant-authority-ui"
import { OnboardingModal } from "@/components/onboarding-modal"
import { MCPComponent } from "@/components/mcp-component"
import { motion, AnimatePresence, LayoutGroup } from "framer-motion"
import { ArrowDown, ArrowRight, Sparkles, Archive, Network, Shield, Workflow } from "lucide-react"
import { useDemoInitialization } from "@/hooks/use-demo-initialization"

// Typewriter component
function TypewriterText({ text, delay = 0, speed = 80 }: { text: string; delay?: number; speed?: number }) {
  const [displayedText, setDisplayedText] = useState("")
  const [startTyping, setStartTyping] = useState(false)

  useEffect(() => {
    const startTimer = setTimeout(() => {
      setStartTyping(true)
    }, delay)

    return () => clearTimeout(startTimer)
  }, [delay])

  useEffect(() => {
    if (!startTyping) return

    let i = 0
    const timer = setInterval(() => {
      if (i < text.length) {
        setDisplayedText(text.slice(0, i + 1))
        i++
      } else {
        clearInterval(timer)
      }
    }, speed)

    return () => clearInterval(timer)
  }, [text, speed, startTyping])

  return <span>{displayedText}</span>
}

export default function HomePage() {
  // Initialize demo data automatically
  const { initialized: demoInitialized } = useDemoInitialization()
  
  // Flow state management
  const [currentStep, setCurrentStep] = useState<'initial' | 'preferences' | 'authority' | 'applications'>('initial')
  const [showPreferences, setShowPreferences] = useState(false)
  const [showGrantAuthority, setShowGrantAuthority] = useState(false)
  const [showApplications, setShowApplications] = useState(false)
  const [showChat, setShowChat] = useState(false)
  const [showNegotiation, setShowNegotiation] = useState(false)
  const [showMCP, setShowMCP] = useState(false)
  
  // Modal state
  const [currentModal, setCurrentModal] = useState<'preferences' | 'authority' | 'application' | null>(null)
  
  // Button click tracking
  const [authorityButtonClicked, setAuthorityButtonClicked] = useState(false)
  const [applicationButtonClicked, setApplicationButtonClicked] = useState(false)

  const handleModalClose = (modal: 'preferences' | 'authority' | 'application') => {
    setCurrentModal(null)
    
    setTimeout(() => {
      if (modal === 'preferences') {
        setCurrentStep('preferences')
        // Don't auto-expand preferences - let user click to open
      } else if (modal === 'authority') {
        setCurrentStep('authority')
        // Don't auto-expand authority - let user click to open
      } else if (modal === 'application') {
        setCurrentStep('applications')
        // Don't auto-expand applications - let user click to open
      }
    }, 300)
  }
  
  const handleAddAuthority = () => {
    setAuthorityButtonClicked(true)
    setCurrentModal('authority')
  }
  
  const handleSeeInUse = () => {
    setApplicationButtonClicked(true)
    setCurrentModal('application')
  }

  const toggleComponent = (component: string) => {
    switch(component) {
      case 'chat':
        setShowChat(!showChat)
        break
      case 'preferences':
        setShowPreferences(!showPreferences)
        break
      case 'negotiation':
        setShowNegotiation(!showNegotiation)
        break
      case 'authority':
        setShowGrantAuthority(!showGrantAuthority)
        break
      case 'mcp':
        setShowMCP(!showMCP)
        break
    }
  }

  const containerVariants = {
    hidden: { 
      opacity: 0,
      y: 60,
      filter: "blur(15px)"
    },
    visible: { 
      opacity: 1,
      y: 0,
      filter: "blur(0px)",
      transition: {
        duration: 1.2,
        ease: "easeOut" as const
      }
    }
  }

  const contentVariants = {
    collapsed: {
      height: 0,
      opacity: 0,
      transition: {
        height: { duration: 0.5, ease: "easeInOut" as const },
        opacity: { duration: 0.3 }
      }
    },
    expanded: {
      height: "auto",
      opacity: 1,
      transition: {
        height: { duration: 0.5, ease: "easeInOut" as const },
        opacity: { duration: 0.4, delay: 0.1 }
      }
    }
  }


  return (
    <>
      {/* Onboarding Modals - Progressive Flow */}
      <OnboardingModal
        isOpen={currentModal === 'preferences'}
        onClose={() => handleModalClose('preferences')}
        title="The Importance of Human Context"
        content="To perform most interactions online, you need to know an individual's preferences and history. This 'human context' is what makes AI truly useful."
        actionLabel="See what Human Context is"
        modalType="preferences"
      />
      <OnboardingModal
        isOpen={currentModal === 'authority'}
        onClose={() => handleModalClose('authority')}
        title="Controlling Your Agent Authority"
        content="Your context is sensitive. Grant of Authority lets you control how it's shared and used by AI."
        actionLabel="Grant Agentic Authorization"
        modalType="authority"
      />
      <OnboardingModal
        isOpen={currentModal === 'application'}
        onClose={() => handleModalClose('application')}
        title="See It In Action"
        content="Watch how context and authority work together across AI applications."
        actionLabel="Explore Applications"
        modalType="application"
      />
      
      <div className="min-h-screen bg-gradient-to-b from-background via-background to-muted/20 relative overflow-hidden">
        {/* Subtle background pattern */}
        <div className="absolute inset-0 opacity-[0.015]" 
          style={{
            backgroundImage: `radial-gradient(circle at 1px 1px, currentColor 1px, transparent 1px)`,
            backgroundSize: '40px 40px'
          }}
        />
        
        <div className="max-w-4xl mx-auto px-4 py-8 sm:px-6 sm:py-12 md:px-8 md:py-16 lg:px-12 lg:py-20">
        {/* Header */}
        <motion.div 
          className="text-center mb-16 sm:mb-16 md:mb-20 lg:mb-24"
        >
          {/* Typewriter tagline - appears when no modal is open */}
          {!currentModal && (
            <motion.div
              initial={{ opacity: 0 }}
              animate={{ opacity: 1 }}
              transition={{ 
                duration: 0.8, 
                delay: 0.5,
                ease: [0.16, 1, 0.3, 1]
              }}
              className="inline-block mb-8 sm:mb-10"
            >
              <span className="text-xs sm:text-xs font-mono tracking-[0.2em] sm:tracking-[0.3em] text-muted-foreground/60 uppercase">
                <TypewriterText 
                  text="PROTECTED AND UNLOCKING CONTEXT FOR AGENTS" 
                  delay={500}
                  speed={40}
                />
                <motion.span
                  animate={{ opacity: [1, 0] }}
                  transition={{ 
                    duration: 0.8,
                    repeat: Infinity,
                    repeatType: "reverse",
                    delay: 0.8
                  }}
                  className="ml-1 inline-block w-0.5 h-3 bg-muted-foreground/60"
                />
              </span>
            </motion.div>
          )}
          
          {/* Main title emerges with elegant stagger */}
          <motion.div className="mb-10 sm:mb-12">
            <motion.h1 
              className="text-4xl sm:text-5xl md:text-6xl lg:text-7xl font-light tracking-tight"
              style={{ fontFamily: 'var(--font-crimson)' }}
            >
              <motion.span 
                className="block"
                initial={{ opacity: 0, y: 30, filter: "blur(5px)" }}
                animate={{ opacity: currentModal ? 0.3 : 1, y: 0, filter: "blur(0px)" }}
                transition={{ 
                  duration: 0.8, 
                  delay: 0.2,
                  ease: [0.16, 1, 0.3, 1]
                }}
              >
                Human Context
              </motion.span>
              <motion.span 
                className="block text-xl sm:text-2xl md:text-3xl lg:text-4xl mt-4 text-muted-foreground font-normal"
                initial={{ opacity: 0, y: 20, filter: "blur(3px)" }}
                animate={{ opacity: currentModal ? 0.2 : 1, y: 0, filter: "blur(0px)" }}
                transition={{ 
                  duration: 0.8, 
                  delay: 0.4,
                  ease: [0.16, 1, 0.3, 1]
                }}
              >
                to Agent Behavior
              </motion.span>
            </motion.h1>
          </motion.div>
          
          {/* Subtitle fades in gracefully */}
          <motion.p
            initial={{ opacity: 0, y: 20, filter: "blur(3px)" }}
            animate={{ opacity: currentModal ? 0.2 : 1, y: 0, filter: "blur(0px)" }}
            transition={{ 
              duration: 0.8, 
              delay: 0.6,
              ease: [0.16, 1, 0.3, 1]
            }}
            className="text-sm sm:text-base md:text-lg text-muted-foreground/80 max-w-sm sm:max-w-2xl mx-auto leading-relaxed mb-8"
          >
            How delegated authority and control unlock the value of personal context in AI interactions
          </motion.p>

          {/* Start Demo Button */}
          {currentStep === 'initial' && (
            <motion.div
              initial={{ opacity: 0, y: 20 }}
              animate={{ opacity: 1, y: 0 }}
              transition={{ 
                duration: 0.8, 
                delay: 1.2,
                ease: [0.16, 1, 0.3, 1]
              }}
              className="flex justify-center"
              style={{ pointerEvents: 'auto' }}
            >
              <button
                onClick={() => setCurrentModal('preferences')}
                className="group relative bg-gradient-to-b from-primary to-primary/90 hover:from-primary/95 hover:to-primary/85 text-primary-foreground px-6 sm:px-8 md:px-10 py-4 sm:py-5 rounded-2xl text-sm sm:text-base md:text-lg font-medium transition-all duration-300 hover:scale-[1.02] active:scale-[0.98] min-h-[56px] sm:min-h-[60px] shadow-lg hover:shadow-xl max-w-[280px] sm:max-w-none"
              >
                <span className="flex items-center justify-center gap-2 sm:gap-3">
                  <span className="block sm:inline leading-tight">
                    See why context and delegation is important
                  </span>
                  <ArrowRight className="w-4 h-4 sm:w-5 sm:h-5 flex-shrink-0 transition-transform duration-300 group-hover:translate-x-0.5" />
                </span>
                <span className="absolute inset-0 rounded-2xl ring-1 ring-white/10" />
              </button>
            </motion.div>
          )}
        </motion.div>

        {/* Main Content */}
        <LayoutGroup>
          <motion.div layout className="space-y-6 sm:space-y-8 md:space-y-10 pb-8 sm:pb-12 md:pb-16">

              {/* Step 1: Human Context (Preference Database) */}
              {currentStep !== 'initial' && (
              <motion.div
                layout
                initial="hidden"
                animate="visible"
                variants={{
                  hidden: { 
                    opacity: 0,
                    y: 60,
                    filter: "blur(15px)"
                  },
                  visible: { 
                    opacity: 1,
                    y: 0,
                    filter: "blur(0px)",
                    transition: {
                      duration: 0.8,
                      ease: [0.25, 0.46, 0.45, 0.94],
                      delay: 0.3
                    }
                  }
                }}
                className="w-full"
              >
                <Card className="overflow-hidden bg-card/80 backdrop-blur-md border-border/40 shadow-lg hover:shadow-xl transition-shadow duration-500">
                  <motion.div 
                    className="p-4 sm:p-6 md:p-8 lg:p-10 flex items-center justify-between cursor-pointer group"
                    onClick={() => toggleComponent('preferences')}
                    whileHover={{ backgroundColor: "rgba(0,0,0,0.01)" }}
                  >
                    <div className="flex items-center gap-3 sm:gap-4 md:gap-5">
                      <motion.div 
                        className="w-10 h-10 sm:w-12 sm:h-12 md:w-14 md:h-14 rounded-xl bg-primary/10 flex items-center justify-center"
                        whileHover={{ scale: 1.05 }}
                        transition={{ type: "spring", stiffness: 400 }}
                      >
                        <Archive className="w-5 h-5 sm:w-6 sm:h-6 md:w-7 md:h-7 text-primary" />
                      </motion.div>
                      <div>
                        <h2 className="text-lg sm:text-xl md:text-2xl lg:text-3xl mb-1" style={{ fontFamily: 'var(--font-crimson)' }}>
                          Human Context
                        </h2>
                        <p className="text-xs sm:text-sm md:text-base text-muted-foreground">
                          Your preferences, values, and interaction history
                        </p>
                      </div>
                    </div>
                    <motion.div
                      animate={{ rotate: showPreferences ? 180 : 0 }}
                      transition={{ duration: 0.4, ease: "easeInOut" as const }}
                      className="group-hover:bg-accent/10 rounded-full p-2 sm:p-3 transition-colors"
                    >
                      <ArrowDown className="w-4 h-4 sm:w-5 sm:h-5 text-muted-foreground" />
                    </motion.div>
                  </motion.div>
                  
                  <AnimatePresence>
                    {showPreferences && (
                      <motion.div
                        initial="collapsed"
                        animate="expanded"
                        exit="collapsed"
                        variants={contentVariants}
                        className="overflow-hidden"
                      >
                        <div className="px-4 pb-4 sm:px-8 sm:pb-8 md:px-10 md:pb-10">
                          <div className="h-[350px] sm:h-[400px] md:h-[450px] rounded-lg bg-muted/5 p-1">
                            <PreferenceDatabaseUI />
                          </div>
                        </div>
                      </motion.div>
                    )}
                  </AnimatePresence>
                </Card>
                
                {/* Add Grant Authority Button */}
                <AnimatePresence>
                  {showPreferences && currentStep === 'preferences' && !authorityButtonClicked && (
                    <motion.div
                      initial={{ opacity: 0, y: 20 }}
                      animate={{ opacity: 1, y: 0 }}
                      exit={{ opacity: 0, y: -20 }}
                      transition={{ delay: 0.8, duration: 0.3 }}
                      className="flex justify-center mt-6"
                      style={{ pointerEvents: 'auto' }}
                    >
                      <button
                        onClick={handleAddAuthority}
                        className="group relative bg-gradient-to-b from-primary to-primary/90 hover:from-primary/95 hover:to-primary/85 text-primary-foreground px-5 sm:px-6 md:px-8 py-3.5 sm:py-4 rounded-xl text-sm sm:text-base font-medium transition-all duration-300 hover:scale-[1.02] active:scale-[0.98] min-h-[48px] sm:min-h-[52px] shadow-md hover:shadow-lg"
                      >
                        <span className="flex items-center justify-center gap-2">
                          <span>Add Grant of Authority</span>
                          <ArrowRight className="w-4 h-4 transition-transform duration-300 group-hover:translate-x-0.5" />
                        </span>
                        <span className="absolute inset-0 rounded-xl ring-1 ring-white/10" />
                      </button>
                    </motion.div>
                  )}
                </AnimatePresence>
              </motion.div>
              )}

              {/* Step 2: Grant of Authority - Only show after preferences */}
              {(currentStep === 'authority' || currentStep === 'applications') && (
              <motion.div
                layout
                initial="hidden"
                animate="visible"
                variants={containerVariants}
                className="w-full"
              >
                <Card className="overflow-hidden bg-card/80 backdrop-blur-md border-border/40 shadow-lg hover:shadow-xl transition-shadow duration-500">
                  <motion.div 
                    className="p-4 sm:p-6 md:p-8 lg:p-10 flex items-center justify-between cursor-pointer group"
                    onClick={() => toggleComponent('authority')}
                    whileHover={{ backgroundColor: "rgba(0,0,0,0.01)" }}
                  >
                    <div className="flex items-center gap-3 sm:gap-4 md:gap-5">
                      <motion.div 
                        className="w-10 h-10 sm:w-12 sm:h-12 md:w-14 md:h-14 rounded-xl bg-primary/10 flex items-center justify-center"
                        whileHover={{ scale: 1.05 }}
                        transition={{ type: "spring", stiffness: 400 }}
                      >
                        <Shield className="w-5 h-5 sm:w-6 sm:h-6 md:w-7 md:h-7 text-primary" />
                      </motion.div>
                      <div>
                        <h2 className="text-lg sm:text-xl md:text-2xl lg:text-3xl mb-1" style={{ fontFamily: 'var(--font-crimson)' }}>
                          Grant of Authority
                        </h2>
                        <p className="text-xs sm:text-sm md:text-base text-muted-foreground">
                          Control how your context is shared and used
                        </p>
                      </div>
                    </div>
                    <motion.div
                      animate={{ rotate: showGrantAuthority ? 180 : 0 }}
                      transition={{ duration: 0.4, ease: "easeInOut" as const }}
                      className="group-hover:bg-accent/10 rounded-full p-2 sm:p-3 transition-colors"
                    >
                      <ArrowDown className="w-4 h-4 sm:w-5 sm:h-5 text-muted-foreground" />
                    </motion.div>
                  </motion.div>
                  
                  <AnimatePresence>
                    {showGrantAuthority && (
                      <motion.div
                        initial="collapsed"
                        animate="expanded"
                        exit="collapsed"
                        variants={contentVariants}
                        className="overflow-hidden"
                      >
                        <div className="px-4 pb-4 sm:px-8 sm:pb-8 md:px-10 md:pb-10">
                          <div className="h-[350px] sm:h-[400px] md:h-[450px] rounded-lg bg-muted/5 p-1">
                            <GrantAuthorityUI />
                          </div>
                        </div>
                      </motion.div>
                    )}
                  </AnimatePresence>
                </Card>
                
                {/* See in Use Button */}
                <AnimatePresence>
                  {showGrantAuthority && currentStep === 'authority' && !applicationButtonClicked && (
                    <motion.div
                      initial={{ opacity: 0, y: 20 }}
                      animate={{ opacity: 1, y: 0 }}
                      exit={{ opacity: 0, y: -20 }}
                      transition={{ delay: 0.8, duration: 0.3 }}
                      className="flex justify-center mt-6"
                      style={{ pointerEvents: 'auto' }}
                    >
                      <button
                        onClick={handleSeeInUse}
                        className="group relative bg-gradient-to-b from-primary to-primary/90 hover:from-primary/95 hover:to-primary/85 text-primary-foreground px-5 sm:px-6 md:px-8 py-3.5 sm:py-4 rounded-xl text-sm sm:text-base font-medium transition-all duration-300 hover:scale-[1.02] active:scale-[0.98] min-h-[48px] sm:min-h-[52px] shadow-md hover:shadow-lg"
                      >
                        <span className="flex items-center justify-center gap-2">
                          <span>See this in use</span>
                          <ArrowRight className="w-4 h-4 transition-transform duration-300 group-hover:translate-x-0.5" />
                        </span>
                        <span className="absolute inset-0 rounded-xl ring-1 ring-white/10" />
                      </button>
                    </motion.div>
                  )}
                </AnimatePresence>
              </motion.div>
              )}

              {/* Step 3: Applications (Chat & Agent Negotiation) */}
              {currentStep === 'applications' && (
                <>
                  <motion.div
                    initial={{ opacity: 0, y: 20 }}
                    animate={{ opacity: 1, y: 0 }}
                    transition={{ delay: 0.2 }}
                    className="text-center mb-8"
                  >
                    <h2 className="text-xl sm:text-2xl md:text-3xl lg:text-4xl font-light mb-2" style={{ fontFamily: 'var(--font-crimson)' }}>
                      Applications in Action
                    </h2>
                    <p className="text-sm sm:text-base text-muted-foreground">
                      See how human context and authority work together
                    </p>
                  </motion.div>
                  
                  {/* Chat Interface */}
                  <motion.div
                    layout
                    initial="hidden"
                    animate="visible"
                    variants={containerVariants}
                    className="w-full"
                  >
                    <Card className="overflow-hidden bg-card/80 backdrop-blur-md border-border/40 shadow-lg hover:shadow-xl transition-shadow duration-500">
                      <motion.div 
                        className="p-4 sm:p-6 md:p-8 lg:p-10 flex items-center justify-between cursor-pointer group"
                        onClick={() => toggleComponent('chat')}
                        whileHover={{ backgroundColor: "rgba(0,0,0,0.01)" }}
                      >
                        <div className="flex items-center gap-3 sm:gap-4 md:gap-5">
                          <motion.div 
                            className="w-10 h-10 sm:w-12 sm:h-12 md:w-14 md:h-14 rounded-xl bg-primary/10 flex items-center justify-center"
                            whileHover={{ scale: 1.05 }}
                            transition={{ type: "spring", stiffness: 400 }}
                          >
                            <Sparkles className="w-5 h-5 sm:w-6 sm:h-6 md:w-7 md:h-7 text-primary" />
                          </motion.div>
                          <div>
                            <h2 className="text-lg sm:text-xl md:text-2xl lg:text-3xl mb-1" style={{ fontFamily: 'var(--font-crimson)' }}>
                              AI Chat Interface
                            </h2>
                            <p className="text-xs sm:text-sm md:text-base text-muted-foreground">
                              Using human context in chatbots safely
                            </p>
                          </div>
                        </div>
                        <motion.div
                          animate={{ rotate: showChat ? 180 : 0 }}
                          transition={{ duration: 0.4, ease: "easeInOut" as const }}
                          className="group-hover:bg-accent/10 rounded-full p-2 sm:p-3 transition-colors"
                        >
                          <ArrowDown className="w-4 h-4 sm:w-5 sm:h-5 text-muted-foreground" />
                        </motion.div>
                      </motion.div>
                      
                      <AnimatePresence>
                        {showChat && (
                          <motion.div
                            initial="collapsed"
                            animate="expanded"
                            exit="collapsed"
                            variants={contentVariants}
                            className="overflow-hidden"
                          >
                            <div className="px-4 pb-4 sm:px-8 sm:pb-8 md:px-10 md:pb-10">
                              <div className="h-[350px] sm:h-[400px] md:h-[450px] rounded-lg bg-muted/5 p-1">
                                <ChatComponent />
                              </div>
                            </div>
                          </motion.div>
                        )}
                      </AnimatePresence>
                    </Card>
                  </motion.div>
                  
                  {/* Agent Negotiation */}
                  <motion.div
                    layout
                    initial="hidden"
                    animate="visible"
                    variants={containerVariants}
                    className="w-full"
                  >
                    <Card className="overflow-hidden bg-card/80 backdrop-blur-md border-border/40 shadow-lg hover:shadow-xl transition-shadow duration-500">
                      <motion.div 
                        className="p-4 sm:p-6 md:p-8 lg:p-10 flex items-center justify-between cursor-pointer group"
                        onClick={() => toggleComponent('negotiation')}
                        whileHover={{ backgroundColor: "rgba(0,0,0,0.01)" }}
                      >
                        <div className="flex items-center gap-3 sm:gap-4 md:gap-5">
                          <motion.div 
                            className="w-10 h-10 sm:w-12 sm:h-12 md:w-14 md:h-14 rounded-xl bg-primary/10 flex items-center justify-center"
                            whileHover={{ scale: 1.05 }}
                            transition={{ type: "spring", stiffness: 400 }}
                          >
                            <Network className="w-5 h-5 sm:w-6 sm:h-6 md:w-7 md:h-7 text-primary" />
                          </motion.div>
                          <div>
                            <h2 className="text-lg sm:text-xl md:text-2xl lg:text-3xl mb-1" style={{ fontFamily: 'var(--font-crimson)' }}>
                              Agent Negotiation
                            </h2>
                            <p className="text-xs sm:text-sm md:text-base text-muted-foreground">
                              AI agents working together on your behalf
                            </p>
                          </div>
                        </div>
                        <motion.div
                          animate={{ rotate: showNegotiation ? 180 : 0 }}
                          transition={{ duration: 0.4, ease: "easeInOut" as const }}
                          className="group-hover:bg-accent/10 rounded-full p-2 sm:p-3 transition-colors"
                        >
                          <ArrowDown className="w-4 h-4 sm:w-5 sm:h-5 text-muted-foreground" />
                        </motion.div>
                      </motion.div>
                      
                      <AnimatePresence>
                        {showNegotiation && (
                          <motion.div
                            initial="collapsed"
                            animate="expanded"
                            exit="collapsed"
                            variants={contentVariants}
                            className="overflow-hidden"
                          >
                            <div className="px-4 pb-4 sm:px-8 sm:pb-8 md:px-10 md:pb-10">
                              <div className="min-h-[350px] sm:min-h-[400px] md:min-h-[450px] rounded-lg bg-muted/5 p-1">
                                <AgentNegotiation />
                              </div>
                            </div>
                          </motion.div>
                        )}
                      </AnimatePresence>
                    </Card>
                  </motion.div>
                  
                  {/* Model Context Protocol */}
                  <motion.div
                    layout
                    initial="hidden"
                    animate="visible"
                    variants={containerVariants}
                    className="w-full"
                  >
                    <Card className="overflow-hidden bg-card/80 backdrop-blur-md border-border/40 shadow-lg hover:shadow-xl transition-shadow duration-500">
                      <motion.div 
                        className="p-4 sm:p-6 md:p-8 lg:p-10 flex items-center justify-between cursor-pointer group"
                        onClick={() => toggleComponent('mcp')}
                        whileHover={{ backgroundColor: "rgba(0,0,0,0.01)" }}
                      >
                        <div className="flex items-center gap-3 sm:gap-4 md:gap-5">
                          <motion.div 
                            className="w-10 h-10 sm:w-12 sm:h-12 md:w-14 md:h-14 rounded-xl bg-primary/10 flex items-center justify-center"
                            whileHover={{ scale: 1.05 }}
                            transition={{ type: "spring", stiffness: 400 }}
                          >
                            <Workflow className="w-5 h-5 sm:w-6 sm:h-6 md:w-7 md:h-7 text-primary" />
                          </motion.div>
                          <div>
                            <h2 className="text-lg sm:text-xl md:text-2xl lg:text-3xl mb-1" style={{ fontFamily: 'var(--font-crimson)' }}>
                              Model Context Protocol
                            </h2>
                            <p className="text-xs sm:text-sm md:text-base text-muted-foreground">
                              Connect your context to any AI workflow
                            </p>
                          </div>
                        </div>
                        <motion.div
                          animate={{ rotate: showMCP ? 180 : 0 }}
                          transition={{ duration: 0.4, ease: "easeInOut" as const }}
                          className="group-hover:bg-accent/10 rounded-full p-2 sm:p-3 transition-colors"
                        >
                          <ArrowDown className="w-4 h-4 sm:w-5 sm:h-5 text-muted-foreground" />
                        </motion.div>
                      </motion.div>
                      
                      <AnimatePresence>
                        {showMCP && (
                          <motion.div
                            initial="collapsed"
                            animate="expanded"
                            exit="collapsed"
                            variants={contentVariants}
                            className="overflow-hidden"
                          >
                            <div className="px-4 pb-4 sm:px-8 sm:pb-8 md:px-10 md:pb-10">
                              <div className="min-h-[350px] sm:min-h-[400px] md:min-h-[450px] rounded-lg bg-muted/5 p-1">
                                <MCPComponent />
                              </div>
                            </div>
                          </motion.div>
                        )}
                      </AnimatePresence>
                    </Card>
                  </motion.div>
                </>
              )}
          </motion.div>
        </LayoutGroup>
        
        {/* Manifesto */}
        <motion.div
          initial={{ opacity: 0 }}
          animate={{ opacity: 1 }}
          transition={{ duration: 1, delay: 0.8 }}
          className="mt-16 sm:mt-20 md:mt-24 lg:mt-32 mb-8 sm:mb-10 md:mb-12"
        >
          <div className="max-w-2xl sm:max-w-3xl mx-auto px-4 sm:px-6">
            <motion.div
              initial={{ scaleX: 0 }}
              animate={{ scaleX: 1 }}
              transition={{ duration: 0.8, delay: 1 }}
              className="h-px bg-gradient-to-r from-transparent via-border to-transparent mb-12"
            />
            
            <motion.p 
              initial={{ opacity: 0, y: 20 }}
              animate={{ opacity: 1, y: 0 }}
              transition={{ duration: 0.8, delay: 1.2 }}
              className="text-base sm:text-lg md:text-xl leading-[1.7] sm:leading-[1.8] text-center text-muted-foreground"
              style={{ fontFamily: 'var(--font-crimson)' }}
            >
              Human context is the foundation of AI utility. Without understanding{" "}
              <span className="text-foreground font-medium">preferences and interaction history</span>,{" "}
              AI cannot deliver personalized, meaningful experiences. This context must be{" "}
              <span className="text-foreground font-medium">transparent, interoperable, and secure</span>.
            </motion.p>
            
            <motion.p
              initial={{ opacity: 0, y: 20 }}
              animate={{ opacity: 1, y: 0 }}
              transition={{ duration: 0.8, delay: 1.4 }}
              className="text-base sm:text-lg md:text-xl leading-[1.7] sm:leading-[1.8] text-center text-muted-foreground mt-4 sm:mt-6"
              style={{ fontFamily: 'var(--font-crimson)' }}
            >
              Grant of Authority is the key unlock for deploying agents at scale. By giving users{" "}
              <span className="text-foreground font-medium">fine-grained control</span>{" "}
              over how their context is shared and used, we enable a future where AI can{" "}
              <span className="text-foreground font-medium">safely and reliably</span>{" "}
              act on our behalf.
            </motion.p>
            
            <motion.div
              initial={{ scaleX: 0 }}
              animate={{ scaleX: 1 }}
              transition={{ duration: 0.8, delay: 1.6 }}
              className="h-px bg-gradient-to-r from-transparent via-border to-transparent mt-12"
            />
          </div>
        </motion.div>
        
        {/* Attribution Footer */}
        <motion.div
          initial={{ opacity: 0 }}
          animate={{ opacity: 1 }}
          transition={{ duration: 1.2, delay: 8.0 }}
          className="text-center pt-16 sm:pt-20 md:pt-24 pb-12 sm:pb-16 md:pb-20"
        >
          <p className="text-xs text-muted-foreground/40 font-mono tracking-wide">
            Made with ๐Ÿ’™ by Tobin in collaboration with{" "}
            <span className="text-muted-foreground/60">Stanford DEL</span> and{" "}
            <span className="text-muted-foreground/60">Consumer Reports</span>
          </p>
        </motion.div>
        </div>
      </div>
    </>
  )
}