function FloatingDemo({ positionClass, animationClass, initialScale = 0.8, children }) {
  const [offset, setOffset] = React.useState({ x: 0, y: 0 });
  const [scale, setScale] = React.useState(initialScale);
  const [showPreviewHint, setShowPreviewHint] = React.useState(false);
  const hintTimer = React.useRef(null);
  const innerRef = React.useRef(null);

  const triggerPreviewHint = () => {
    setShowPreviewHint(true);
    clearTimeout(hintTimer.current);
    hintTimer.current = setTimeout(() => setShowPreviewHint(false), 1800);
  };

  React.useEffect(() => () => clearTimeout(hintTimer.current), []);

  const handleMouseDown = (e) => {
    if (e.target.closest('button, input, textarea, a, select, [data-no-drag]')) return;
    const origX = offset.x;
    const origY = offset.y;
    const startX = e.clientX;
    const startY = e.clientY;
    document.body.style.userSelect = 'none';
    document.body.style.cursor = 'grabbing';

    const onMove = (ev) => {
      setOffset({
        x: origX + ev.clientX - startX,
        y: origY + ev.clientY - startY,
      });
    };
    const onUp = () => {
      document.body.style.userSelect = '';
      document.body.style.cursor = '';
      window.removeEventListener('mousemove', onMove);
      window.removeEventListener('mouseup', onUp);
    };
    window.addEventListener('mousemove', onMove);
    window.addEventListener('mouseup', onUp);
    e.preventDefault();
  };

  // Corner-specific sign (which mouse direction grows the window) and the
  // anchor compensation (which translate components must move with the scale).
  const CORNER_CONFIG = {
    nw: { sign: [-1, -1], anchor: [1, 1], cursor: 'nwse-resize' },
    ne: { sign: [ 1, -1], anchor: [0, 1], cursor: 'nesw-resize' },
    sw: { sign: [-1,  1], anchor: [1, 0], cursor: 'nesw-resize' },
    se: { sign: [ 1,  1], anchor: [0, 0], cursor: 'nwse-resize' },
  };

  const handleResizeStart = (corner) => (e) => {
    e.stopPropagation();
    e.preventDefault();
    const { sign, anchor, cursor } = CORNER_CONFIG[corner];
    const startX = e.clientX;
    const startY = e.clientY;
    const startScale = scale;
    const startOffset = { ...offset };
    // Unscaled intrinsic size of the inner wrapper.
    const rect = innerRef.current.getBoundingClientRect();
    const W = rect.width / scale;
    const H = rect.height / scale;
    document.body.style.userSelect = 'none';
    document.body.style.cursor = cursor;

    const onMove = (ev) => {
      const dx = ev.clientX - startX;
      const dy = ev.clientY - startY;
      const delta = (sign[0] * dx + sign[1] * dy) / 400;
      const newScale = Math.max(0.5, Math.min(2, startScale + delta));
      const ds = newScale - startScale;
      setScale(newScale);
      setOffset({
        x: startOffset.x - W * ds * anchor[0],
        y: startOffset.y - H * ds * anchor[1],
      });
    };
    const onUp = () => {
      document.body.style.userSelect = '';
      document.body.style.cursor = '';
      window.removeEventListener('mousemove', onMove);
      window.removeEventListener('mouseup', onUp);
    };
    window.addEventListener('mousemove', onMove);
    window.addEventListener('mouseup', onUp);
  };

  const handleResizeDoubleClick = (e) => {
    e.stopPropagation();
    setScale(initialScale);
  };

  const cornerPositions = {
    nw: 'top-0 left-0',
    ne: 'top-0 right-0',
    sw: 'bottom-0 left-0',
    se: 'bottom-0 right-0',
  };

  // Outer wrapper keeps the floating bounce animation running at all times.
  // Inner wrapper applies the user's drag translate + resize scale on top, so
  // dragging and the float animation compose instead of conflicting.
  return ReactDOM.createPortal(
    <div className={`fixed z-50 ${positionClass} ${animationClass}`}>
      <div
        ref={innerRef}
        style={{
          cursor: 'grab',
          transform: `translate(${offset.x}px, ${offset.y}px) scale(${scale})`,
          transformOrigin: 'top left',
          position: 'relative',
        }}
        onMouseDown={handleMouseDown}
      >
        <div onClick={triggerPreviewHint}>
          {children}
        </div>
        {/* "Visual preview only" hint */}
        <div
          style={{
            position: 'absolute',
            bottom: -36,
            left: '50%',
            transform: 'translateX(-50%)',
            pointerEvents: 'none',
            opacity: showPreviewHint ? 1 : 0,
            transition: 'opacity 0.4s ease',
            whiteSpace: 'nowrap',
          }}
        >
          <span
            style={{
              background: 'rgba(124,58,237,0.85)',
              color: 'rgba(255,255,255,0.95)',
              fontSize: 11,
              fontWeight: 600,
              padding: '5px 14px',
              borderRadius: 8,
              letterSpacing: '0.03em',
              boxShadow: '0 4px 16px rgba(0,0,0,0.35)',
              fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
            }}
          >
            Visual preview only
          </span>
        </div>
        {/* Resize handles — one per corner */}
        {Object.keys(CORNER_CONFIG).map((corner) => (
          <div
            key={corner}
            data-no-drag
            onMouseDown={handleResizeStart(corner)}
            onDoubleClick={handleResizeDoubleClick}
            title="Drag to resize · Double-click to reset"
            className={`absolute ${cornerPositions[corner]} w-5 h-5 group/resize`}
            style={{ cursor: CORNER_CONFIG[corner].cursor, zIndex: 20 }}
          >
            <div
              className="absolute w-1.5 h-1.5 rounded-full bg-white/40 group-hover/resize:bg-white/90 transition-colors"
              style={{
                top: corner[0] === 'n' ? 3 : 'auto',
                bottom: corner[0] === 's' ? 3 : 'auto',
                left: corner[1] === 'w' ? 3 : 'auto',
                right: corner[1] === 'e' ? 3 : 'auto',
              }}
            ></div>
          </div>
        ))}
      </div>
    </div>,
    document.body
  );
}

export default function FlowFloatLanding() {
  const [activeDemos, setActiveDemos] = React.useState([]);
  const [glowDemos, setGlowDemos] = React.useState([]);
  const [hiddenSideDemos, setHiddenSideDemos] = React.useState([]);
  const closeDemo = (demoKey) => setActiveDemos(activeDemos.filter(d => d !== demoKey));
  const closeSideDemo = (demoKey) => setHiddenSideDemos((prev) => [...prev, demoKey]);

  const SIDE_DEMOS = ['flownotes', 'flowtasks'];
  const handleDemoClick = (demoKey) => {
    if (SIDE_DEMOS.includes(demoKey)) {
      if (hiddenSideDemos.includes(demoKey)) {
        setHiddenSideDemos((prev) => prev.filter(d => d !== demoKey));
      }
      setGlowDemos((prev) => [...prev, demoKey]);
      setTimeout(() => setGlowDemos((prev) => prev.filter(d => d !== demoKey)), 1600);
    } else {
      setActiveDemos((prev) => [...prev, demoKey]);
    }
  };

  React.useEffect(() => {
    if (activeDemos.length === 0) return;
    const onKey = (e) => { if (e.key === 'Escape') setActiveDemos([]); };
    window.addEventListener('keydown', onKey);
    return () => window.removeEventListener('keydown', onKey);
  }, [activeDemos]);

  return (
    <div className="min-h-screen bg-gradient-to-b from-purple-950 via-black to-black text-white relative overflow-hidden">

{/* ALWAYS-VISIBLE SIDE FLOATING DEMOS */}
{/* FlowNotes — left side */}
{!hiddenSideDemos.includes('flownotes') && (
<FloatingDemo positionClass="top-[18%] left-12" animationClass={`animate-bounce-physics ${glowDemos.includes('flownotes') ? 'animate-demo-glow' : ''}`} initialScale={0.85}>
  <div
    className="relative overflow-hidden shadow-2xl shadow-purple-500/20"
    style={{
      width: 320,
      height: 500,
      borderRadius: 16,
      background: "rgba(10, 10, 20, 0.55)",
      border: "1.5px solid rgba(255,255,255,0.13)",
      outline: "1px solid rgba(0,0,0,0.8)",
      color: "rgba(235,225,255,0.97)",
      display: "flex",
      flexDirection: "column",
      fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
      fontSize: 12,
    }}
  >
    {/* Top gloss */}
    <div className="absolute inset-0 pointer-events-none" style={{borderRadius:15,background:"radial-gradient(ellipse 90% 28% at 50% 0%, rgba(255,255,255,0.08), transparent 55%), linear-gradient(180deg, rgba(120,80,255,0.06) 0%, transparent 40%)"}}></div>

    {/* Header */}
    <div className="relative z-10 flex items-center justify-between px-[14px] py-[10px]" style={{borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.04)"}}>
      <div className="flex items-center gap-[7px]">
        <div className="w-[22px] h-[22px] rounded-[6px] flex items-center justify-center flex-shrink-0" style={{background:"linear-gradient(135deg,rgb(124,58,237),rgb(219,39,119))"}}>
          <svg width="12" height="12" fill="none" stroke="rgba(255,255,255,0.9)" strokeWidth="2" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/></svg>
        </div>
        <span style={{fontSize:12,fontWeight:600,letterSpacing:"0.02em",color:"rgba(225,215,255,0.97)"}}>FlowNotes</span>
      </div>
      <div className="flex items-center gap-1">
        <button className="cursor-pointer px-[6px] py-[3px] rounded-[5px] transition-colors hover:bg-white/10" style={{background:"none",border:"none",color:"rgba(200,190,240,0.60)",fontSize:13,lineHeight:1}}>−</button>
        <button onClick={() => closeSideDemo('flownotes')} className="cursor-pointer px-[6px] py-[3px] rounded-[5px] transition-colors hover:bg-white/10" style={{background:"none",border:"none",color:"rgba(200,190,240,0.60)",fontSize:13,lineHeight:1}}>✕</button>
      </div>
    </div>

    {/* Search */}
    <div className="relative z-10 px-[10px] pt-[8px] pb-[6px]">
      <div className="flex items-center gap-[6px] px-[8px] py-[5px] rounded-[8px]" style={{background:"rgba(255,255,255,0.07)",border:"1px solid rgba(255,255,255,0.10)"}}>
        <svg width="13" height="13" fill="none" stroke="rgba(190,175,235,0.50)" strokeWidth="2" viewBox="0 0 24 24" className="flex-shrink-0"><circle cx="11" cy="11" r="8"/><path strokeLinecap="round" d="m21 21-4.35-4.35"/></svg>
        <span style={{fontSize:11,color:"rgba(150,130,200,0.50)",fontStyle:"italic"}}>Search notes...</span>
      </div>
    </div>

    {/* Notes list */}
    <div className="relative z-10 flex-1 overflow-y-auto px-[10px] flex flex-col gap-[5px]" style={{scrollbarWidth:"none"}}>
      {[
        {text:"The best interfaces disappear. They don't make you think — they let you think.", time:"2m ago", pinned:true},
        {text:"Meeting notes: rebrand kick-off went well. Logo direction = minimal, fluid. Follow up w/ Maya on color palette.", time:"18m ago"},
        {text:"\"We are what we repeatedly do. Excellence, then, is not an act, but a habit.\" — Aristotle", time:"1h ago"},
        {text:"Random thought — what if the app icon subtly animated when a timer is running? Like a slow pulse or glow.", time:"3h ago", done:true},
      ].map((note, i) => (
        <div key={i} className="group relative flex-shrink-0 px-[10px] py-[8px] rounded-[8px] transition-all" style={{
          background:"rgba(255,255,255,0.07)",
          border:`1px solid ${note.pinned ? "rgba(250,204,21,0.50)" : "rgba(255,255,255,0.12)"}`,
          borderLeft: note.pinned ? "2px solid rgba(250,204,21,0.70)" : undefined,
          opacity: note.done ? 0.45 : 1,
        }}>
          <div style={{fontSize:12,lineHeight:1.4,color:"rgba(200,180,255,0.90)",wordBreak:"break-word",textDecoration:note.done?"line-through":"none"}}>{note.text}</div>
          <div className="flex items-center justify-between mt-[5px]">
            <span style={{fontSize:10,color:"rgba(150,130,200,0.60)"}}>{note.time}</span>
            <div className="flex gap-[3px] opacity-0 group-hover:opacity-100 transition-opacity">
              {[
                <svg key="copy" width="12" height="12" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg>,
                <svg key="pin" width="12" height="12" fill={note.pinned?"currentColor":"none"} stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.56 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z"/></svg>,
                <svg key="edit" width="12" height="12" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>,
                <svg key="done" width="12" height="12" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg>,
              ].map((icon, j) => (
                <button key={j} className="flex items-center justify-center rounded-[5px] cursor-pointer transition-all hover:scale-105" style={{background:"rgba(124,58,237,0.28)",border:"1.5px solid rgba(124,58,237,0.45)",color:"#d4c8ff",padding:"4px 7px",fontSize:10}}>
                  {icon}
                </button>
              ))}
              <button className="flex items-center justify-center rounded-[5px] cursor-pointer transition-all hover:scale-105" style={{background:"rgba(239,68,68,0.22)",border:"1.5px solid rgba(239,68,68,0.45)",color:"#ffa0a0",padding:"4px 7px",fontSize:10}}>
                <svg width="12" height="12" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6m5 0V4a1 1 0 011-1h2a1 1 0 011 1v2"/></svg>
              </button>
            </div>
          </div>
        </div>
      ))}
    </div>

    {/* Input area */}
    <div className="relative z-10 px-[10px] py-[8px] flex flex-col gap-[6px]" style={{borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.18)"}}>
      <textarea
        readOnly
        rows={2}
        placeholder="Type a note... (Enter to add)"
        className="w-full rounded-[8px] px-[10px] py-[7px] resize-none outline-none"
        style={{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.15)",fontSize:12,color:"rgba(240,232,255,0.95)",fontFamily:"inherit",minHeight:48,maxHeight:80}}
      />
      <div className="flex items-center justify-between">
        <button className="rounded-[7px] px-[14px] py-[6px] cursor-pointer transition-all" style={{background:"linear-gradient(135deg,#7c3aed,#db2777)",border:"none",color:"white",fontSize:11,fontWeight:600}}>Add Note</button>
        <div className="flex gap-1">
          {["Clear Done","Export"].map(label => (
            <button key={label} className="cursor-pointer px-[5px] py-[2px] rounded-[4px] transition-colors hover:bg-white/10" style={{background:"none",border:"none",fontSize:10,color:"rgba(190,175,235,0.65)"}}>{label}</button>
          ))}
        </div>
      </div>
    </div>

    {/* Footer */}
    <div className="relative z-10 flex items-center justify-between px-[12px] pb-[8px] pt-[6px]" style={{borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.18)"}}>
      <div className="flex items-center gap-[5px]">
        <div className="w-[5px] h-[5px] rounded-full bg-green-400"></div>
        <span style={{fontSize:10,color:"rgba(190,175,235,0.65)"}}>3 notes, 1 done</span>
      </div>
      <div className="flex gap-1">
        {["Clipboard","Clear All"].map(label => (
          <button key={label} className="cursor-pointer px-[5px] py-[2px] rounded-[4px] transition-colors hover:bg-white/10" style={{background:"none",border:"none",fontSize:10,color:"rgba(190,175,235,0.65)"}}>{label}</button>
        ))}
      </div>
    </div>
  </div>
</FloatingDemo>
)}

{/* FlowTasks — right side */}
{!hiddenSideDemos.includes('flowtasks') && (
<FloatingDemo positionClass="top-[22%] right-4" animationClass={`animate-bounce-physics-delayed ${glowDemos.includes('flowtasks') ? 'animate-demo-glow' : ''}`} initialScale={0.85}>
  <div
    className="relative overflow-hidden shadow-2xl shadow-purple-500/20"
    style={{
      width: 340,
      height: 480,
      borderRadius: 18,
      background: "rgba(10, 10, 20, 0.55)",
      border: "1.5px solid rgba(255,255,255,0.13)",
      outline: "1px solid rgba(0,0,0,0.8)",
      color: "rgba(235,225,255,0.97)",
      display: "flex",
      flexDirection: "column",
      fontFamily: "'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",
    }}
  >
    {/* Top gloss */}
    <div className="absolute inset-0 pointer-events-none" style={{borderRadius:17,background:"radial-gradient(ellipse 90% 28% at 50% 0%, rgba(255,255,255,0.08), transparent 55%), linear-gradient(180deg, rgba(120,80,255,0.06) 0%, transparent 40%)"}}></div>

    {/* Header */}
    <div className="relative z-10 flex items-center justify-between flex-shrink-0" style={{padding:"11px 14px 9px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.04)"}}>
      <div className="flex items-center gap-[7px]">
        <div className="flex items-center justify-center flex-shrink-0" style={{width:22,height:22,borderRadius:6,background:"linear-gradient(135deg,rgb(124,58,237),rgb(219,39,119))"}}>
          <svg width="13" height="13" fill="none" stroke="#fff" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M4.5 12.75l6 6 9-13.5"/></svg>
        </div>
        <span style={{fontSize:12,fontWeight:600,letterSpacing:"0.02em",color:"rgba(225,215,255,0.97)"}}>FlowTasks</span>
      </div>
      <div className="flex items-center gap-1">
        <button className="cursor-pointer transition-colors hover:bg-white/10 flex items-center justify-center" style={{background:"none",border:"none",color:"rgba(200,190,240,0.55)",padding:"3px 5px",borderRadius:5}} title="Minimize">
          <svg width="14" height="14" fill="none" stroke="currentColor" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M5 12h14"/></svg>
        </button>
        <button onClick={() => closeSideDemo('flowtasks')} className="cursor-pointer transition-colors hover:bg-white/10 flex items-center justify-center" style={{background:"none",border:"none",color:"rgba(200,190,240,0.55)",padding:"3px 5px",borderRadius:5}} title="Close">
          <svg width="14" height="14" fill="none" stroke="currentColor" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
        </button>
      </div>
    </div>

    {/* Progress */}
    <div className="relative z-10 flex-shrink-0" style={{padding:"10px 14px 8px"}}>
      <div className="flex items-center justify-between" style={{marginBottom:6}}>
        <span style={{fontSize:11,fontWeight:600,color:"rgba(200,180,255,0.80)"}}>Tasks</span>
        <span style={{fontSize:10,color:"rgba(180,160,220,0.65)"}}>2 / 5</span>
      </div>
      <div style={{width:"100%",height:4,background:"rgba(255,255,255,0.08)",borderRadius:2,overflow:"hidden"}}>
        <div style={{width:"40%",height:"100%",background:"linear-gradient(90deg,rgb(124,58,237),rgb(74,222,128))",borderRadius:2}}></div>
      </div>
    </div>

    {/* Task list */}
    <div className="relative z-10 flex-1 overflow-y-auto" style={{padding:"0 10px 10px",display:"flex",flexDirection:"column",gap:5,scrollbarWidth:"thin"}}>
      {[
        { text: "Finish the presentation for Monday", done: false },
        { text: "Reply to Sarah's email about dinner", done: false },
        { text: "30 min run before it gets dark", done: false },
        { text: "Pick up dry cleaning on 5th Ave", done: true },
        { text: "Cancel free trial before it renews", done: true },
      ].map((t, i) => (
        <div key={i} className="group/task flex items-start flex-shrink-0 transition-colors" style={{gap:8,padding:"8px 10px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.10)",borderRadius:10,opacity:t.done?0.55:1}}>
          <div className="flex items-center justify-center flex-shrink-0 cursor-pointer transition-all" style={{width:17,height:17,border:t.done?"2px solid transparent":"2px solid rgba(124,58,237,0.50)",borderRadius:4,background:t.done?"linear-gradient(135deg,rgb(124,58,237),rgb(219,39,119))":"transparent",marginTop:1}}>
            {t.done && (
              <svg width="11" height="11" fill="none" stroke="#fff" strokeWidth="3" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M5 13l4 4L19 7"/></svg>
            )}
          </div>
          <div className="flex-1" style={{fontSize:12,lineHeight:1.45,color:t.done?"rgba(160,140,200,0.60)":"rgba(210,195,255,0.90)",wordBreak:"break-word",padding:"1px 0",textDecoration:t.done?"line-through":"none"}}>{t.text}</div>
          <button className="opacity-0 group-hover/task:opacity-100 flex items-center justify-center cursor-pointer transition-opacity" style={{width:17,height:17,border:"2px solid rgba(239,68,68,0.45)",borderRadius:4,background:"transparent",color:"rgba(239,68,68,0.70)",padding:0,marginTop:1,flexShrink:0}}>
            <svg width="10" height="10" fill="none" stroke="currentColor" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
          </button>
        </div>
      ))}
    </div>

    {/* Input */}
    <div className="relative z-10 flex-shrink-0" style={{padding:"10px 12px",borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.28)"}}>
      <div className="flex items-center" style={{gap:8}}>
        <input
          readOnly
          type="text"
          placeholder="Add a new task..."
          className="flex-1 outline-none"
          style={{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:10,padding:"8px 12px",fontSize:12,color:"rgba(240,232,255,0.95)",fontFamily:"inherit"}}
        />
        <button className="flex items-center justify-center cursor-pointer transition-transform hover:-translate-y-px" style={{background:"linear-gradient(135deg,rgb(124,58,237),rgb(219,39,119))",border:"none",borderRadius:10,width:36,height:36,flexShrink:0}} title="Add task">
          <svg width="16" height="16" fill="none" stroke="#fff" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
        </button>
      </div>
    </div>

    {/* Footer */}
    <div className="relative z-10 flex items-center justify-between flex-shrink-0" style={{padding:"6px 14px 8px",borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.28)"}}>
      <div className="flex items-center" style={{gap:6}}>
        <div style={{width:6,height:6,borderRadius:"50%",background:"rgb(74,222,128)",flexShrink:0}}></div>
        <span style={{fontSize:10,color:"rgba(190,175,235,0.65)"}}>5 tasks</span>
      </div>
      <div className="flex items-center" style={{gap:2}}>
        <button className="cursor-pointer transition-colors hover:bg-white/[0.08]" style={{fontSize:10,color:"rgba(190,175,235,0.60)",background:"none",border:"none",padding:"3px 6px",borderRadius:5}}>Clear Done</button>
        <button className="cursor-pointer transition-colors hover:bg-white/[0.08]" style={{fontSize:10,color:"rgba(190,175,235,0.60)",background:"none",border:"none",padding:"3px 6px",borderRadius:5}}>Export</button>
      </div>
    </div>
  </div>
</FloatingDemo>
)}

{/* FLOATING DEMO NOTES */}
{activeDemos.includes('flownotes') && (
<FloatingDemo positionClass="top-20 right-8" animationClass="animate-bounce-physics">
  <div
    className="relative overflow-hidden shadow-2xl shadow-purple-500/20"
    style={{
      width: 320,
      height: 500,
      borderRadius: 16,
      background: "rgba(10, 10, 20, 0.55)",
      border: "1.5px solid rgba(255,255,255,0.13)",
      outline: "1px solid rgba(0,0,0,0.8)",
      color: "rgba(235,225,255,0.97)",
      display: "flex",
      flexDirection: "column",
      fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
      fontSize: 12,
    }}
  >
    {/* Top gloss */}
    <div className="absolute inset-0 pointer-events-none" style={{borderRadius:15,background:"radial-gradient(ellipse 90% 28% at 50% 0%, rgba(255,255,255,0.08), transparent 55%), linear-gradient(180deg, rgba(120,80,255,0.06) 0%, transparent 40%)"}}></div>

    {/* Header */}
    <div className="relative z-10 flex items-center justify-between px-[14px] py-[10px]" style={{borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.04)"}}>
      <div className="flex items-center gap-[7px]">
        <div className="w-[22px] h-[22px] rounded-[6px] flex items-center justify-center flex-shrink-0" style={{background:"linear-gradient(135deg,rgb(124,58,237),rgb(219,39,119))"}}>
          <svg width="12" height="12" fill="none" stroke="rgba(255,255,255,0.9)" strokeWidth="2" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/></svg>
        </div>
        <span style={{fontSize:12,fontWeight:600,letterSpacing:"0.02em",color:"rgba(225,215,255,0.97)"}}>FlowNotes</span>
      </div>
      <div className="flex items-center gap-1">
        <button className="cursor-pointer px-[6px] py-[3px] rounded-[5px] transition-colors hover:bg-white/10" style={{background:"none",border:"none",color:"rgba(200,190,240,0.60)",fontSize:13,lineHeight:1}}>−</button>
        <button onClick={() => closeDemo('flownotes')} className="cursor-pointer px-[6px] py-[3px] rounded-[5px] transition-colors hover:bg-white/10" style={{background:"none",border:"none",color:"rgba(200,190,240,0.60)",fontSize:13,lineHeight:1}}>✕</button>
      </div>
    </div>

    {/* Search */}
    <div className="relative z-10 px-[10px] pt-[8px] pb-[6px]">
      <div className="flex items-center gap-[6px] px-[8px] py-[5px] rounded-[8px]" style={{background:"rgba(255,255,255,0.07)",border:"1px solid rgba(255,255,255,0.10)"}}>
        <svg width="13" height="13" fill="none" stroke="rgba(190,175,235,0.50)" strokeWidth="2" viewBox="0 0 24 24" className="flex-shrink-0"><circle cx="11" cy="11" r="8"/><path strokeLinecap="round" d="m21 21-4.35-4.35"/></svg>
        <span style={{fontSize:11,color:"rgba(150,130,200,0.50)",fontStyle:"italic"}}>Search notes...</span>
      </div>
    </div>

    {/* Notes list */}
    <div className="relative z-10 flex-1 overflow-y-auto px-[10px] flex flex-col gap-[5px]" style={{scrollbarWidth:"thin"}}>
      {[
        {text:"Review FlowFloat landing page copy", time:"2m ago", pinned:true},
        {text:"Test always-on-top behavior across monitors", time:"14m ago"},
        {text:"Check responsive design at 1080p + 4K", time:"1h ago"},
        {text:"Share beta link with design team", time:"3h ago", done:true},
      ].map((note, i) => (
        <div key={i} className="group relative flex-shrink-0 px-[10px] py-[8px] rounded-[8px] transition-all" style={{
          background:"rgba(255,255,255,0.07)",
          border:`1px solid ${note.pinned ? "rgba(250,204,21,0.50)" : "rgba(255,255,255,0.12)"}`,
          borderLeft: note.pinned ? "2px solid rgba(250,204,21,0.70)" : undefined,
          opacity: note.done ? 0.45 : 1,
        }}>
          <div style={{fontSize:12,lineHeight:1.4,color:"rgba(200,180,255,0.90)",wordBreak:"break-word",textDecoration:note.done?"line-through":"none"}}>{note.text}</div>
          <div className="flex items-center justify-between mt-[5px]">
            <span style={{fontSize:10,color:"rgba(150,130,200,0.60)"}}>{note.time}</span>
            <div className="flex gap-[3px] opacity-0 group-hover:opacity-100 transition-opacity">
              {[
                <svg key="copy" width="12" height="12" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg>,
                <svg key="pin" width="12" height="12" fill={note.pinned?"currentColor":"none"} stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.56 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z"/></svg>,
                <svg key="edit" width="12" height="12" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>,
                <svg key="done" width="12" height="12" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg>,
              ].map((icon, j) => (
                <button key={j} className="flex items-center justify-center rounded-[5px] cursor-pointer transition-all hover:scale-105" style={{background:"rgba(124,58,237,0.28)",border:"1.5px solid rgba(124,58,237,0.45)",color:"#d4c8ff",padding:"4px 7px",fontSize:10}}>
                  {icon}
                </button>
              ))}
              <button className="flex items-center justify-center rounded-[5px] cursor-pointer transition-all hover:scale-105" style={{background:"rgba(239,68,68,0.22)",border:"1.5px solid rgba(239,68,68,0.45)",color:"#ffa0a0",padding:"4px 7px",fontSize:10}}>
                <svg width="12" height="12" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6m5 0V4a1 1 0 011-1h2a1 1 0 011 1v2"/></svg>
              </button>
            </div>
          </div>
        </div>
      ))}
    </div>

    {/* Input area */}
    <div className="relative z-10 px-[10px] py-[8px] flex flex-col gap-[6px]" style={{borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.18)"}}>
      <textarea
        readOnly
        rows={2}
        placeholder="Type a note... (Enter to add)"
        className="w-full rounded-[8px] px-[10px] py-[7px] resize-none outline-none"
        style={{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.15)",fontSize:12,color:"rgba(240,232,255,0.95)",fontFamily:"inherit",minHeight:48,maxHeight:80}}
      />
      <div className="flex items-center justify-between">
        <button className="rounded-[7px] px-[14px] py-[6px] cursor-pointer transition-all" style={{background:"linear-gradient(135deg,#7c3aed,#db2777)",border:"none",color:"white",fontSize:11,fontWeight:600}}>Add Note</button>
        <div className="flex gap-1">
          {["Clear Done","Export"].map(label => (
            <button key={label} className="cursor-pointer px-[5px] py-[2px] rounded-[4px] transition-colors hover:bg-white/10" style={{background:"none",border:"none",fontSize:10,color:"rgba(190,175,235,0.65)"}}>{label}</button>
          ))}
        </div>
      </div>
    </div>

    {/* Footer */}
    <div className="relative z-10 flex items-center justify-between px-[12px] pb-[8px] pt-[6px]" style={{borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.18)"}}>
      <div className="flex items-center gap-[5px]">
        <div className="w-[5px] h-[5px] rounded-full bg-green-400"></div>
        <span style={{fontSize:10,color:"rgba(190,175,235,0.65)"}}>3 active, 1 done</span>
      </div>
      <div className="flex gap-1">
        {["Clipboard","Clear All"].map(label => (
          <button key={label} className="cursor-pointer px-[5px] py-[2px] rounded-[4px] transition-colors hover:bg-white/10" style={{background:"none",border:"none",fontSize:10,color:"rgba(190,175,235,0.65)"}}>{label}</button>
        ))}
      </div>
    </div>
  </div>
</FloatingDemo>
)}

{/* FLOATING DEMO SLACK INTEGRATION */}
{activeDemos.includes('flowslack') && (
<FloatingDemo positionClass="bottom-8 left-8" animationClass="animate-bounce-physics-delayed">
  <div className="relative backdrop-blur-xl bg-black/50 border border-white/20 rounded-2xl p-4 shadow-2xl shadow-purple-500/20 min-w-[280px] max-w-[320px] overflow-hidden">
    
    {/* Gradient overlay for consistent contrast */}
    <div className="absolute inset-0 bg-gradient-to-br from-black/60 via-purple-900/40 to-black/60 pointer-events-none"></div>

    <div className="relative z-10">
      
      {/* Header */}
      <div className="flex items-center justify-between mb-3">
        <div className="flex items-center gap-2">
          <div className="w-2 h-2 rounded-full bg-green-400 animate-pulse"></div>
          <div className="w-6 h-6 rounded bg-purple-600 flex items-center justify-center">
            <span className="text-white text-xs font-bold">S</span>
          </div>
          <span className="text-xs text-purple-100 font-medium">FlowSlack</span>
        </div>
        <button onClick={() => closeDemo('flowslack')} className="text-purple-200/70 hover:text-purple-100">
          <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
          </svg>
        </button>
      </div>

      <div className="space-y-3 mb-3">

        {/* Channels */}
        <div className="p-2 rounded-xl bg-purple-900/30 border border-purple-700/40">
          <div className="flex items-center justify-between mb-2">
            <span className="text-xs font-semibold text-purple-200 flex items-center gap-1">
              📌 Pinned Channels
            </span>
          </div>

          <div className="space-y-1">
            {[
              { name: "general", count: 12 },
              { name: "product", count: 8 },
              { name: "dev-team", count: 5 },
              { name: "leadership", count: 3, lock: true },
            ].map((channel, i) => (
              <div key={i} className="flex items-center gap-2 p-1 rounded hover:bg-purple-800/30 cursor-pointer transition-colors">
                <span className="text-purple-300">{channel.lock ? "🔒" : "#"}</span>
                <span className="text-xs text-purple-100">{channel.name}</span>
                <span className="text-xs text-purple-300/70 ml-auto">{channel.count}</span>
              </div>
            ))}
          </div>
        </div>

        {/* People */}
        <div className="p-2 rounded-xl bg-purple-900/30 border border-purple-700/40">
          <div className="flex items-center justify-between mb-2">
            <span className="text-xs font-semibold text-purple-200 flex items-center gap-1">
              📍 Pinned People & Group Chats
            </span>
          </div>

          <div className="space-y-1">

            {[
              { name: "John Dev", initials: "JD", color: "bg-green-500", status: "online" },
              { name: "Sarah Manager", initials: "SM", color: "bg-blue-500", status: "online" },
              { name: "Design Team", initials: "GC", color: "bg-gradient-to-br from-purple-500 to-pink-500", count: 5 },
              { name: "Alex Designer", initials: "AD", color: "bg-purple-500", status: "away" },
              { name: "Project Alpha", initials: "PM", color: "bg-gradient-to-br from-orange-500 to-red-500", count: 12 },
              { name: "Tech Bot", initials: "TB", color: "bg-orange-500", status: "offline" },
            ].map((person, i) => (
              <div key={i} className="flex items-center gap-2 p-1 rounded hover:bg-purple-800/30 cursor-pointer transition-colors">
                
                <div className={`w-4 h-4 rounded flex items-center justify-center ${person.color}`}>
                  <span className="text-white text-xs font-bold">{person.initials}</span>
                </div>

                <span className="text-xs text-purple-100">{person.name}</span>

                {person.status && (
                  <div
                    className={`w-2 h-2 rounded-full ml-auto ${
                      person.status === "online"
                        ? "bg-green-400"
                        : person.status === "away"
                        ? "bg-yellow-400"
                        : "bg-gray-400"
                    }`}
                  ></div>
                )}

                {person.count && (
                  <span className="text-xs text-purple-300/70 ml-auto">{person.count}</span>
                )}
              </div>
            ))}

          </div>
        </div>

      </div>

      {/* Footer */}
      <div className="flex items-center justify-between text-xs text-purple-200/70">
        <div className="flex items-center gap-2">
          <span>🔗 4 channels, 4 people</span>
          <div className="w-2 h-2 rounded-full bg-green-400"></div>
        </div>
        <button className="hover:text-purple-100 transition-colors">
          ⚙️ Settings
        </button>
      </div>

    </div>
  </div>
</FloatingDemo>
)}

{/* FLOATING DEMO TASKS */}
{activeDemos.includes('flowtasks') && (
<FloatingDemo positionClass="bottom-8 left-8" animationClass="animate-bounce-physics-delayed">
  <div
    className="relative overflow-hidden shadow-2xl shadow-purple-500/20"
    style={{
      width: 340,
      height: 480,
      borderRadius: 18,
      background: "rgba(10, 10, 20, 0.55)",
      border: "1.5px solid rgba(255,255,255,0.13)",
      outline: "1px solid rgba(0,0,0,0.8)",
      color: "rgba(235,225,255,0.97)",
      display: "flex",
      flexDirection: "column",
      fontFamily: "'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",
    }}
  >
    {/* Top gloss */}
    <div className="absolute inset-0 pointer-events-none" style={{borderRadius:17,background:"radial-gradient(ellipse 90% 28% at 50% 0%, rgba(255,255,255,0.08), transparent 55%), linear-gradient(180deg, rgba(120,80,255,0.06) 0%, transparent 40%)"}}></div>

    {/* Header */}
    <div className="relative z-10 flex items-center justify-between flex-shrink-0" style={{padding:"11px 14px 9px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.04)"}}>
      <div className="flex items-center gap-[7px]">
        <div className="flex items-center justify-center flex-shrink-0" style={{width:22,height:22,borderRadius:6,background:"linear-gradient(135deg,rgb(124,58,237),rgb(219,39,119))"}}>
          <svg width="13" height="13" fill="none" stroke="#fff" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M4.5 12.75l6 6 9-13.5"/></svg>
        </div>
        <span style={{fontSize:12,fontWeight:600,letterSpacing:"0.02em",color:"rgba(225,215,255,0.97)"}}>FlowTasks</span>
      </div>
      <div className="flex items-center gap-1">
        <button className="cursor-pointer transition-colors hover:bg-white/10 flex items-center justify-center" style={{background:"none",border:"none",color:"rgba(200,190,240,0.55)",padding:"3px 5px",borderRadius:5}} title="Minimize">
          <svg width="14" height="14" fill="none" stroke="currentColor" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M5 12h14"/></svg>
        </button>
        <button onClick={() => closeDemo('flowtasks')} className="cursor-pointer transition-colors hover:bg-white/10 flex items-center justify-center" style={{background:"none",border:"none",color:"rgba(200,190,240,0.55)",padding:"3px 5px",borderRadius:5}} title="Close">
          <svg width="14" height="14" fill="none" stroke="currentColor" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
        </button>
      </div>
    </div>

    {/* Progress */}
    <div className="relative z-10 flex-shrink-0" style={{padding:"10px 14px 8px"}}>
      <div className="flex items-center justify-between" style={{marginBottom:6}}>
        <span style={{fontSize:11,fontWeight:600,color:"rgba(200,180,255,0.80)"}}>Tasks</span>
        <span style={{fontSize:10,color:"rgba(180,160,220,0.65)"}}>2 / 5</span>
      </div>
      <div style={{width:"100%",height:4,background:"rgba(255,255,255,0.08)",borderRadius:2,overflow:"hidden"}}>
        <div style={{width:"40%",height:"100%",background:"linear-gradient(90deg,rgb(124,58,237),rgb(74,222,128))",borderRadius:2}}></div>
      </div>
    </div>

    {/* Task list */}
    <div className="relative z-10 flex-1 overflow-y-auto" style={{padding:"0 10px 10px",display:"flex",flexDirection:"column",gap:5,scrollbarWidth:"thin"}}>
      {[
        { text: "Review FlowFloat landing page copy", done: false },
        { text: "Test always-on-top across monitors", done: false },
        { text: "Check responsive design at 1080p + 4K", done: false },
        { text: "Share beta link with design team", done: true },
        { text: "Set up icon asset pipeline", done: true },
      ].map((t, i) => (
        <div key={i} className="group/task flex items-start flex-shrink-0 transition-colors" style={{gap:8,padding:"8px 10px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.10)",borderRadius:10,opacity:t.done?0.55:1}}>
          <div className="flex items-center justify-center flex-shrink-0 cursor-pointer transition-all" style={{width:17,height:17,border:t.done?"2px solid transparent":"2px solid rgba(124,58,237,0.50)",borderRadius:4,background:t.done?"linear-gradient(135deg,rgb(124,58,237),rgb(219,39,119))":"transparent",marginTop:1}}>
            {t.done && (
              <svg width="11" height="11" fill="none" stroke="#fff" strokeWidth="3" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M5 13l4 4L19 7"/></svg>
            )}
          </div>
          <div className="flex-1" style={{fontSize:12,lineHeight:1.45,color:t.done?"rgba(160,140,200,0.60)":"rgba(210,195,255,0.90)",wordBreak:"break-word",padding:"1px 0",textDecoration:t.done?"line-through":"none"}}>{t.text}</div>
          <button className="opacity-0 group-hover/task:opacity-100 flex items-center justify-center cursor-pointer transition-opacity" style={{width:17,height:17,border:"2px solid rgba(239,68,68,0.45)",borderRadius:4,background:"transparent",color:"rgba(239,68,68,0.70)",padding:0,marginTop:1,flexShrink:0}}>
            <svg width="10" height="10" fill="none" stroke="currentColor" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
          </button>
        </div>
      ))}
    </div>

    {/* Input */}
    <div className="relative z-10 flex-shrink-0" style={{padding:"10px 12px",borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.28)"}}>
      <div className="flex items-center" style={{gap:8}}>
        <input
          readOnly
          type="text"
          placeholder="Add a new task..."
          className="flex-1 outline-none"
          style={{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:10,padding:"8px 12px",fontSize:12,color:"rgba(240,232,255,0.95)",fontFamily:"inherit"}}
        />
        <button className="flex items-center justify-center cursor-pointer transition-transform hover:-translate-y-px" style={{background:"linear-gradient(135deg,rgb(124,58,237),rgb(219,39,119))",border:"none",borderRadius:10,width:36,height:36,flexShrink:0}} title="Add task">
          <svg width="16" height="16" fill="none" stroke="#fff" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
        </button>
      </div>
    </div>

    {/* Footer */}
    <div className="relative z-10 flex items-center justify-between flex-shrink-0" style={{padding:"6px 14px 8px",borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.28)"}}>
      <div className="flex items-center" style={{gap:6}}>
        <div style={{width:6,height:6,borderRadius:"50%",background:"rgb(74,222,128)",flexShrink:0}}></div>
        <span style={{fontSize:10,color:"rgba(190,175,235,0.65)"}}>5 tasks</span>
      </div>
      <div className="flex items-center" style={{gap:2}}>
        <button className="cursor-pointer transition-colors hover:bg-white/[0.08]" style={{fontSize:10,color:"rgba(190,175,235,0.60)",background:"none",border:"none",padding:"3px 6px",borderRadius:5}}>Clear Done</button>
        <button className="cursor-pointer transition-colors hover:bg-white/[0.08]" style={{fontSize:10,color:"rgba(190,175,235,0.60)",background:"none",border:"none",padding:"3px 6px",borderRadius:5}}>Export</button>
      </div>
    </div>
  </div>
</FloatingDemo>
)}

    {/* FLOATING DEMO LLM CHATBOT */}
{activeDemos.includes('flowai') && (
<FloatingDemo positionClass="top-20 left-8" animationClass="animate-bounce-physics-center">
  <div
    className="relative overflow-hidden shadow-2xl shadow-purple-500/20"
    style={{
      width: 360,
      height: 520,
      borderRadius: 18,
      background: "rgba(10, 10, 20, 0.55)",
      border: "1.5px solid rgba(255,255,255,0.13)",
      outline: "1px solid rgba(0,0,0,0.8)",
      color: "rgba(235,225,255,0.97)",
      display: "flex",
      flexDirection: "column",
      fontFamily: "'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",
    }}
  >
    {/* Top gloss */}
    <div className="absolute inset-0 pointer-events-none" style={{borderRadius:17,background:"radial-gradient(ellipse 90% 28% at 50% 0%, rgba(255,255,255,0.08), transparent 55%), linear-gradient(180deg, rgba(120,80,255,0.06) 0%, transparent 40%)"}}></div>

    {/* Header */}
    <div className="relative z-10 flex items-center justify-between flex-shrink-0" style={{padding:"11px 14px 9px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.04)"}}>
      <div className="flex items-center gap-[7px]">
        <div className="flex items-center justify-center flex-shrink-0" style={{width:22,height:22,borderRadius:6,background:"linear-gradient(135deg,rgb(124,58,237),rgb(219,39,119))",fontSize:10,fontWeight:700,color:"#fff"}}>AI</div>
        <span style={{fontSize:12,fontWeight:600,letterSpacing:"0.02em",color:"rgba(225,215,255,0.97)"}}>FlowAI</span>
        <span style={{fontSize:9,fontWeight:600,letterSpacing:"0.03em",background:"rgba(124,58,237,0.22)",border:"1px solid rgba(124,58,237,0.35)",color:"rgba(200,180,255,0.90)",padding:"1px 6px",borderRadius:4,marginLeft:2}}>GPT-4.1 mini</span>
      </div>
      <div className="flex items-center gap-1">
        <button className="cursor-pointer transition-colors hover:bg-white/10 flex items-center justify-center" style={{background:"none",border:"none",color:"rgba(200,190,240,0.55)",padding:"3px 5px",borderRadius:5}} title="Hide">
          <svg width="14" height="14" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M20 12H4"/></svg>
        </button>
        <button onClick={() => closeDemo('flowai')} className="cursor-pointer transition-colors hover:bg-white/10 flex items-center justify-center" style={{background:"none",border:"none",color:"rgba(200,190,240,0.55)",padding:"3px 5px",borderRadius:5}} title="Close">
          <svg width="14" height="14" fill="none" stroke="currentColor" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
        </button>
      </div>
    </div>

    {/* Welcome / chat body */}
    <div className="relative z-10 flex-1 flex flex-col items-center justify-center text-center" style={{padding:"20px 18px",gap:14}}>
      <div className="flex items-center justify-center" style={{width:44,height:44,borderRadius:"50%",background:"linear-gradient(135deg,rgba(124,58,237,0.35),rgba(219,39,119,0.35))",border:"1.5px solid rgba(124,58,237,0.45)"}}>
        <svg width="22" height="22" fill="none" stroke="rgba(220,200,255,0.9)" strokeWidth="1.8" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456z"/></svg>
      </div>
      <h2 style={{fontSize:15,fontWeight:600,color:"rgba(240,232,255,0.97)",margin:0}}>FlowAI Assistant</h2>
      <p style={{fontSize:12,color:"rgba(200,180,255,0.78)",lineHeight:1.5,margin:0,maxWidth:260}}>Ask me anything — coding, writing, analysis, or just thinking out loud.</p>

      <div className="flex flex-col w-full" style={{gap:6,marginTop:4}}>
        {[
          "Explain quantum computing simply",
          "Help me write a business plan",
          "Debug this React component",
        ].map((s, i) => (
          <button key={i} className="w-full text-left cursor-pointer transition-colors hover:bg-white/[0.14]" style={{background:"rgba(255,255,255,0.07)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:10,padding:"8px 12px",fontSize:11.5,color:"rgba(200,180,255,0.80)",fontFamily:"inherit"}}>{s}</button>
        ))}
      </div>
    </div>

    {/* Input section */}
    <div className="relative z-10 flex-shrink-0" style={{padding:"10px 12px",borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.15)"}}>
      <div className="flex items-end" style={{gap:8}}>
        <textarea
          readOnly
          rows={1}
          placeholder="Message FlowAI..."
          className="flex-1 resize-none outline-none"
          style={{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:10,padding:"8px 12px",fontSize:12,color:"rgba(240,232,255,0.95)",fontFamily:"inherit",minHeight:36,maxHeight:80,lineHeight:1.4}}
        />
        <button className="flex items-center justify-center cursor-pointer transition-transform hover:-translate-y-px" style={{background:"linear-gradient(135deg,rgb(124,58,237),rgb(219,39,119))",border:"none",borderRadius:10,width:36,height:36,flexShrink:0}} title="Send">
          <svg width="16" height="16" fill="none" stroke="#fff" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"/></svg>
        </button>
      </div>
    </div>

    {/* Footer */}
    <div className="relative z-10 flex items-center justify-between flex-shrink-0" style={{padding:"6px 14px 8px",borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.15)"}}>
      <div className="flex items-center" style={{gap:6}}>
        <div style={{width:6,height:6,borderRadius:"50%",background:"#4ade80"}}></div>
        <span style={{fontSize:10,color:"rgba(190,175,235,0.65)"}}>Ready</span>
      </div>
      <button className="cursor-pointer transition-colors hover:bg-white/[0.08]" style={{fontSize:10,color:"rgba(190,175,235,0.60)",background:"none",border:"none",padding:"3px 6px",borderRadius:5}}>Clear</button>
    </div>
  </div>
</FloatingDemo>
)}
     {/* FLOATING DEMO POMODORO TIMER */}
{activeDemos.includes('flowtime') && (
<FloatingDemo positionClass="bottom-8 right-8" animationClass="animate-bounce-physics-pomodoro">
  <div
    className="relative overflow-hidden"
    style={{
      width: 280,
      height: 320,
      padding: 12,
      borderRadius: 16,
      background: "rgba(0, 0, 0, 0.5)",
      border: "1px solid rgba(255,255,255,0.2)",
      boxShadow: "0 8px 32px rgba(147, 51, 234, 0.2)",
      color: "rgba(240,232,255,0.95)",
      display: "flex",
      flexDirection: "column",
      fontFamily: "'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
    }}
  >
    {/* Tinted gradient overlay (matches real app's ::before) */}
    <div className="absolute inset-0 pointer-events-none" style={{borderRadius:16,background:"linear-gradient(135deg, rgba(0,0,0,0.6), rgba(147,51,234,0.4), rgba(0,0,0,0.6))"}}></div>

    {/* Header */}
    <div className="relative flex items-center justify-between" style={{marginBottom:6,zIndex:2}}>
      <div className="flex items-center" style={{gap:8}}>
        <div className="animate-pulse" style={{width:8,height:8,borderRadius:"50%",background:"#ef4444"}}></div>
        <span style={{fontSize:12,fontWeight:500,color:"rgba(240,232,255,0.95)"}}>FlowPomo</span>
      </div>
      <div className="flex items-center" style={{gap:2}}>
        <button className="cursor-pointer transition-colors hover:text-white" style={{color:"rgba(240,232,255,0.7)",background:"none",border:"none",padding:4,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center"}} title="Minimize">
          <svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M5 12h14"/></svg>
        </button>
        <button onClick={() => closeDemo('flowtime')} className="cursor-pointer transition-colors hover:text-white" style={{color:"rgba(240,232,255,0.7)",background:"none",border:"none",padding:4,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center"}} title="Close">
          <svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12"/></svg>
        </button>
      </div>
    </div>

    {/* Timer section */}
    <div className="relative text-center" style={{marginBottom:6,zIndex:2}}>
      <div className="relative mx-auto" style={{width:160,height:160,marginBottom:4}}>
        <svg width="160" height="160" viewBox="0 0 160 160" style={{transform:"rotate(-90deg)",overflow:"visible"}}>
          <defs>
            <linearGradient id="flowtime-demo-gradient" x1="0%" y1="0%" x2="100%" y2="100%">
              <stop offset="0%" stopColor="#ef4444"/>
              <stop offset="100%" stopColor="#a855f7"/>
            </linearGradient>
          </defs>
          <circle cx="80" cy="80" r="70" stroke="rgba(255,255,255,0.15)" strokeWidth="6" fill="none"/>
          <circle
            cx="80"
            cy="80"
            r="70"
            stroke="url(#flowtime-demo-gradient)"
            strokeWidth="6"
            fill="none"
            strokeLinecap="round"
            strokeDasharray={2 * Math.PI * 70}
            strokeDashoffset={2 * Math.PI * 70 * 0.25}
            style={{filter:"drop-shadow(0 0 4px rgba(168,85,247,0.6))"}}
          />
        </svg>
        <div className="absolute inset-0 flex flex-col items-center justify-center">
          <div style={{fontSize:40,fontWeight:700,lineHeight:1,fontFamily:"'JetBrains Mono','SF Mono','Monaco',monospace",color:"rgba(240,232,255,0.95)"}}>18:47</div>
          <div style={{fontSize:13,color:"rgba(240,232,255,0.5)",marginTop:2}}>Focus Time</div>
        </div>
      </div>

      <div className="flex justify-center" style={{gap:6,marginBottom:4}}>
        <button className="cursor-pointer transition-all hover:brightness-110" style={{padding:"6px 12px",borderRadius:10,fontSize:12,fontWeight:500,color:"rgba(240,232,255,0.95)",border:"1px solid rgba(255,255,255,0.1)",background:"linear-gradient(135deg, rgba(239,68,68,0.3), rgba(168,85,247,0.3))",fontFamily:"inherit"}}>Start</button>
        <button className="cursor-pointer transition-all hover:bg-white/20" style={{padding:"6px 12px",borderRadius:10,fontSize:12,fontWeight:500,color:"rgba(240,232,255,0.95)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)",fontFamily:"inherit"}}>Pause</button>
        <button className="cursor-pointer transition-all hover:bg-white/20" style={{padding:"6px 12px",borderRadius:10,fontSize:12,fontWeight:500,color:"rgba(240,232,255,0.95)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)",fontFamily:"inherit"}}>Reset</button>
      </div>
    </div>

    {/* Footer */}
    <div className="relative flex items-center justify-between" style={{fontSize:10,color:"rgba(240,232,255,0.5)",marginTop:"auto",zIndex:2}}>
      <span>⏱️ 2 sessions completed</span>
      <div className="flex" style={{gap:4}}>
        <button className="cursor-pointer transition-all hover:bg-white/15" style={{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.12)",color:"rgba(240,232,255,0.55)",padding:"3px 8px",borderRadius:20,fontSize:11,fontWeight:500,fontFamily:"inherit"}}>5m</button>
        <button className="cursor-pointer transition-all" style={{background:"linear-gradient(135deg, rgba(239,68,68,0.3), rgba(168,85,247,0.3))",border:"1px solid rgba(168,85,247,0.4)",color:"rgba(240,232,255,0.95)",padding:"3px 8px",borderRadius:20,fontSize:11,fontWeight:500,fontFamily:"inherit"}}>25m</button>
      </div>
    </div>
  </div>
</FloatingDemo>
)}

{/* FLOATING DEMO LAUNCHER */}
{activeDemos.includes('flowlauncher') && (
<FloatingDemo positionClass="top-24 left-1/3" animationClass="animate-bounce-physics-center">
  <div
    className="relative overflow-hidden"
    style={{
      width: 460,
      borderRadius: 18,
      background: "rgba(10, 10, 20, 0.85)",
      border: "1.5px solid rgba(255,255,255,0.13)",
      outline: "1px solid rgba(0,0,0,0.8)",
      color: "rgba(235,225,255,0.97)",
      display: "flex",
      flexDirection: "column",
      fontFamily: "'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",
      boxShadow: "0 4px 8px rgba(0,0,0,0.35), 0 12px 28px rgba(0,0,0,0.30), 0 24px 60px rgba(124,58,237,0.12)",
    }}
  >
    {/* Top gloss */}
    <div className="absolute inset-0 pointer-events-none" style={{borderRadius:17,background:"radial-gradient(ellipse 90% 28% at 50% 0%, rgba(255,255,255,0.08), transparent 55%), linear-gradient(180deg, rgba(120,80,255,0.06) 0%, transparent 40%)"}}></div>

    {/* Header */}
    <div className="relative z-10 flex items-center justify-between flex-shrink-0" style={{padding:"14px 16px 10px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.04)"}}>
      <div className="flex items-center" style={{gap:9}}>
        <div className="flex items-center justify-center flex-shrink-0" style={{width:24,height:24,borderRadius:7,background:"linear-gradient(135deg,rgb(124,58,237),rgb(219,39,119))",color:"#fff"}}>
          <svg width="13" height="13" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M15.59 14.37a6 6 0 01-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 006.16-12.12A14.98 14.98 0 009.63 8.41m5.96 5.96a14.93 14.93 0 01-5.96 2.58m0 0a14.93 14.93 0 01-5.96-2.58"/></svg>
        </div>
        <span style={{fontSize:13,fontWeight:600,letterSpacing:"0.02em",color:"rgba(225,215,255,0.97)"}}>FlowHub</span>
      </div>
      <div className="flex items-center" style={{gap:8}}>
        <div style={{fontSize:10,color:"rgba(124,58,237,0.85)",background:"rgba(124,58,237,0.15)",padding:"3px 8px",borderRadius:5,fontFamily:"'Consolas','SF Mono',monospace",fontWeight:600,letterSpacing:"0.03em"}}>Ctrl+Shift+Space</div>
        <button onClick={() => closeDemo('flowlauncher')} className="cursor-pointer transition-colors hover:bg-white/10 flex items-center justify-center" style={{background:"none",border:"none",color:"rgba(200,190,240,0.55)",padding:"3px 5px",borderRadius:5}} title="Close">
          <svg width="14" height="14" fill="none" stroke="currentColor" strokeWidth="2.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
        </button>
      </div>
    </div>

    {/* Results */}
    <div className="relative z-10 flex-1 overflow-y-auto" style={{padding:"4px 0",scrollbarWidth:"thin"}}>
      {[
        { name: "FlowAI", desc: "AI-powered chat assistant", hotkey: "Alt+1", gradient: "linear-gradient(135deg,#3b82f6,#6366f1)", running: true, selected: false, icon: <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-4l-4 4z"/> },
        { name: "FlowNotes", desc: "Floating quick-capture notes", hotkey: "Alt+2", gradient: "linear-gradient(135deg,#10b981,#16a34a)", running: false, selected: true, icon: <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/> },
        { name: "FlowTasks", desc: "Always-on-top floating to-dos", hotkey: "Alt+3", gradient: "linear-gradient(135deg,#f59e0b,#ea580c)", running: true, selected: false, icon: <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"/> },
        { name: "FlowPomo", desc: "Pomodoro focus timer", hotkey: "Alt+4", gradient: "linear-gradient(135deg,#f43f5e,#db2777)", running: false, selected: false, icon: <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/> },
        { name: "FlowCalendar", desc: "Glanceable daily agenda", hotkey: "Alt+5", gradient: "linear-gradient(135deg,#0ea5e9,#2563eb)", running: false, selected: false, icon: <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/> },
      ].map((app, i) => (
        <div key={i} className="flex items-center cursor-pointer transition-colors" style={{gap:12,padding:"10px 16px",background:app.selected?"rgba(124,58,237,0.18)":"transparent"}}>
          <div className="flex items-center justify-center flex-shrink-0" style={{width:36,height:36,borderRadius:9,background:app.gradient}}>
            <svg width="18" height="18" fill="none" stroke="#fff" viewBox="0 0 24 24">{app.icon}</svg>
          </div>
          <div className="flex-1 min-w-0">
            <div style={{fontSize:13,fontWeight:600,color:"rgba(240,232,255,0.95)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}>{app.name}</div>
            <div style={{fontSize:10.5,color:"rgba(160,140,210,0.65)",marginTop:1}}>{app.desc}</div>
          </div>
          <div className="flex items-center flex-shrink-0" style={{gap:6}}>
            {app.running && (
              <div className="flex items-center" style={{gap:5}}>
                <div className="animate-pulse" style={{width:7,height:7,borderRadius:"50%",background:"rgb(74,222,128)"}}></div>
                <span style={{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"rgba(74,222,128,0.85)"}}>Running</span>
              </div>
            )}
            <div style={{fontSize:11,fontWeight:600,color:"rgba(124,58,237,0.95)",background:"rgba(124,58,237,0.2)",border:"1.5px solid rgba(124,58,237,0.4)",padding:"4px 8px",borderRadius:6,fontFamily:"'Consolas','SF Mono',monospace",letterSpacing:"0.02em",minWidth:28,textAlign:"center",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}}>{app.hotkey}</div>
          </div>
        </div>
      ))}
    </div>

    {/* Footer */}
    <div className="relative z-10 flex items-center justify-between flex-shrink-0" style={{padding:"8px 16px 10px",borderTop:"1px solid rgba(255,255,255,0.06)"}}>
      <span style={{fontSize:10,color:"rgba(160,140,210,0.40)"}}>
        <kbd style={{background:"rgba(255,255,255,0.08)",padding:"1px 4px",borderRadius:3,fontSize:10,fontFamily:"inherit"}}>↑↓</kbd>
        <span style={{margin:"0 4px 0 4px"}}>navigate</span>
        <kbd style={{background:"rgba(255,255,255,0.08)",padding:"1px 4px",borderRadius:3,fontSize:10,fontFamily:"inherit"}}>↵</kbd>
        <span style={{marginLeft:4}}>launch</span>
      </span>
      <span style={{fontSize:10,color:"rgba(160,140,210,0.40)"}}>5 apps</span>
    </div>
  </div>
</FloatingDemo>
)}

{/* FLOATING DEMO CALENDAR */}
{activeDemos.includes('flowcalendar') && (
<FloatingDemo positionClass="top-16 right-12" animationClass="animate-bounce-physics">
  <div
    className="relative overflow-hidden shadow-2xl shadow-blue-500/20"
    style={{
      width: 320,
      height: 500,
      borderRadius: 16,
      background: "rgba(10, 10, 20, 0.88)",
      border: "1.5px solid rgba(255,255,255,0.10)",
      outline: "1px solid rgba(0,0,0,0.8)",
      color: "rgba(235,225,255,0.97)",
      display: "flex",
      flexDirection: "column",
      fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
      fontSize: 12,
    }}
  >
    {/* Top gloss */}
    <div className="absolute inset-0 pointer-events-none" style={{borderRadius:15,background:"radial-gradient(ellipse 90% 28% at 50% 0%, rgba(255,255,255,0.06), transparent 55%), linear-gradient(180deg, rgba(59,130,246,0.06) 0%, transparent 40%)"}}></div>

    {/* Header */}
    <div className="relative z-10 flex items-center justify-between flex-shrink-0" style={{padding:"10px 14px",borderBottom:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.28)"}}>
      <div className="flex items-center gap-[7px]">
        <div style={{width:8,height:8,borderRadius:"50%",background:"#4ade80",boxShadow:"0 0 8px rgba(74,222,128,0.5)"}}></div>
        <div className="flex items-center justify-center flex-shrink-0" style={{width:24,height:24,borderRadius:6,background:"linear-gradient(135deg,#8b5cf6,#3b82f6)",fontSize:12,fontWeight:700,color:"white"}}>C</div>
        <span style={{fontSize:12,fontWeight:600,letterSpacing:"0.02em",color:"rgba(225,215,255,0.97)"}}>FlowCalendar</span>
      </div>
      <div className="flex items-center gap-1">
        <button className="cursor-pointer transition-colors hover:bg-white/10" style={{background:"none",border:"none",color:"rgba(200,190,240,0.60)",fontSize:13,lineHeight:1,padding:"3px 6px",borderRadius:5}}>─</button>
        <button onClick={() => closeDemo('flowcalendar')} className="cursor-pointer transition-colors hover:bg-white/10" style={{background:"none",border:"none",color:"rgba(200,190,240,0.60)",fontSize:13,lineHeight:1,padding:"3px 6px",borderRadius:5}}>×</button>
      </div>
    </div>

    {/* Calendar Nav */}
    <div className="relative z-10 flex items-center justify-between flex-shrink-0" style={{padding:"12px 14px",borderBottom:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.2)"}}>
      <div className="flex items-center gap-3">
        <button className="cursor-pointer transition-colors hover:bg-white/[0.08]" style={{background:"none",border:"none",color:"rgba(210,195,255,0.7)",fontSize:16,padding:"4px 8px",borderRadius:4}}>«</button>
        <button className="cursor-pointer transition-colors hover:bg-white/[0.08]" style={{background:"none",border:"none",color:"rgba(210,195,255,0.7)",fontSize:12,padding:"4px 8px",borderRadius:4}}>Today</button>
        <button className="cursor-pointer transition-colors hover:bg-white/[0.08]" style={{background:"none",border:"none",color:"rgba(210,195,255,0.7)",fontSize:16,padding:"4px 8px",borderRadius:4}}>»</button>
      </div>
      <span style={{fontSize:14,fontWeight:600,color:"rgba(225,215,255,0.97)"}}>April 2026</span>
    </div>

    {/* Calendar Grid */}
    <div className="relative z-10 flex-1 overflow-hidden" style={{padding:8}}>
      {/* Weekday headers */}
      <div style={{display:"grid",gridTemplateColumns:"repeat(7,1fr)",gap:2,marginBottom:8}}>
        {["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(d => (
          <div key={d} style={{fontSize:10,fontWeight:600,textAlign:"center",color:"rgba(180,165,220,0.8)",padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"}}>{d}</div>
        ))}
      </div>
      {/* Days */}
      <div style={{display:"grid",gridTemplateColumns:"repeat(7,1fr)",gap:2}}>
        {/* Previous month padding (April 2026 starts on Wednesday) */}
        {[29,30,31].map(d => (
          <div key={`prev-${d}`} className="flex items-center justify-center" style={{aspectRatio:"1",borderRadius:6,fontSize:11,fontWeight:500,color:"rgba(180,165,220,0.4)",background:"rgba(124,58,237,0.05)",border:"1px solid rgba(124,58,237,0.1)"}}>{d}</div>
        ))}
        {/* April days 1-30 */}
        {Array.from({length:30},(_,i)=>i+1).map(d => {
          const isToday = d === 28;
          const hasEvent = [3,7,10,14,21,28].includes(d);
          return (
            <div key={d} className="flex items-center justify-center relative cursor-pointer transition-all hover:shadow-[0_0_0_1px_rgba(124,58,237,0.35)]" style={{
              aspectRatio:"1",
              borderRadius:6,
              fontSize:11,
              fontWeight: isToday ? 600 : 500,
              color: isToday ? "white" : "rgba(225,215,255,0.85)",
              background: isToday ? "linear-gradient(135deg,#8b5cf6,#3b82f6)" : "rgba(124,58,237,0.1)",
              border: isToday ? "1px solid rgba(139,92,246,0.5)" : "1px solid rgba(124,58,237,0.2)",
            }}>
              {d}
              {hasEvent && !isToday && <div style={{position:"absolute",bottom:2,width:4,height:4,borderRadius:"50%",background:"#f97316"}}></div>}
            </div>
          );
        })}
        {/* Next month padding */}
        {[1,2].map(d => (
          <div key={`next-${d}`} className="flex items-center justify-center" style={{aspectRatio:"1",borderRadius:6,fontSize:11,fontWeight:500,color:"rgba(180,165,220,0.4)",background:"rgba(124,58,237,0.05)",border:"1px solid rgba(124,58,237,0.1)"}}>{d}</div>
        ))}
      </div>
    </div>

    {/* Events Panel */}
    <div className="relative z-10 flex-shrink-0" style={{borderTop:"1px solid rgba(255,255,255,0.12)",background:"rgba(8,8,18,0.55)",padding:0}}>
      {/* Drag handle */}
      <div className="flex items-center justify-center" style={{height:18}}>
        <div style={{width:32,height:4,background:"rgba(180,165,220,0.3)",borderRadius:2}}></div>
      </div>
      {/* Events header */}
      <div className="flex items-center justify-between" style={{padding:"0 14px 8px"}}>
        <span style={{fontSize:11,fontWeight:600,textTransform:"uppercase",color:"rgba(180,165,220,0.8)",letterSpacing:"0.05em"}}>Today's Events</span>
        <div style={{width:20,height:20,borderRadius:"50%",border:"1px solid rgba(124,58,237,0.4)",background:"rgba(124,58,237,0.2)",color:"rgba(225,215,255,0.9)",fontSize:12,fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}}>+</div>
      </div>
      {/* Event items */}
      <div style={{padding:"0 14px 10px",display:"flex",flexDirection:"column",gap:4}}>
        {[
          {time:"9:00", title:"Standup with design team"},
          {time:"2:30", title:"Review Q2 roadmap draft"},
        ].map((ev,i) => (
          <div key={i} className="flex items-center cursor-pointer transition-colors hover:bg-[rgba(124,58,237,0.25)]" style={{gap:8,padding:"6px 8px",borderRadius:6,background:"rgba(124,58,237,0.15)",border:"1px solid rgba(124,58,237,0.25)"}}>
            <span style={{fontSize:10,fontWeight:600,color:"rgba(249,115,22,0.9)",minWidth:35}}>{ev.time}</span>
            <span style={{fontSize:11,color:"rgba(225,215,255,0.85)",flex:1}}>{ev.title}</span>
          </div>
        ))}
      </div>
    </div>

    {/* Footer */}
    <div className="relative z-10 flex items-center justify-between flex-shrink-0" style={{padding:"7px 14px 9px",borderTop:"1px solid rgba(255,255,255,0.07)",background:"rgba(0,0,0,0.28)"}}>
      <div className="flex items-center" style={{gap:6}}>
        <div style={{width:8,height:8,borderRadius:"50%",background:"#4ade80"}}></div>
        <span style={{fontSize:11,color:"rgba(190,175,235,0.75)"}}>Today</span>
      </div>
      <button className="cursor-pointer transition-colors hover:bg-white/[0.08]" style={{fontSize:11,color:"rgba(190,175,235,0.70)",background:"none",border:"none",padding:"3px 6px",borderRadius:5}}>Settings</button>
    </div>
  </div>
</FloatingDemo>
)}

      {/* Add custom physics-based animations */}
      <style jsx>{`
        @keyframes bounce-physics {
          0% { 
            transform: translate(0px, 0px) rotate(0deg); 
          }
          10% { 
            transform: translate(30px, -20px) rotate(2deg); 
          }
          20% { 
            transform: translate(-20px, -35px) rotate(-1deg); 
          }
          30% { 
            transform: translate(-40px, -10px) rotate(1deg); 
          }
          40% { 
            transform: translate(-10px, 15px) rotate(-2deg); 
          }
          50% { 
            transform: translate(25px, 25px) rotate(1deg); 
          }
          60% { 
            transform: translate(40px, 5px) rotate(-1deg); 
          }
          70% { 
            transform: translate(15px, -15px) rotate(2deg); 
          }
          80% { 
            transform: translate(-25px, 5px) rotate(-1deg); 
          }
          90% { 
            transform: translate(10px, 20px) rotate(1deg); 
          }
          100% { 
            transform: translate(0px, 0px) rotate(0deg); 
          }
        }
        
        @keyframes bounce-physics-delayed {
          0% { 
            transform: translate(0px, 0px) rotate(0deg); 
          }
          12% { 
            transform: translate(-25px, 15px) rotate(-2deg); 
          }
          24% { 
            transform: translate(35px, 20px) rotate(1deg); 
          }
          36% { 
            transform: translate(20px, -25px) rotate(-1deg); 
          }
          48% { 
            transform: translate(-30px, -15px) rotate(2deg); 
          }
          60% { 
            transform: translate(-15px, 30px) rotate(-1deg); 
          }
          72% { 
            transform: translate(30px, 10px) rotate(1deg); 
          }
          84% { 
            transform: translate(10px, -20px) rotate(-2deg); 
          }
          92% { 
            transform: translate(-20px, -5px) rotate(1deg); 
          }
          100% { 
            transform: translate(0px, 0px) rotate(0deg); 
          }
        }
        
        @keyframes bounce-physics-center {
          0% { 
            transform: translate(0px, 0px) rotate(0deg); 
          }
          15% { 
            transform: translate(20px, -25px) rotate(-1deg); 
          }
          30% { 
            transform: translate(-15px, -10px) rotate(2deg); 
          }
          45% { 
            transform: translate(25px, 15px) rotate(-2deg); 
          }
          60% { 
            transform: translate(-20px, 25px) rotate(1deg); 
          }
          75% { 
            transform: translate(30px, -20px) rotate(-1deg); 
          }
          90% { 
            transform: translate(-10px, -15px) rotate(2deg); 
          }
          100% { 
            transform: translate(0px, 0px) rotate(0deg); 
          }
        }
        
        .animate-bounce-physics {
          animation: bounce-physics 12s ease-in-out infinite;
        }
        
        .animate-bounce-physics-delayed {
          animation: bounce-physics-delayed 14s ease-in-out infinite;
        }
        
        .animate-bounce-physics-center {
          animation: bounce-physics-center 16s ease-in-out infinite;
        }
        
        @keyframes bounce-physics-pomodoro {
          0% { 
            transform: translate(0px, 0px) rotate(0deg); 
          }
          12% { 
            transform: translate(-25px, -20px) rotate(1deg); 
          }
          24% { 
            transform: translate(15px, -30px) rotate(-2deg); 
          }
          36% { 
            transform: translate(-30px, -10px) rotate(2deg); 
          }
          48% { 
            transform: translate(20px, 15px) rotate(-1deg); 
          }
          60% { 
            transform: translate(-15px, 25px) rotate(1deg); 
          }
          72% { 
            transform: translate(25px, -15px) rotate(-2deg); 
          }
          84% { 
            transform: translate(-20px, 10px) rotate(1deg); 
          }
          96% { 
            transform: translate(10px, -25px) rotate(-1deg); 
          }
          100% { 
            transform: translate(0px, 0px) rotate(0deg); 
          }
        }
        
        .animate-bounce-physics-pomodoro {
          animation: bounce-physics-pomodoro 15s ease-in-out infinite;
        }
        
        @keyframes demo-glow {
          0% { filter: drop-shadow(0 0 0px rgba(124,58,237,0)); }
          20% { filter: drop-shadow(0 0 28px rgba(124,58,237,0.9)) drop-shadow(0 0 60px rgba(219,39,119,0.5)); }
          50% { filter: drop-shadow(0 0 20px rgba(124,58,237,0.7)) drop-shadow(0 0 45px rgba(219,39,119,0.35)); }
          80% { filter: drop-shadow(0 0 28px rgba(124,58,237,0.9)) drop-shadow(0 0 60px rgba(219,39,119,0.5)); }
          100% { filter: drop-shadow(0 0 0px rgba(124,58,237,0)); }
        }
        
        .animate-demo-glow {
          animation: demo-glow 1.6s ease-in-out;
        }
        
        @keyframes pulse-slow {
          0%, 100% { 
            opacity: 0.9; 
            transform: translateX(-50%) scale(1); 
          }
          50% { 
            opacity: 1; 
            transform: translateX(-50%) scale(1.05); 
          }
        }
        
        .animate-pulse-slow {
          animation: pulse-slow 3s ease-in-out infinite;
        }
      `}</style>
      {/* NAV */}
      <div className="flex items-center justify-between px-8 py-6 border-b border-purple-900/40">
        <div className="text-xl font-semibold tracking-tight text-purple-200">FlowFloat</div>
        <div></div>
        <button className="inline-flex items-center gap-1.5 px-4 py-2 rounded-xl text-white text-sm font-medium transition-all hover:brightness-110" style={{background:"linear-gradient(135deg,#7c3aed,#a21caf)"}}>
          <svg className="w-3.5 h-3.5" viewBox="0 0 24 24" fill="currentColor"><path d="M0 3.449L9.75 2.1v9.451H0m10.949-9.602L24 0v11.4H10.949M0 12.6h9.75v9.451L0 20.699M10.949 12.6H24V24l-12.9-1.801"/></svg>
          Microsoft Store
        </button>
      </div>

      {/* HERO */}
      <div className="relative px-8 pt-28 pb-32 text-center overflow-hidden">
        {/* Animated dot-grid background */}
        {React.createElement(() => {
          const canvasRef = React.useRef(null);
          React.useEffect(() => {
            const canvas = canvasRef.current;
            if (!canvas) return;
            const ctx = canvas.getContext('2d');
            let raf;
            let t = 0;
            const SPACING = 36;

            const resize = () => {
              canvas.width = canvas.offsetWidth;
              canvas.height = canvas.offsetHeight;
            };
            resize();
            window.addEventListener('resize', resize);

            const draw = () => {
              const { width, height } = canvas;
              ctx.clearRect(0, 0, width, height);
              const cols = Math.ceil(width / SPACING) + 1;
              const rows = Math.ceil(height / SPACING) + 1;
              for (let r = 0; r < rows; r++) {
                for (let c = 0; c < cols; c++) {
                  const x = c * SPACING;
                  const y = r * SPACING;
                  // wave ripple based on distance from center
                  const cx = width / 2, cy = height / 2;
                  const dist = Math.sqrt((x - cx) ** 2 + (y - cy) ** 2);
                  const wave = Math.sin(dist / 60 - t * 0.8) * 0.5 + 0.5;
                  // fade toward center (where text is) and edges
                  const edgeFadeX = Math.min(x / (width * 0.28), 1) * Math.min((width - x) / (width * 0.28), 1);
                  const edgeFadeY = Math.min(y / (height * 0.18), 1) * Math.min((height - y) / (height * 0.18), 1);
                  const alpha = wave * 0.35 * edgeFadeX * edgeFadeY;
                  const radius = 1.2 + wave * 0.8;
                  ctx.beginPath();
                  ctx.arc(x, y, radius, 0, Math.PI * 2);
                  ctx.fillStyle = `rgba(167, 139, 250, ${alpha})`;
                  ctx.fill();
                }
              }
              t += 0.016;
              raf = requestAnimationFrame(draw);
            };
            draw();
            return () => {
              cancelAnimationFrame(raf);
              window.removeEventListener('resize', resize);
            };
          }, []);
          return (
            <canvas
              ref={canvasRef}
              className="pointer-events-none absolute inset-0 w-full h-full"
              style={{ zIndex: 0 }}
            />
          );
        })}

        {/* Ambient background glow */}
        <div className="pointer-events-none absolute inset-0" style={{ zIndex: 1 }}>
          <div className="absolute left-1/2 top-10 h-[520px] w-[520px] -translate-x-1/2 rounded-full bg-purple-600/20 blur-3xl"></div>
          <div className="absolute left-[20%] top-40 h-[280px] w-[280px] rounded-full bg-fuchsia-500/10 blur-3xl"></div>
          <div className="absolute right-[20%] top-52 h-[320px] w-[320px] rounded-full bg-indigo-500/10 blur-3xl"></div>
        </div>

        <div className="relative" style={{ zIndex: 2 }}>
        {/* VERSION RELEASE ANNOUNCEMENT */}
        <div className="mb-10 inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-4 py-1.5 text-xs font-medium text-purple-100/90 backdrop-blur-xl">
          <span className="relative flex h-1.5 w-1.5">
            <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-green-400 opacity-75"></span>
            <span className="relative inline-flex h-1.5 w-1.5 rounded-full bg-green-400"></span>
          </span>
          <span className="tracking-wide">Version 1.0 — now available</span>
          <span className="text-purple-200/40">·</span>
          <a href="#apps" className="text-purple-200/80 hover:text-white transition-colors">See what's new →</a>
        </div>

        <div className="mb-5 text-xs font-medium uppercase tracking-[0.2em] text-purple-300/70">
          Always-on-top productivity suite
        </div>
        <h1 className="mx-auto max-w-4xl text-6xl md:text-7xl font-semibold tracking-tight leading-[1.05]">
          <span className="bg-gradient-to-b from-white to-purple-200/80 bg-clip-text text-transparent">Stay in flow.</span>
          <br />
          <span className="bg-gradient-to-r from-purple-300 via-fuchsia-300 to-purple-300 bg-clip-text text-transparent">Everything else floats.</span>
        </h1>
        <p className="mx-auto mt-8 max-w-2xl text-lg leading-relaxed text-purple-200/70">
          A suite of always-on-top apps that float alongside your workflow — notes, tasks, timers, AI chat, calendar, and more — designed with simplicity at its core, to keep you in your flow state.
        </p>

        <div className="mt-10 flex flex-col sm:flex-row justify-center items-center gap-3">
          <button className="group inline-flex items-center gap-2 rounded-xl px-6 py-3 text-sm font-semibold text-white shadow-lg shadow-purple-500/30 transition-all hover:brightness-110 hover:shadow-purple-500/50" style={{background:"linear-gradient(135deg,#7c3aed,#a21caf)"}}>
            <svg className="w-4 h-4" viewBox="0 0 24 24" fill="currentColor">
              <path d="M0 3.449L9.75 2.1v9.451H0m10.949-9.602L24 0v11.4H10.949M0 12.6h9.75v9.451L0 20.699M10.949 12.6H24V24l-12.9-1.801"/>
            </svg>
            Get on Microsoft Store
          </button>
        </div>
        </div>
      </div>

      {/* APPS */}
      <div id="apps" className="px-8 py-28 bg-gradient-to-b from-black/40 to-purple-950/20">
        <div className="max-w-6xl mx-auto">
          {/* Header */}
          <div className="text-center mb-16">
            <div className="mb-4 inline-flex items-center gap-2 text-xs font-medium uppercase tracking-[0.2em] text-purple-300/70">
              <span className="h-px w-8 bg-purple-400/30"></span>
              The suite
              <span className="h-px w-8 bg-purple-400/30"></span>
            </div>
            <h2 className="mx-auto max-w-3xl text-4xl md:text-5xl font-semibold tracking-tight leading-[1.1]">
              Six focused apps.
              <span className="bg-gradient-to-r from-purple-300 to-fuchsia-300 bg-clip-text text-transparent"> One flow state.</span>
            </h2>
            <p className="mx-auto mt-6 max-w-2xl text-base md:text-lg leading-relaxed text-purple-200/70">
              Each FlowFloat app does one thing well — and stays exactly where you need it. Use one, or stack them together as your personal productivity OS.
            </p>
          </div>

          {/* App graph — FlowHub hub + 5 spokes */}
          {(() => {
            const spokeApps = [
              {
                name: "FlowAI",
                tag: "AI",
                tagClass: "bg-blue-500/15 text-blue-200/90 border-blue-400/20",
                gradient: "from-blue-500 to-indigo-600",
                lineColor: "#6366f1",
                description: "A floating chat assistant for instant answers, drafts, and brainstorms.",
                demoKey: "flowai",
                icon: <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-4l-4 4z" />,
              },
              {
                name: "FlowNotes",
                tag: "Notes",
                tagClass: "bg-emerald-500/15 text-emerald-200/90 border-emerald-400/20",
                gradient: "from-emerald-500 to-green-600",
                lineColor: "#10b981",
                description: "Capture thoughts the moment they hit — without leaving your work.",
                demoKey: "flownotes",
                icon: <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />,
              },
              {
                name: "FlowTasks",
                tag: "Tasks",
                tagClass: "bg-amber-500/15 text-amber-200/90 border-amber-400/20",
                gradient: "from-amber-500 to-orange-600",
                lineColor: "#f59e0b",
                description: "A floating to-do list that stays beside whatever you're doing.",
                demoKey: "flowtasks",
                icon: <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4" />,
              },
              {
                name: "FlowPomo",
                tag: "Focus",
                tagClass: "bg-rose-500/15 text-rose-200/90 border-rose-400/20",
                gradient: "from-rose-500 to-pink-600",
                lineColor: "#f43f5e",
                description: "A Pomodoro timer that gently holds your attention on the task at hand.",
                demoKey: "flowtime",
                icon: <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />,
              },
              {
                name: "FlowCalendar",
                tag: "Schedule",
                tagClass: "bg-sky-500/15 text-sky-200/90 border-sky-400/20",
                gradient: "from-sky-500 to-blue-600",
                lineColor: "#0ea5e9",
                description: "Your day's agenda, always one glance away. Never miss a meeting again.",
                demoKey: "flowcalendar",
                icon: <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />,
              },
            ];

            const comingSoonApps = [
              { name: "FlowMail", lineColor: "#a78bfa", angle: 54 },
              { name: "FlowMusic", lineColor: "#c084fc", angle: 342 },
              { name: "FlowHabit", lineColor: "#e879f9", angle: 270 },
              { name: "FlowFocus", lineColor: "#818cf8", angle: 198 },
              { name: "FlowClip", lineColor: "#67e8f9", angle: 126 },
            ];

            const angles = [90, 18, 306, 234, 162];
            const CX = 50;
            const CY = 50;
            const R = 38;
            const R_COMING = 28;

            const spokePositions = angles.map((deg) => {
              const rad = (deg * Math.PI) / 180;
              return { x: CX + R * Math.cos(rad), y: CY - R * Math.sin(rad) };
            });

            const comingSoonPositions = comingSoonApps.map((app) => {
              const rad = (app.angle * Math.PI) / 180;
              return { x: CX + R_COMING * Math.cos(rad), y: CY - R_COMING * Math.sin(rad) };
            });

            const CARD_R = 7;
            const COMING_R = 4;
            const HUB_R = 6;

            return (
              <div className="relative w-full" style={{ minHeight: 680 }}>
                <svg
                  className="absolute inset-0 w-full h-full pointer-events-none"
                  viewBox="0 0 100 100"
                  preserveAspectRatio="xMidYMid meet"
                  style={{ zIndex: 0 }}
                >
                  <defs>
                    {spokeApps.map((app, i) => (
                      <marker
                        key={`arrow-${i}`}
                        id={`arrow-${i}`}
                        viewBox="0 0 10 10"
                        refX="9"
                        refY="5"
                        markerWidth="5"
                        markerHeight="5"
                        orient="auto-start-reverse"
                      >
                        <path d="M 0 0 L 10 5 L 0 10 z" fill={app.lineColor} opacity="0.7" />
                      </marker>
                    ))}
                  </defs>
                  {comingSoonApps.map((app, i) => {
                    const pos = comingSoonPositions[i];
                    const dx = pos.x - CX;
                    const dy = pos.y - CY;
                    const len = Math.sqrt(dx * dx + dy * dy);
                    const ux = dx / len;
                    const uy = dy / len;
                    const x1 = CX + ux * HUB_R;
                    const y1 = CY + uy * HUB_R;
                    const x2 = pos.x - ux * COMING_R;
                    const y2 = pos.y - uy * COMING_R;
                    return (
                      <line
                        key={`coming-${i}`}
                        x1={x1}
                        y1={y1}
                        x2={x2}
                        y2={y2}
                        stroke={app.lineColor}
                        strokeWidth="0.25"
                        strokeOpacity="0.30"
                        strokeDasharray="0.8 0.6"
                      >
                        <animate attributeName="stroke-dashoffset" from="0" to="-2.8" dur="2s" repeatCount="indefinite" />
                      </line>
                    );
                  })}
                  {spokePositions.map((pos, i) => {
                    const dx = pos.x - CX;
                    const dy = pos.y - CY;
                    const len = Math.sqrt(dx * dx + dy * dy);
                    const ux = dx / len;
                    const uy = dy / len;
                    const x1 = CX + ux * HUB_R;
                    const y1 = CY + uy * HUB_R;
                    const x2 = pos.x - ux * CARD_R;
                    const y2 = pos.y - uy * CARD_R;
                    return (
                      <line
                        key={i}
                        x1={x1}
                        y1={y1}
                        x2={x2}
                        y2={y2}
                        stroke={spokeApps[i].lineColor}
                        strokeWidth="0.35"
                        strokeOpacity="0.45"
                        strokeDasharray="1.2 0.8"
                        markerEnd={`url(#arrow-${i})`}
                      />
                    );
                  })}
                </svg>

                <div
                  className="absolute z-10"
                  style={{
                    left: "50%",
                    top: "50%",
                    transform: "translate(-50%, -50%)",
                    width: 200,
                  }}
                >
                  <div
                    onClick={() => setActiveDemos([...activeDemos, "flowlauncher"])}
                    onMouseDown={(e) => e.preventDefault()}
                    role="button"
                    tabIndex={0}
                    onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); setActiveDemos([...activeDemos, "flowlauncher"]); } }}
                    className="group relative cursor-pointer rounded-2xl bg-purple-950/60 border-2 border-violet-500/60 p-5 text-center transition-all duration-300 hover:border-violet-400 hover:shadow-2xl hover:shadow-violet-500/30 hover:-translate-y-1"
                    style={{ backdropFilter: "blur(12px)" }}
                  >
                    <div className="mx-auto mb-3 w-14 h-14 rounded-xl bg-gradient-to-br from-violet-500 to-indigo-600 flex items-center justify-center shadow-lg shadow-black/40">
                      <svg className="w-7 h-7 text-white" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24">
                        <path strokeLinecap="round" strokeLinejoin="round" d="M15.59 14.37a6 6 0 01-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 006.16-12.12A14.98 14.98 0 009.63 8.41m5.96 5.96a14.93 14.93 0 01-5.96 2.58m0 0a14.93 14.93 0 01-5.96-2.58" />
                      </svg>
                    </div>
                    <div className="font-bold text-purple-50 text-base mb-1">FlowHub</div>
                    <div className="text-[10px] font-medium uppercase tracking-wider border rounded-full px-2 py-0.5 bg-violet-500/15 text-violet-200/90 border-violet-400/20 inline-block mb-2">Hub</div>
                    <p className="text-purple-200/60 text-xs leading-relaxed">One shortcut to summon any app.</p>
                    <span className="mt-3 inline-flex items-center gap-1 text-[10px] font-medium uppercase tracking-wider rounded-full px-2 py-0.5 border border-green-400/30 bg-green-500/10 text-green-200/90">
                      <span className="relative flex h-1.5 w-1.5">
                        <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-green-400 opacity-75"></span>
                        <span className="relative inline-flex h-1.5 w-1.5 rounded-full bg-green-400"></span>
                      </span>
                      Live demo
                    </span>
                    <div className="absolute -inset-px rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none" style={{ boxShadow: "0 0 32px 4px rgba(139,92,246,0.25)" }}></div>
                  </div>
                </div>

                {spokeApps.map((app, i) => {
                  const pos = spokePositions[i];
                  return (
                    <div
                      key={app.name}
                      className="absolute z-10 group"
                      style={{
                        left: `${pos.x}%`,
                        top: `${pos.y}%`,
                        transform: "translate(-50%, -50%)",
                        width: 172,
                      }}
                    >
                      <div
                        onClick={() => app.demoKey && handleDemoClick(app.demoKey)}
                        onMouseDown={(e) => { if (app.demoKey) e.preventDefault(); }}
                        role={app.demoKey ? "button" : undefined}
                        tabIndex={app.demoKey ? 0 : undefined}
                        onKeyDown={(e) => { if (app.demoKey && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); handleDemoClick(app.demoKey); } }}
                        className={`relative rounded-2xl bg-purple-950/40 border border-purple-800/40 p-4 transition-all duration-300 overflow-hidden ${app.demoKey ? 'cursor-pointer hover:border-purple-500/60 hover:-translate-y-1 hover:shadow-xl hover:shadow-purple-500/15' : 'cursor-default'}`}
                        style={{ backdropFilter: "blur(10px)" }}
                      >
                        <div className="flex items-center gap-3 mb-2.5">
                          <div className={`w-9 h-9 rounded-xl bg-gradient-to-br ${app.gradient} flex items-center justify-center shadow-md shadow-black/30 flex-shrink-0`}>
                            <svg className="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">{app.icon}</svg>
                          </div>
                          <div>
                            <div className="font-semibold text-purple-50 text-sm leading-tight">{app.name}</div>
                            <span className={`text-[9px] font-medium uppercase tracking-wider border rounded-full px-1.5 py-0.5 ${app.tagClass}`}>{app.tag}</span>
                          </div>
                        </div>
                        <p className="text-purple-200/55 text-xs leading-relaxed">{app.description}</p>
                        {app.demoKey && (
                          <div className="mt-2.5 flex items-center gap-1 text-[9px] text-purple-400 group-hover:text-purple-200 transition-colors">
                            <span>Preview</span>
                            <svg className="w-3 h-3 group-hover:translate-x-0.5 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" /></svg>
                          </div>
                        )}
                      </div>
                    </div>
                  );
                })}

                {comingSoonApps.map((app, i) => {
                  const pos = comingSoonPositions[i];
                  return (
                    <div
                      key={`coming-${app.name}`}
                      className="absolute z-10"
                      style={{
                        left: `${pos.x}%`,
                        top: `${pos.y}%`,
                        transform: "translate(-50%, -50%)",
                      }}
                    >
                      <div
                        className="rounded-xl border border-dashed border-purple-500/25 px-3 py-2 text-center"
                        style={{
                          background: "rgba(124,58,237,0.06)",
                          backdropFilter: "blur(6px)",
                          minWidth: 90,
                        }}
                      >
                        <div className="font-semibold text-purple-300/50 text-xs leading-tight">{app.name}</div>
                        <div className="mt-1 text-[8px] font-medium uppercase tracking-widest text-purple-400/40">Coming soon</div>
                      </div>
                    </div>
                  );
                })}

                <div className="absolute bottom-4 left-1/2 -translate-x-1/2 z-10">
                  <span className="inline-flex items-center gap-2 text-[11px] font-medium tracking-wide text-purple-300/50">
                    <span className="inline-block w-6 h-px bg-purple-400/20"></span>
                    Many more coming soon
                    <span className="inline-block w-6 h-px bg-purple-400/20"></span>
                  </span>
                </div>
              </div>
            );
          })()}

        </div>
      </div>

      {/* SECTIONS BELOW HIDDEN — re-enable by removing the display:none wrapper */}
      <div style={{ display: "none" }}>

      {/* WHY NOW */}
      <div className="relative px-8 py-28 border-y border-purple-900/30 bg-gradient-to-b from-purple-950/30 via-black/40 to-purple-950/30 overflow-hidden">
        {/* Subtle grid texture */}
        <div
          className="pointer-events-none absolute inset-0 opacity-[0.04]"
          style={{
            backgroundImage:
              "linear-gradient(rgba(255,255,255,0.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.6) 1px, transparent 1px)",
            backgroundSize: "48px 48px",
          }}
        ></div>

        <div className="relative max-w-6xl mx-auto">
          {/* Header */}
          <div className="text-center mb-16">
            <div className="mb-4 inline-flex items-center gap-2 text-xs font-medium uppercase tracking-[0.2em] text-purple-300/70">
              <span className="h-px w-8 bg-purple-400/30"></span>
              The case for FlowFloat
              <span className="h-px w-8 bg-purple-400/30"></span>
            </div>
            <h2 className="mx-auto max-w-3xl text-4xl md:text-5xl font-semibold tracking-tight leading-[1.1]">
              Modern work is
              <span className="bg-gradient-to-r from-purple-300 to-fuchsia-300 bg-clip-text text-transparent"> fragmented by design.</span>
            </h2>
            <p className="mx-auto mt-6 max-w-2xl text-base md:text-lg leading-relaxed text-purple-200/70">
              Tabs multiply, notifications interrupt, and every tool demands its own window. FlowFloat is a quiet rebellion against that — a set of focused apps that stay exactly where you need them.
            </p>
          </div>

          {/* Problem vs Approach */}
          <div className="grid md:grid-cols-2 gap-6">
            <div className="relative rounded-2xl border border-red-500/15 bg-red-500/5 p-8">
              <div className="mb-4 inline-flex items-center gap-2 text-xs font-medium uppercase tracking-[0.15em] text-red-300/80">
                <span className="h-1.5 w-1.5 rounded-full bg-red-400/80"></span>
                The problem
              </div>
              <h3 className="text-xl font-semibold mb-3 text-purple-50">Context switching has a cost.</h3>
              <p className="text-sm leading-relaxed text-purple-200/60">
                Constant tab-hopping, AI overload, and scattered workflows quietly drain focus. Every detour back to your task is friction — and friction compounds.
              </p>
            </div>
            <div className="relative rounded-2xl border border-purple-400/20 bg-gradient-to-br from-purple-600/10 to-fuchsia-600/5 p-8">
              <div className="mb-4 inline-flex items-center gap-2 text-xs font-medium uppercase tracking-[0.15em] text-purple-200/90">
                <span className="h-1.5 w-1.5 rounded-full bg-purple-300"></span>
                Our approach
              </div>
              <h3 className="text-xl font-semibold mb-3 text-purple-50">Tools that live where you work.</h3>
              <p className="text-sm leading-relaxed text-purple-200/70">
                FlowFloat apps stay on top of whatever you're doing — instantly accessible, and out of the way when you don't need them. One shortcut. Zero context switches.
              </p>
            </div>
          </div>
        </div>
      </div>

      {/* SOCIAL PROOF */}
      <div className="px-8 py-10 text-center text-purple-300/50 text-sm">
        Built for deep work, creators, and fast thinkers
      </div>

      {/* COMMUNITY COMMITMENT */}
      <div className="px-8 py-16 bg-gradient-to-r from-purple-950/30 to-black/30">
        <div className="max-w-4xl mx-auto text-center">
          <div className="flex items-center justify-center mb-6">
            <div className="w-12 h-12 rounded-full bg-purple-500/20 flex items-center justify-center mr-4">
              <svg className="w-6 h-6 text-purple-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 11a7 7 0 01-7 7m0 0a7 7 0 017-7m-7 7v4m0 0h4" />
              </svg>
            </div>
            <h2 className="text-2xl font-semibold text-purple-200">Always Listening, Always Building</h2>
          </div>
          
          <p className="text-purple-200/70 text-lg mb-8 max-w-3xl mx-auto leading-relaxed">
            We're committed to our community. Your feedback drives our roadmap, and we're constantly adding new apps and integrations based on what you need most.
          </p>
          
          <div className="grid md:grid-cols-3 gap-6 mb-8">
            <div className="p-6 rounded-2xl bg-purple-950/40 border border-purple-800/40">
              <div className="w-10 h-10 rounded-xl bg-gradient-to-br from-blue-500/20 to-purple-600/20 flex items-center justify-center mb-3">
                <svg className="w-5 h-5 text-purple-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4" />
                </svg>
              </div>
              <h3 className="font-semibold text-purple-200 mb-2">Monthly Updates</h3>
              <p className="text-purple-200/60 text-sm">New apps and features released every month based on community requests</p>
            </div>
            
            <div className="p-6 rounded-2xl bg-purple-950/40 border border-purple-800/40">
              <div className="w-10 h-10 rounded-xl bg-gradient-to-br from-green-500/20 to-emerald-600/20 flex items-center justify-center mb-3">
                <svg className="w-5 h-5 text-purple-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 4M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" />
                </svg>
              </div>
              <h3 className="font-semibold text-purple-200 mb-2">Integration Hub</h3>
              <p className="text-purple-200/60 text-sm">Connecting with your favorite tools like Slack, Notion, and more</p>
            </div>
            
            <div className="p-6 rounded-2xl bg-purple-950/40 border border-purple-800/40">
              <div className="w-10 h-10 rounded-xl bg-gradient-to-br from-purple-500/20 to-pink-600/20 flex items-center justify-center mb-3">
                <svg className="w-5 h-5 text-purple-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
                </svg>
              </div>
              <h3 className="font-semibold text-purple-200 mb-2">Community Driven</h3>
              <p className="text-purple-200/60 text-sm">Your ideas shape our product roadmap and priorities</p>
            </div>
          </div>
          
          <div className="flex items-center justify-center gap-4 text-sm text-purple-300/50">
            <div className="flex items-center gap-2">
              <div className="w-2 h-2 rounded-full bg-green-400"></div>
              <span>Active Development</span>
            </div>
            <span>•</span>
            <span>📊 50+ Community Requests Completed</span>
            <span>•</span>
            <span>🚀 New apps every 4 weeks</span>
          </div>
        </div>
      </div>

      {/* TESTIMONIALS */}
      <div className="px-8 py-24 text-center">
        <h2 className="text-3xl font-semibold mb-10">People love FlowFloat</h2>
        <div className="grid md:grid-cols-3 gap-6 max-w-5xl mx-auto">
          <div className="p-6 rounded-2xl bg-purple-950/30 border border-purple-800/40">
            <p className="text-purple-200/60 text-sm">“I stopped switching tabs completely. Focus is insane now.”</p>
            <div className="mt-4 text-sm text-purple-300">— early user</div>
          </div>
          <div className="p-6 rounded-2xl bg-purple-950/30 border border-purple-800/40">
            <p className="text-purple-200/60 text-sm">“Feels like cheating productivity. Everything is just there.”</p>
            <div className="mt-4 text-sm text-purple-300">— developer</div>
          </div>
          <div className="p-6 rounded-2xl bg-purple-950/30 border border-purple-800/40">
            <p className="text-purple-200/60 text-sm">“This completely changed how I work on my laptop.”</p>
            <div className="mt-4 text-sm text-purple-300">— student</div>
          </div>
        </div>
      </div>

      {/* PRICING */}
      <div id="pricing" className="px-8 py-24 text-center">
        <h2 className="text-3xl font-semibold mb-4">Pricing</h2>
        <p className="text-purple-200/60 mb-12">Start free. Upgrade when you want deeper control.</p>

        <div className="grid md:grid-cols-3 gap-6 max-w-5xl mx-auto">
          <div className="p-6 rounded-2xl border border-purple-800/40 bg-purple-950/30 hover:border-purple-600/60 hover:bg-purple-950/50 hover:scale-105 transition-all duration-300 cursor-pointer">
            <h3 className="text-xl font-semibold mb-2">Free</h3>
            <p className="text-purple-200/60">Basic floating apps</p>
            <button className="mt-4 px-4 py-2 rounded-xl border border-purple-700/40 text-white text-sm font-medium hover:bg-purple-900/30 transition-colors duration-200">
              Get Started
            </button>
          </div>

          <div className="p-6 rounded-2xl border border-purple-500 bg-purple-900/40 scale-105 hover:scale-110 transition-all duration-300 cursor-pointer shadow-lg hover:shadow-purple-500/20">
            <h3 className="text-xl font-semibold mb-2">Pro</h3>
            <p className="text-purple-200/60">AI + integrations + customization</p>
            <div className="text-2xl font-bold mt-4">$20/mo</div>
            <button className="mt-4 px-4 py-2 rounded-xl bg-purple-500 text-black text-sm font-medium hover:bg-purple-400 transition-colors duration-200">
              Upgrade Now
            </button>
          </div>

          <div className="p-6 rounded-2xl border border-purple-800/40 bg-purple-950/30 hover:border-purple-600/60 hover:bg-purple-950/50 hover:scale-105 transition-all duration-300 cursor-pointer">
            <h3 className="text-xl font-semibold mb-2">Team</h3>
            <p className="text-purple-200/60">Collaboration tools</p>
            <div className="text-2xl font-bold mt-4">$49/mo</div>
            <button className="mt-4 px-4 py-2 rounded-xl border border-purple-700/40 text-white text-sm font-medium hover:bg-purple-900/30 transition-colors duration-200">
              Contact Sales
            </button>
          </div>
        </div>
      </div>

      {/* FEEDBACK */}
      <div className="px-8 py-24 bg-purple-950/30">
        <div className="max-w-4xl mx-auto text-center">
          <h2 className="text-3xl font-semibold mb-4">Help us improve FlowFloat</h2>
          <p className="text-purple-200/60 mb-8 max-w-2xl mx-auto">
            Your feedback drives our development. Share your ideas, report issues, or suggest features you'd love to see.
          </p>
          
          <div className="grid md:grid-cols-1 gap-6 mb-8 max-w-2xl mx-auto">
            <div className="p-6 rounded-2xl bg-purple-950/40 border border-purple-800/40">
              <h3 className="font-semibold mb-3">Feature Suggestions</h3>
              <p className="text-purple-200/60 text-sm mb-4">What would make FlowFloat even better for you?</p>
              <textarea 
                className="w-full p-3 rounded-xl bg-purple-900/30 border border-purple-700/40 text-white placeholder-purple-400/50 text-sm resize-none"
                rows="4"
                placeholder="Share your ideas..."
              />
              <button className="mt-3 px-4 py-2 rounded-xl bg-purple-500 text-black text-sm font-medium hover:bg-purple-400">
                Submit Suggestion
              </button>
            </div>
          </div>
          
          <div className="flex justify-center gap-4 text-sm text-purple-300/50">
            <a href="mailto:feedback@flowfloat.app" className="hover:text-purple-300">
              ✉️ feedback@flowfloat.app
            </a>
            <span>•</span>
            <a href="#" className="hover:text-purple-300">
              💬 Join our Discord
            </a>
            <span>•</span>
            <a href="#" className="hover:text-purple-300">
              🐛 Report a bug
            </a>
          </div>
        </div>
      </div>

      {/* CTA */}
      <div className="px-8 py-24 text-center">
        <h2 className="text-3xl font-semibold mb-4">Start building your flow state</h2>
        <button className="px-8 py-4 rounded-xl bg-purple-500 text-black font-medium">Get FlowFloat</button>
      </div>

      </div>{/* end hidden sections */}

      {/* BUILD YOUR FLOW STATE CTA */}
      <div className="relative px-8 py-28 text-center overflow-hidden">
        {/* Glow */}
        <div className="pointer-events-none absolute inset-0">
          <div className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 h-[400px] w-[600px] rounded-full blur-3xl" style={{background:"radial-gradient(ellipse,rgba(124,58,237,0.18),transparent 70%)"}}></div>
        </div>
        <div className="relative" style={{zIndex:1}}>
          <div className="mb-4 inline-flex items-center gap-2 text-xs font-medium uppercase tracking-[0.2em] text-purple-300/60">
            <span className="h-px w-8 bg-purple-400/30"></span>
            Ready when you are
            <span className="h-px w-8 bg-purple-400/30"></span>
          </div>
          <h2 className="mx-auto max-w-2xl text-4xl md:text-5xl font-semibold tracking-tight leading-[1.1] mb-6">
            <span className="bg-gradient-to-b from-white to-purple-200/80 bg-clip-text text-transparent">So let's build your</span>
            <br />
            <span className="bg-gradient-to-r from-purple-300 via-fuchsia-300 to-purple-300 bg-clip-text text-transparent">flow state.</span>
          </h2>
          <p className="mx-auto max-w-xl text-base leading-relaxed text-purple-200/60 mb-10">
            One install. Six tools. Everything you need to stay focused, organised, and in the zone — floating right where you need it.
          </p>
          <button className="inline-flex items-center gap-2 rounded-xl px-8 py-4 text-base font-semibold text-white shadow-xl shadow-purple-500/30 transition-all hover:brightness-110 hover:shadow-purple-500/50 hover:-translate-y-0.5" style={{background:"linear-gradient(135deg,#7c3aed,#a21caf)"}}>
            <svg className="w-5 h-5" viewBox="0 0 24 24" fill="currentColor"><path d="M0 3.449L9.75 2.1v9.451H0m10.949-9.602L24 0v11.4H10.949M0 12.6h9.75v9.451L0 20.699M10.949 12.6H24V24l-12.9-1.801"/></svg>
            Get on Microsoft Store
          </button>
          <div className="mt-6 flex items-center justify-center gap-6 text-xs text-purple-300/40">
            <span className="inline-flex items-center gap-1.5">
              <svg className="w-3.5 h-3.5" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M5 13l4 4L19 7"/></svg>
              Free during beta
            </span>
            <span className="h-3 w-px bg-purple-300/20"></span>
            <span className="inline-flex items-center gap-1.5">
              <svg className="w-3.5 h-3.5" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/></svg>
              No account required
            </span>
            <span className="h-3 w-px bg-purple-300/20"></span>
            <span className="inline-flex items-center gap-1.5">
              <svg className="w-3.5 h-3.5" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z"/></svg>
              Under 50 MB
            </span>
          </div>
        </div>
      </div>

      {/* FOOTER */}
      <div className="px-8 py-10 border-t border-purple-900/40 text-center text-purple-300/50 text-sm">
        <div>&copy; {new Date().getFullYear()} FlowFloat. All rights reserved.</div>
        <a href="privacy-policy.html" className="text-purple-400/70 hover:text-purple-300 underline mt-2 inline-block">Privacy Policy</a>
      </div>
    </div>
  );
}
