---
/**
 * MMVC pinned narrative — five-panel sticky-scroll sequence.
 *
 * Roles: Model · AI · Module · Controller · View. The "AI" panel was added
 * as a first-class step between Model and Module — Nibiru ships an AI module
 * (chat / embed / RAG / agent plugins) that wraps raw weights into intent.
 *
 * CSS is a faithful port of design-system/source/index-v2.html §MMVC PINNED
 * NARRATIVE (lines 408-518). Markup mirrors the mockup, with one extra panel
 * + step. Track height scaled from 400vh (4 panels) to 500vh (5 panels).
 *
 * The scroll-spy + camera presets live in public/js/nibiru-scene.js — that
 * file's step math (Math.floor(progress * N) and clamp) was bumped from 4→5
 * in the same change.
 */
---
<section class="section mmvc-stage" id="mmvc" aria-labelledby="mmvc-h">
  <div class="container">
    <div class="section-head">
      <span class="eyebrow">The pattern · 01</span>
      <h2 id="mmvc-h" class="section-title">Five roles. <span class="accent">One orbit.</span></h2>
      <p class="section-sub">MMVC generalises classic MVC for AI workloads. The monolithic Model splits — first into weights, then into the AI patterns and typed capabilities that wrap them. Watch the system come into focus.</p>
    </div>
  </div>

  <div class="mmvc-track" id="mmvcTrack">
    <div class="mmvc-pin">
      <!-- Progress rail -->
      <div class="mmvc-progress" aria-hidden="true">
        <div class="step active" data-step="0"><span class="bar"></span><span>Model</span></div>
        <div class="step"        data-step="1"><span class="bar"></span><span>AI</span></div>
        <div class="step"        data-step="2"><span class="bar"></span><span>Module</span></div>
        <div class="step"        data-step="3"><span class="bar"></span><span>Controller</span></div>
        <div class="step"        data-step="4"><span class="bar"></span><span>View</span></div>
      </div>

      <div class="mmvc-copy">
        <div class="panel active" data-panel="0">
          <div class="step-num">01 / 05 — MODEL</div>
          <h3>The <span class="pop">star</span><br/>at the centre.</h3>
          <p>The <strong>Model</strong> is the underlying ML model. Weights, runtime, inference — wherever it lives, on a laptop or a cluster. From the Controller's view it is stateless and addressable: <code>Model::load('nibiru-base-7B')</code>.</p>
          <p>One Model, many Modules.</p>
        </div>
        <div class="panel" data-panel="1">
          <div class="step-num">02 / 05 — AI</div>
          <h3>The <span class="pop">spark</span><br/>that lights it up.</h3>
          <p>The <strong>AI</strong> module turns weights into intent. Chat, embeddings, retrieval, agents — the inference patterns Nibiru ships with, wrapped around any Model the runtime can reach.</p>
          <p>From <code>Model::load()</code> to <code>Ai::ask()</code> in one hop.</p>
        </div>
        <div class="panel" data-panel="2">
          <div class="step-num">03 / 05 — MODULE</div>
          <h3>Modules <span class="pop">orbit</span><br/>the Model.</h3>
          <p>A <strong>Module</strong> is a typed capability — a retriever, a planner, a tool, a vision encoder. It has typed inputs and outputs. Composable. Pure-function-shaped over the Model.</p>
          <p>This is the layer MVC never had. Capabilities live here, not in the Model.</p>
        </div>
        <div class="panel" data-panel="3">
          <div class="step-num">04 / 05 — CONTROLLER</div>
          <h3>The <span class="pop">gravity</span><br/>between them.</h3>
          <p>The <strong>Controller</strong> orchestrates. It decides which Modules run, in what order, and how their outputs flow. Holds policy, never weights — the same Controller drives a chat agent or a batch job.</p>
        </div>
        <div class="panel" data-panel="4">
          <div class="step-num">05 / 05 — VIEW</div>
          <h3>The <span class="pop">surface</span><br/>at the horizon.</h3>
          <p>The <strong>View</strong> is the user-facing layer — <code>ChatView</code>, <code>VoiceView</code>, <code>APIView</code>. Swap one for another and the Controller does not change. Same agent, different sky.</p>
        </div>
      </div>

      <div class="mmvc-visual" id="mmvcVisual">
        <canvas id="mmvc-canvas" aria-hidden="true"></canvas>
      </div>
    </div>
  </div>
</section>

<style is:global>
  /* ============== MMVC PINNED NARRATIVE — verbatim from index-v2.html
     §lines 408-518 (4-panel mockup), with .mmvc-track height scaled from
     400vh → 500vh for the 5th panel. ============== */
  .mmvc-stage {
    position: relative;
    padding: 0;
  }
  .mmvc-track {
    position: relative;
    height: 500vh; /* 5 panels worth of scroll (mockup was 400vh for 4) */
  }
  .mmvc-pin {
    position: sticky; top: 0;
    height: 100vh;
    display: block;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 50%, var(--nibiru-plum, #1c0f3a), var(--nibiru-space, #0a0414) 60%);
  }
  .mmvc-visual {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 0;
    opacity: 0.45;
  }
  #mmvc-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
  }
  .mmvc-copy {
    position: absolute; inset: 0;
    z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0 24px;
    text-align: center;
  }
  .mmvc-copy .panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, calc(-50% + 24px));
    display: flex; flex-direction: column; align-items: center;
    width: min(720px, calc(100vw - 48px));
    text-align: center;
    opacity: 0;
    transition: opacity 500ms ease, transform 500ms ease;
    pointer-events: none;
  }
  .mmvc-copy .panel.active {
    opacity: 1; transform: translate(-50%, -50%);
    pointer-events: auto;
  }
  .mmvc-copy .step-num {
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 12px; letter-spacing: 0.18em;
    color: var(--nibiru-nebula-mag, #b86bff);
    text-transform: uppercase;
    margin-bottom: 24px;
    display: inline-flex; align-items: center; gap: 12px;
    justify-content: center;
  }
  .mmvc-copy .step-num::before,
  .mmvc-copy .step-num::after {
    content: ''; width: 28px; height: 1px;
    background: var(--nibiru-nebula-mag, #b86bff);
    opacity: 0.6;
  }
  .mmvc-copy h3 {
    font-family: 'Space Grotesk', 'Inter Tight', ui-sans-serif, sans-serif;
    font-size: clamp(48px, 6vw, 88px);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.035em;
    margin: 0 0 24px;
    color: var(--nibiru-star, #f4eedb);
  }
  .mmvc-copy h3 em { font-style: normal; font-weight: 500; }
  .mmvc-copy h3 .pop {
    background: linear-gradient(110deg, #ffb574, #b86bff);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: normal; font-weight: 500;
  }
  .mmvc-copy p {
    font-size: 20px; line-height: 1.55;
    color: rgba(244, 238, 219, 0.85);
    max-width: 56ch;
    margin: 0 auto 16px;
    text-wrap: pretty;
  }
  .mmvc-copy code {
    background: rgba(244, 238, 219, 0.06);
    border: 1px solid var(--nibiru-line, rgba(244, 238, 219, 0.12));
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: var(--nibiru-iris-soft, #d4b4ff);
  }
  .mmvc-progress {
    position: absolute;
    left: 50%;
    top: 80px;
    transform: translateX(-50%);
    display: flex; gap: 8px; align-items: center;
    z-index: 4;
    flex-wrap: nowrap;
    justify-content: center;
    white-space: nowrap;
    padding: 0 16px;
  }
  .mmvc-progress .step {
    display: flex; align-items: center; gap: 8px;
    color: var(--nibiru-muted, #6e6680);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px; letter-spacing: 0.10em; text-transform: uppercase;
    transition: color 240ms ease;
    padding-right: 10px;
  }
  .mmvc-progress .step .bar {
    width: 24px; height: 2px;
    background: var(--nibiru-line, rgba(244, 238, 219, 0.12));
    transition: background 240ms ease, width 240ms ease;
    border-radius: 2px;
  }
  .mmvc-progress .step.active { color: var(--nibiru-star, #f4eedb); }
  .mmvc-progress .step.active .bar {
    background: var(--nibiru-nebula-mag, #b86bff);
    width: 40px;
  }

  @media (max-width: 720px) {
    .mmvc-progress { gap: 4px; font-size: 9px; padding: 0 8px; }
    .mmvc-progress .step { gap: 4px; padding-right: 4px; }
    .mmvc-progress .step .bar { width: 14px; }
    .mmvc-progress .step.active .bar { width: 24px; }
  }

  @media (max-width: 960px) {
    .mmvc-track { height: 460vh; }
    .mmvc-copy h3 { font-size: clamp(36px, 8vw, 56px); }
    .mmvc-copy p  { font-size: 16px; }
    .mmvc-progress { top: 32px; }
  }
</style>
