// ======== WORK / CASE STUDIES ========

function GraphicFleet() {
  // Featured: fleet dispatch — map + routes + live pins
  return (
    <svg className="case-graphic" viewBox="0 0 800 400" preserveAspectRatio="xMidYMid meet">
      <defs>
        <pattern id="fleetGrid" width="40" height="40" patternUnits="userSpaceOnUse">
          <path d="M 40 0 L 0 0 0 40" fill="none" stroke="#0E0E0C" strokeOpacity="0.06" strokeWidth="1"/>
        </pattern>
        <radialGradient id="fleetGlow" cx="0.5" cy="0.5" r="0.5">
          <stop offset="0%" stopColor="oklch(0.72 0.18 145)" stopOpacity="0.5"/>
          <stop offset="100%" stopColor="oklch(0.72 0.18 145)" stopOpacity="0"/>
        </radialGradient>
      </defs>
      <rect width="800" height="400" fill="#E8E4DB" />
      <rect width="800" height="400" fill="url(#fleetGrid)" />

      {/* abstract district shapes */}
      <path d="M 60 280 Q 120 200 220 220 Q 320 240 360 180 Q 400 120 500 140 Q 600 160 660 110" fill="none" stroke="#0E0E0C" strokeOpacity="0.14" strokeWidth="1.5" strokeDasharray="none"/>
      <path d="M 40 140 Q 160 180 260 140 Q 360 100 480 180 Q 560 240 720 200" fill="none" stroke="#0E0E0C" strokeOpacity="0.14" strokeWidth="1.5"/>

      {/* route A — active delivery path */}
      <path d="M 140 300 L 220 260 L 300 270 L 380 220 L 460 210 L 520 170" fill="none" stroke="#0E0E0C" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
      <path d="M 140 300 L 220 260 L 300 270 L 380 220 L 460 210 L 520 170" fill="none" stroke="oklch(0.72 0.18 145)" strokeWidth="2.5" strokeLinecap="round" strokeDasharray="0 60 400" />

      {/* route B */}
      <path d="M 560 330 L 620 280 L 680 250" fill="none" stroke="#0E0E0C" strokeOpacity="0.5" strokeWidth="2" strokeLinecap="round" strokeDasharray="4 4"/>

      {/* pickup pin */}
      <g transform="translate(140,300)">
        <circle r="20" fill="url(#fleetGlow)"/>
        <circle r="7" fill="#0E0E0C"/>
        <circle r="3" fill="#F3F1EC"/>
      </g>

      {/* driver (current, accent) */}
      <g transform="translate(460,210)">
        <circle r="28" fill="url(#fleetGlow)"/>
        <circle r="12" fill="oklch(0.72 0.18 145)"/>
        <circle r="12" fill="none" stroke="#0E0E0C" strokeWidth="1.5"/>
        <path d="M -5 -2 L -1 2 L 5 -4" fill="none" stroke="#0E0E0C" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
      </g>

      {/* dropoff pin */}
      <g transform="translate(520,170)">
        <circle r="7" fill="none" stroke="#0E0E0C" strokeWidth="2"/>
        <circle r="2" fill="#0E0E0C"/>
      </g>

      {/* other fleet dots */}
      {[[180,130],[320,340],[620,120],[720,280],[400,340]].map(([x,y],i) => (
        <circle key={i} cx={x} cy={y} r="4" fill="#0E0E0C" fillOpacity="0.35"/>
      ))}

      {/* top-left floating card — ETA */}
      <g transform="translate(40,40)">
        <rect width="200" height="72" rx="10" fill="#0E0E0C"/>
        <text x="16" y="26" fontFamily="JetBrains Mono" fontSize="9" fill="#F3F1EC" fillOpacity="0.55" letterSpacing="1.5">ETA · ORDER</text>
        <text x="16" y="58" fontFamily="Instrument Serif" fontStyle="italic" fontSize="32" fill="#F3F1EC">12 min</text>
        <circle cx="178" cy="30" r="4" fill="oklch(0.72 0.18 145)"/>
        <circle cx="178" cy="30" r="4" fill="oklch(0.72 0.18 145)" fillOpacity="0.3">
          <animate attributeName="r" from="4" to="14" dur="1.6s" repeatCount="indefinite"/>
          <animate attributeName="fillOpacity" from="0.3" to="0" dur="1.6s" repeatCount="indefinite"/>
        </circle>
      </g>

      {/* bottom-right stat cluster — illustrative only */}
      <g transform="translate(560,320)">
        <text x="0" y="0" fontFamily="JetBrains Mono" fontSize="9" fill="#0E0E0C" fillOpacity="0.5" letterSpacing="1.5">ROUTES</text>
        <text x="0" y="40" fontFamily="Instrument Serif" fontStyle="italic" fontSize="44" fill="#0E0E0C">·</text>
        <text x="120" y="0" fontFamily="JetBrains Mono" fontSize="9" fill="#0E0E0C" fillOpacity="0.5" letterSpacing="1.5">FLEET</text>
        <text x="120" y="40" fontFamily="Instrument Serif" fontStyle="italic" fontSize="44" fill="#0E0E0C">·</text>
      </g>
    </svg>
  );
}

function GraphicNoise() {
  // Workplace noise monitoring — giant circular dB meter
  return (
    <svg className="case-graphic" viewBox="0 0 800 400" preserveAspectRatio="xMidYMid meet">
      <rect width="800" height="400" fill="#0E0E0C" />

      {/* label top-left */}
      <text x="60" y="60" fontFamily="JetBrains Mono" fontSize="10" fill="#F3F1EC" fillOpacity="0.5" letterSpacing="2">ZONE · FLOOR 3 / BAY A</text>
      <text x="60" y="92" fontFamily="Instrument Serif" fontStyle="italic" fontSize="28" fill="#F3F1EC">Live noise level</text>

      {/* circular meter (arc) */}
      <g transform="translate(260,200)">
        {/* ticks */}
        {Array.from({length: 48}).map((_, i) => {
          const angle = (i / 48) * Math.PI * 1.4 - Math.PI * 1.2;
          const r1 = 130, r2 = i % 4 === 0 ? 152 : 144;
          const x1 = Math.cos(angle) * r1, y1 = Math.sin(angle) * r1;
          const x2 = Math.cos(angle) * r2, y2 = Math.sin(angle) * r2;
          const hot = i > 30;
          return <line key={i} x1={x1} y1={y1} x2={x2} y2={y2} stroke={hot ? 'oklch(0.72 0.18 145)' : '#F3F1EC'} strokeOpacity={hot ? 1 : 0.4} strokeWidth={i % 4 === 0 ? 1.5 : 1}/>;
        })}
        {/* dial value */}
        <text x="0" y="-8" fontFamily="JetBrains Mono" fontSize="10" fill="#F3F1EC" fillOpacity="0.5" textAnchor="middle" letterSpacing="2">CURRENT</text>
        <text x="0" y="48" fontFamily="Instrument Serif" fontStyle="italic" fontSize="100" fill="#F3F1EC" textAnchor="middle">78</text>
        <text x="0" y="80" fontFamily="JetBrains Mono" fontSize="11" fill="#F3F1EC" fillOpacity="0.6" textAnchor="middle" letterSpacing="3">dB (A)</text>
        {/* needle */}
        <line x1="0" y1="0" x2="105" y2="-48" stroke="oklch(0.72 0.18 145)" strokeWidth="2" strokeLinecap="round"/>
        <circle r="7" fill="#F3F1EC"/>
        <circle r="3" fill="#0E0E0C"/>
      </g>

      {/* threshold bars on right */}
      <g transform="translate(540,120)">
        <text x="0" y="-14" fontFamily="JetBrains Mono" fontSize="9" fill="#F3F1EC" fillOpacity="0.5" letterSpacing="2">THRESHOLDS</text>
        {[
          { label: 'SAFE', val: '< 70', color: '#F3F1EC', op: 0.5, active: false },
          { label: 'CAUTION', val: '70 – 85', color: '#F3F1EC', op: 1, active: true },
          { label: 'LOUD', val: '85 – 100', color: 'oklch(0.72 0.18 145)', op: 0.6, active: false },
          { label: 'CRITICAL', val: '> 100', color: 'oklch(0.72 0.18 145)', op: 0.3, active: false },
        ].map((t, i) => (
          <g key={t.label} transform={`translate(0, ${i*56})`}>
            <rect x="0" y="0" width="200" height="40" rx="6" fill={t.active ? 'oklch(0.72 0.18 145)' : 'transparent'} stroke="#F3F1EC" strokeOpacity={t.active ? 0 : 0.15}/>
            <text x="16" y="16" fontFamily="JetBrains Mono" fontSize="9" fill={t.active ? '#0E0E0C' : '#F3F1EC'} fillOpacity={t.active ? 0.7 : 0.5} letterSpacing="1.5">{t.label}</text>
            <text x="16" y="32" fontFamily="Instrument Serif" fontStyle="italic" fontSize="16" fill={t.active ? '#0E0E0C' : '#F3F1EC'}>{t.val}</text>
            {t.active && <circle cx="184" cy="20" r="4" fill="#0E0E0C"/>}
          </g>
        ))}
      </g>
    </svg>
  );
}

function GraphicChat() {
  // Website AI chat — full browser window with chat widget popping out bottom-right
  return (
    <svg className="case-graphic" viewBox="0 0 800 400" preserveAspectRatio="xMidYMid meet">
      <rect width="800" height="400" fill="#F3F1EC" />

      {/* browser window */}
      <rect x="40" y="30" width="720" height="340" rx="10" fill="#FFFFFF" stroke="#0E0E0C" strokeOpacity="0.1"/>
      {/* browser chrome */}
      <rect x="40" y="30" width="720" height="36" rx="10" fill="#0E0E0C" fillOpacity="0.04"/>
      <circle cx="60" cy="48" r="5" fill="#0E0E0C" fillOpacity="0.15"/>
      <circle cx="76" cy="48" r="5" fill="#0E0E0C" fillOpacity="0.15"/>
      <circle cx="92" cy="48" r="5" fill="#0E0E0C" fillOpacity="0.15"/>
      <rect x="200" y="40" width="400" height="16" rx="8" fill="#0E0E0C" fillOpacity="0.05"/>
      <text x="400" y="52" fontFamily="JetBrains Mono" fontSize="9" fill="#0E0E0C" fillOpacity="0.5" textAnchor="middle" letterSpacing="1">company.com</text>

      {/* website content — faded so the widget reads as foreground */}
      <g opacity="0.55">
        {/* nav */}
        <rect x="60" y="82" width="80" height="8" rx="2" fill="#0E0E0C" fillOpacity="0.6"/>
        <rect x="580" y="82" width="40" height="8" rx="2" fill="#0E0E0C" fillOpacity="0.3"/>
        <rect x="630" y="82" width="40" height="8" rx="2" fill="#0E0E0C" fillOpacity="0.3"/>
        <rect x="680" y="82" width="40" height="8" rx="2" fill="#0E0E0C" fillOpacity="0.3"/>

        {/* hero */}
        <text x="60" y="170" fontFamily="Instrument Serif" fontStyle="italic" fontSize="56" fill="#0E0E0C" letterSpacing="-2">A better way</text>
        <text x="60" y="214" fontFamily="Instrument Serif" fontStyle="italic" fontSize="56" fill="#0E0E0C" letterSpacing="-2">to do business.</text>
        <rect x="60" y="244" width="300" height="6" rx="2" fill="#0E0E0C" fillOpacity="0.3"/>
        <rect x="60" y="258" width="240" height="6" rx="2" fill="#0E0E0C" fillOpacity="0.3"/>

        {/* cards on right */}
        <rect x="440" y="110" width="260" height="170" rx="8" fill="#0E0E0C" fillOpacity="0.04"/>
        <rect x="456" y="126" width="80" height="6" rx="2" fill="#0E0E0C" fillOpacity="0.3"/>
        <rect x="456" y="144" width="140" height="6" rx="2" fill="#0E0E0C" fillOpacity="0.2"/>
      </g>

      {/* chat widget — bottom right, popping out */}
      <g transform="translate(470,140)">
        <rect x="0" y="0" width="270" height="210" rx="16" fill="#FFFFFF" stroke="#0E0E0C" strokeOpacity="0.1"/>
        {/* widget header */}
        <rect x="0" y="0" width="270" height="44" rx="16" fill="#0E0E0C"/>
        <rect x="0" y="28" width="270" height="16" fill="#0E0E0C"/>
        <circle cx="22" cy="22" r="8" fill="oklch(0.72 0.18 145)"/>
        <text x="40" y="20" fontFamily="Geist" fontSize="11" fill="#F3F1EC" fontWeight="500">Ask our team</text>
        <text x="40" y="34" fontFamily="JetBrains Mono" fontSize="8" fill="#F3F1EC" fillOpacity="0.5" letterSpacing="1.5">ONLINE · AR / EN</text>

        {/* message — user */}
        <rect x="70" y="64" width="180" height="30" rx="10" fill="#0E0E0C" fillOpacity="0.06"/>
        <rect x="84" y="76" width="140" height="6" rx="2" fill="#0E0E0C" fillOpacity="0.6"/>

        {/* message — AI */}
        <rect x="20" y="108" width="200" height="56" rx="10" fill="oklch(0.72 0.18 145)" fillOpacity="0.15"/>
        <rect x="36" y="122" width="160" height="5" rx="2" fill="#0E0E0C" fillOpacity="0.7"/>
        <rect x="36" y="134" width="140" height="5" rx="2" fill="#0E0E0C" fillOpacity="0.7"/>
        <rect x="36" y="146" width="90" height="5" rx="2" fill="#0E0E0C" fillOpacity="0.4"/>

        {/* input */}
        <rect x="12" y="178" width="200" height="22" rx="11" fill="#0E0E0C" fillOpacity="0.04"/>
        <text x="22" y="193" fontFamily="Geist" fontSize="9" fill="#0E0E0C" fillOpacity="0.4">Type a message...</text>
        <circle cx="240" cy="189" r="11" fill="#0E0E0C"/>
        <path d="M 236 189 L 244 189 M 240 185 L 244 189 L 240 193" stroke="#F3F1EC" strokeWidth="1.2" fill="none" strokeLinecap="round"/>
      </g>

      {/* floating widget launcher at bottom-right edge */}
      <g transform="translate(710,330)">
        <circle r="22" fill="oklch(0.72 0.18 145)"/>
        <circle r="22" fill="none" stroke="#0E0E0C" strokeOpacity="0.08"/>
        <path d="M -9 -3 Q -9 -10 -2 -10 L 6 -10 Q 13 -10 13 -3 L 13 3 Q 13 10 6 10 L -3 10 L -9 14 L -7 10 Q -9 10 -9 3 Z" fill="#0E0E0C"/>
      </g>
    </svg>
  );
}

function GraphicRentals() {
  // Rentals marketplace — search bar + photo-forward listing cards
  return (
    <svg className="case-graphic" viewBox="0 0 800 400" preserveAspectRatio="xMidYMid meet">
      <defs>
        <linearGradient id="photoA" x1="0" y1="0" x2="1" y2="1">
          <stop offset="0%" stopColor="#C9B89A"/>
          <stop offset="100%" stopColor="#8A7456"/>
        </linearGradient>
        <linearGradient id="photoB" x1="0" y1="0" x2="1" y2="1">
          <stop offset="0%" stopColor="#2A3440"/>
          <stop offset="100%" stopColor="#0E0E0C"/>
        </linearGradient>
        <linearGradient id="photoC" x1="0" y1="0" x2="1" y2="1">
          <stop offset="0%" stopColor="oklch(0.72 0.18 145)"/>
          <stop offset="100%" stopColor="oklch(0.52 0.14 145)"/>
        </linearGradient>
      </defs>
      <rect width="800" height="400" fill="#F3F1EC"/>

      {/* search bar */}
      <rect x="60" y="40" width="680" height="56" rx="28" fill="#FFFFFF" stroke="#0E0E0C" strokeOpacity="0.1"/>
      <circle cx="94" cy="68" r="9" fill="none" stroke="#0E0E0C" strokeOpacity="0.5" strokeWidth="1.5"/>
      <line x1="100" y1="74" x2="107" y2="81" stroke="#0E0E0C" strokeOpacity="0.5" strokeWidth="1.5"/>
      <text x="124" y="72" fontFamily="Instrument Serif" fontStyle="italic" fontSize="18" fill="#0E0E0C">Dubai Marina</text>
      <line x1="260" y1="56" x2="260" y2="80" stroke="#0E0E0C" strokeOpacity="0.1"/>
      <text x="280" y="60" fontFamily="JetBrains Mono" fontSize="8" fill="#0E0E0C" fillOpacity="0.4" letterSpacing="1.5">DATES</text>
      <text x="280" y="78" fontFamily="Geist" fontSize="12" fill="#0E0E0C" fillOpacity="0.8">Jun 12 – Jun 20</text>
      <line x1="460" y1="56" x2="460" y2="80" stroke="#0E0E0C" strokeOpacity="0.1"/>
      <text x="480" y="60" fontFamily="JetBrains Mono" fontSize="8" fill="#0E0E0C" fillOpacity="0.4" letterSpacing="1.5">TYPE</text>
      <text x="480" y="78" fontFamily="Geist" fontSize="12" fill="#0E0E0C" fillOpacity="0.8">2BR Apartment</text>
      <circle cx="710" cy="68" r="20" fill="#0E0E0C"/>
      <path d="M 703 68 L 717 68 M 710 61 L 717 68 L 710 75" stroke="#F3F1EC" strokeWidth="1.5" fill="none" strokeLinecap="round"/>

      {/* listing cards */}
      {[
        { grad: 'photoA', price: '6,800', tag: 'MARINA', favorite: true, x: 60 },
        { grad: 'photoC', price: '4,200', tag: 'DOWNTOWN', favorite: false, x: 290 },
        { grad: 'photoB', price: '9,400', tag: 'JBR', favorite: false, x: 520 },
      ].map((c, i) => (
        <g key={i} transform={`translate(${c.x},130)`}>
          <rect width="220" height="180" rx="10" fill={`url(#${c.grad})`}/>
          {/* inside-photo overlays */}
          <rect width="220" height="180" rx="10" fill="#0E0E0C" fillOpacity="0.12"/>
          {/* image markers — fake window lights */}
          <g opacity="0.25" transform="translate(20,110)">
            {Array.from({length: 12}).map((_, j) => (
              <rect key={j} x={j*15} y="0" width="8" height="12" rx="1" fill="#F3F1EC" fillOpacity={j % 3 ? 0.3 : 0.9}/>
            ))}
          </g>
          {/* heart */}
          <g transform="translate(186,20)">
            <circle r="12" fill={c.favorite ? '#FFFFFF' : '#FFFFFF'} fillOpacity="0.9"/>
            <path d="M 0 3 Q -6 -3 -3 -6 Q 0 -7 0 -3 Q 0 -7 3 -6 Q 6 -3 0 3 Z" fill={c.favorite ? 'oklch(0.62 0.22 25)' : 'none'} stroke="#0E0E0C" strokeWidth={c.favorite ? 0 : 1}/>
          </g>
          {/* dots */}
          <g transform="translate(110,164)">
            {[0,1,2,3].map(j => <circle key={j} cx={(j-1.5)*10} cy="0" r="2.5" fill="#F3F1EC" fillOpacity={j === 0 ? 1 : 0.4}/>)}
          </g>
        </g>
      ))}

      {/* card meta rows */}
      {[
        { x: 60, price: '6,800', tag: '2BR · MARINA', rating: '4.9' },
        { x: 290, price: '4,200', tag: '1BR · DOWNTOWN', rating: '4.8' },
        { x: 520, price: '9,400', tag: '3BR · JBR', rating: '5.0' },
      ].map((c, i) => (
        <g key={i} transform={`translate(${c.x},324)`}>
          <text x="0" y="8" fontFamily="JetBrains Mono" fontSize="8" fill="#0E0E0C" fillOpacity="0.45" letterSpacing="1.5">{c.tag}</text>
          <text x="0" y="36" fontFamily="Instrument Serif" fontStyle="italic" fontSize="26" fill="#0E0E0C">{c.price}</text>
          <text x="74" y="36" fontFamily="JetBrains Mono" fontSize="9" fill="#0E0E0C" fillOpacity="0.5" letterSpacing="1.5">AED/MO</text>
          <g transform="translate(180,28)">
            <path d="M 0 -5 L 1.5 -1.5 L 5 -1.5 L 2 1 L 3 5 L 0 2.5 L -3 5 L -2 1 L -5 -1.5 L -1.5 -1.5 Z" fill="#0E0E0C"/>
            <text x="10" y="3" fontFamily="JetBrains Mono" fontSize="10" fill="#0E0E0C">{c.rating}</text>
          </g>
        </g>
      ))}
    </svg>
  );
}

function GraphicClinic() {
  // Clinic appointments — day-view timeline with stacked blocks
  return (
    <svg className="case-graphic" viewBox="0 0 800 400" preserveAspectRatio="xMidYMid meet">
      <rect width="800" height="400" fill="#141412"/>

      {/* header */}
      <text x="60" y="60" fontFamily="JetBrains Mono" fontSize="10" fill="#F3F1EC" fillOpacity="0.5" letterSpacing="2">TODAY · THU 12 JUN</text>
      <text x="60" y="96" fontFamily="Instrument Serif" fontStyle="italic" fontSize="36" fill="#F3F1EC">Dr. Leila's day</text>

      {/* clinician tabs */}
      <g transform="translate(340,76)">
        {['LEILA', 'OMAR', 'YARA'].map((n, i) => (
          <g key={n} transform={`translate(${i*90},0)`}>
            <rect width="78" height="26" rx="13" fill={i === 0 ? '#F3F1EC' : 'transparent'} stroke="#F3F1EC" strokeOpacity={i === 0 ? 0 : 0.2}/>
            <text x="39" y="17" fontFamily="JetBrains Mono" fontSize="9" fill={i === 0 ? '#0E0E0C' : '#F3F1EC'} fillOpacity={i === 0 ? 0.75 : 0.5} textAnchor="middle" letterSpacing="1.5">{n}</text>
          </g>
        ))}
      </g>

      {/* timeline hour labels */}
      <g transform="translate(60,140)">
        {['08', '09', '10', '11', '12', '13', '14', '15', '16', '17'].map((h, i) => (
          <g key={h} transform={`translate(${i*72},0)`}>
            <text x="0" y="0" fontFamily="JetBrains Mono" fontSize="9" fill="#F3F1EC" fillOpacity="0.4" letterSpacing="1.5">{h}</text>
            <line x1="0" y1="12" x2="0" y2="190" stroke="#F3F1EC" strokeOpacity="0.08"/>
          </g>
        ))}
        <line x1="0" y1="12" x2="648" y2="12" stroke="#F3F1EC" strokeOpacity="0.15"/>
        <line x1="0" y1="200" x2="648" y2="200" stroke="#F3F1EC" strokeOpacity="0.08"/>

        {/* now-line */}
        <line x1="160" y1="0" x2="160" y2="210" stroke="oklch(0.72 0.18 145)" strokeWidth="1.5"/>
        <circle cx="160" cy="-4" r="3" fill="oklch(0.72 0.18 145)"/>
        <text x="166" y="-6" fontFamily="JetBrains Mono" fontSize="8" fill="oklch(0.72 0.18 145)" letterSpacing="1.5">NOW</text>

        {/* appointment blocks */}
        {[
          { row: 0, start: 0, dur: 1.5, name: 'S. Haddad', type: 'Consult', past: true },
          { row: 1, start: 1.5, dur: 1, name: 'M. Qasim', type: 'Follow-up', past: true },
          { row: 0, start: 2.5, dur: 1, name: 'A. Reza', type: 'Consult', current: true },
          { row: 0, start: 3.8, dur: 1.5, name: 'N. Farouk', type: 'Procedure', past: false },
          { row: 1, start: 3.8, dur: 1, name: 'R. Antoun', type: 'Telehealth', past: false },
          { row: 0, start: 6, dur: 1.8, name: 'H. Tawfik', type: 'Consult', past: false },
          { row: 1, start: 6.5, dur: 1.3, name: 'D. Ayad', type: 'Follow-up', past: false },
          { row: 0, start: 8, dur: 1.5, name: 'Y. Malek', type: 'Procedure', past: false },
        ].map((a, i) => {
          const x = a.start * 72;
          const w = a.dur * 72 - 8;
          const y = 28 + a.row * 86;
          return (
            <g key={i}>
              <rect x={x} y={y} width={w} height="76" rx="6"
                    fill={a.current ? 'oklch(0.72 0.18 145)' : '#F3F1EC'}
                    fillOpacity={a.current ? 1 : a.past ? 0.06 : 0.14}
                    stroke={a.current ? 'oklch(0.72 0.18 145)' : '#F3F1EC'}
                    strokeOpacity={a.current ? 0 : a.past ? 0 : 0.2}/>
              {/* left color bar */}
              {!a.past && <rect x={x} y={y} width="3" height="76" fill={a.current ? '#0E0E0C' : 'oklch(0.72 0.18 145)'}/>}
              <text x={x+12} y={y+20} fontFamily="Geist" fontSize="11" fontWeight="500"
                    fill={a.current ? '#0E0E0C' : '#F3F1EC'} fillOpacity={a.past ? 0.4 : 1}>{a.name}</text>
              <text x={x+12} y={y+36} fontFamily="JetBrains Mono" fontSize="8"
                    fill={a.current ? '#0E0E0C' : '#F3F1EC'} fillOpacity={a.current ? 0.7 : a.past ? 0.3 : 0.55} letterSpacing="1.5">{a.type.toUpperCase()}</text>
              {a.current && (
                <g transform={`translate(${x + w - 24}, ${y + 60})`}>
                  <circle r="8" fill="#0E0E0C"/>
                  <circle r="3" fill="oklch(0.72 0.18 145)"/>
                </g>
              )}
            </g>
          );
        })}
      </g>

      {/* footer stats — illustrative */}
      <text x="60" y="375" fontFamily="JetBrains Mono" fontSize="10" fill="#F3F1EC" fillOpacity="0.5" letterSpacing="2">DAY VIEW</text>
      <text x="260" y="375" fontFamily="JetBrains Mono" fontSize="10" fill="#F3F1EC" fillOpacity="0.5" letterSpacing="2">CLINICIANS</text>
      <text x="740" y="375" fontFamily="JetBrains Mono" fontSize="10" fill="oklch(0.72 0.18 145)" letterSpacing="2" textAnchor="end">UPCOMING</text>
    </svg>
  );
}

const WORK = [
  { title: 'Fleet dispatch platform', tag: 'LOGISTICS · WEB · KSA', desc: 'Real-time dispatch and ops dashboard for a fleet operating across Riyadh.', featured: true, Graphic: GraphicFleet, bg: 'bg-fleet' },
  { title: 'Workplace noise monitoring', tag: 'IoT · WEB · GCC', desc: 'A sound-monitoring system letting operations teams track and manage noise levels across their sites in real time.', Graphic: GraphicNoise, bg: 'bg-noise' },
  { title: 'Website AI chat assistant', tag: 'AI · WEB', desc: 'An embedded AI chat assistant that answers customer questions directly on a company website. Arabic + English.', Graphic: GraphicChat, bg: 'bg-chat' },
  { title: 'Rentals marketplace', tag: 'MARKETPLACE · WEB', desc: 'Short and long-term rentals across the UAE, with built-in KYC and payments.', Graphic: GraphicRentals, bg: 'bg-rentals' },
  { title: 'Clinic appointments', tag: 'HEALTHTECH · WEB', desc: 'Appointment and clinic ops software for independent practitioners.', Graphic: GraphicClinic, bg: 'bg-clinic' },
];

function Work() {
  return (
    <section className="section page" id="work">
      <div style={{display:'flex', justifyContent:'space-between', alignItems:'flex-end', marginBottom: 80, gap: 48, flexWrap:'wrap'}}>
        <div>
          <div className="eyebrow" style={{marginBottom: 32}}>
            <span>[ 04 / Selected work ]</span>
          </div>
          <h2 className="display" style={{fontSize:'clamp(48px, 8vw, 140px)'}}>
            <RevealLine as="span" className="word-block">Things</RevealLine>
            <RevealLine as="span" className="word-block" delay={100}>we've <span className="serif">shipped.</span></RevealLine>
          </h2>
        </div>
        <FadeUp delay={300}>
          <p style={{maxWidth: 360, color: 'var(--fg-2)', fontSize: 15, lineHeight: 1.5}}>
            A representative slice of work, across the region and beyond.
          </p>
        </FadeUp>
      </div>

      <div className="work-grid">
        {WORK.map((w, i) => {
          const G = w.Graphic;
          return (
            <FadeUp key={w.title} className={`work-card ${w.featured ? 'featured' : ''}`} delay={i*80}>
              <div data-cursor="invert">
                <div className={`work-card-media ${w.bg || ''}`}><G /></div>
                <div className="work-card-meta">
                  <div>
                    <div className="work-card-title">{w.title}</div>
                    <div className="work-card-desc">{w.desc}</div>
                  </div>
                  <div className="work-card-tag">{w.tag}</div>
                </div>
              </div>
            </FadeUp>
          );
        })}
      </div>
    </section>
  );
}

Object.assign(window, { Work });
