// ============ SCENE ILLUSTRATIONS ============
// Architectural-drawing style illustrations in the same visual language as
// HouseIllustration (grid paper, thin lines, mono labels, clay + green + dark).
//
// All scenes use viewBox 0 0 400 340 (ratio ~4/3) unless noted — they crop
// gracefully inside containers of other ratios.

const SceneFrame = ({ children, viewBox = '0 0 400 340', bg = 'var(--cream-3)', id = 'scn' }) => (
  <svg viewBox={viewBox} width="100%" height="100%" preserveAspectRatio="xMidYMid slice"
       style={{display:'block', background: bg}}>
    <defs>
      <pattern id={`grid-${id}`} width="20" height="20" patternUnits="userSpaceOnUse">
        <path d="M 20 0 L 0 0 0 20" fill="none" stroke="#3D5A40" strokeWidth="0.3" opacity="0.1"/>
      </pattern>
    </defs>
    <rect width="100%" height="100%" fill={`url(#grid-${id})`}/>
    {children}
  </svg>
);

const MonoLabel = ({ x, y, children, anchor = 'start', color = '#3D5A40', size = 7 }) => (
  <text x={x} y={y} fontFamily="'JetBrains Mono', monospace" fontSize={size}
        fill={color} letterSpacing="1" textAnchor={anchor}>{children}</text>
);

const Person = ({ x, y, scale = 1, color = '#1A2019' }) => (
  <g transform={`translate(${x},${y}) scale(${scale})`} stroke={color}
     strokeWidth="0.9" fill="none" strokeLinecap="round">
    <circle cx="0" cy="0" r="2.2" fill={color}/>
    <line x1="0" y1="2.2" x2="0" y2="13"/>
    <line x1="0" y1="5.5" x2="-3" y2="9"/>
    <line x1="0" y1="5.5" x2="3" y2="9"/>
    <line x1="0" y1="13" x2="-3" y2="20"/>
    <line x1="0" y1="13" x2="3" y2="20"/>
  </g>
);

const Sun = ({ x, y, r = 10 }) => (
  <g>
    <circle cx={x} cy={y} r={r} fill="#A67B5B"/>
    <g stroke="#A67B5B" strokeWidth="0.7" strokeLinecap="round" opacity="0.85">
      <line x1={x} y1={y - r - 5} x2={x} y2={y - r - 1}/>
      <line x1={x - r - 5} y1={y} x2={x - r - 1} y2={y}/>
      <line x1={x + r + 1} y1={y} x2={x + r + 5} y2={y}/>
      <line x1={x - r*0.8} y1={y - r*0.8} x2={x - r*1.1} y2={y - r*1.1}/>
      <line x1={x + r*0.8} y1={y - r*0.8} x2={x + r*1.1} y2={y - r*1.1}/>
    </g>
  </g>
);

// ============ HERO SCENES ============

// Hero A — Family in front of home (emotional, wide landscape)
const HeroFamilyScene = () => (
  <SceneFrame id="hfam" viewBox="0 0 800 600" bg="#2E4434">
    <defs>
      <pattern id="grid-hfam" width="28" height="28" patternUnits="userSpaceOnUse">
        <path d="M 28 0 L 0 0 0 28" fill="none" stroke="#E8E2D5" strokeWidth="0.35" opacity="0.15"/>
      </pattern>
    </defs>
    <rect width="800" height="600" fill="#2E4434"/>
    <rect width="800" height="600" fill="url(#grid-hfam)"/>

    {/* horizon hills */}
    <path d="M 0 380 Q 200 340 400 360 T 800 350 L 800 440 L 0 440 Z"
          fill="#3D5A40" opacity="0.45"/>
    <path d="M 0 420 Q 250 400 500 410 T 800 405 L 800 480 L 0 480 Z"
          fill="#3D5A40" opacity="0.65"/>

    {/* large sun */}
    <circle cx="640" cy="160" r="60" fill="#A67B5B" opacity="0.55"/>
    <circle cx="640" cy="160" r="34" fill="#A67B5B"/>

    {/* house silhouette - centered */}
    <g transform="translate(260, 220)">
      <path d="M 0 80 L 0 20 L 140 20 L 140 80 Z" fill="#1A2019" stroke="#E8E2D5" strokeWidth="1.2"/>
      <path d="M -10 20 L 70 -30 L 150 20 Z" fill="#1A2019" stroke="#E8E2D5" strokeWidth="1.2"/>
      {/* solar panels on roof */}
      {Array.from({length: 4}).map((_, c) =>
        Array.from({length: 3}).map((_, r) => (
          <rect key={`${c}-${r}`} x={75 + c*16} y={-18 + r*10}
                width="14" height="8" fill="#0F1B14" stroke="#A67B5B" strokeWidth="0.3"/>
        ))
      )}
      {/* windows glowing */}
      <rect x="14" y="36" width="22" height="20" fill="#E8C982" opacity="0.9"/>
      <rect x="104" y="36" width="22" height="20" fill="#E8C982" opacity="0.9"/>
      <rect x="58" y="50" width="24" height="30" fill="#1A2019" stroke="#E8E2D5" strokeWidth="0.8"/>
    </g>

    {/* family silhouettes - foreground */}
    <g stroke="#E8E2D5" strokeWidth="1.2" fill="none" strokeLinecap="round">
      {/* adult 1 */}
      <g transform="translate(310, 380)">
        <circle cx="0" cy="0" r="8" fill="#E8E2D5"/>
        <path d="M -10 10 L -10 55 M 10 10 L 10 55 M -10 10 L 10 10 M -10 55 L -16 90 M 10 55 L 16 90" strokeWidth="14" stroke="#E8E2D5"/>
      </g>
      {/* adult 2 */}
      <g transform="translate(490, 380)">
        <circle cx="0" cy="0" r="8" fill="#E8E2D5"/>
        <path d="M -10 10 L -10 55 M 10 10 L 10 55 M -10 10 L 10 10 M -10 55 L -16 90 M 10 55 L 16 90" strokeWidth="14" stroke="#E8E2D5"/>
      </g>
      {/* child */}
      <g transform="translate(400, 420)">
        <circle cx="0" cy="0" r="6" fill="#E8E2D5"/>
        <path d="M -8 8 L -8 40 M 8 8 L 8 40 M -8 8 L 8 8 M -8 40 L -12 62 M 8 40 L 12 62" strokeWidth="10" stroke="#E8E2D5"/>
      </g>
    </g>

    {/* ground */}
    <line x1="0" y1="510" x2="800" y2="510" stroke="#E8E2D5" strokeWidth="1" opacity="0.5"/>

    {/* annotation */}
    <g fill="#E8E2D5" opacity="0.7">
      <MonoLabel x="40" y="560" color="#E8E2D5" size="10">FAMILIE · EIGENHEIM · 11,16 kWp</MonoLabel>
      <MonoLabel x="760" y="560" anchor="end" color="#A67B5B" size="10">SÜDLAGE ↗</MonoLabel>
    </g>
  </SceneFrame>
);

// Hero B — Cinematic house at dusk (wide)
const HeroHouseNightScene = () => (
  <SceneFrame id="hnight" viewBox="0 0 800 450" bg="#0F1B14">
    <rect width="800" height="450" fill="#0F1B14"/>

    {/* gradient-ish sky with stroked sun */}
    <circle cx="160" cy="110" r="28" fill="#A67B5B" opacity="0.6"/>

    {/* mountains */}
    <path d="M 0 250 L 120 200 L 240 240 L 380 180 L 500 230 L 650 195 L 800 235 L 800 320 L 0 320 Z"
          fill="#1A2019" stroke="#3D5A40" strokeWidth="0.6"/>

    {/* wide house */}
    <g transform="translate(220, 200)">
      <path d="M 0 120 L 0 40 L 360 40 L 360 120 Z" fill="#0A100A" stroke="#A67B5B" strokeWidth="1.2"/>
      <path d="M -10 40 L 180 -30 L 370 40 Z" fill="#0A100A" stroke="#A67B5B" strokeWidth="1.2"/>
      {/* solar panel grid on entire roof */}
      {Array.from({length: 10}).map((_, c) =>
        Array.from({length: 4}).map((_, r) => (
          <rect key={`${c}-${r}`}
                x={15 + c*33} y={-22 + r*15}
                width="30" height="13"
                fill="#050908" stroke="#A67B5B" strokeWidth="0.4" opacity="0.95"/>
        ))
      )}
      {/* illuminated windows */}
      {[0, 1, 2, 3, 4, 5].map(i => (
        <rect key={i} x={25 + i*56} y={65} width="34" height="30"
              fill="#E8C982" opacity="0.85"/>
      ))}
      <rect x="168" y="80" width="36" height="40" fill="#1A2019" stroke="#A67B5B" strokeWidth="0.8"/>
    </g>

    {/* tree silhouettes */}
    <g fill="#0A100A" stroke="#3D5A40" strokeWidth="0.6">
      <path d="M 80 340 L 80 280 Q 80 255 95 250 Q 110 255 110 285 L 110 340 Z"/>
      <path d="M 720 340 L 720 290 Q 720 265 735 260 Q 750 265 750 295 L 750 340 Z"/>
    </g>

    {/* ground */}
    <line x1="0" y1="340" x2="800" y2="340" stroke="#A67B5B" strokeWidth="0.9" opacity="0.6"/>
    <g stroke="#A67B5B" strokeWidth="0.3" opacity="0.5">
      {Array.from({length: 40}).map((_, i) => (
        <line key={i} x1={i*20} y1="340" x2={i*20} y2="346"/>
      ))}
    </g>

    {/* annotation */}
    <MonoLabel x="40" y="410" color="#A67B5B" size="10">KALAE · KOMPLETTANLAGE 'FAMILIE'</MonoLabel>
    <MonoLabel x="760" y="410" anchor="end" color="#E8E2D5" size="10">11,16 kWp · 40 MODULE</MonoLabel>
  </SceneFrame>
);

// Hero C — Technician with customer (portrait)
const HeroTechnicianScene = () => (
  <SceneFrame id="htech" viewBox="0 0 400 520" bg="#EFEBE4">
    <defs>
      <pattern id="grid-htech" width="20" height="20" patternUnits="userSpaceOnUse">
        <path d="M 20 0 L 0 0 0 20" fill="none" stroke="#3D5A40" strokeWidth="0.3" opacity="0.12"/>
      </pattern>
    </defs>
    <rect width="400" height="520" fill="#EFEBE4"/>
    <rect width="400" height="520" fill="url(#grid-htech)"/>

    <Sun x={340} y={60} r={14}/>

    {/* Small house in background */}
    <g transform="translate(80, 200)">
      <rect x="0" y="40" width="90" height="70" fill="none" stroke="#1A2019" strokeWidth="1"/>
      <path d="M -6 40 L 45 5 L 96 40 Z" fill="none" stroke="#1A2019" strokeWidth="1"/>
      {/* panels */}
      {Array.from({length: 4}).map((_, i) => (
        <rect key={i} x={48 + i*10} y={10} width="8" height="24"
              fill="#1A2019" stroke="#A67B5B" strokeWidth="0.3"/>
      ))}
      <rect x="10" y="55" width="18" height="18" fill="none" stroke="#1A2019" strokeWidth="0.6"/>
      <rect x="40" y="70" width="14" height="40" fill="none" stroke="#1A2019" strokeWidth="0.6"/>
    </g>

    {/* technician + customer - larger, foreground */}
    <g transform="translate(200, 340)">
      {/* customer */}
      <g transform="translate(-50, 0)" stroke="#1A2019" strokeWidth="1.3" fill="none" strokeLinecap="round">
        <circle cx="0" cy="0" r="10" fill="#1A2019"/>
        <line x1="-4" y1="-3" x2="-2" y2="-3" stroke="#EFEBE4" strokeWidth="1.2"/>
        <line x1="2" y1="-3" x2="4" y2="-3" stroke="#EFEBE4" strokeWidth="1.2"/>
        {/* body */}
        <path d="M -12 12 L -14 60 L -8 110 L 8 110 L 14 60 L 12 12 Z" fill="#3D5A40" stroke="#1A2019"/>
        {/* arms */}
        <path d="M -12 14 L -22 45 L -18 58" strokeWidth="8" stroke="#3D5A40"/>
        <path d="M 12 14 L 20 40 L 28 46" strokeWidth="8" stroke="#3D5A40"/>
      </g>
      {/* technician - slightly behind */}
      <g transform="translate(48, -8)" stroke="#1A2019" strokeWidth="1.3" fill="none" strokeLinecap="round">
        <circle cx="0" cy="0" r="10" fill="#1A2019"/>
        {/* hard hat */}
        <path d="M -11 -5 Q 0 -16 11 -5 Z" fill="#A67B5B" stroke="#1A2019"/>
        <line x1="-12" y1="-5" x2="12" y2="-5" stroke="#1A2019" strokeWidth="1"/>
        <path d="M -12 12 L -14 60 L -8 115 L 8 115 L 14 60 L 12 12 Z" fill="#A67B5B" stroke="#1A2019"/>
        {/* pointing arm */}
        <path d="M -12 15 L -28 10 L -44 -2" strokeWidth="8" stroke="#A67B5B"/>
        <path d="M 12 15 L 18 40 L 22 55" strokeWidth="8" stroke="#A67B5B"/>
        {/* clipboard in hand */}
        <rect x="-52" y="-10" width="16" height="20" fill="#EFEBE4" stroke="#1A2019"/>
        <line x1="-49" y1="-5" x2="-39" y2="-5" stroke="#1A2019" strokeWidth="0.5"/>
        <line x1="-49" y1="-2" x2="-41" y2="-2" stroke="#1A2019" strokeWidth="0.5"/>
        <line x1="-49" y1="1" x2="-42" y2="1" stroke="#1A2019" strokeWidth="0.5"/>
      </g>
    </g>

    {/* ground */}
    <line x1="0" y1="470" x2="400" y2="470" stroke="#1A2019" strokeWidth="0.9"/>

    <MonoLabel x="20" y="500" color="#3D5A40" size="8">BERATER + KUNDE · VOR-ORT-TERMIN</MonoLabel>
  </SceneFrame>
);

// Small roof detail (hero C secondary image, square)
const HeroRoofDetailScene = () => (
  <SceneFrame id="hroof" viewBox="0 0 300 300" bg="#1A2019">
    <rect width="300" height="300" fill="#1A2019"/>
    {/* angled roof detail - closeup panels */}
    <g transform="translate(0, 40) rotate(-12 150 130)">
      {Array.from({length: 5}).map((_, c) =>
        Array.from({length: 6}).map((_, r) => (
          <rect key={`${c}-${r}`}
                x={30 + c*50} y={20 + r*35}
                width="45" height="30"
                fill="#0A100A" stroke="#A67B5B" strokeWidth="0.6"/>
        ))
      )}
      {/* cell lines inside each module */}
      {Array.from({length: 5}).map((_, c) =>
        Array.from({length: 6}).map((_, r) => (
          <g key={`c-${c}-${r}`} stroke="#A67B5B" strokeWidth="0.2" opacity="0.5">
            <line x1={30 + c*50 + 22} y1={20 + r*35}
                  x2={30 + c*50 + 22} y2={20 + r*35 + 30}/>
            <line x1={30 + c*50} y1={20 + r*35 + 15}
                  x2={30 + c*50 + 45} y2={20 + r*35 + 15}/>
          </g>
        ))
      )}
    </g>
    <MonoLabel x="20" y="280" color="#A67B5B" size="7">DACH-DETAIL · FULL BLACK</MonoLabel>
  </SceneFrame>
);

// ============ PROCESS SCENES (6) ============

// 01 - Phone/call
const ProcCallScene = () => (
  <SceneFrame id="pc1">
    <Sun x={350} y={50} r={9}/>
    {/* phone */}
    <g transform="translate(130, 100)">
      <rect x="0" y="0" width="140" height="180" rx="14" fill="none" stroke="#1A2019" strokeWidth="1.6"/>
      <rect x="8" y="16" width="124" height="148" fill="none" stroke="#1A2019" strokeWidth="0.9"/>
      {/* speech bubble icon */}
      <g transform="translate(70, 80)">
        <path d="M -30 -20 L 30 -20 L 30 10 L 10 10 L 0 22 L 0 10 L -30 10 Z"
              fill="none" stroke="#3D5A40" strokeWidth="1.2"/>
        <line x1="-20" y1="-10" x2="20" y2="-10" stroke="#3D5A40" strokeWidth="0.8"/>
        <line x1="-20" y1="-4" x2="14" y2="-4" stroke="#3D5A40" strokeWidth="0.8"/>
        <line x1="-20" y1="2" x2="18" y2="2" stroke="#3D5A40" strokeWidth="0.8"/>
      </g>
      <circle cx="70" cy="172" r="3" fill="none" stroke="#1A2019" strokeWidth="0.8"/>
    </g>
    {/* connection line */}
    <path d="M 80 180 Q 40 220 60 280" fill="none" stroke="#A67B5B" strokeWidth="0.8" strokeDasharray="3 3"/>
    <circle cx="60" cy="285" r="3" fill="#A67B5B"/>
    <MonoLabel x="20" y="320">01 · GESPRÄCH · 30 MIN</MonoLabel>
  </SceneFrame>
);

// 02 - Satellite / roof analysis
const ProcRoofAnalysisScene = () => (
  <SceneFrame id="pc2">
    {/* laptop */}
    <g transform="translate(60, 80)">
      <rect x="0" y="0" width="280" height="170" fill="none" stroke="#1A2019" strokeWidth="1.4"/>
      <rect x="8" y="8" width="264" height="154" fill="#EFEBE4" stroke="#3D5A40" strokeWidth="0.6"/>
      {/* roof outline w/ panel layout */}
      <g transform="translate(30, 30)">
        <polygon points="0,60 90,0 180,60 180,100 0,100" fill="none" stroke="#1A2019" strokeWidth="1"/>
        <polygon points="0,60 90,0 180,60" fill="#3D5A40" opacity="0.08"/>
        {/* panels on roof */}
        {Array.from({length: 5}).map((_, c) =>
          Array.from({length: 3}).map((_, r) => (
            <rect key={`${c}-${r}`} x={20 + c*28} y={20 + r*12}
                  width="24" height="10" fill="#1A2019" stroke="#A67B5B" strokeWidth="0.3"/>
          ))
        )}
        {/* dimension lines */}
        <line x1="0" y1="115" x2="180" y2="115" stroke="#A67B5B" strokeWidth="0.5"/>
        <line x1="0" y1="112" x2="0" y2="118" stroke="#A67B5B" strokeWidth="0.5"/>
        <line x1="180" y1="112" x2="180" y2="118" stroke="#A67B5B" strokeWidth="0.5"/>
      </g>
      {/* laptop base */}
      <path d="M -16 170 L 296 170 L 280 185 L 0 185 Z" fill="none" stroke="#1A2019" strokeWidth="1.2"/>
    </g>
    {/* cursor */}
    <path d="M 220 160 L 220 180 L 226 176 L 232 188 L 237 186 L 231 174 L 238 174 Z"
          fill="#A67B5B" stroke="#1A2019" strokeWidth="0.5"/>
    <MonoLabel x="20" y="320">02 · DACH-CHECK · 48 STD</MonoLabel>
  </SceneFrame>
);

// 03 - Planning / blueprint
const ProcPlanningScene = () => (
  <SceneFrame id="pc3">
    {/* drawing sheet */}
    <g transform="translate(60, 50)">
      <rect x="0" y="0" width="280" height="220" fill="#FAF7F0" stroke="#1A2019" strokeWidth="1.2"/>
      {/* title block */}
      <rect x="180" y="180" width="96" height="36" fill="none" stroke="#1A2019" strokeWidth="0.6"/>
      <line x1="180" y1="192" x2="276" y2="192" stroke="#1A2019" strokeWidth="0.5"/>
      <line x1="180" y1="204" x2="276" y2="204" stroke="#1A2019" strokeWidth="0.5"/>
      <line x1="228" y1="180" x2="228" y2="216" stroke="#1A2019" strokeWidth="0.5"/>

      {/* blueprint roof plan */}
      <g transform="translate(20, 30)">
        <rect x="0" y="0" width="140" height="100" fill="none" stroke="#3D5A40" strokeWidth="0.9"/>
        <line x1="70" y1="0" x2="70" y2="100" stroke="#3D5A40" strokeWidth="0.6" strokeDasharray="2 2"/>
        {/* panel grid */}
        {Array.from({length: 5}).map((_, c) =>
          Array.from({length: 4}).map((_, r) => (
            <rect key={`${c}-${r}`} x={75 + c*12} y={8 + r*22}
                  width="10" height="18" fill="none" stroke="#3D5A40" strokeWidth="0.4"/>
          ))
        )}
        {/* dimensions */}
        <line x1="0" y1="-8" x2="140" y2="-8" stroke="#A67B5B" strokeWidth="0.4"/>
        <line x1="0" y1="-12" x2="0" y2="-4" stroke="#A67B5B" strokeWidth="0.4"/>
        <line x1="140" y1="-12" x2="140" y2="-4" stroke="#A67B5B" strokeWidth="0.4"/>
        <text x="70" y="-14" fontFamily="'JetBrains Mono', monospace" fontSize="5"
              fill="#A67B5B" textAnchor="middle">8.40 m</text>
      </g>
    </g>
    {/* ruler + pencil */}
    <g transform="translate(40, 270)">
      <rect x="0" y="0" width="180" height="10" fill="none" stroke="#1A2019" strokeWidth="0.9"/>
      {Array.from({length: 18}).map((_, i) => (
        <line key={i} x1={i*10} y1="0" x2={i*10} y2={i%5===0?6:3}
              stroke="#1A2019" strokeWidth="0.5"/>
      ))}
    </g>
    <g transform="translate(240, 260) rotate(30)">
      <rect x="0" y="0" width="80" height="6" fill="#A67B5B" stroke="#1A2019" strokeWidth="0.6"/>
      <path d="M 80 0 L 90 3 L 80 6 Z" fill="#1A2019"/>
    </g>
    <MonoLabel x="20" y="320">03 · PLANUNG + STATIK</MonoLabel>
  </SceneFrame>
);

// 04 - Montage
const ProcMontageScene = () => (
  <SceneFrame id="pc4">
    <Sun x={350} y={50} r={9}/>
    {/* house + partially-installed panels */}
    <g transform="translate(80, 130)">
      <rect x="0" y="60" width="240" height="100" fill="none" stroke="#1A2019" strokeWidth="1.2"/>
      <path d="M -8 60 L 120 -10 L 248 60 Z" fill="none" stroke="#1A2019" strokeWidth="1.2"/>

      {/* installed panels left half */}
      {Array.from({length: 4}).map((_, c) =>
        Array.from({length: 3}).map((_, r) => (
          <rect key={`i-${c}-${r}`} x={10 + c*22} y={-5 + r*15}
                width="20" height="13" fill="#1A2019" stroke="#A67B5B" strokeWidth="0.4"/>
        ))
      )}
      {/* being-installed panel (tilted) */}
      <g transform="translate(115, 5) rotate(-8)">
        <rect width="20" height="13" fill="#A67B5B" stroke="#1A2019" strokeWidth="0.6" opacity="0.85"/>
      </g>
      {/* ghost panels right half */}
      {Array.from({length: 3}).map((_, c) =>
        Array.from({length: 3}).map((_, r) => (
          <rect key={`g-${c}-${r}`} x={145 + c*22} y={-5 + r*15}
                width="20" height="13" fill="none" stroke="#1A2019"
                strokeWidth="0.3" strokeDasharray="1.5 1.5" opacity="0.6"/>
        ))
      )}

      {/* tech on roof */}
      <g transform="translate(135, -2) scale(0.7)" stroke="#1A2019" strokeWidth="1" fill="none">
        <circle cx="0" cy="0" r="2.5" fill="#1A2019"/>
        <path d="M -2 -3 Q 0 -6 2 -3 Z" fill="#A67B5B"/>
        <line x1="0" y1="2.5" x2="0" y2="14"/>
        <line x1="0" y1="6" x2="-4" y2="10"/>
        <line x1="0" y1="6" x2="6" y2="2"/>
        <line x1="0" y1="14" x2="-3" y2="22"/>
        <line x1="0" y1="14" x2="3" y2="22"/>
      </g>
    </g>
    {/* ladder */}
    <g stroke="#A67B5B" strokeWidth="1" fill="none">
      <line x1="50" y1="110" x2="85" y2="290"/>
      <line x1="60" y1="110" x2="95" y2="290"/>
      {Array.from({length: 8}).map((_, i) => (
        <line key={i} x1={51 + i*4.4} y1={130 + i*22} x2={61 + i*4.4} y2={130 + i*22}/>
      ))}
    </g>
    {/* ground */}
    <line x1="20" y1="290" x2="380" y2="290" stroke="#1A2019" strokeWidth="0.9"/>
    <MonoLabel x="20" y="320">04 · MONTAGE · 1–2 TAGE</MonoLabel>
  </SceneFrame>
);

// 05 - Handshake / handover
const ProcHandoverScene = () => (
  <SceneFrame id="pc5">
    <Sun x={350} y={50} r={9}/>
    {/* finished house small */}
    <g transform="translate(140, 70)">
      <rect x="0" y="40" width="120" height="60" fill="none" stroke="#1A2019" strokeWidth="1"/>
      <path d="M -8 40 L 60 0 L 128 40 Z" fill="none" stroke="#1A2019" strokeWidth="1"/>
      {Array.from({length: 5}).map((_, c) =>
        Array.from({length: 3}).map((_, r) => (
          <rect key={`${c}-${r}`} x={62 + c*12} y={6 + r*10}
                width="10" height="8" fill="#1A2019" stroke="#A67B5B" strokeWidth="0.3"/>
        ))
      )}
      {/* checkmark badge */}
      <circle cx="126" cy="10" r="10" fill="#3D5A40" stroke="#1A2019" strokeWidth="0.8"/>
      <path d="M 121 10 L 125 14 L 132 6" fill="none" stroke="#EFEBE4" strokeWidth="1.4" strokeLinecap="round"/>
    </g>
    {/* two hands/figures shaking hands */}
    <g transform="translate(200, 240)">
      <g transform="translate(-60, 0)">
        <Person x={0} y={0} scale={2.2}/>
      </g>
      <g transform="translate(60, 0)">
        <Person x={0} y={0} scale={2.2}/>
      </g>
      {/* clasped hands */}
      <g transform="translate(0, 12)" stroke="#A67B5B" strokeWidth="2.2" fill="none" strokeLinecap="round">
        <line x1="-28" y1="0" x2="-6" y2="0"/>
        <line x1="28" y1="0" x2="6" y2="0"/>
        <circle cx="0" cy="0" r="5" fill="#A67B5B"/>
      </g>
    </g>
    <line x1="20" y1="300" x2="380" y2="300" stroke="#1A2019" strokeWidth="0.9"/>
    <MonoLabel x="20" y="320">05 · ÜBERGABE + ANMELDUNG</MonoLabel>
  </SceneFrame>
);

// 06 - App dashboard
const ProcAppScene = () => (
  <SceneFrame id="pc6">
    <Sun x={350} y={50} r={9}/>
    {/* phone with dashboard */}
    <g transform="translate(140, 70)">
      <rect x="0" y="0" width="120" height="210" rx="12" fill="none" stroke="#1A2019" strokeWidth="1.4"/>
      <rect x="8" y="14" width="104" height="180" fill="#FAF7F0" stroke="#3D5A40" strokeWidth="0.5"/>

      {/* header */}
      <text x="16" y="30" fontFamily="'JetBrains Mono', monospace" fontSize="5"
            fill="#3D5A40" letterSpacing="0.5">HEUTE</text>
      <text x="16" y="46" fontFamily="'Instrument Serif', serif" fontSize="16"
            fill="#1A2019">18,4 kWh</text>

      {/* bar chart */}
      <g transform="translate(16, 58)">
        {[30, 44, 58, 50, 36, 22, 14].map((h, i) => (
          <g key={i}>
            <rect x={i*12} y={60 - h} width="8" height={h}
                  fill={i === 2 ? "#A67B5B" : "#3D5A40"} opacity={i === 2 ? 1 : 0.6}/>
          </g>
        ))}
        <line x1="0" y1="60" x2="84" y2="60" stroke="#1A2019" strokeWidth="0.5"/>
      </g>

      {/* stats row */}
      <g transform="translate(16, 140)">
        <text x="0" y="0" fontFamily="'Instrument Serif', serif" fontSize="11" fill="#1A2019">96%</text>
        <text x="0" y="10" fontFamily="'JetBrains Mono', monospace" fontSize="4" fill="#3D5A40">AUTARKIE</text>
        <text x="50" y="0" fontFamily="'Instrument Serif', serif" fontSize="11" fill="#1A2019">+4,20€</text>
        <text x="50" y="10" fontFamily="'JetBrains Mono', monospace" fontSize="4" fill="#3D5A40">ERSPART</text>
      </g>
      {/* icons row */}
      <g transform="translate(16, 168)">
        <rect x="0" y="0" width="26" height="18" fill="none" stroke="#3D5A40" strokeWidth="0.6"/>
        <rect x="32" y="0" width="26" height="18" fill="none" stroke="#3D5A40" strokeWidth="0.6"/>
        <rect x="64" y="0" width="26" height="18" fill="none" stroke="#A67B5B" strokeWidth="0.6"/>
      </g>
      <circle cx="60" cy="202" r="3" fill="none" stroke="#1A2019" strokeWidth="0.6"/>
    </g>
    <MonoLabel x="20" y="320">06 · APP · 25 JAHRE BEGLEITUNG</MonoLabel>
  </SceneFrame>
);

// ============ ABOUT SCENES ============

// Founder portrait-style drawing (tall)
const FounderScene = () => (
  <SceneFrame id="fnd" viewBox="0 0 320 400" bg="#2E4434">
    <rect width="320" height="400" fill="#2E4434"/>
    <defs>
      <pattern id="grid-fnd" width="24" height="24" patternUnits="userSpaceOnUse">
        <path d="M 24 0 L 0 0 0 24" fill="none" stroke="#E8E2D5" strokeWidth="0.3" opacity="0.12"/>
      </pattern>
    </defs>
    <rect width="320" height="400" fill="url(#grid-fnd)"/>
    <circle cx="260" cy="70" r="26" fill="#A67B5B" opacity="0.55"/>

    {/* portrait bust - stylized */}
    <g transform="translate(160, 160)" stroke="#E8E2D5" strokeWidth="1.4" fill="#3D5A40" strokeLinecap="round">
      {/* shoulders / body */}
      <path d="M -90 200 L -80 130 Q -60 100 -30 95 L 30 95 Q 60 100 80 130 L 90 200 Z"
            fill="#1A2019"/>
      {/* shirt line */}
      <path d="M -30 95 Q 0 115 30 95" fill="none" stroke="#E8E2D5" strokeWidth="1"/>
      {/* neck */}
      <rect x="-14" y="60" width="28" height="36" fill="#D4A77A" stroke="#1A2019" strokeWidth="0.8"/>
      {/* head */}
      <ellipse cx="0" cy="20" rx="42" ry="52" fill="#D4A77A" stroke="#1A2019" strokeWidth="1.2"/>
      {/* hair */}
      <path d="M -42 10 Q -44 -32 0 -38 Q 44 -32 42 10 Q 36 -10 0 -12 Q -36 -10 -42 10 Z"
            fill="#1A2019"/>
      {/* eyes (thin) */}
      <line x1="-18" y1="22" x2="-10" y2="22" strokeWidth="1.4" stroke="#1A2019"/>
      <line x1="10" y1="22" x2="18" y2="22" strokeWidth="1.4" stroke="#1A2019"/>
      {/* nose */}
      <path d="M 0 28 L -3 40 L 2 42" fill="none" stroke="#1A2019" strokeWidth="0.8"/>
      {/* mouth - slight smile */}
      <path d="M -8 52 Q 0 56 8 52" fill="none" stroke="#1A2019" strokeWidth="1.2"/>
      {/* subtle beard */}
      <path d="M -20 48 Q 0 66 20 48 Q 16 62 0 64 Q -16 62 -20 48 Z" fill="#1A2019" opacity="0.3"/>
    </g>

    <MonoLabel x="20" y="380" color="#E8E2D5" size="8">JAKOB MEISTER · GRÜNDER · SEIT 2016</MonoLabel>
  </SceneFrame>
);

// Team small (square)
const TeamScene = () => (
  <SceneFrame id="team" viewBox="0 0 300 300" bg="#A67B5B">
    <rect width="300" height="300" fill="#A67B5B"/>
    <defs>
      <pattern id="grid-team" width="20" height="20" patternUnits="userSpaceOnUse">
        <path d="M 20 0 L 0 0 0 20" fill="none" stroke="#1A2019" strokeWidth="0.3" opacity="0.15"/>
      </pattern>
    </defs>
    <rect width="300" height="300" fill="url(#grid-team)"/>

    {/* 4 people in row */}
    {[0, 1, 2, 3].map(i => (
      <g key={i} transform={`translate(${50 + i*60}, 130)`}
         stroke="#1A2019" strokeWidth="1.3" fill="#EFEBE4">
        {/* hard hat */}
        <path d={`M -14 -6 Q 0 -22 14 -6 Z`} fill="#3D5A40" stroke="#1A2019"/>
        <line x1="-16" y1="-6" x2="16" y2="-6" stroke="#1A2019" strokeWidth="1"/>
        {/* head */}
        <circle cx="0" cy="0" r="10" fill={i % 2 === 0 ? "#D4A77A" : "#B8855B"} stroke="#1A2019"/>
        {/* body */}
        <path d="M -14 12 L -16 60 L -8 115 L 8 115 L 16 60 L 14 12 Z" fill="#EFEBE4" stroke="#1A2019"/>
        {/* arms */}
        <path d="M -14 14 L -20 50 L -18 70" strokeWidth="10" stroke="#EFEBE4"/>
        <path d="M 14 14 L 20 50 L 18 70" strokeWidth="10" stroke="#EFEBE4"/>
      </g>
    ))}
    <line x1="0" y1="255" x2="300" y2="255" stroke="#1A2019" strokeWidth="0.9"/>
    <MonoLabel x="20" y="285" color="#1A2019" size="7">MONTAGE-TEAM · 34 MITARBEITENDE</MonoLabel>
  </SceneFrame>
);

// Advisor portrait - Jakob Tietz (contact, square)
const AdvisorScene = () => (
  <SceneFrame id="adv" viewBox="0 0 200 200" bg="#3D5A40">
    <rect width="200" height="200" fill="#3D5A40"/>
    <defs>
      <pattern id="grid-adv" width="16" height="16" patternUnits="userSpaceOnUse">
        <path d="M 16 0 L 0 0 0 16" fill="none" stroke="#E8E2D5" strokeWidth="0.3" opacity="0.14"/>
      </pattern>
    </defs>
    <rect width="200" height="200" fill="url(#grid-adv)"/>
    <circle cx="160" cy="40" r="14" fill="#A67B5B" opacity="0.8"/>

    <g transform="translate(100, 105)" stroke="#1A2019" strokeWidth="1.3">
      {/* shoulders / shirt */}
      <path d="M -55 100 L -45 48 Q -28 30 -8 28 L 8 28 Q 28 30 45 48 L 55 100 Z"
            fill="#EFEBE4" stroke="#1A2019"/>
      {/* collar */}
      <path d="M -14 28 L -4 42 L 4 42 L 14 28" fill="#3D5A40" stroke="#1A2019" strokeWidth="0.9"/>
      {/* neck */}
      <rect x="-9" y="14" width="18" height="18" fill="#D4A77A" stroke="#1A2019"/>
      {/* head */}
      <ellipse cx="0" cy="-8" rx="30" ry="36" fill="#D4A77A" stroke="#1A2019" strokeWidth="1.2"/>
      {/* hair - short, warm */}
      <path d="M -28 -18 Q -30 -46 0 -48 Q 30 -46 28 -18 Q 22 -30 0 -32 Q -22 -30 -28 -18 Z"
            fill="#3D2817"/>
      {/* eyes */}
      <line x1="-13" y1="-8" x2="-7" y2="-8" strokeWidth="1.4" stroke="#1A2019"/>
      <line x1="7" y1="-8" x2="13" y2="-8" strokeWidth="1.4" stroke="#1A2019"/>
      {/* brows */}
      <line x1="-14" y1="-14" x2="-6" y2="-15" strokeWidth="0.9" stroke="#1A2019"/>
      <line x1="6" y1="-15" x2="14" y2="-14" strokeWidth="0.9" stroke="#1A2019"/>
      {/* nose */}
      <path d="M 0 -2 L -2 8 L 2 10" fill="none" stroke="#1A2019" strokeWidth="0.9"/>
      {/* mouth - warm smile */}
      <path d="M -7 18 Q 0 22 7 18" fill="none" stroke="#1A2019" strokeWidth="1.2"/>
      {/* subtle stubble */}
      <path d="M -16 14 Q 0 26 16 14" fill="none" stroke="#1A2019" strokeWidth="0.4" opacity="0.3"/>
    </g>

    <text x="100" y="186" fontFamily="'JetBrains Mono', monospace" fontSize="7"
          fill="#E8E2D5" textAnchor="middle" letterSpacing="1" opacity="0.75">JAKOB TIETZ</text>
  </SceneFrame>
);

// Expose
Object.assign(window, {
  HeroFamilyScene,
  HeroHouseNightScene,
  HeroTechnicianScene,
  HeroRoofDetailScene,
  ProcCallScene,
  ProcRoofAnalysisScene,
  ProcPlanningScene,
  ProcMontageScene,
  ProcHandoverScene,
  ProcAppScene,
  FounderScene,
  TeamScene,
  AdvisorScene,
});
