// Act III — THE SOLUTION (THE PLATFORM)
// God-mode redesign 2026-04-28: 5-panel beat-swap. Doug flagged the original
// architecture diagram as "horrendously crowded" — V too small, INGEST/DELIVER
// flat, hard to read. This rebuild lets the system unfold across clicks:
//
//   b0  The Keystone   — massive V mark, headline lands
//   b1  Six Capabilities — what the platform does (3×2 display grid)
//   b2  INGEST          — partners flow in from the supply side
//   b3  DELIVER         — users emerge on the demand side
//   b4  The Close       — revenue streams + system summary
//
// The V is the protagonist on b0; on every subsequent panel the eye carries
// it as the implied center the system orbits around.

const SOL_CAPABILITIES = [
  { kicker: '01', title: 'Museum-Quality Archive',   body: 'High-res 360° scans of garments, accessories, textiles — partner museums globally.', glyph: '◉', tint: 'var(--gold)' },
  { kicker: '02', title: 'Curriculum-Mapped Search', body: 'Tagged by era, designer, technique. Aligned to FIT, Parsons, SCAD, TJU.',          glyph: '◈', tint: 'var(--sage)' },
  { kicker: '03', title: 'Design Studio Tools',      body: 'Annotation, mood-boards, citation. Fits a thesis, not a stock-photo workflow.',     glyph: '✎', tint: 'var(--parchment-dim)' },
  { kicker: '04', title: 'Museum Revenue Share',     body: 'Per-access licensing fees. Solves the museum monetization problem.',                glyph: '⚖', tint: 'var(--gold)' },
  { kicker: '05', title: 'Curriculum Telemetry',     body: 'Engagement, popular assets, syllabus effectiveness. Evidence for educators.',       glyph: '▤', tint: 'var(--sage)' },
  { kicker: '06', title: 'Rights-Cleared Licensing', body: 'Fully licensed for educational use. No copyright risk for the institution.',         glyph: '⚿', tint: 'var(--parchment-dim)' },
];

const SOL_PARTNERS = [
  { kicker: 'P1', title: 'Fashion Museums',       body: 'Collections, expertise, heritage assets.' },
  { kicker: 'P2', title: 'Universities Archives', body: 'Academic collections, theses, research.' },
  { kicker: 'P3', title: 'Brands Heritage',       body: 'Lookbooks, campaigns, brand documentation.' },
  { kicker: 'P4', title: 'Private Collections',   body: 'Rare garments, accessories, ephemera.' },
];

const SOL_USERS = [
  { kicker: 'U1', title: 'Students',       body: 'Authentic 3D assets for learning, analysis, creative dev.' },
  { kicker: 'U2', title: 'Educators',      body: 'Teaching tools, curriculum, digital studio.' },
  { kicker: 'U3', title: 'Researchers',    body: 'High-quality data for academic and industry research.' },
  { kicker: 'U4', title: 'Designers',      body: 'Inspiration, reference, innovation support.' },
  { kicker: 'U5', title: 'General Public', body: 'Engaging exhibitions accessible to all.' },
];

const SOL_REVENUE = [
  { glyph: '◍', title: 'Subscriptions',         body: 'Tiered access — students, educators, institutions.' },
  { glyph: '◇', title: 'Asset Licensing',       body: 'Educational, research, commercial use.' },
  { glyph: '◐', title: 'Virtual Exhibitions',   body: 'Ticketed exhibitions and immersive experiences.' },
  { glyph: '◈', title: 'Training & Consulting', body: 'Workshops on 3D digitization and preservation.' },
  { glyph: '◊', title: 'Partnerships & Grants', body: 'Institutional partnerships, public grants.' },
];

// ─── The V Keystone ───────────────────────────────────────────────────────
// Massive center mark. Concentric sage + gold rings, rhizome dots, big italic
// V. Visible only on b0; on later panels we let the audience CARRY the V as
// the implied center the system orbits around (cleaner than persisting it
// across every panel and competing with each panel's content).
//
// Sized 480px on a 1080-tall stage so it's monumental but doesn't crowd the
// headline below it.
function VKeystone({ progress = 1 }) {
  const eased = 1 - Math.pow(1 - Math.max(0, Math.min(1, progress)), 3);
  // 16 rhizome dots positioned around the rings
  const dots = [];
  const radius = 165;
  for (let i = 0; i < 16; i++) {
    const angle = (i / 16) * Math.PI * 2;
    const r = i % 2 === 0 ? radius : radius - 22;
    const x = Math.cos(angle) * r;
    const y = Math.sin(angle) * r;
    dots.push({ x, y, idx: i });
  }
  return (
    <div style={{
      position: 'relative',
      width: 480, height: 480,
      transform: `scale(${0.7 + eased * 0.3})`,
      opacity: eased,
      transition: 'transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.7s ease',
    }}>
      {/* Outer sage ring */}
      <div style={{
        position: 'absolute', inset: 0,
        borderRadius: '50%',
        border: '1px solid rgba(143,166,143,0.4)',
      }} />
      {/* Inner gold ring */}
      <div style={{
        position: 'absolute', inset: 50,
        borderRadius: '50%',
        border: '1px solid rgba(201,168,76,0.45)',
      }} />
      {/* Innermost hairline */}
      <div style={{
        position: 'absolute', inset: 110,
        borderRadius: '50%',
        border: '1px solid rgba(201,168,76,0.18)',
      }} />
      {/* Rhizome dots — sage, alternating sizes around the perimeter */}
      {dots.map(d => (
        <div key={d.idx} style={{
          position: 'absolute',
          left: `calc(50% + ${d.x}px)`,
          top: `calc(50% + ${d.y}px)`,
          width: d.idx % 2 === 0 ? 6 : 4,
          height: d.idx % 2 === 0 ? 6 : 4,
          borderRadius: '50%',
          background: d.idx % 4 === 0 ? 'var(--gold)' : 'var(--sage)',
          transform: 'translate(-50%, -50%)',
          opacity: 0.5 + (d.idx % 3) * 0.15,
          boxShadow: d.idx % 4 === 0 ? '0 0 12px rgba(201,168,76,0.5)' : 'none',
        }} />
      ))}
      {/* Connecting hairlines — internal rhizome geometry */}
      <svg style={{ position: 'absolute', inset: 0, width: '100%', height: '100%' }} viewBox="-240 -240 480 480">
        <line x1="-120" y1="0" x2="120" y2="0" stroke="rgba(143,166,143,0.18)" strokeWidth="0.5" strokeDasharray="2 3" />
        <line x1="0" y1="-120" x2="0" y2="120" stroke="rgba(143,166,143,0.18)" strokeWidth="0.5" strokeDasharray="2 3" />
        <line x1="-85" y1="-85" x2="85" y2="85" stroke="rgba(201,168,76,0.12)" strokeWidth="0.5" strokeDasharray="2 3" />
        <line x1="85" y1="-85" x2="-85" y2="85" stroke="rgba(201,168,76,0.12)" strokeWidth="0.5" strokeDasharray="2 3" />
      </svg>
      {/* Center V — display Play italic, monumental */}
      <div style={{
        position: 'absolute', inset: 0,
        display: 'flex', alignItems: 'center', justifyContent: 'center',
      }}>
        <span style={{
          fontFamily: 'var(--font-display)',
          fontSize: 280,
          fontStyle: 'italic',
          fontWeight: 700,
          letterSpacing: '-0.06em',
          lineHeight: 1,
          background: 'linear-gradient(180deg, var(--gold) 0%, var(--sage) 100%)',
          WebkitBackgroundClip: 'text',
          WebkitTextFillColor: 'transparent',
          backgroundClip: 'text',
          textShadow: '0 0 40px rgba(201,168,76,0.25)',
          paddingBottom: 24,
        }}>V</span>
      </div>
    </div>
  );
}

// ─── Panel 0 · The Keystone ───────────────────────────────────────────────
function SolKeystonePanel({ vis }) {
  const eased = 1 - Math.pow(1 - vis, 3);
  return (
    <div style={{
      position: 'absolute', inset: 0,
      opacity: eased, transform: `translateY(${(1 - eased) * 24}px)`,
      transition: 'opacity 0.7s ease, transform 0.7s ease',
      pointerEvents: vis > 0.05 ? 'auto' : 'none',
      display: 'flex', alignItems: 'center', justifyContent: 'center',
      padding: '0 80px',
    }}>
      <div style={{
        display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 80,
        alignItems: 'center', maxWidth: 1480, width: '100%',
      }}>
        {/* Left — typography */}
        <div>
          <span className="label-text" style={{
            color: 'var(--gold)', letterSpacing: '0.36em',
          }}>The Platform</span>
          <h2 className="font-display" style={{
            fontSize: 'clamp(56px, 6.4vw, 104px)',
            lineHeight: 0.94, letterSpacing: '-0.02em',
            color: 'var(--parchment)',
            margin: '20px 0 0', textTransform: 'uppercase',
          }}>
            Six capabilities,<br />
            <span style={{ color: 'var(--sage)', fontStyle: 'italic' }}>nested in a system.</span>
          </h2>
          <div style={{
            margin: '32px 0 0', height: 1, width: 240,
            background: 'linear-gradient(to right, var(--gold), transparent)',
          }} />
          <p className="font-editorial" style={{
            margin: '28px 0 0', fontSize: 19, lineHeight: 1.55,
            color: 'var(--parchment-dim)', maxWidth: 540,
            fontStyle: 'italic', textWrap: 'pretty',
          }}>
            Partners ingest. Users pull. Revenue closes.<br />
            One archive, one platform, one loop.
          </p>
        </div>
        {/* Right — V keystone */}
        <div style={{
          display: 'flex', alignItems: 'center', justifyContent: 'center',
        }}>
          <VKeystone progress={vis} />
        </div>
      </div>
    </div>
  );
}

// ─── Panel 1 · Six Capabilities ──────────────────────────────────────────
function SolCapabilitiesPanel({ vis }) {
  const eased = 1 - Math.pow(1 - vis, 3);
  return (
    <div style={{
      position: 'absolute', inset: 0,
      opacity: eased, transform: `translateY(${(1 - eased) * 24}px)`,
      transition: 'opacity 0.7s ease, transform 0.7s ease',
      pointerEvents: vis > 0.05 ? 'auto' : 'none',
      display: 'flex', alignItems: 'center', justifyContent: 'center',
      padding: '0 80px',
    }}>
      <div style={{ width: '100%', maxWidth: 1480 }}>
        <div style={{ display: 'flex', alignItems: 'baseline', gap: 16, marginBottom: 18 }}>
          <span className="label-text" style={{ color: 'var(--sage)', letterSpacing: '0.32em' }}>The Platform · what it does</span>
          <div style={{ flex: 1, height: 1, background: 'rgba(143,166,143,0.22)' }} />
          <span className="label-text" style={{ color: 'var(--gold)' }}>
            ◆ six capabilities · one product
          </span>
        </div>
        <h3 className="font-display" style={{
          fontSize: 'clamp(40px, 4.4vw, 64px)',
          lineHeight: 0.98, letterSpacing: '-0.02em',
          color: 'var(--parchment)', margin: '0 0 36px', textTransform: 'uppercase',
        }}>
          What the <span style={{ color: 'var(--gold)', fontStyle: 'italic' }}>archive</span> can do.
        </h3>
        <div style={{
          display: 'grid',
          gridTemplateColumns: 'repeat(3, 1fr)',
          gap: 22,
        }}>
          {SOL_CAPABILITIES.map((c) => (
            <div key={c.kicker} style={{
              padding: '28px 28px 26px',
              background: 'rgba(7,50,66,0.55)',
              border: '1px solid rgba(143,166,143,0.18)',
              borderTop: `2px solid ${c.tint}`,
              minHeight: 220,
              display: 'flex', flexDirection: 'column',
            }}>
              <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline' }}>
                <span className="label-text" style={{ color: 'var(--taupe)' }}>{c.kicker}</span>
                <span style={{
                  fontFamily: 'var(--font-display)', fontSize: 28,
                  color: c.tint, opacity: 0.7, lineHeight: 1,
                }}>{c.glyph}</span>
              </div>
              <h4 className="font-display" style={{
                margin: '14px 0 10px', fontSize: 22, lineHeight: 1.1,
                letterSpacing: '-0.005em',
                color: 'var(--parchment)', textTransform: 'uppercase',
              }}>{c.title}</h4>
              <p className="font-editorial" style={{
                margin: 0, fontSize: 14, lineHeight: 1.55,
                color: 'rgba(255,255,255,0.72)', textWrap: 'pretty',
              }}>{c.body}</p>
            </div>
          ))}
        </div>
      </div>
    </div>
  );
}

// ─── Panel 2 · INGEST (the supply side) ──────────────────────────────────
function SolIngestPanel({ vis }) {
  const eased = 1 - Math.pow(1 - vis, 3);
  return (
    <div style={{
      position: 'absolute', inset: 0,
      opacity: eased, transform: `translateY(${(1 - eased) * 24}px)`,
      transition: 'opacity 0.7s ease, transform 0.7s ease',
      pointerEvents: vis > 0.05 ? 'auto' : 'none',
      display: 'flex', alignItems: 'center', justifyContent: 'center',
      padding: '0 80px',
    }}>
      <div style={{ width: '100%', maxWidth: 1480 }}>
        <div style={{ display: 'flex', alignItems: 'baseline', gap: 16, marginBottom: 28 }}>
          <span className="label-text" style={{ color: 'var(--sage)', letterSpacing: '0.32em' }}>The Platform · supply side</span>
          <div style={{ flex: 1, height: 1, background: 'rgba(143,166,143,0.25)' }} />
          <span className="label-text" style={{ color: 'var(--sage)' }}>
            → flows into the V
          </span>
        </div>
        {/* Cinematic INGEST headline */}
        <div style={{ display: 'flex', alignItems: 'center', gap: 32, marginBottom: 40 }}>
          <h3 className="font-display" style={{
            fontSize: 'clamp(96px, 11vw, 200px)',
            lineHeight: 0.9, letterSpacing: '-0.05em',
            color: 'var(--sage)', fontStyle: 'italic',
            margin: 0,
          }}>Ingest.</h3>
          <div style={{ flex: 1 }}>
            <p className="font-editorial" style={{
              fontSize: 19, lineHeight: 1.5,
              color: 'var(--parchment-dim)', fontStyle: 'italic',
              maxWidth: 580, margin: 0, textWrap: 'pretty',
            }}>
              Where the archive comes from. Four supply lanes feed the platform — each
              with its own rights model, each with its own kind of artifact.
            </p>
          </div>
        </div>
        {/* Partners — 4 substantial cards in a row */}
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 18 }}>
          {SOL_PARTNERS.map((p) => (
            <div key={p.kicker} style={{
              padding: '24px 22px 22px',
              background: 'rgba(7,50,66,0.55)',
              border: '1px solid rgba(143,166,143,0.22)',
              borderLeft: '3px solid var(--sage)',
            }}>
              <div className="label-text" style={{ color: 'var(--taupe)' }}>{p.kicker}</div>
              <h4 className="font-display" style={{
                margin: '12px 0 10px', fontSize: 22, lineHeight: 1.1,
                letterSpacing: '-0.005em',
                color: 'var(--parchment)', textTransform: 'uppercase',
              }}>{p.title}</h4>
              <p className="font-editorial" style={{
                margin: 0, fontSize: 14, lineHeight: 1.55,
                color: 'rgba(240,238,233,0.68)', textWrap: 'pretty',
              }}>{p.body}</p>
            </div>
          ))}
        </div>
        {/* Flow indicator — sage line drawing toward right edge (toward V) */}
        <div style={{
          marginTop: 38,
          display: 'flex', alignItems: 'center', gap: 20,
        }}>
          <div style={{
            flex: 1, height: 1,
            background: 'linear-gradient(to right, transparent, var(--sage))',
            opacity: 0.5,
          }} />
          <span className="label-text" style={{ color: 'var(--sage)', letterSpacing: '0.36em' }}>
            ▸ to the platform
          </span>
        </div>
      </div>
    </div>
  );
}

// ─── Panel 3 · DELIVER (the demand side) ─────────────────────────────────
function SolDeliverPanel({ vis }) {
  const eased = 1 - Math.pow(1 - vis, 3);
  return (
    <div style={{
      position: 'absolute', inset: 0,
      opacity: eased, transform: `translateY(${(1 - eased) * 24}px)`,
      transition: 'opacity 0.7s ease, transform 0.7s ease',
      pointerEvents: vis > 0.05 ? 'auto' : 'none',
      display: 'flex', alignItems: 'center', justifyContent: 'center',
      padding: '0 80px',
    }}>
      <div style={{ width: '100%', maxWidth: 1480 }}>
        <div style={{ display: 'flex', alignItems: 'baseline', gap: 16, marginBottom: 28 }}>
          <span className="label-text" style={{ color: 'var(--gold)', letterSpacing: '0.32em' }}>The Platform · demand side</span>
          <div style={{ flex: 1, height: 1, background: 'rgba(201,168,76,0.3)' }} />
          <span className="label-text" style={{ color: 'var(--gold)' }}>
            from the V →
          </span>
        </div>
        <div style={{ display: 'flex', alignItems: 'center', gap: 32, marginBottom: 40 }}>
          <h3 className="font-display" style={{
            fontSize: 'clamp(96px, 11vw, 200px)',
            lineHeight: 0.9, letterSpacing: '-0.05em',
            color: 'var(--gold)', fontStyle: 'italic',
            margin: 0,
          }}>Deliver.</h3>
          <div style={{ flex: 1 }}>
            <p className="font-editorial" style={{
              fontSize: 19, lineHeight: 1.5,
              color: 'var(--parchment-dim)', fontStyle: 'italic',
              maxWidth: 580, margin: 0, textWrap: 'pretty',
            }}>
              Who the archive serves. Five demand lanes — each with its own way of
              using the platform, each with its own willingness to pay.
            </p>
          </div>
        </div>
        {/* Users — 5 cards in a row */}
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 16 }}>
          {SOL_USERS.map((u) => (
            <div key={u.kicker} style={{
              padding: '22px 20px 20px',
              background: 'rgba(7,50,66,0.55)',
              border: '1px solid rgba(201,168,76,0.22)',
              borderRight: '3px solid var(--gold)',
            }}>
              <div className="label-text" style={{ color: 'var(--taupe)' }}>{u.kicker}</div>
              <h4 className="font-display" style={{
                margin: '12px 0 10px', fontSize: 20, lineHeight: 1.1,
                letterSpacing: '-0.005em',
                color: 'var(--parchment)', textTransform: 'uppercase',
              }}>{u.title}</h4>
              <p className="font-editorial" style={{
                margin: 0, fontSize: 13, lineHeight: 1.5,
                color: 'rgba(240,238,233,0.68)', textWrap: 'pretty',
              }}>{u.body}</p>
            </div>
          ))}
        </div>
        <div style={{
          marginTop: 38,
          display: 'flex', alignItems: 'center', gap: 20,
        }}>
          <span className="label-text" style={{ color: 'var(--gold)', letterSpacing: '0.36em' }}>
            ◂ from the platform
          </span>
          <div style={{
            flex: 1, height: 1,
            background: 'linear-gradient(to left, transparent, var(--gold))',
            opacity: 0.5,
          }} />
        </div>
      </div>
    </div>
  );
}

// ─── Panel 4 · The Close (revenue + summary) ─────────────────────────────
function SolClosePanel({ vis }) {
  const eased = 1 - Math.pow(1 - vis, 3);
  return (
    <div style={{
      position: 'absolute', inset: 0,
      opacity: eased, transform: `translateY(${(1 - eased) * 24}px)`,
      transition: 'opacity 0.7s ease, transform 0.7s ease',
      pointerEvents: vis > 0.05 ? 'auto' : 'none',
      display: 'flex', alignItems: 'center', justifyContent: 'center',
      padding: '0 80px',
    }}>
      <div style={{ width: '100%', maxWidth: 1480 }}>
        <div style={{ display: 'flex', alignItems: 'baseline', gap: 16, marginBottom: 28 }}>
          <span className="label-text" style={{ color: 'var(--gold)', letterSpacing: '0.32em' }}>The Platform · the close</span>
          <div style={{ flex: 1, height: 1, background: 'rgba(201,168,76,0.3)' }} />
          <span className="label-text" style={{ color: 'var(--sage)' }}>
            ◆ five revenue streams
          </span>
        </div>
        <h3 className="font-display" style={{
          fontSize: 'clamp(48px, 5.4vw, 88px)',
          lineHeight: 0.98, letterSpacing: '-0.02em',
          color: 'var(--parchment)', margin: '0 0 56px', textTransform: 'uppercase',
        }}>
          The loop <span style={{ color: 'var(--gold)', fontStyle: 'italic' }}>closes.</span>
        </h3>
        {/* Revenue chips — 5 across */}
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 18, marginBottom: 56 }}>
          {SOL_REVENUE.map((r) => (
            <div key={r.title} style={{
              padding: '24px 18px 22px',
              textAlign: 'center',
              background: 'rgba(7,50,66,0.45)',
              border: '1px solid rgba(201,168,76,0.18)',
              borderTop: '2px solid var(--gold)',
            }}>
              <div style={{
                fontFamily: 'var(--font-display)', fontSize: 36,
                color: 'var(--gold)', opacity: 0.85,
                lineHeight: 1, marginBottom: 12,
              }}>{r.glyph}</div>
              <div className="label-text" style={{
                color: 'var(--gold)', letterSpacing: '0.26em',
                marginBottom: 10,
              }}>{r.title}</div>
              <p className="font-editorial" style={{
                margin: 0, fontSize: 12.5, lineHeight: 1.5,
                color: 'rgba(240,238,233,0.7)', textWrap: 'pretty',
              }}>{r.body}</p>
            </div>
          ))}
        </div>
        {/* Summary line — partners → V → users → revenue */}
        <div style={{
          padding: '22px 32px',
          background: 'rgba(143,166,143,0.05)',
          borderLeft: '2px solid var(--sage)',
          borderRight: '2px solid var(--gold)',
        }}>
          <PullQuote align="center" size="clamp(28px, 3vw, 44px)" italic>
            <span style={{ color: 'var(--sage)' }}>Partners</span>
            <span style={{ color: 'var(--parchment-dim)', margin: '0 18px' }}>→</span>
            <span style={{ color: 'var(--parchment)' }}>V</span>
            <span style={{ color: 'var(--parchment-dim)', margin: '0 18px' }}>→</span>
            <span style={{ color: 'var(--gold)' }}>Users</span>
            <span style={{ color: 'var(--parchment-dim)', margin: '0 18px' }}>→</span>
            <span style={{ color: 'var(--gold)' }}>Revenue</span>
          </PullQuote>
        </div>
      </div>
    </div>
  );
}

// ─── Panel 5 · The Full Map ──────────────────────────────────────────────
// Recap. Every component the audience just walked through, now visible all at
// once. The V is center; partners feed in from left, users emerge to right,
// capabilities ride above V, revenue streams along the bottom. Subtle sage and
// gold flow lines connect.
function SolFullMapPanel({ vis }) {
  const eased = 1 - Math.pow(1 - vis, 3);
  return (
    <div style={{
      position: 'absolute', inset: 0,
      opacity: eased, transform: `translateY(${(1 - eased) * 24}px)`,
      transition: 'opacity 0.7s ease, transform 0.7s ease',
      pointerEvents: vis > 0.05 ? 'auto' : 'none',
      display: 'flex', alignItems: 'center', justifyContent: 'center',
      padding: '0 56px',
    }}>
      <div style={{ width: '100%', maxWidth: 1700 }}>
        {/* Header strip */}
        <div style={{ display: 'flex', alignItems: 'baseline', gap: 16, marginBottom: 14 }}>
          <span className="label-text" style={{ color: 'var(--sage)', letterSpacing: '0.36em' }}>The Platform · all together</span>
          <div style={{ flex: 1, height: 1, background: 'rgba(143,166,143,0.22)' }} />
          <span className="label-text" style={{ color: 'var(--gold)' }}>
            ◆ partners · capabilities · users · revenue
          </span>
        </div>
        <h3 className="font-display" style={{
          fontSize: 'clamp(36px, 4vw, 56px)',
          lineHeight: 0.98, letterSpacing: '-0.02em',
          color: 'var(--parchment)', margin: '0 0 22px', textTransform: 'uppercase',
        }}>
          One <span style={{ color: 'var(--gold)', fontStyle: 'italic' }}>system</span>.
        </h3>

        {/* The map — 3-column layout: partners | V+capabilities | users */}
        <div style={{
          display: 'grid', gridTemplateColumns: '1fr 1.5fr 1fr',
          gap: 20, alignItems: 'stretch',
          marginBottom: 18,
        }}>
          {/* PARTNERS — left rail */}
          <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
            <div className="label-text" style={{
              color: 'var(--sage)', letterSpacing: '0.32em', marginBottom: 4,
            }}>Partners · ingest →</div>
            {SOL_PARTNERS.map((p) => (
              <div key={p.kicker} style={{
                padding: '12px 16px',
                background: 'rgba(7,50,66,0.55)',
                border: '1px solid rgba(143,166,143,0.2)',
                borderLeft: '3px solid var(--sage)',
              }}>
                <div className="label-text" style={{ color: 'var(--taupe)', fontSize: 9 }}>{p.kicker}</div>
                <div className="font-display" style={{
                  fontSize: 14, color: 'var(--parchment)',
                  marginTop: 4, lineHeight: 1.1, textTransform: 'uppercase', letterSpacing: '-0.005em',
                }}>{p.title}</div>
              </div>
            ))}
          </div>

          {/* CENTER — V mark + capabilities ledger */}
          <div style={{
            display: 'flex', flexDirection: 'column', alignItems: 'center',
            position: 'relative',
            padding: '6px 12px',
          }}>
            {/* Capabilities — 2x3 grid above V */}
            <div style={{
              display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)',
              gap: '6px 14px',
              padding: '12px 16px',
              background: 'rgba(143,166,143,0.05)',
              border: '1px solid rgba(143,166,143,0.18)',
              borderLeft: '2px solid var(--sage)',
              borderRight: '2px solid var(--gold)',
              width: '100%',
              marginBottom: 14,
            }}>
              {SOL_CAPABILITIES.map((c) => (
                <div key={c.kicker} style={{ display: 'flex', alignItems: 'baseline', gap: 6 }}>
                  <span className="label-text" style={{ color: c.tint, fontSize: 9 }}>{c.kicker}</span>
                  <span className="font-editorial" style={{
                    fontSize: 11.5, color: 'var(--parchment)',
                    lineHeight: 1.25, letterSpacing: '0.005em',
                  }}>{c.title}</span>
                </div>
              ))}
            </div>

            {/* The V mark — smaller, with rings */}
            <div style={{
              position: 'relative',
              width: 200, height: 200,
              margin: '6px 0',
            }}>
              <div style={{
                position: 'absolute', inset: 0,
                borderRadius: '50%',
                border: '1px solid rgba(143,166,143,0.4)',
              }} />
              <div style={{
                position: 'absolute', inset: 22,
                borderRadius: '50%',
                border: '1px solid rgba(201,168,76,0.45)',
              }} />
              <div style={{
                position: 'absolute', inset: 0,
                display: 'flex', alignItems: 'center', justifyContent: 'center',
              }}>
                <span style={{
                  fontFamily: 'var(--font-display)',
                  fontSize: 130,
                  fontStyle: 'italic',
                  fontWeight: 700,
                  letterSpacing: '-0.06em',
                  lineHeight: 1,
                  background: 'linear-gradient(180deg, var(--gold) 0%, var(--sage) 100%)',
                  WebkitBackgroundClip: 'text',
                  WebkitTextFillColor: 'transparent',
                  backgroundClip: 'text',
                  textShadow: '0 0 24px rgba(201,168,76,0.25)',
                  paddingBottom: 12,
                }}>V</span>
              </div>
            </div>

            {/* INGEST/DELIVER labels straddling the V */}
            <div style={{
              position: 'absolute', left: -38, top: '52%', transform: 'translateY(-50%)',
            }}>
              <span className="label-text" style={{
                color: 'var(--sage)', letterSpacing: '0.36em', fontSize: 9,
                writingMode: 'vertical-rl', transform: 'rotate(180deg)',
              }}>INGEST →</span>
            </div>
            <div style={{
              position: 'absolute', right: -38, top: '52%', transform: 'translateY(-50%)',
            }}>
              <span className="label-text" style={{
                color: 'var(--gold)', letterSpacing: '0.36em', fontSize: 9,
                writingMode: 'vertical-rl',
              }}>→ DELIVER</span>
            </div>
          </div>

          {/* USERS — right rail */}
          <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
            <div className="label-text" style={{
              color: 'var(--gold)', letterSpacing: '0.32em', marginBottom: 4,
              textAlign: 'right',
            }}>← deliver · Users</div>
            {SOL_USERS.map((u) => (
              <div key={u.kicker} style={{
                padding: '10px 14px',
                background: 'rgba(7,50,66,0.55)',
                border: '1px solid rgba(201,168,76,0.2)',
                borderRight: '3px solid var(--gold)',
              }}>
                <div className="label-text" style={{ color: 'var(--taupe)', fontSize: 9 }}>{u.kicker}</div>
                <div className="font-display" style={{
                  fontSize: 13, color: 'var(--parchment)',
                  marginTop: 3, lineHeight: 1.1, textTransform: 'uppercase', letterSpacing: '-0.005em',
                }}>{u.title}</div>
              </div>
            ))}
          </div>
        </div>

        {/* REVENUE — bottom strip */}
        <div style={{
          display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)',
          gap: 12,
          padding: '14px 18px',
          background: 'rgba(201,168,76,0.05)',
          border: '1px solid rgba(201,168,76,0.22)',
          borderTop: '2px solid var(--gold)',
        }}>
          {SOL_REVENUE.map((r) => (
            <div key={r.title} style={{ textAlign: 'center' }}>
              <div style={{
                fontFamily: 'var(--font-display)', fontSize: 18,
                color: 'var(--gold)', opacity: 0.85, lineHeight: 1, marginBottom: 4,
              }}>{r.glyph}</div>
              <div className="label-text" style={{
                color: 'var(--gold)', letterSpacing: '0.22em', fontSize: 9,
              }}>{r.title}</div>
            </div>
          ))}
        </div>
        <div style={{
          marginTop: 8, textAlign: 'center',
        }}>
          <span className="label-text" style={{
            color: 'var(--sage)', letterSpacing: '0.36em',
          }}>Revenue · the loop closes</span>
        </div>
      </div>
    </div>
  );
}

// ─── Inner act ────────────────────────────────────────────────────────────
function ActSolutionInner({ act, index, total }) {
  // Full Map recap restored 2026-04-29 round 3 — Doug noticed the very last
  // section got lost when I cut it during the click-economy pass. The Map
  // is the "all together now" zoom-out that lands the entire system after
  // walking through each component. Worth one extra click.
  const p0 = useBeatProgress(0);
  const p1 = useBeatProgress(1);
  const p2 = useBeatProgress(2);
  const p3 = useBeatProgress(3);
  const p4 = useBeatProgress(4);
  const p5 = useBeatProgress(5);

  const visKeystone     = panelVis(p0, p1);
  const visCapabilities = panelVis(p1, p2);
  const visIngest       = panelVis(p2, p3);
  const visDeliver      = panelVis(p3, p4);
  const visClose        = panelVis(p4, p5);
  const visMap          = p5;  // last panel holds

  return (
    <ActFrame act={act} index={index} total={total} bg="var(--petrol)" bleed>
      <div style={{ position: 'absolute', inset: 0, zIndex: 4 }}>
        <SolKeystonePanel vis={visKeystone} />
        <SolCapabilitiesPanel vis={visCapabilities} />
        <SolIngestPanel vis={visIngest} />
        <SolDeliverPanel vis={visDeliver} />
        <SolClosePanel vis={visClose} />
        <SolFullMapPanel vis={visMap} />
      </div>
    </ActFrame>
  );
}

function ActSolution({ index, total, act }) {
  return (
    <ScrollBeats beats={6} bg="var(--petrol)">
      <ActSolutionInner act={act} index={index} total={total} />
    </ScrollBeats>
  );
}

window.ActSolution = ActSolution;
