// All the long-form sections, written with the original prose intact.
const { useState: useStateC, useEffect: useEffectC } = React;

/* ============================================================
   LEAD / INTRO
   ============================================================ */
function Intro() {
  return (
    <>
      <p className="lead">
        You wrote a thing. Now you want it to move. This is how I got from a finished
        Substack post to a 30-second animated video, using AI tools, without losing
        the post's argument (or my mind). The walk-through uses a real essay of mine
        about teaching and learning centers as the running example. Swap in your own
        anywhere the example appears.
      </p>
      <p>The whole workflow takes a few hours the first time and around an hour once you have a rhythm.</p>
      <p style={{ color: 'var(--ink-soft)', fontSize: 16 }}>
        Use the sidebar to jump between scenes. Mark each one complete as you go &mdash; your progress is saved on this device.
        Stuck anywhere? There's an <strong>Ask</strong> box at the end of every scene, and a floating help button if you'd rather ask a free-form question.
      </p>
    </>
  );
}

/* ============================================================
   EDUCATOR'S PREFACE
   ============================================================ */
function EducatorPreface() {
  return (
    <aside id="educators" className="edu-preface">
      <div className="edu-preface-head">
        <span className="edu-preface-tag">For educators</span>
        <h2>Two ways to use this guide</h2>
        <p className="edu-preface-sub">
          This guide was written as a solo walk-through, but a lot of educators are reading it.
          Here is how to use it for each of the two reasons you might be.
        </p>
      </div>
      <div className="edu-preface-grid">
        <div className="edu-preface-card">
          <div className="edu-preface-card-num">I</div>
          <h3>You&rsquo;re making a video for your own teaching</h3>
          <p>
            Read the eight scenes in order. Substitute your own content for the example &mdash;
            a lecture explainer, a primary-source close reading, a lab walk-through, a case study.
            Pay particular attention to Scene 1 (your visual spine is not "the slide deck") and
            Scene 3 (the brief). The rest is procedural.
          </p>
          <div className="edu-preface-anchors">
            <a href="#step1">Start at Scene 1 &rarr;</a>
          </div>
        </div>
        <div className="edu-preface-card">
          <div className="edu-preface-card-num">II</div>
          <h3>You&rsquo;re teaching this workflow to students</h3>
          <p>
            Use the scenes as your lesson outline; each one has a learning objective in the header.
            The Educator&rsquo;s Toolkit at the bottom collects a 16-cell rubric, a suggested class
            structure, ready-to-paste AI-use policy language, an accessibility checklist for the
            final video, common student pitfalls, and discussion prompts for class.
          </p>
          <div className="edu-preface-anchors">
            <a href="#edu-toolkit">Jump to the Educator&rsquo;s Toolkit &rarr;</a>
          </div>
        </div>
      </div>
    </aside>
  );
}

/* ============================================================
   HARDWARE & ACCESS NOTES — used in NeedSection and EducatorToolkit
   ============================================================ */
const HARDWARE = [
  { name: 'Compute',
    body: 'Everything runs in a browser. A Chromebook, iPad with keyboard, five-year-old laptop, or computer-lab machine all work. CapCut\u2019s desktop app benefits from a real machine; the browser version is fine for short videos.' },
  { name: 'Internet',
    body: 'Upload-heavy. Each frame and clip is a megabyte or more to push and pull. Plan for 10\u00a0Mbps up minimum; under 5 will be frustrating. Worth flagging for students on tethered phones.' },
  { name: 'Microphone',
    body: 'The one place hardware matters. Voice cloning needs about a minute of clean audio. Built-in mics work; AirPods or a USB mic work better; a podcast mic works best. Record in a soft room.' },
  { name: 'Headphones',
    body: 'Essential for the CapCut step. Laptop speakers lie about levels. Anything wired beats laptop speakers.' },
  { name: 'Display',
    body: 'A second monitor helps in the consistency check and the timeline edit but is not required. A calibrated display matters more than a big one for accessibility.' },
  { name: 'Phone alternative',
    body: 'Runway, ElevenLabs, and CapCut all have mobile apps. A student with only a phone can do the whole workflow \u2014 slower for the brief, but possible.' },
  { name: 'What you don\u2019t need',
    body: 'No GPU, no creator-grade hardware, no Adobe subscription, no dedicated camera, no dedicated lighting.' },
];

function HardwareNotes({ heading = 'Hardware & access', bare = false }) {
  return (
    <div className={`hardware-block ${bare ? 'hardware-block-bare' : ''}`}>
      {!bare && (
        <div className="hardware-block-head">
          <span className="hardware-block-eyebrow">Before you buy anything</span>
          <h3>{heading}</h3>
        </div>
      )}
      <div className="hardware-grid">
        {HARDWARE.map((h, i) => (
          <div key={h.name} className="hardware-item">
            <div className="hardware-item-num">{String(i + 1).padStart(2, '0')}</div>
            <div className="hardware-item-body">
              <div className="hardware-item-name">{h.name}</div>
              <p>{h.body}</p>
            </div>
          </div>
        ))}
      </div>
    </div>
  );
}

/* ============================================================
   WHAT YOU WILL NEED
   ============================================================ */
function NeedSection() {
  return (
    <section id="need">
      <h2 className="section-h">What you will need</h2>
      <p>Three required tools, plus one optional one if you want help drafting the brief.</p>

      <div className="tools-grid">

        <div className="tool-card">
          <div className="tool-icon"><Icon d={Icons.film} size={22}/></div>
          <div className="tool-card-body">
            <div className="tool-card-head"><h3 className="tool-name">Runway</h3></div>
            <div className="tool-url"><a href="https://runwayml.com" target="_blank" rel="noopener">runwayml.com ↗</a></div>
            <p>
              For the storyboard and the animation. A monthly subscription is recommended;
              expect to spend a few hundred to a few thousand credits per video depending on
              length and number of regenerations. Runway Agent is the conversational interface
              that handles both storyboard and animation in one session.
            </p>
          </div>
        </div>

        <div className="tool-card">
          <div className="tool-icon"><Icon d={Icons.mic} size={22}/></div>
          <div className="tool-card-body">
            <div className="tool-card-head"><h3 className="tool-name">ElevenLabs</h3></div>
            <div className="tool-url"><a href="https://elevenlabs.io" target="_blank" rel="noopener">elevenlabs.io ↗</a></div>
            <p>
              For narration. The free tier lets you clone your own voice from about a minute
              of clean audio. The paid tier gives better fidelity and more characters per
              month. Yes, hearing yourself read your own writing back to you is a slightly
              surreal experience. Plan for that.
            </p>
          </div>
        </div>

        <div className="tool-card">
          <div className="tool-icon"><Icon d={Icons.scissors} size={22}/></div>
          <div className="tool-card-body">
            <div className="tool-card-head"><h3 className="tool-name">CapCut</h3></div>
            <div className="tool-url"><a href="https://capcut.com" target="_blank" rel="noopener">capcut.com ↗</a></div>
            <p>
              Or any video editor you already use. For stitching the individual clips
              together, layering in narration, and exporting. CapCut is free and works
              in a browser.
            </p>
          </div>
        </div>

        <div className="tool-card alt">
          <div className="tool-icon"><Icon d={Icons.film} size={22}/></div>
          <div className="tool-card-body">
            <div className="tool-card-head">
              <h3 className="tool-name">Invideo AI</h3>
              <span className="tag">Alternative</span>
            </div>
            <div className="tool-url"><a href="https://invideo.io/ai/" target="_blank" rel="noopener">invideo.io/ai ↗</a></div>
            <p>
              A browser-based alternative if Runway is unavailable, paywalled past your
              budget, or your institution restricts it. Invideo AI generates short videos
              from a text brief, supports voice-over, and can stitch the result in one tool
              &mdash; skipping the CapCut step. Less character/setting control than Runway,
              so the consistency rules in Scene&nbsp;3 matter even more.
            </p>
          </div>
        </div>

        <div className="tool-card optional">
          <div className="tool-icon"><Icon d={Icons.sparkle} size={22}/></div>
          <div className="tool-card-body">
            <div className="tool-card-head">
              <h3 className="tool-name">A general-purpose AI assistant</h3>
              <span className="tag">Optional</span>
            </div>
            <div className="tool-url">Gemini, ChatGPT, Claude, Copilot, or similar</div>
            <p>
              For help converting your blog post into the structured brief that Runway
              Agent can use. Especially useful for analytical or argumentative posts,
              where pulling the visual spine, casting the characters, and writing the
              beats can be hard to do from a blank page. Paste your post in, ask the
              assistant to draft a brief in the format shown in Step 3, then revise from there.
            </p>
          </div>
        </div>

      </div>

      <div className="annot">
        <span className="annot-marker">¶</span>
        <span>
          <strong>Working with a character who talks on camera, performs, or carries several connected
          scenes?</strong> The three tools above still cover this guide&rsquo;s workflow. For the specialists &mdash;
          Hedra, Runway Act-Two, Kling, Veo, LTX Studio, Magnific, Descript &mdash; see{' '}
          <a href="#characters">Animated characters</a> after Scene&nbsp;8.
        </span>
      </div>

      <p>
        You will also need the post you want to animate, and ideally one existing visual
        asset from the post (a header illustration or featured image) to use as a style
        reference.
      </p>

      <HardwareNotes heading="What you'll actually need (hardware)" />

      <div className="annot">
        <span className="annot-marker">¶</span>
        <span>
          A working palette helps too. Lock 4&ndash;6 colors before you brief the agent &mdash;
          the more you can hand the AI, the less it invents. The palette below is this guide's
          own. For yours, see the swatch tools in <a href="#resources">the toolkit at the bottom</a>.
        </span>
      </div>
      <PaletteSwatches />
    </section>
  );
}

/* ============================================================
   PRINCIPLES
   ============================================================ */
function PrinciplesSection() {
  return (
    <section id="principles">
      <h2 className="section-h">Two things to know before you start</h2>
      <p>
        Read these before you open a single tool. They will save you a small fortune
        in regenerations and approximately one minor existential crisis.
      </p>

      <div className="principles-grid">
        <div className="principle-card">
          <div className="principle-num">·  I  ·</div>
          <h3>Analytical writing has to be translated before AI can render it.</h3>
          <p>
            Story-driven content (a character does X, then Y, then Z) is easy for video AI
            to handle. Arguments are not. If you paste your essay into Runway Agent and ask
            it to make a storyboard, you will get generic stock-photo academia. The fix is
            to pick one <span className="highlight">visual through-line</span> that carries
            your argument and brief the agent on that, not on the essay itself.
          </p>
        </div>

        <div className="principle-card">
          <div className="principle-num">·  II  ·</div>
          <h3>AI drifts on characters and settings.</h3>
          <p>
            A face that looks one way in frame 1 will look different in frame 2 unless you
            anchor it explicitly. The same building will look like three different buildings
            across three beats. The fix is to write a <span className="highlight teal">detailed cast and locations block</span> at
            the top of your brief. The brief gets long. That length is the consistency mechanism.
          </p>
        </div>
      </div>

      <p>If you understand these two principles, the rest of the workflow is procedural.</p>
    </section>
  );
}

/* ============================================================
   STEP WRAPPER
   ============================================================ */
function StepBlock({ step, done, onToggle, children, context }) {
  return (
    <section id={step.id} className={`step ${done ? 'done' : ''}`}
             data-step={step.n}
             data-screen-label={`${String(step.n).padStart(2, '0')} ${step.label}`}>
      <StepHeader step={step} done={done} onToggleDone={onToggle} />
      <FilmFrame number={step.n} label={step.frame}>
        {children}
      </FilmFrame>
    </section>
  );
}

/* ============================================================
   STEP 1
   ============================================================ */
function Step1Body() {
  return (
    <>
      <p>
        Before anything else, before you open a tool or spend a credit: read your post
        like a director, not a writer. Ask yourself: if I had to pick one image or one
        location that carries the argument, what would it be?
      </p>
      <p>
        In the example post, I am arguing that informal hallway conversations between
        faculty members about teaching are valuable pedagogical work, but those
        conversations only happen if you have the right colleagues, the right
        institutional culture, and the time to spare. The visual spine is the hallway
        itself. Specifically, variations of who is and is not in that hallway across the beats.
      </p>
      <p>
        Some posts have an obvious spine. A piece arguing that AI in classrooms is
        reshaping student attention could anchor on the same classroom scene with
        different objects on the desks across decades. A piece about how grants get
        awarded could anchor on a single conference room with different combinations of
        people around the table. Pick the one location or object that recurs in your
        argument and use it as the backbone.
      </p>
      <p>
        If you cannot find a spine, your post may be too abstract for visual treatment.
        That is information too. Pick a different post.
      </p>
      <Checkup
        question="Your post argues that in-person book clubs build community in ways book apps can't. What's the visual spine?"
        answer={<>
          <p>The <strong>book club itself</strong> — the same living room or coffee table, the same loose circle of chairs — recurring across beats with different combinations of people present, different books on the table, different times of day.</p>
          <p>Notice the move: you pick one <em>recurring location</em>, then let the variation happen <em>within</em> it. That contained variation is the engine of your visual argument.</p>
        </>}
      />
    </>
  );
}

/* ============================================================
   STEP 2
   ============================================================ */
function Step2Body() {
  return (
    <>
      <p>Two questions to answer.</p>
      <p>
        <strong>Are you on screen or off screen?</strong> If you have an avatar of
        yourself, you can be the narrator and the storyboard becomes cutaways. If you do
        not (or do not want to be), the storyboard tells the whole story without you in
        it. For a first project, off-screen is easier. You avoid having to keep your
        avatar visually consistent on top of everything else.
      </p>
      <p>
        <strong>What is the aesthetic?</strong> Look at your existing publication. If
        your Substack uses soft illustrated headers, the video should feel like those
        headers in motion. If your blog uses photography, the video should lean
        photoreal. Whatever you choose, you will give the AI a sample image from your
        publication so the storyboard matches.
      </p>
      <p>In the example, the post uses warm peach-and-coral illustrated headers, so the storyboard inherits that aesthetic.</p>

      <div className="callout">
        <div className="callout-icon"><Icon d={Icons.brush} size={20}/></div>
        <div className="callout-body">
          <div className="callout-label">If you need to build a palette from scratch</div>
          <p>
            Don't have an established look yet? Pull one from a photo with <a href="https://color.adobe.com" target="_blank" rel="noopener">Adobe Color</a>,
            roll palettes on <a href="https://coolors.co" target="_blank" rel="noopener">Coolors</a>, or browse
            ready-made ones on <a href="https://colorhunt.co" target="_blank" rel="noopener">Color Hunt</a>.
            For illustrated work specifically, <a href="https://lospec.com/palette-list" target="_blank" rel="noopener">Lospec</a> has tight,
            painterly palettes that translate well to AI illustration. Pick 3 to 5 colors, save the hex codes, and feed them
            to the agent in your brief — "warm peach and coral palette, hex #D97757, #B84A2C, #F4E8DE."
          </p>
          <p>
            The full list of palette resources is in <a href="#resources">the toolkit at the bottom</a>.
          </p>
        </div>
      </div>

      <div className="annot">
        <span className="annot-marker">✻</span>
        <span>
          Save the reference image now. You'll upload it in Step 4 and want it findable, not buried in a downloads folder.
        </span>
      </div>
    </>
  );
}

/* ============================================================
   STEP 3 — with the long sample brief
   ============================================================ */
function Step3Body() {
  const sampleBrief = `An 8-beat illustrated narrative arguing that pedagogical coaching is real work, regardless of where it happens. Warm, soft, peach and coral palette, hand-drawn illustration style throughout, academic settings.

CAST. These characters must remain visually identical across every beat they appear in. Lock face structure, hair, skin tone, clothing, and body type.

JUNIOR FACULTY (appears in beats 1, 2, 3): mid-thirties Asian American man, short black hair, rectangular wire-rim glasses, wearing a rust-orange button-down shirt and dark trousers. Same exact person in all three beats.

SENIOR COLLEAGUE (appears in beat 1 only): late sixties white man, silver hair, beige cardigan over a white shirt, warm expression.

SECOND FACULTY MEMBER (appears in beat 4 only): forties Black woman, natural curly hair pulled back, teal blouse and dark slacks. Clearly NOT the same person as Junior Faculty.

INSTRUCTIONAL DESIGNER (appears in beats 4, 5, 6, 7): forties Black woman, mid-length locs, coral cardigan over a cream blouse, dark jeans, warm and direct expression. Same exact person in all four beats.

[Additional supporting cast members described the same way]

LOCATIONS. These settings must remain visually identical across the beats they appear in.

THE ACADEMIC BUILDING HALLWAY (appears in beats 1, 3, 4, 8): warm cream walls, polished wood floors, rows of wooden office doors with brass numbers, soft natural light from a window at the end.

[Other recurring locations described the same way]

BEATS.

Beat 1: Inside the Senior Colleague's office. Senior Colleague and Junior Faculty sit side-by-side at the wooden desk, both leaning over the open book, deep in conversation.

Beat 2: Junior Faculty (same exact person as beat 1, same glasses, same rust-orange shirt) stands at the front of a university classroom, gesturing toward a chalkboard.

[Beats continue, each referencing characters and locations by their cast/location names]

CONSISTENCY RULES (strict). Junior Faculty in beats 1, 2, 3 must be the same person, same face, same glasses, same shirt. Instructional Designer in beats 4, 5, 6, 7 must be the same person. The hallway architecture must match across beats 1, 3, 4, 8. No character drift across beats. No text or captions anywhere in any image. Full body or torso-with-hands visible in every beat to support later animation.`;

  const studentBrief = `A 6-beat illustrated video arguing that library study spaces help students learn better than dorm rooms. Soft, warm illustration style. Academic library setting.

CAST.

STUDENT (in beats 1, 2, 3, 6): early twenties Latina woman, shoulder-length dark wavy hair, glasses, gray hoodie over a white t-shirt, jeans. Same person every time.

LIBRARIAN (in beat 4 only): fifties Black woman, glasses on a chain, navy cardigan, friendly expression.

ROOMMATE (in beat 1 only): early twenties white man, messy blonde hair, gaming headset around his neck, hoodie.

LOCATIONS.

THE DORM ROOM (beat 1): cluttered, two beds, posters on the wall, blue light from a monitor.

THE LIBRARY (beats 2, 3, 4, 5, 6): tall windows, wooden tables, green-shaded reading lamps, books in the background.

BEATS.

Beat 1: Student tries to read at a desk in the dorm room. Roommate is gaming at his desk behind her. Student looks tired.

Beat 2: Student walking into the library, backpack on, sunlight coming through the windows.

Beat 3: Student sitting at a library table, laptop open, focused. Same person as beat 1, same hoodie.

Beat 4: Student talking to Librarian at the help desk. Librarian is handing her a book.

Beat 5: A wide shot of the library — many students at tables, quiet, working.

Beat 6: Student leaving the library at sunset, smiling, books under her arm.

CONSISTENCY RULES. Student must be the same person in beats 1, 2, 3, 6. No text in any image.`;
  return (
    <>
      <p>This is the longest step and the most important one. If you skim it, the rest of the guide cannot help you.</p>

      <div className="callout">
        <div className="callout-icon"><Icon d={Icons.bulb} size={20}/></div>
        <div className="callout-body">
          <div className="callout-label">A tip on drafting</div>
          <p>
            If pulling this structure out of your post feels overwhelming on a first read,
            this is exactly where the optional AI assistant earns its keep. Paste your
            post into Gemini, ChatGPT, Claude, or Copilot and ask it to draft a brief in
            the format below. Tell the assistant your aesthetic, your aspect ratio, and
            how many beats you want. Treat the output as a first draft you will edit, not
            a finished brief. The casting choices, the beat ordering, and the tone all
            need your hand on them. But starting from a draft beats starting from a blank page.
          </p>
        </div>
      </div>

      <p>A brief has four parts: an argument statement, a cast, locations, and beats. Plus a short consistency rules section at the end.</p>
      <p><strong>The argument statement</strong> is one or two sentences saying what the video argues. Not a summary of the post. The argument itself.</p>
      <p>
        <strong>The cast</strong> is a description of every recurring character. Each
        character gets a name (use a role name like "Junior Faculty" rather than a
        personal name), an age range, demographic details, and locked clothing and hair
        description. The locked details are what the AI will use to keep them
        consistent across beats.
      </p>
      <p><strong>The locations</strong> are descriptions of every setting that recurs. Same treatment as characters: lock the architecture, the wall color, the lighting.</p>
      <p>
        <strong>The beats</strong> are the individual frames of your storyboard. Six to
        ten beats is typical. Each beat references characters and locations by their
        cast/location names so the AI knows who and where.
      </p>
      <p>Here is the brief used in the example. You can adapt the structure for any post.</p>

      <PromptBlock label="Sample Brief · paste into Runway Agent" code={sampleBrief} />

      <p>The exact length will vary. The example brief above is around 700 words. That is normal for an 8-beat video with several recurring characters.</p>

      <div className="annot">
        <span className="annot-marker">¶</span>
        <span>
          <strong>For educators showing first drafts:</strong> the next block is what an
          acceptable <em>first attempt</em> looks like &mdash; the kind a student turns in at the end of
          a 30-minute in-class writing session. Notice what works (the cast is locked, the beats
          reference characters by name) and what still needs another pass (locations are thin, the
          consistency rules section is one sentence). Both versions earn proficient on the rubric;
          only the longer one earns exemplary.
        </span>
      </div>

      <PromptBlock label="Example student first attempt · acceptable but improvable" code={studentBrief} />

      <CharacterSheet />

      <Checkup
        question="Why use role names (like 'Junior Faculty') instead of personal names (like 'Marcus')?"
        answer={<>
          <p>Two reasons. <strong>One:</strong> the AI doesn't know who "Marcus" is, but it knows what "Junior Faculty" suggests — age range, dress code, posture. Role names carry visual information; personal names don't.</p>
          <p><strong>Two:</strong> when you reference the character in a later beat — "Junior Faculty (same exact person as beat 1)" — the role name acts as a re-anchor. The AI is being told to look back at the locked description, not invent a new face from a name.</p>
        </>}
      />
    </>
  );
}

/* ============================================================
   STEP 4
   ============================================================ */
function Step4Body() {
  return (
    <>
      <p>
        Sign in at <a href="https://runwayml.com" target="_blank" rel="noopener">runwayml.com</a>.
        From the dashboard, open Runway Agent (the conversational interface that
        replaced the older Chat Mode). Start a new session.
      </p>
      <p>Runway Agent will ask you for four things up front.</p>
      <p><strong>A description.</strong> Paste your full brief here.</p>
      <p>
        <strong>Reference images.</strong> Upload one or two visuals from your
        publication (a header illustration, a featured image) to anchor the aesthetic.
        Tell the agent: "Use this image as the visual style reference for all beats."
      </p>
      <ChPolishCallout />
      <p>
        <strong>Aspect ratio.</strong> Choose 9:16 if you are publishing to Reels,
        TikTok, or YouTube Shorts. Choose 16:9 if you are embedding the video on a
        webpage or showing it at a festival.
      </p>
      <p>
        <strong>Duration.</strong> Multiply your number of beats by 3 to 4 seconds. For
        8 beats, 30 seconds is a good target.
      </p>
      <p><strong>Audio.</strong> Choose silent or no audio. You will add narration externally.</p>
      <p>Submit. The agent will propose a concept and produce the first round of storyboard frames.</p>
    </>
  );
}

/* ============================================================
   STEP 5
   ============================================================ */
function Step5Body() {
  return (
    <>
      <p>The agent will usually generate multiple variations. Look at each one and check three things.</p>
      <p>
        <strong>Do the recurring characters look like the same person across the beats
        where they recur?</strong> Compare the Junior Faculty in beat 1 to the Junior
        Faculty in beat 2 and beat 3. If the face, hair, or clothing has changed, you
        have drift.
      </p>
      <p>
        <strong>Do the recurring locations look like the same place?</strong> Compare
        the hallway in beat 1 to the hallway in beat 3 and beat 4. If the wall color,
        door style, or floor is different, you have drift.
      </p>
      <p>
        <strong>Did the aesthetic hold?</strong> The palette, the line quality, the
        lighting should be consistent across all beats.
      </p>
      <p>
        If you have drift, tell the agent specifically what to fix. Plain language works.
        "In beat 3, the Junior Faculty member should be the exact same person as in beat 1.
        Same face, same glasses, same rust-orange shirt." The agent will regenerate.
      </p>
      <p>
        If the agent cannot hold a character through description alone, take the best
        version of that character and upload it back as a reference. Tell the agent: "Use
        this image as the character reference for the Junior Faculty member in beats 2 and 3."
      </p>

      <div className="callout coral">
        <div className="callout-icon"><Icon d={Icons.warn} size={20}/></div>
        <div className="callout-body">
          <div className="callout-label">A hard rule</div>
          <p>Approve the storyboard only when the consistency holds. Animation makes drift worse, not better.</p>
        </div>
      </div>
    </>
  );
}

/* ============================================================
   STEP 6
   ============================================================ */
function Step6Body() {
  const animPrompt = `Proceed with animation of the approved 8-beat storyboard. Maintain the exact character and setting consistency from the approved stills. No character drift during motion.

Motion direction per beat:

Beat 1: Subtle character motion. Senior Colleague turns a page; Junior Faculty leans in slightly. Camera holds soft and steady.

Beat 2: Slow camera push-in toward Junior Faculty at the chalkboard. Minimal character motion.

Beat 3: Slow camera pan across the closed doors of the hallway, ending on Junior Faculty standing alone.

[Continue for each beat]

Total duration 30 seconds, roughly 3 to 4 seconds per beat. Aspect ratio 9:16. No audio.`;
  return (
    <>
      <p>
        Once the stills are approved, ask the agent to animate. Be specific about
        per-beat motion. Some beats should have subtle character motion (a page turning,
        a door opening, a lean toward a book). Some should have only slow camera
        movement (push-in, pan, pull-back).
      </p>
      <TestClipCheck />
      <p>A sample animation prompt:</p>
      <PromptBlock label="Sample Animation Prompt" code={animPrompt} />
      <p>Runway Agent generates one video clip per beat, not a single stitched video. You will assemble them externally in Step 8.</p>
      <ChAnimatorCallout />
    </>
  );
}

/* ============================================================
   STEP 7
   ============================================================ */
function Step7Body() {
  return (
    <>
      <p>
        Pick two or three short lines from your post that carry the argument. Not
        summary lines. Pivot lines, landing lines, the sentences that earn their place.
      </p>
      <p>
        In the example, three lines do the work for a 30-second video: a wry observation
        that reframes the opponent's argument, a middle line that grounds the work in
        lived experience, and a declarative thesis statement at the close.
      </p>
      <p>
        Open ElevenLabs and either pick a stock voice or clone your own. To clone, record
        one minute of clean audio (read a paragraph from your post into your phone in a
        quiet room), upload it to Voice Lab, and follow the prompts. The clone takes a few
        minutes to process.
      </p>
      <p>Once your voice is ready, generate audio for each narration line separately. Save the audio files.</p>

      <div className="callout">
        <div className="callout-icon"><Icon d={Icons.voice} size={20}/></div>
        <div className="callout-body">
          <div className="callout-label">Direction tip</div>
          <p>
            Different lines often need different delivery. A wry observation should be
            delivered dry and matter-of-fact. A thesis statement should be delivered with
            conviction. If your clone delivers both the same way, retype the lines with
            different punctuation. A period instead of a comma forces a longer pause and changes the read.
          </p>
        </div>
      </div>

      <div className="callout coral">
        <div className="callout-icon"><Icon d={Icons.bulb} size={20}/></div>
        <div className="callout-body">
          <div className="callout-label">Want to sharpen the words themselves?</div>
          <p>
            Writing for the ear is a different craft from writing for the page. For pacing,
            landings, and how to read your own lines aloud without sounding wooden, the gold
            standard is <a href="https://transom.org" target="_blank" rel="noopener">Transom.org</a>;
            <a href="https://training.npr.org" target="_blank" rel="noopener"> NPR Training</a> has
            shorter practical guides. <a href="https://www.youtube.com/watch?v=loxJ3FtCJJA" target="_blank" rel="noopener">Ira Glass's
            four-part storytelling video</a> is 5 minutes and reframes how you'll think about beats.
          </p>
          <p>
            If you're rewriting the whole essay into a script (not just pulling lines),
            <a href="https://johnaugust.com" target="_blank" rel="noopener"> John August's blog</a> and the
            <a href="https://www.aerogrammestudio.com/2013/03/07/pixars-22-rules-of-storytelling/" target="_blank" rel="noopener"> Pixar 22 Rules</a> are
            short, dense, and worth every minute. Full lists for both narration writing and script structure are in
            <a href="#resources"> the toolkit at the bottom</a>.
          </p>
        </div>
      </div>

      <ChTalkingCallout />
    </>
  );
}

/* ============================================================
   STEP 8
   ============================================================ */
function Step8Body() {
  return (
    <>
      <p>Open a new CapCut project. Set the canvas size to match your aspect ratio (9:16 for vertical).</p>
      <p>Drop all your Runway clips onto the timeline in beat order. They should play back-to-back as a single 30-second sequence.</p>
      <ChKeepersCallout />
      <p>
        Drop your narration audio onto a separate track. Drag each line into position so
        it lands over the relevant beats. Leave silent beats where the visuals carry the
        story alone. Do not fill every second with voice.
      </p>
      <p>Adjust the volume so the narration sits cleanly above any ambient sound the video clips include.</p>
      <p>Export. For Reels, TikTok, and YouTube Shorts, export at 1080&times;1920 (9:16). For everything else, export at the resolution your destination requires.</p>

      <div className="worked-example">
        <div className="worked-example-label">
          <Icon d={Icons.play} size={12}/> The worked example
        </div>
        <h3 className="worked-example-title">The finished video this guide describes</h3>
        <p className="worked-example-blurb">
          Here is the 30-second video built from the running example essay, following
          every step above. Watch it once before you start &mdash; not as a template to match,
          but as proof that the workflow ends somewhere real.
        </p>
        <div className="video-frame">
          <iframe
            src="https://www.youtube.com/embed/xsQeMryKvTc"
            title="Pedagogical content knowledge is real &mdash; animated essay"
            allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
            allowFullScreen
            loading="lazy"
          ></iframe>
        </div>
        <p className="worked-example-caption">
          <a href="https://youtu.be/xsQeMryKvTc" target="_blank" rel="noopener">
            Watch on YouTube <Icon d={Icons.external} size={12} />
          </a>
        </p>
      </div>
    </>
  );
}

/* ============================================================
   WATCH-OUT SECTION
   ============================================================ */
function WatchSection() {
  return (
    <section id="watch">
      <h2 className="section-h">Where it tends to go sideways</h2>
      <p>The five failure modes you will hit most often, and the fixes.</p>
      <div className="watch-list">
        <div className="watch-item">
          <div className="watch-icon"><Icon d={Icons.face} size={20}/></div>
          <div className="watch-body">
            <div className="watch-name">Drift on faces</div>
            <p>The Junior Faculty in beat 2 has different glasses than in beat 1. Fix: regenerate with the exact same character description, or use the beat 1 image as a reference for the regeneration.</p>
          </div>
        </div>
        <div className="watch-item">
          <div className="watch-icon"><Icon d={Icons.building} size={20}/></div>
          <div className="watch-body">
            <div className="watch-name">Drift on settings</div>
            <p>The hallway in beat 4 has a bookshelf that was not in beat 1. Fix: re-describe the hallway with the same locked details (wall color, floor, doors) and ask the agent to match.</p>
          </div>
        </div>
        <div className="watch-item">
          <div className="watch-icon"><Icon d={Icons.text} size={20}/></div>
          <div className="watch-body">
            <div className="watch-name">Text leakage</div>
            <p>The brief said no text, but some image generators sneak text onto signs, books, or screens anyway. Decide whether the leak matters. At animation speed, small chart labels or book titles are rarely readable. If the text is large or prominent, use a surgical fix: "In beat X, remove the text from the [object]. Show the [object] without any labels. Leave everything else in the image the same."</p>
          </div>
        </div>
        <div className="watch-item">
          <div className="watch-icon"><Icon d={Icons.motion} size={20}/></div>
          <div className="watch-body">
            <div className="watch-name">Animations that look stiff</div>
            <p>AI motion is improving fast but still skews subtle. Lean into that. Slow camera moves, small character gestures, and soft pacing read better than ambitious action.</p>
          </div>
        </div>
        <div className="watch-item">
          <div className="watch-icon"><Icon d={Icons.voice} size={20}/></div>
          <div className="watch-body">
            <div className="watch-name">Lip-sync that slips</div>
            <p>Only matters if a character talks on camera. Lip-sync works best when the face is clearly visible in a close or medium shot. It gets less reliable when the character turns rapidly into profile; hair, hands, or objects cross the mouth; more than one person is in frame; movements are abrupt or exaggerated; the reference and the driving performance start in different poses; the character is too small in frame; the audio is noisy or uneven; the clip is too long; clothing has complicated patterns; or the model has too little visual information about the character. Fix: test a three- to five-second clip before generating the full scene.</p>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ============================================================
   RESOURCES SECTION — every link in one place
   ============================================================ */
const RESOURCES = {
  'Required tools': [
    { name: 'Runway',     url: 'https://runwayml.com',  blurb: 'Storyboard + animation', icon: Icons.film,    accent: 'teal' },
    { name: 'ElevenLabs', url: 'https://elevenlabs.io', blurb: 'Voice cloning + narration', icon: Icons.mic,  accent: 'teal' },
    { name: 'CapCut',     url: 'https://capcut.com',    blurb: 'Free in-browser video editor', icon: Icons.scissors, accent: 'teal' },
    { name: 'Invideo AI', url: 'https://invideo.io/ai/', blurb: 'Browser alternative to Runway', icon: Icons.film, accent: 'teal' },
  ],
  'Animated-character tools': [
    { name: 'Hedra',              url: 'https://www.hedra.com',              blurb: 'Talking characters driven by audio', icon: Icons.face, accent: 'teal' },
    { name: 'ElevenLabs Avatars', url: 'https://elevenlabs.io/avatars',      blurb: 'Voice + reusable character + lip-sync', icon: Icons.mic, accent: 'teal' },
    { name: 'Descript',           url: 'https://www.descript.com',           blurb: 'Transcript editing, captions, AI avatars', icon: Icons.text, accent: 'teal' },
    { name: 'Runway Act-Two',     url: 'https://runwayml.com',               blurb: 'Transfer your performance (Standard plan+)', icon: Icons.motion, accent: 'teal' },
    { name: 'Kling AI',           url: 'https://kling.ai',                   blurb: 'Individual cinematic shots', icon: Icons.film, accent: 'teal' },
    { name: 'Google Veo',         url: 'https://deepmind.google/models/veo/', blurb: 'Individual cinematic shots', icon: Icons.film, accent: 'teal' },
    { name: 'LTX Studio',         url: 'https://ltx.io/studio',              blurb: 'Storyboard to connected scenes', icon: Icons.film, accent: 'teal' },
    { name: 'Magnific',           url: 'https://www.magnific.com',           blurb: 'Upscale references and final clips', icon: Icons.sparkle, accent: 'teal' },
  ],
  'Character reference images': [
    { name: 'Gemini (Nano Banana 2)', url: 'https://gemini.google.com', blurb: 'Multi-reference character images', icon: Icons.brush, accent: 'coral' },
    { name: 'ChatGPT Images',         url: 'https://chatgpt.com',       blurb: 'Create and revise a character sheet', icon: Icons.brush, accent: 'coral' },
    { name: 'Midjourney',             url: 'https://www.midjourney.com', blurb: 'Create and revise a character sheet', icon: Icons.brush, accent: 'coral' },
    { name: 'Animated characters field guide', url: 'https://akesha.github.io/aichar/', blurb: 'The companion guide this section adapts', icon: Icons.external, accent: 'coral' },
  ],
  'AI writing assistants (any one will do)': [
    { name: 'Claude',   url: 'https://claude.ai',         blurb: 'Drafts the brief from your post', icon: Icons.sparkle, accent: 'coral' },
    { name: 'ChatGPT',  url: 'https://chat.openai.com',   blurb: 'Drafts the brief from your post', icon: Icons.sparkle, accent: 'coral' },
    { name: 'Gemini',   url: 'https://gemini.google.com', blurb: 'Drafts the brief from your post', icon: Icons.sparkle, accent: 'coral' },
    { name: 'Copilot',  url: 'https://copilot.microsoft.com', blurb: 'Drafts the brief from your post', icon: Icons.sparkle, accent: 'coral' },
  ],
  'Finding a color palette': [
    { name: 'Adobe Color',  url: 'https://color.adobe.com',     blurb: 'Extract palettes from any photo', icon: Icons.brush, accent: 'coral' },
    { name: 'Coolors',      url: 'https://coolors.co',          blurb: 'Generate & lock palettes fast',   icon: Icons.brush, accent: 'coral' },
    { name: 'Khroma',       url: 'https://khroma.co',           blurb: 'AI palette tuned to your taste',  icon: Icons.brush, accent: 'coral' },
    { name: 'Color Hunt',   url: 'https://colorhunt.co',        blurb: 'Browse curated 4-color palettes', icon: Icons.brush, accent: 'coral' },
    { name: 'Happy Hues',   url: 'https://www.happyhues.co',    blurb: 'Palettes shown in real UI context', icon: Icons.brush, accent: 'coral' },
    { name: 'Pigment',      url: 'https://pigment.shapefactory.co', blurb: 'Paint-chip style browser',    icon: Icons.brush, accent: 'coral' },
    { name: 'Lospec',       url: 'https://lospec.com/palette-list', blurb: 'Tight illustration palettes', icon: Icons.brush, accent: 'coral' },
    { name: 'Paletton',     url: 'https://paletton.com',        blurb: 'Classic color-wheel theory tool', icon: Icons.brush, accent: 'coral' },
  ],
  'Writing for narration & voice-over': [
    { name: 'Transom.org',           url: 'https://transom.org',                       blurb: 'Audio storytelling craft, deep archive', icon: Icons.mic, accent: 'coral' },
    { name: 'NPR Training',          url: 'https://training.npr.org',                  blurb: 'Free, practical audio writing guides',   icon: Icons.mic, accent: 'coral' },
    { name: 'Ira Glass on Storytelling', url: 'https://www.youtube.com/watch?v=loxJ3FtCJJA', blurb: 'The four-part fundamentals video', icon: Icons.mic, accent: 'coral' },
    { name: 'This American Life: Make Radio', url: 'https://www.thisamericanlife.org/make-radio', blurb: 'How TAL writes for the ear',  icon: Icons.mic, accent: 'coral' },
    { name: 'The Moth: Storytelling Tips',    url: 'https://themoth.org/share-your-story/storytelling-tips-tricks', blurb: 'Pacing & landings for personal narrative', icon: Icons.mic, accent: 'coral' },
    { name: 'Nieman Storyboard',     url: 'https://niemanstoryboard.org',              blurb: 'Narrative writing analysis & craft',     icon: Icons.mic, accent: 'coral' },
    { name: 'Hemingway Editor',      url: 'https://hemingwayapp.com',                  blurb: 'Flag sentences that won\u2019t read aloud',     icon: Icons.mic, accent: 'coral' },
    { name: 'Voices.com VO Guide',   url: 'https://www.voices.com/blog/how-to-write-a-voice-over-script/', blurb: 'Pro voice-over scriptwriting basics', icon: Icons.mic, accent: 'coral' },
  ],
  'Script writing & story structure': [
    { name: 'John August',           url: 'https://johnaugust.com',                    blurb: 'Working screenwriter\u2019s craft blog', icon: Icons.text, accent: 'teal' },
    { name: 'Scriptnotes (podcast)', url: 'https://johnaugust.com/scriptnotes',        blurb: 'August & Mazin on writing craft',         icon: Icons.text, accent: 'teal' },
    { name: 'Pixar\u2019s 22 Story Rules', url: 'https://www.aerogrammestudio.com/2013/03/07/pixars-22-rules-of-storytelling/', blurb: 'Emma Coats\u2019 compiled list',     icon: Icons.text, accent: 'teal' },
    { name: 'Save the Cat Beat Sheet', url: 'https://savethecat.com/beat-sheet',       blurb: 'Beat-by-beat story structure',            icon: Icons.text, accent: 'teal' },
    { name: 'BBC Writers Room',      url: 'https://www.bbc.co.uk/writers',             blurb: 'Free scripts + craft articles',           icon: Icons.text, accent: 'teal' },
    { name: 'The Black List Blog',   url: 'https://blcklst.com/blog',                  blurb: 'Industry-grade scriptwriting advice',     icon: Icons.text, accent: 'teal' },
    { name: 'WGA Foundation Craft',  url: 'https://www.wgfoundation.org/programs',     blurb: 'Free talks from working writers',         icon: Icons.text, accent: 'teal' },
    { name: 'Celtx (free)',          url: 'https://www.celtx.com',                     blurb: 'Browser-based scriptwriting editor',      icon: Icons.text, accent: 'teal' },
  ],
  'Where to publish': [
    { name: 'YouTube Shorts', url: 'https://youtube.com/upload', blurb: 'Vertical, 9:16, up to 60s', icon: Icons.play, accent: 'teal' },
    { name: 'Instagram Reels', url: 'https://instagram.com', blurb: 'Vertical, 9:16, up to 90s', icon: Icons.play, accent: 'teal' },
    { name: 'TikTok',          url: 'https://tiktok.com',    blurb: 'Vertical, 9:16, up to 10 min', icon: Icons.play, accent: 'teal' },
    { name: 'Substack Notes',  url: 'https://substack.com',  blurb: 'Embed alongside your post', icon: Icons.play, accent: 'teal' },
  ],
};

function ResourcesSection() {
  return (
    <section id="resources" className="resources">
      <div className="resources-head">
        <div className="sub">Toolkit</div>
        <h2>All resources, in one place</h2>
      </div>
      {Object.entries(RESOURCES).map(([heading, items]) => (
        <div key={heading} className="res-section">
          <div className="res-section-label"><span className="dot"></span>{heading}</div>
          <div className="res-grid">
            {items.map(item => (
              <a key={item.name} className={`res-link ${item.accent || ''}`} href={item.url} target="_blank" rel="noopener">
                <div className="res-link-icon"><Icon d={item.icon} size={18}/></div>
                <div className="res-link-text">
                  <div className="res-link-name">{item.name}</div>
                  <div className="res-link-url">{item.blurb} · {item.url.replace(/^https?:\/\//, '')}</div>
                </div>
                <div className="res-link-arrow"><Icon d={Icons.external} size={14}/></div>
              </a>
            ))}
          </div>
        </div>
      ))}
    </section>
  );
}

/* ============================================================
   REFERENCES — citations, editorial style
   ============================================================ */
const REFERENCES = [
  {
    heading: 'The framework — Kim Offord\u2019s AI Film Intensive materials',
    items: [
      { author: 'Offord, K.', year: '2025', title: 'Welcome to the Intensive!', kind: 'Workshop workbook', pub: 'The Referral Store LLC', url: 'https://playgroundpastime.ai' },
      { author: 'Offord, K.', year: '2025', title: 'AI Film Resources: AI Image & Film Descriptors', kind: 'Reference deck', pub: 'The Referral Store LLC' },
      { author: 'Offord, K.', year: '2025', title: '2025 MidJourney Cheat Sheet (v6.1)', pub: 'The Referral Store LLC' },
      { author: 'Offord, K.', year: '2024–2025', title: 'MidJourney Mastery Resource Guide: AI-Powered Image Creation', pub: 'The Referral Store LLC' },
      { author: 'Offord, K.', year: '2026, May 16', title: '2-Day AI Film Intensive: Day 1', kind: 'Live workshop, recorded', pub: 'Playground Pastime' },
      { author: 'Offord, K.', year: 'n.d.', title: 'AI Film Studio Coach', kind: 'Custom GPT', pub: 'ChatGPT' },
    ],
  },
  {
    heading: 'Runway documentation — Steps 4 and 6',
    items: [
      { author: 'Runway', year: '2025', title: 'Creating with Runway Agent', kind: 'Runway Help Center', url: 'https://help.runwayml.com/hc/en-us/articles/51601639579667-Creating-with-Runway-Agent' },
      { author: 'Runway', year: '2025', title: 'Introducing Runway Agent', kind: 'Runway News', url: 'https://runwayml.com/news/introducing-runway-agent' },
      { author: 'Runway', year: '2025', title: 'Navigating Runway', kind: 'Runway Help Center', url: 'https://help.runwayml.com/hc/en-us/articles/24298206897043-Navigating-Runway' },
      { author: 'Runway Academy', year: '2025', title: 'How to Use the Storyboard Featured Workflow', url: 'https://academy.runwayml.com/tutorial/storyboard-featured-workflow' },
    ],
  },
  {
    heading: 'Other tools cited',
    items: [
      { author: 'ElevenLabs', year: 'n.d.', title: 'Voice Lab', url: 'https://elevenlabs.io' },
      { author: 'CapCut', year: 'n.d.', title: 'CapCut', url: 'https://capcut.com' },
    ],
    note: 'Gemini, ChatGPT, Claude, and Copilot are mentioned generically in the optional-tool section and do not require formal citation in an instructional guide.',
  },
  {
    heading: 'Animated characters — companion material',
    items: [
      { author: 'Horton, A.', year: '2026, September', title: 'How do you create an animated character? A character-to-video field guide', kind: 'Interactive guide', url: 'https://akesha.github.io/aichar/' },
    ],
    note: 'The character-reference sheet, test-clip checklist, tool comparisons, workflow recommender, and pipeline are adapted from this guide. Prices and plan details were current as of September 2026; check each product’s pricing page before subscribing.',
  },
  {
    heading: 'The worked example',
    items: [
      { author: 'Horton, A.', year: '2026, April', title: 'Pedagogical content knowledge is real', kind: '4 Degrees & Feelings: AI + Tea' },
    ],
    note: 'The author\u2019s own post — listed so readers can find it, and to be clear that this guide uses it as a running case study.',
  },
];

function ReferencesSection() {
  return (
    <section id="references" className="references">
      <div className="references-head">
        <div className="sub">Citations</div>
        <h2>References &amp; further reading</h2>
        <p className="references-intro">
          The framework in this guide is adapted from <a href="https://playgroundpastime.ai" target="_blank" rel="noopener">Kim Offord&rsquo;s AI Film Intensive</a>;
          Steps 4 and 6 lean on Runway's own documentation; the animated-character material is adapted
          from <a href="https://akesha.github.io/aichar/" target="_blank" rel="noopener">the companion field guide</a>. Full sources below.
        </p>
      </div>
      {REFERENCES.map((group, gi) => (
        <div key={gi} className="ref-group">
          <div className="ref-group-label">{group.heading}</div>
          <ol className="ref-list">
            {group.items.map((r, ri) => (
              <li key={ri} className="ref-item">
                <span className="ref-author">{r.author}</span>
                <span className="ref-year"> ({r.year}). </span>
                <span className="ref-title">{r.title}</span>
                {r.kind && <span className="ref-kind"> [{r.kind}]</span>}
                {r.pub && <span className="ref-pub">. {r.pub}</span>}
                {r.url && (<>. <a className="ref-url" href={r.url} target="_blank" rel="noopener">{r.url.replace(/^https?:\/\//, '')}</a></>)}
                {!r.url && '.'}
              </li>
            ))}
          </ol>
          {group.note && <p className="ref-note">{group.note}</p>}
        </div>
      ))}
    </section>
  );
}

/* ============================================================
   EDUCATOR'S TOOLKIT
   ============================================================ */
const RUBRIC_CRITERIA = [
  {
    name: 'Argument fidelity',
    blurb: 'Does the video make the same argument the post makes, or summarize it?',
    levels: {
      Exemplary:  'The video makes the same argument, in the same voice, with a clear pivot and landing. The visual spine carries the argument; narration lands it.',
      Proficient: 'The argument is intact. Some moments lean on summary, some on illustration. The landing is clear.',
      Developing: 'The argument is present but partially summarized. The visual spine wavers in places.',
      Beginning:  'The video summarizes the post rather than arguing it. The visual spine is unclear.',
    },
  },
  {
    name: 'Visual consistency',
    blurb: 'Do recurring characters and settings hold across the beats?',
    levels: {
      Exemplary:  'Recurring characters and settings are visually identical across every beat they appear in.',
      Proficient: 'Recurring characters are recognizable across beats. Minor drift in one or two frames.',
      Developing: 'Noticeable drift in character or setting that distracts from the argument.',
      Beginning:  'Characters and settings change significantly across beats; the viewer cannot track a recurring person.',
    },
  },
  {
    name: 'Voice & pacing',
    blurb: 'Does narration carry the argument without filling every second?',
    levels: {
      Exemplary:  'Two or three narration lines, placed where visuals can\u2019t carry meaning alone. Delivery matches each line\u2019s tone.',
      Proficient: 'Narration is sparing and audible. Delivery is consistent.',
      Developing: 'Narration fills too many seconds; some lines summarize rather than land.',
      Beginning:  'Narration is wall-to-wall or unintelligible. Voice clone over- or under-delivers.',
    },
  },
  {
    name: 'Technical execution',
    blurb: 'Is the export correct for its destination and clean to watch?',
    levels: {
      Exemplary:  'Correct aspect ratio and full target resolution. Clean audio mix. No visible artifacting.',
      Proficient: 'Correct aspect ratio. Minor audio issues. Some AI artifacting but not distracting.',
      Developing: 'Wrong aspect ratio, significant audio problems, or major artifacting.',
      Beginning:  'Export issues prevent the video from playing as intended on its target platform.',
    },
  },
];

const DISCUSSION_PROMPTS = [
  { scene: 1, prompt: 'Pair off. Each of you describe your visual spine in one sentence. Can the other person predict the post\u2019s argument from just that sentence?' },
  { scene: 2, prompt: 'Find a piece of writing online that has a strong visual identity. What three things would the AI need to know to match it?' },
  { scene: 3, prompt: 'Swap briefs with a partner. Read theirs back to them out loud. Where does it feel essay-like instead of script-like?' },
  { scene: 4, prompt: 'Why does Runway Agent need a reference image even if the brief is detailed? What does the image carry that the words can\u2019t?' },
  { scene: 5, prompt: 'Look at a partner\u2019s storyboard. Find one instance of drift they didn\u2019t notice. How would you describe the fix to the agent?' },
  { scene: 6, prompt: 'When is "slow camera push" the right choice and when is it the lazy choice? Watch two animated explainers and grade their motion vocabulary.' },
  { scene: 7, prompt: 'Read one of your candidate narration lines two different ways: dry and matter-of-fact, then with conviction. Which one lands?' },
  { scene: 8, prompt: 'Where in the timeline did you leave silence on purpose? Where did you fill silence because you were uncomfortable with it?' },
];

const PITFALLS = [
  { title: 'Picks a post that has no argument', body: 'A post can be 1,500 well-written words and still not argue anything. If the student can\u2019t state the argument in one sentence, they\u2019re not ready for Scene 1. Push them back to the post first.' },
  { title: 'Writes the brief essay-style', body: 'The most common failure mode. The brief is a script document, not a prose document. If a section reads like a paragraph, it\u2019s wrong. Cast and locations should look like character bios; beats should look like screenplay slugs.' },
  { title: 'Approves a drifty storyboard to save credits', body: 'Animation makes drift worse, not better. Tell students explicitly: the moment they animate a drifty frame, they\u2019ve burned the credits that would have fixed it.' },
  { title: 'Reads narration like a paper, not a script', body: 'Students will read their own writing the way they read it in their head \u2014 fast, flat, and dense. Have them mark up the script with pauses (single periods, double periods, paragraph breaks) before they record.' },
  { title: 'Forgets to disclose the tools', body: 'Whatever your institution\u2019s AI policy says, every student should disclose every tool used. Make this part of the submission, not an afterthought.' },
];

function EducatorToolkit() {
  return (
    <section id="edu-toolkit" className="edu-toolkit">
      <div className="edu-toolkit-head">
        <div className="sub">For educators</div>
        <h2>The Educator&rsquo;s Toolkit</h2>
        <p className="edu-toolkit-intro">
          Everything you need to teach this workflow to students &mdash; a rubric, a class
          structure, AI-use policy language for your syllabus, an accessibility checklist,
          common student pitfalls, and discussion prompts.
        </p>
        <div className="edu-toolkit-actions">
          <button
            type="button"
            className="print-btn"
            onClick={() => { document.body.classList.add('printing'); window.print(); setTimeout(() => document.body.classList.remove('printing'), 500); }}
          >
            <Icon d={Icons.copy} size={13} /> Print as lesson plan
          </button>
          <span className="print-note">
            Hides nav and Q&amp;A widgets; keeps the scenes, learning objectives, rubric, policy, accessibility list, pitfalls, and prompts.
          </span>
        </div>
      </div>

      {/* ——— RUBRIC ——— */}
      <div id="edu-rubric" className="edu-block">
        <div className="edu-block-label"><span className="dot"></span>Rubric &middot; four criteria, four levels</div>
        <p className="edu-block-blurb">
          Use this as is, or copy it into your LMS and reweight. Total points are up to you;
          we recommend equal weighting across the four criteria.
        </p>
        <div className="rubric-table">
          <div className="rubric-row rubric-row-head">
            <div className="rubric-criterion-cell"></div>
            <div className="rubric-level-cell">Exemplary</div>
            <div className="rubric-level-cell">Proficient</div>
            <div className="rubric-level-cell">Developing</div>
            <div className="rubric-level-cell">Beginning</div>
          </div>
          {RUBRIC_CRITERIA.map((c) => (
            <div key={c.name} className="rubric-row">
              <div className="rubric-criterion-cell">
                <div className="rubric-criterion-name">{c.name}</div>
                <div className="rubric-criterion-blurb">{c.blurb}</div>
              </div>
              {['Exemplary', 'Proficient', 'Developing', 'Beginning'].map((lv) => (
                <div key={lv} className={`rubric-level-cell rubric-level-${lv.toLowerCase()}`}>
                  {c.levels[lv]}
                </div>
              ))}
            </div>
          ))}
        </div>
      </div>

      {/* ——— CLASS STRUCTURE ——— */}
      <div id="edu-class" className="edu-block">
        <div className="edu-block-label"><span className="dot"></span>Suggested class structures</div>
        <div className="class-grid">
          <div className="class-card">
            <div className="class-card-title">Two-hour workshop</div>
            <ol className="class-card-list">
              <li><strong>10 min</strong> &middot; Scenes 1 &amp; 2 (lecture + a written exercise: find your spine)</li>
              <li><strong>35 min</strong> &middot; Scene 3 (pairs, draft and trade briefs)</li>
              <li><strong>20 min</strong> &middot; Scene 4 (demo Runway Agent, students set up sessions)</li>
              <li><strong>25 min</strong> &middot; Scene 5 (consistency check, in pairs)</li>
              <li><strong>30 min</strong> &middot; Scenes 6&ndash;8 assigned as homework with a clear deadline</li>
            </ol>
          </div>
          <div className="class-card">
            <div className="class-card-title">Three-session module</div>
            <ol className="class-card-list">
              <li><strong>Session 1</strong> &middot; Scenes 1&ndash;3. Most of the class period on the brief.</li>
              <li><strong>Session 2</strong> &middot; Scenes 4&ndash;6. Live demo, then studio time with consistency checks.</li>
              <li><strong>Session 3</strong> &middot; Scenes 7&ndash;8 plus a critique session against the rubric.</li>
            </ol>
          </div>
          <div className="class-card">
            <div className="class-card-title">Group-work pattern</div>
            <ul className="class-card-list">
              <li><strong>Solo</strong> &middot; Scenes 1, 2, 7 (individual creative decisions)</li>
              <li><strong>Pairs</strong> &middot; Scenes 3, 5, 8 (fresh eyes catch drift and pacing)</li>
              <li><strong>Whole class</strong> &middot; Final screening and peer-rubric critique</li>
            </ul>
          </div>
        </div>
      </div>

      {/* ——— AI USE POLICY ——— */}
      <div id="edu-policy" className="edu-block">
        <div className="edu-block-label"><span className="dot"></span>AI-use policy language for your syllabus</div>
        <p className="edu-block-blurb">
          Adapt to your institution&rsquo;s policy; the bracketed clause is where to slot
          in your university or department language. Paste into your syllabus or assignment sheet.
        </p>
        <PromptBlock
          label="Suggested syllabus language"
          defaultExpanded={true}
          code={`This assignment uses generative AI tools (Runway, ElevenLabs, and \u2014 optionally \u2014 a writing assistant such as Claude, ChatGPT, Gemini, or Copilot) to translate a piece of your own writing into a short animated video.

You must disclose, in a brief appendix submitted with the video:
\u2022 Every AI tool you used, with the specific model or product name.
\u2022 The prompts you wrote for the storyboard and animation, and roughly how many regenerations each beat required.
\u2022 Any reference images you uploaded that are not your own work, with attribution.
\u2022 Any narration lines that were generated rather than written by you (if a writing assistant drafted lines).

You retain the argument and the writing. Per [INSERT YOUR INSTITUTION\u2019S AI POLICY HERE], AI may not produce the substance of your argument; it may only produce the visualization and narration of an argument you have already made and written. Submissions that present an AI-generated argument as the student\u2019s own will be treated as a violation of the academic integrity policy.

If you do not have access to a paid Runway or ElevenLabs subscription, contact the instructor before starting. Free-tier paths are available.`}
        />
      </div>

      {/* ——— ACCESSIBILITY ——— */}
      <div id="edu-a11y" className="edu-block">
        <div className="edu-block-label"><span className="dot"></span>Accessibility checklist for the finished video</div>
        <p className="edu-block-blurb">
          Anything published or screened in class should clear this list. Treat it as part of the rubric&rsquo;s technical-execution criterion.
        </p>
        <ul className="a11y-list">
          <li><strong>Open or closed captions</strong> for every narration line. CapCut auto-captions, then proof.</li>
          <li><strong>Transcript</strong> published alongside the video for screen-reader users.</li>
          <li><strong>Alt description</strong> of 1&ndash;2 sentences for the video on any page that embeds it.</li>
          <li><strong>Audio levels</strong> &mdash; narration peaks no higher than &minus;3&nbsp;dB; no clipping anywhere.</li>
          <li><strong>Color contrast</strong> &mdash; any on-screen text should clear WCAG AA (4.5:1) against its background.</li>
          <li><strong>Flashing content</strong> &mdash; no element flashes more than three times per second (PEAT-safe).</li>
          <li><strong>Voice clone consent</strong> &mdash; if a student clones an instructor or classmate&rsquo;s voice, that person has signed off in writing.</li>
        </ul>
      </div>

      {/* ——— HARDWARE & ACCESS ——— */}
      <div id="edu-hardware" className="edu-block">
        <div className="edu-block-label"><span className="dot"></span>Hardware &amp; access notes (the equity question)</div>
        <p className="edu-block-blurb">
          The first thing a department chair or IT director asks is &ldquo;do my students
          need a powerful laptop?&rdquo; The honest answer is no, but the details matter
          if you have students on tethered phones, in shared computer labs, or in dorms
          with thin Wi-Fi. Use this to write a one-line equipment list for your syllabus.
        </p>
        <HardwareNotes heading="Hardware & access notes" bare={true} />
      </div>

      {/* ——— PITFALLS ——— */}
      <div id="edu-pitfalls" className="edu-block">
        <div className="edu-block-label"><span className="dot"></span>Common student pitfalls</div>
        <p className="edu-block-blurb">
          The general &ldquo;where it goes sideways&rdquo; section earlier covers everyone. These are the ones we&rsquo;ve seen specifically in classrooms.
        </p>
        <div className="pitfalls-grid">
          {PITFALLS.map((p, i) => (
            <div key={i} className="pitfall-card">
              <div className="pitfall-num">{String(i + 1).padStart(2, '0')}</div>
              <div className="pitfall-body">
                <div className="pitfall-title">{p.title}</div>
                <p>{p.body}</p>
              </div>
            </div>
          ))}
        </div>
      </div>

      {/* ——— DISCUSSION PROMPTS ——— */}
      <div id="edu-discussion" className="edu-block">
        <div className="edu-block-label"><span className="dot"></span>Discussion prompts, one per scene</div>
        <p className="edu-block-blurb">
          For pairs, small groups, or whole-class conversation. Pair each with a 5&ndash;10 minute time box.
        </p>
        <ol className="discussion-list">
          {DISCUSSION_PROMPTS.map((d) => (
            <li key={d.scene} className="discussion-item">
              <a className="discussion-scene" href={`#step${d.scene}`}>Scene&nbsp;{String(d.scene).padStart(2, '0')}</a>
              <p className="discussion-prompt">{d.prompt}</p>
            </li>
          ))}
        </ol>
      </div>

    </section>
  );
}

/* ============================================================
   CLOSING
   ============================================================ */
function ClosingSection({ completedCount }) {
  const allDone = completedCount === STEPS.length;
  return (
    <div className="closing">
      <div className="closing-title">A note for the first attempt</div>
      <p>
        Your first attempt will be imperfect and you will see the seams. That is the
        point. The first time through is for learning what your workflow needs, not for
        shipping a flawless asset. Most of the lessons live in Steps 3 and 5, where the
        brief and the consistency check do the heavy lifting.
      </p>
      <p>Be patient with yourself. Or don't. But ship anyway.</p>
      <div className="mantra">
        Pick a post. Find the spine. <span className="coral">Write the brief.</span><br/>
        Iterate. Animate. Narrate. Assemble. <span className="coral">Ship.</span>
      </div>
      {allDone && (
        <div className="completion-banner">
          <div className="badge"><Icon d={Icons.check} size={22} stroke={2.5}/></div>
          <div>
            <h4>All eight scenes complete</h4>
            <p>Now make the video. Then come back and pick a second post.</p>
          </div>
        </div>
      )}
    </div>
  );
}

Object.assign(window, {
  Intro, EducatorPreface, NeedSection, PrinciplesSection, StepBlock,
  Step1Body, Step2Body, Step3Body, Step4Body, Step5Body, Step6Body, Step7Body, Step8Body,
  WatchSection, ResourcesSection, ReferencesSection, EducatorToolkit, ClosingSection,
});
