// Work — three visual, distinct mockups (website / automation / leadgen)

const DEMOS = [
  {
    type: 'website',
    tag: 'sample · landing page',
    title: 'a website that turns readers into clients',
    body: 'one page. one promise. one button. that\'s the whole formula. notice how every line either earns your attention or asks for it back.',
    why: ['big clear headline', 'one obvious next step', 'words that sound human'],
    result: 'avg 2.4× more bookings',
  },
  {
    type: 'automation',
    tag: 'sample · automation',
    title: 'an inbox that empties itself',
    body: 'new email comes in. system reads it, drafts a reply in your voice, and waits for your one-click ok. you keep the relationship, lose the busywork.',
    why: ['runs every 5 minutes, 24/7', 'never sends without your ok', 'learns your voice over time'],
    result: '~8 hours back per week',
  },
  {
    type: 'leadgen',
    tag: 'sample · client pipeline',
    title: 'four booked calls a week, on autopilot',
    body: 'finds your perfect-fit clients, sends a personal note, follows up politely, books the call on your calendar. you just show up.',
    why: ['only your dream clients', 'feels handwritten, isn\'t', 'lands on your calendar'],
    result: '4–9 calls/wk on average',
  },
];

function Work() {
  return (
    <section id="work" className="section">
      <SectionHead
        id="real.examples"
        kicker="see it in action"
        title='same playbook,<br/><span class="italic-em">your business.</span>'
        lede="three real examples of what i build. these aren't case studies — they're the actual blueprints i'd hand you. yours would look different. the results land the same."
      />

      <div className="container" style={{ display: 'grid', gap: 32 }}>
        {DEMOS.map((d, i) => (
          <Reveal key={d.type} delay={(i % 3) + 1}>
            <DemoRow d={d} idx={i} />
          </Reveal>
        ))}
      </div>

      <div className="container" style={{ marginTop: 56, paddingTop: 32, borderTop: '1px dashed var(--line-2)', display: 'flex', justifyContent: 'space-between', alignItems: 'center', flexWrap: 'wrap', gap: 16 }}>
        <p style={{ fontSize: 16, color: 'var(--ink-2)', maxWidth: 520, margin: 0 }}>
          <span className="italic" style={{ fontFamily: 'var(--serif-italic)' }}>want one like these for your business?</span> twenty minutes, free, no pressure.
        </p>
        <a href="#booking" className="btn">book the call →</a>
      </div>
    </section>
  );
}

function DemoRow({ d, idx }) {
  const flip = idx % 2 === 1;
  return (
    <article className="demo-grid" style={{
      display: 'grid',
      gridTemplateColumns: 'minmax(0, 1.3fr) minmax(0, 1fr)',
      gap: 48,
      alignItems: 'center',
      padding: '48px 0',
      borderTop: '1px solid var(--line-2)',
    }}>
      <div style={{ order: flip ? 2 : 1 }}>
        {d.type === 'website' && <ClientSitePreview />}
        {d.type === 'automation' && <AutomationMock />}
        {d.type === 'leadgen'    && <LeadgenMock />}
      </div>
      <div style={{ order: flip ? 1 : 2 }}>
        <div className="label" style={{ marginBottom: 12 }}>{d.tag}</div>
        <h3 className="serif" style={{ fontSize: 40, lineHeight: 1.05, letterSpacing: '-0.025em', margin: 0, fontWeight: 400, textWrap: 'balance' }}>
          {d.title}
        </h3>
        <p style={{ marginTop: 16, color: 'var(--ink-2)', fontSize: 17, lineHeight: 1.55, textWrap: 'pretty' }}>{d.body}</p>

        <ul style={{ listStyle: 'none', padding: 0, margin: '24px 0 0', display: 'grid', gap: 10 }}>
          {d.why.map(w => (
            <li key={w} style={{ display: 'flex', gap: 12, alignItems: 'center', fontSize: 14, color: 'var(--ink-2)' }}>
              <span style={{
                width: 18, height: 18, borderRadius: '50%',
                display: 'grid', placeItems: 'center',
                background: 'var(--accent)', color: 'var(--accent-ink)',
                fontSize: 11, fontWeight: 700,
              }}>✓</span>
              {w}
            </li>
          ))}
        </ul>

        <div style={{
          marginTop: 28, paddingTop: 18,
          borderTop: '1px dashed var(--line-2)',
          display: 'flex', justifyContent: 'space-between', alignItems: 'center',
        }}>
          <span className="label">// the result</span>
          <span className="mono" style={{ fontSize: 12, color: 'var(--ink)', fontWeight: 600 }}>{d.result}</span>
        </div>
      </div>
    </article>
  );
}

/* ---------- CLIENT SITE PREVIEW ---------- */
function ClientSitePreview() {
  const [hovered, setHovered] = React.useState(false);
  const [clicked, setClicked] = React.useState(false);
  const [ripples, setRipples] = React.useState([]);

  function handleClick(e) {
    const rect = e.currentTarget.getBoundingClientRect();
    const x = e.clientX - rect.left;
    const y = e.clientY - rect.top;
    const id = Date.now();
    setClicked(true);
    setRipples(r => [...r, { id, x, y }]);
    setTimeout(() => setRipples(r => r.filter(rp => rp.id !== id)), 700);
    setTimeout(() => setClicked(false), 150);
  }

  return (
    <>
      <style>{`
        @keyframes ripple {
          0%   { transform: scale(0); opacity: 0.45; }
          100% { transform: scale(4); opacity: 0; }
        }
        @keyframes visitPulse {
          0%, 100% { box-shadow: 0 0 0 0 rgba(255,91,34,0.4); }
          50%       { box-shadow: 0 0 0 8px rgba(255,91,34,0); }
        }
      `}</style>
      <a
        href="https://redouaneimpression.com"
        target="_blank"
        rel="noopener noreferrer"
        onClick={handleClick}
        onMouseEnter={() => setHovered(true)}
        onMouseLeave={() => setHovered(false)}
        style={{
          display: 'block',
          position: 'relative',
          borderRadius: 12,
          overflow: 'hidden',
          boxShadow: hovered
            ? '0 40px 80px -20px rgba(0,0,0,0.35), 0 12px 32px -8px rgba(255,91,34,0.18)'
            : '0 30px 60px -30px rgba(0,0,0,0.3), 0 8px 24px -8px rgba(0,0,0,0.15)',
          border: `1px solid ${hovered ? 'rgba(255,91,34,0.35)' : 'var(--line-2)'}`,
          transform: clicked ? 'scale(0.975)' : hovered ? 'scale(1.015) translateY(-3px)' : 'scale(1) translateY(0)',
          transition: 'transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease, border-color 0.25s ease',
          cursor: 'pointer',
        }}
      >
        <img
          src="1stclient.png"
          alt="Redouane Impression — landing page"
          style={{
            width: '100%',
            display: 'block',
            filter: hovered ? 'brightness(0.72)' : 'brightness(1)',
            transition: 'filter 0.25s ease',
          }}
        />

        {/* overlay label */}
        <div style={{
          position: 'absolute',
          inset: 0,
          display: 'flex',
          flexDirection: 'column',
          alignItems: 'center',
          justifyContent: 'center',
          gap: 10,
          opacity: hovered ? 1 : 0,
          transition: 'opacity 0.22s ease',
          pointerEvents: 'none',
        }}>
          <span style={{
            display: 'inline-flex',
            alignItems: 'center',
            gap: 8,
            padding: '10px 22px',
            borderRadius: 999,
            background: '#FF5B22',
            color: '#14130F',
            fontFamily: 'var(--mono)',
            fontSize: 13,
            fontWeight: 700,
            letterSpacing: '0.04em',
            animation: hovered ? 'visitPulse 1.6s ease infinite' : 'none',
            transform: hovered ? 'translateY(0)' : 'translateY(6px)',
            transition: 'transform 0.22s ease',
          }}>
            visit website →
          </span>
          <span style={{
            fontFamily: 'var(--mono)',
            fontSize: 10,
            color: 'rgba(255,255,255,0.6)',
            letterSpacing: '0.08em',
          }}>
            redouaneimpression.com
          </span>
        </div>

        {/* ripple container */}
        <div style={{ position: 'absolute', inset: 0, pointerEvents: 'none', borderRadius: 12, overflow: 'hidden' }}>
          {ripples.map(rp => (
            <span key={rp.id} style={{
              position: 'absolute',
              left: rp.x,
              top: rp.y,
              width: 80,
              height: 80,
              marginLeft: -40,
              marginTop: -40,
              borderRadius: '50%',
              background: 'rgba(255,91,34,0.35)',
              animation: 'ripple 0.7s ease-out forwards',
            }}/>
          ))}
        </div>
      </a>
    </>
  );
}

/* ---------- WEBSITE MOCK ---------- */
function WebsiteMock() {
  return (
    <BrowserFrame url="auracoaching.co">
      <div style={{
        background: '#0A0A0F',
        padding: '0',
        minHeight: 400,
        position: 'relative',
        overflow: 'hidden',
        fontFamily: 'var(--sans)',
      }}>
        {/* animated gradient orb background */}
        <div aria-hidden="true" style={{
          position: 'absolute',
          top: '50%', left: '50%',
          width: 340, height: 340,
          borderRadius: '50%',
          background: 'radial-gradient(circle, #6C3AED44 0%, #EC489920 40%, transparent 70%)',
          filter: 'blur(50px)',
          transform: 'translate(-50%, -60%)',
          animation: 'mockOrb 8s ease-in-out infinite',
        }}/>
        <style>{`
          @keyframes mockOrb {
            0%, 100% { transform: translate(-50%, -60%) scale(1); }
            33% { transform: translate(-45%, -55%) scale(1.1); }
            66% { transform: translate(-55%, -65%) scale(0.95); }
          }
        `}</style>

        {/* subtle grid overlay */}
        <div aria-hidden="true" style={{
          position: 'absolute', inset: 0,
          backgroundImage: 'linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px)',
          backgroundSize: '40px 40px',
        }}/>

        {/* nav */}
        <div style={{
          display: 'flex', justifyContent: 'space-between', alignItems: 'center',
          padding: '14px 24px',
          position: 'relative', zIndex: 3,
          borderBottom: '1px solid rgba(255,255,255,0.06)',
        }}>
          <span style={{ fontFamily: 'var(--serif)', fontSize: 15, color: '#FAFAFA', letterSpacing: '-0.02em' }}>
            aura<span style={{ color: '#C9A54E' }}>.</span>
          </span>
          <div style={{ display: 'flex', gap: 14, fontFamily: 'var(--mono)', fontSize: 9, color: 'rgba(255,255,255,0.4)' }}>
            <span>method</span><span>results</span><span>about</span>
          </div>
          <span style={{
            padding: '5px 12px', borderRadius: 999,
            background: 'linear-gradient(135deg, #C9A54E, #E8C96A)',
            color: '#0A0A0F',
            fontFamily: 'var(--mono)', fontSize: 9, fontWeight: 600,
          }}>book a call →</span>
        </div>

        {/* hero content */}
        <div style={{
          position: 'relative', zIndex: 2,
          padding: '36px 28px 20px',
          textAlign: 'center',
        }}>
          {/* kicker */}
          <div style={{
            fontFamily: 'var(--mono)', fontSize: 8, color: '#C9A54E',
            letterSpacing: '.2em', textTransform: 'uppercase',
            marginBottom: 14,
          }}>FOR HIGH-PERFORMERS READY TO LEVEL UP</div>

          {/* headline */}
          <div style={{
            fontFamily: 'var(--serif)', fontSize: 38, lineHeight: 0.95,
            letterSpacing: '-0.035em', color: '#FAFAFA',
          }}>
            transform your<br/>
            life in <span style={{
              fontFamily: 'var(--serif-italic)', fontStyle: 'italic',
              background: 'linear-gradient(135deg, #C9A54E, #E8C96A)',
              WebkitBackgroundClip: 'text',
              WebkitTextFillColor: 'transparent',
            }}>90 days.</span>
          </div>

          {/* subhead */}
          <div style={{
            fontSize: 10, color: 'rgba(255,255,255,0.45)', marginTop: 12,
            lineHeight: 1.6, maxWidth: 280, margin: '12px auto 0',
          }}>
            a private coaching experience for founders who want clarity, energy, and ruthless focus.
          </div>

          {/* CTA */}
          <div style={{ marginTop: 18, display: 'flex', justifyContent: 'center', gap: 10, alignItems: 'center' }}>
            <span style={{
              padding: '9px 18px', borderRadius: 999,
              background: 'linear-gradient(135deg, #C9A54E, #E8C96A)',
              color: '#0A0A0F', fontFamily: 'var(--mono)', fontSize: 10, fontWeight: 600,
              boxShadow: '0 0 24px 4px #C9A54E30',
            }}>start your transformation →</span>
          </div>

          {/* social proof */}
          <div style={{
            marginTop: 16, display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 8,
          }}>
            {/* avatar stack */}
            <div style={{ display: 'flex' }}>
              {['#6C3AED','#EC4899','#C9A54E','#3B82F6','#10B981'].map((c, i) => (
                <div key={i} style={{
                  width: 20, height: 20, borderRadius: '50%',
                  background: c,
                  border: '2px solid #0A0A0F',
                  marginLeft: i > 0 ? -6 : 0,
                  display: 'grid', placeItems: 'center',
                  fontSize: 7, color: '#fff', fontWeight: 700,
                }}>{['S','M','A','J','L'][i]}</div>
              ))}
            </div>
            <span style={{ fontFamily: 'var(--mono)', fontSize: 8, color: 'rgba(255,255,255,0.4)' }}>
              500+ lives transformed
            </span>
          </div>
        </div>

        {/* floating testimonial card — glassmorphism */}
        <div style={{
          position: 'relative', zIndex: 2,
          margin: '8px 24px 0',
          padding: '14px 16px',
          borderRadius: 10,
          background: 'rgba(255,255,255,0.04)',
          border: '1px solid rgba(255,255,255,0.08)',
          backdropFilter: 'blur(12px)',
          WebkitBackdropFilter: 'blur(12px)',
        }}>
          <div style={{
            fontFamily: 'var(--serif-italic)', fontStyle: 'italic',
            fontSize: 11, color: 'rgba(255,255,255,0.7)',
            lineHeight: 1.5,
          }}>
            "I made more progress in 90 days than I did in 3 years of figuring it out alone."
          </div>
          <div style={{
            marginTop: 8, display: 'flex', alignItems: 'center', gap: 8,
          }}>
            <div style={{
              width: 18, height: 18, borderRadius: '50%',
              background: 'linear-gradient(135deg, #EC4899, #6C3AED)',
            }}/>
            <div>
              <div style={{ fontFamily: 'var(--mono)', fontSize: 8, color: '#FAFAFA', fontWeight: 600 }}>Sarah K.</div>
              <div style={{ fontFamily: 'var(--mono)', fontSize: 7, color: 'rgba(255,255,255,0.3)' }}>founder, studio maven</div>
            </div>
          </div>
        </div>

        {/* micro-stats bar */}
        <div style={{
          position: 'relative', zIndex: 2,
          margin: '14px 24px 20px',
          padding: '10px 0',
          borderTop: '1px solid rgba(255,255,255,0.06)',
          display: 'flex', justifyContent: 'space-between',
          fontFamily: 'var(--mono)', fontSize: 8,
        }}>
          <div style={{ textAlign: 'center' }}>
            <div style={{ color: '#C9A54E', fontSize: 14, fontWeight: 700 }}>97%</div>
            <div style={{ color: 'rgba(255,255,255,0.3)', marginTop: 2 }}>completion rate</div>
          </div>
          <div style={{ textAlign: 'center' }}>
            <div style={{ color: '#C9A54E', fontSize: 14, fontWeight: 700 }}>4.9★</div>
            <div style={{ color: 'rgba(255,255,255,0.3)', marginTop: 2 }}>client rating</div>
          </div>
          <div style={{ textAlign: 'center' }}>
            <div style={{ color: '#C9A54E', fontSize: 14, fontWeight: 700 }}>Forbes</div>
            <div style={{ color: 'rgba(255,255,255,0.3)', marginTop: 2 }}>featured in</div>
          </div>
        </div>
      </div>
    </BrowserFrame>
  );
}

/* ---------- AUTOMATION MOCK (flow diagram) ---------- */
function AutomationMock() {
  const nodes = [
    { x: 30,  y: 60,  label: 'new email', sub: 'gmail',  c: '#FF5B22', icon: '✉' },
    { x: 165, y: 60,  label: 'read & sort', sub: 'ai',    c: '#6FB1FF', icon: '◆' },
    { x: 300, y: 30,  label: 'urgent?', sub: 'decide',    c: '#E5B96A', icon: '?' },
    { x: 300, y: 130, label: 'draft reply', sub: 'in your voice', c: '#6CD499', icon: '✎' },
    { x: 435, y: 60,  label: 'one-click send', sub: 'you approve',c: '#FF5B22', icon: '→' },
  ];
  const lines = [
    [0,1],[1,2],[1,3],[3,4],[2,4],
  ];
  return (
    <div style={{
      background: '#14130F',
      borderRadius: 12,
      border: '1px solid #2C2A23',
      padding: 24,
      minHeight: 380,
      position: 'relative',
      overflow: 'hidden',
      boxShadow: '0 30px 60px -30px rgba(0,0,0,0.4)',
    }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 20 }}>
        <div>
          <div className="mono" style={{ fontSize: 10, color: '#8a8576' }}>// automation · running</div>
          <div className="serif" style={{ fontSize: 18, color: '#E9E4D8', marginTop: 4 }}>inbox.zero</div>
        </div>
        <div style={{ display: 'flex', alignItems: 'center', gap: 6, fontFamily: 'var(--mono)', fontSize: 10, color: '#6CD499' }}>
          <span style={{ width: 6, height: 6, borderRadius: '50%', background: '#6CD499', boxShadow: '0 0 0 4px #6CD49925' }}/>
          live
        </div>
      </div>

      {/* svg flow */}
      <svg viewBox="0 0 540 220" style={{ width: '100%', height: 220 }}>
        {/* dotted background grid */}
        <defs>
          <pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse">
            <circle cx="1" cy="1" r="1" fill="#2C2A23"/>
          </pattern>
          <marker id="arr" markerWidth="6" markerHeight="6" refX="5" refY="3" orient="auto">
            <path d="M0,0 L6,3 L0,6 z" fill="#5a5749"/>
          </marker>
        </defs>
        <rect width="540" height="220" fill="url(#grid)"/>

        {lines.map(([a,b], i) => {
          const A = nodes[a], B = nodes[b];
          const ax = A.x + 100, ay = A.y + 30;
          const bx = B.x,        by = B.y + 30;
          const mx = (ax + bx) / 2;
          return (
            <path key={i}
              d={`M ${ax} ${ay} C ${mx} ${ay}, ${mx} ${by}, ${bx} ${by}`}
              fill="none" stroke="#5a5749" strokeWidth="1.5" strokeDasharray="4 4"
              markerEnd="url(#arr)"/>
          );
        })}

        {nodes.map((n,i) => (
          <g key={i} transform={`translate(${n.x} ${n.y})`}>
            <rect x="0" y="0" width="100" height="60" rx="10"
              fill="#1B1A15" stroke={n.c} strokeWidth="1.2"/>
            <circle cx="14" cy="20" r="9" fill={n.c}/>
            <text x="14" y="24" textAnchor="middle" fontSize="11" fontWeight="700" fill="#14130F">{n.icon}</text>
            <text x="28" y="24" fontSize="10" fontFamily="var(--mono)" fill="#E9E4D8" fontWeight="600">{n.label}</text>
            <text x="14" y="44" fontSize="8" fontFamily="var(--mono)" fill="#8a8576" letterSpacing="0.1em">{n.sub.toUpperCase()}</text>
          </g>
        ))}
      </svg>

      {/* status bar */}
      <div style={{
        marginTop: 18, paddingTop: 14,
        borderTop: '1px solid #2C2A23',
        display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 12,
        fontFamily: 'var(--mono)', fontSize: 10,
      }}>
        <div>
          <div style={{ color: '#8a8576' }}>processed today</div>
          <div style={{ color: '#E9E4D8', fontSize: 16, marginTop: 2 }}>247</div>
        </div>
        <div>
          <div style={{ color: '#8a8576' }}>auto-handled</div>
          <div style={{ color: '#6CD499', fontSize: 16, marginTop: 2 }}>83%</div>
        </div>
        <div>
          <div style={{ color: '#8a8576' }}>time saved</div>
          <div style={{ color: '#FF5B22', fontSize: 16, marginTop: 2 }}>4.2 hrs</div>
        </div>
      </div>
    </div>
  );
}

/* ---------- LEADGEN MOCK (pipeline dashboard) ---------- */
function LeadgenMock() {
  const cols = [
    { name: 'found',     count: 247, leads: [
      { n: 'Sarah K.',     co: 'Studio Maven',     hot: false },
      { n: 'Marcus B.',    co: 'Forge & Co',        hot: false },
      { n: 'Aisha R.',     co: 'Halo Coaching',     hot: true  },
    ]},
    { name: 'reached',   count:  64, leads: [
      { n: 'Dan W.',       co: 'Quiet Brand',       hot: true  },
      { n: 'Lina M.',      co: 'Soft Launch',       hot: false },
    ]},
    { name: 'replied',   count:  18, leads: [
      { n: 'Aisha R.',     co: 'Halo Coaching',     hot: true  },
    ]},
    { name: 'booked',    count:   4, leads: [
      { n: 'Aisha R.',     co: 'fri 3pm',           hot: true  },
    ]},
  ];
  return (
    <BrowserFrame url="pipeline.run / dashboard">
      <div style={{
        background: '#FAF7F0',
        padding: 20,
        minHeight: 380,
      }}>
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}>
          <div>
            <div className="mono" style={{ fontSize: 10, color: '#6B6557' }}>// this week</div>
            <div className="serif" style={{ fontSize: 22, letterSpacing: '-0.02em', color: '#14130F' }}>your pipeline</div>
          </div>
          <div className="mono" style={{ fontSize: 10, color: '#1F7A3A', display: 'flex', alignItems: 'center', gap: 6 }}>
            <span style={{ width: 6, height: 6, borderRadius: '50%', background: '#1F7A3A' }}/>
            +4 booked
          </div>
        </div>

        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 8 }}>
          {cols.map(col => (
            <div key={col.name} style={{
              background: '#fff',
              border: '1px solid #E5E0D2',
              borderRadius: 8,
              padding: 10,
              minHeight: 220,
            }}>
              <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', marginBottom: 10 }}>
                <span className="mono" style={{ fontSize: 10, color: '#6B6557', textTransform: 'uppercase', letterSpacing: '.08em' }}>
                  {col.name}
                </span>
                <span className="mono" style={{ fontSize: 11, color: '#14130F', fontWeight: 700 }}>{col.count}</span>
              </div>
              <div style={{ display: 'grid', gap: 6 }}>
                {col.leads.map((l, i) => (
                  <div key={i} style={{
                    background: l.hot ? '#FFF1EA' : '#F4EFE6',
                    border: `1px solid ${l.hot ? '#FF5B2233' : '#E5E0D2'}`,
                    borderRadius: 6,
                    padding: '8px 10px',
                  }}>
                    <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                      <span style={{ fontSize: 10, fontWeight: 600, color: '#14130F' }}>{l.n}</span>
                      {l.hot && <span style={{
                        fontSize: 8, fontFamily: 'var(--mono)',
                        color: '#FF5B22', fontWeight: 700,
                        padding: '1px 5px', borderRadius: 3,
                        background: '#FF5B2215',
                      }}>HOT</span>}
                    </div>
                    <div className="mono" style={{ fontSize: 9, color: '#6B6557', marginTop: 2 }}>{l.co}</div>
                  </div>
                ))}
                {col.leads.length === 0 && (
                  <div className="mono" style={{ fontSize: 9, color: '#A8A394', textAlign: 'center', padding: 12 }}>nothing yet</div>
                )}
              </div>
            </div>
          ))}
        </div>

        {/* quick metrics */}
        <div style={{
          marginTop: 14,
          display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 10,
        }}>
          <Metric k="reply rate" v="7.4%" up />
          <Metric k="book rate" v="22%" up />
          <Metric k="avg deal" v="$1.4k" />
        </div>
      </div>
    </BrowserFrame>
  );
}

function Metric({ k, v, up }) {
  return (
    <div style={{
      background: '#fff', border: '1px solid #E5E0D2',
      borderRadius: 8, padding: '8px 12px',
      display: 'flex', justifyContent: 'space-between', alignItems: 'baseline',
    }}>
      <span className="mono" style={{ fontSize: 9, color: '#6B6557', textTransform: 'uppercase', letterSpacing: '.08em' }}>{k}</span>
      <span style={{ fontFamily: 'var(--serif)', fontSize: 16, color: '#14130F', display: 'flex', gap: 4, alignItems: 'baseline' }}>
        {v}
        {up && <span style={{ fontSize: 9, color: '#1F7A3A' }}>↑</span>}
      </span>
    </div>
  );
}

/* ---------- shared browser chrome ---------- */
function BrowserFrame({ url, children }) {
  return (
    <div style={{
      borderRadius: 12,
      overflow: 'hidden',
      boxShadow: '0 30px 60px -30px rgba(0,0,0,0.3), 0 8px 24px -8px rgba(0,0,0,0.15)',
      border: '1px solid var(--line-2)',
      background: '#fff',
    }}>
      <div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '10px 14px', background: '#EDE7DB', borderBottom: '1px solid var(--line-2)' }}>
        <span style={{ width: 10, height: 10, borderRadius: '50%', background: '#E5837F' }}/>
        <span style={{ width: 10, height: 10, borderRadius: '50%', background: '#E5C77F' }}/>
        <span style={{ width: 10, height: 10, borderRadius: '50%', background: '#9CC596' }}/>
        <div style={{
          marginLeft: 10, flex: 1,
          background: '#F8F4EB', borderRadius: 6,
          padding: '4px 10px',
          fontFamily: 'var(--mono)', fontSize: 10, color: 'var(--ink-3)',
          textAlign: 'center',
        }}>
          {url}
        </div>
      </div>
      {children}
    </div>
  );
}

Object.assign(window, { Work });
