// slides-5.jsx — Video slides inserted right after Automation #1.
// Wide-format screen recordings of the automations running.
// Globals used: C, TYPE_SCALE, SPACING, Slide, Chrome.

function VideoSlide({ num, total, src, eyebrow, title, clip, clipsTotal = 3, placeholder, label }) {
  return (
    <Slide bg="#000" ink={C.cream} pad={false} label={label} style={{ position: 'relative' }}>
      {placeholder ? (
        <div style={{
          position: 'absolute', inset: 40, borderRadius: 22,
          border: `3px dashed ${C.coral}`,
          background: `repeating-linear-gradient(45deg, ${C.creamSoft} 0 16px, ${C.cream} 16px 32px)`,
          display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 16,
        }}>
          <div style={{
            fontFamily: '"Barlow Condensed",system-ui,sans-serif', fontSize: 22, color: C.coral,
            fontWeight: 700, letterSpacing: '0.18em', textTransform: 'uppercase',
          }}>Video {clip} of {clipsTotal}</div>
          <div style={{ fontSize: 30, fontWeight: 700, color: C.tealInk, textAlign: 'center', lineHeight: 1.3 }}>
            Drop the clip here.
          </div>
          <div style={{ fontSize: 22, color: 'rgba(16,50,63,0.6)', textAlign: 'center', maxWidth: 560, lineHeight: 1.4 }}>
            [ Placeholder — upload the file and I'll embed it, framed exactly like clip 1. ]
          </div>
        </div>
      ) : (
        <video
          data-deck-video
          src={src}
          controls
          playsInline
          preload="metadata"
          style={{
            position: 'absolute', inset: 0, width: '100%', height: '100%',
            objectFit: 'contain', background: '#000',
          }}
        />
      )}

      {/* Title overlay */}
      <div style={{
        position: 'absolute', top: 0, left: 0, right: 0,
        padding: '46px 64px 90px', pointerEvents: 'none', zIndex: 2,
        background: 'linear-gradient(180deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0) 100%)',
      }}>
        <h1 style={{
          fontSize: 48, fontWeight: 800, letterSpacing: '-0.02em', lineHeight: 1.05,
          margin: 0, color: C.cream, textWrap: 'balance', maxWidth: 1500,
          textShadow: '0 2px 20px rgba(0,0,0,0.55)',
        }}>{title}</h1>
      </div>

      <Chrome num={num} total={total} ink={C.cream} />
    </Slide>
  );
}

// Three clips that sit right after Automation #1 (the Labor Report).
// The arc: manual process → deterministic script → agentic workflow.
function S_Video1({ num, total }) {
  return (
    <VideoSlide
      num={num} total={total}
      eyebrow="Automation 01 · Before"
      title="First, the old way: by hand."
      clip={1}
      src="assets/video-1-manual.mp4"
      label="Clip 1 — Manual process"
    />
  );
}
function S_Video2({ num, total }) {
  return (
    <VideoSlide
      num={num} total={total}
      eyebrow="Automation 01 · Deterministic"
      title="Then, the deterministic Python script."
      clip={2}
      src="assets/video-2-deterministic.mp4"
      label="Clip 2 — Deterministic script"
    />
  );
}
function S_Video3({ num, total }) {
  return (
    <VideoSlide
      num={num} total={total}
      eyebrow="Automation 01 · Agentic"
      title="Now, the agentic workflow."
      clip={3}
      src="assets/video-3-agentic.mp4"
      label="Clip 3 — Agentic workflow"
    />
  );
}

Object.assign(window, { VideoSlide, S_Video1, S_Video2, S_Video3 });

// ─── Where the deterministic script breaks ───────────────────────────────
// Sits between the deterministic-script video and the agentic workflow.
function S_WhereItBreaks({ num, total }) {
  const breaks = [
  { k: 'The format shifts', s: 'A new column, a renamed field, a re-ordered PDF — and the script reads the wrong cell.' },
  { k: 'An edge case appears', s: 'A new cost center, a one-off adjustment, a line it has never seen. No rule covers it.' },
  { k: 'Something needs judgment', s: 'A number looks off. Is it a typo or a real spike? A script can\'t ask — it just reports it.' }];

  return (
    <Slide bg={C.cream} label="Where it breaks">
      <TitleBlock
        eyebrow="The deterministic script · Its ceiling"
        title={<>A script only does <span style={{ color: C.coral }}>exactly</span> what you told it.</>} />

      <div style={{
        marginTop: 32, fontSize: 34, fontWeight: 500, lineHeight: 1.4,
        color: 'rgba(16,50,63,0.72)', maxWidth: 1480, textWrap: 'pretty',
      }}>
        That's its strength — and its ceiling. The moment reality drifts from the rules, it breaks.
      </div>

      <div style={{
        marginTop: 40, display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 26,
      }}>
        {breaks.map((b) =>
        <div key={b.k} style={{
          background: C.creamSoft, borderRadius: 24, padding: '30px 30px',
          borderTop: `4px solid ${C.coral}`,
          display: 'flex', flexDirection: 'column', gap: 14,
        }}>
            <div style={{ fontSize: 32, fontWeight: 800, color: C.tealInk, lineHeight: 1.15, letterSpacing: '-0.01em' }}>{b.k}</div>
            <div style={{ fontSize: 24, color: 'rgba(16,50,63,0.6)', lineHeight: 1.4, textWrap: 'pretty' }}>{b.s}</div>
          </div>
        )}
      </div>

      <div style={{
        marginTop: 'auto', display: 'flex', alignItems: 'center', gap: 24,
        background: C.coral, color: C.cream, borderRadius: 22, padding: '28px 44px',
      }}>
        <div style={{ fontSize: 44, fontWeight: 800, lineHeight: 1, flexShrink: 0 }}>→</div>
        <div style={{ fontSize: 36, fontWeight: 800, letterSpacing: '-0.01em', lineHeight: 1.1, whiteSpace: 'nowrap' }}>
          So a human still has to step in.
        </div>
      </div>

      <Chrome num={num} total={total} />
    </Slide>);
}

Object.assign(window, { S_WhereItBreaks });

// ─── Transition: What is an agentic workflow? ────────────────────────────
// Sits right after "Where it breaks" (the deterministic script's ceiling) and
// before the agentic workflow video. Defines the concept and answers why it
// solves the breaking problem.
function S_WhatIsAgentic({ num, total }) {
  const map = [
  { broke: 'The format changed', fix: 'Reads the new layout and adapts the mapping itself.' },
  { broke: 'An unseen edge case', fix: 'Reasons it through — and asks before it guesses.' },
  { broke: 'It needed judgment', fix: 'Weighs the context and makes the call.' }];

  return (
    <Slide bg={C.cream} label="What is an agentic workflow">
      <TitleBlock
        eyebrow="The deterministic ceiling → the fix"
        title={<>So you wrap it in an <span style={{ color: C.coral }}>agent</span>.</>} />

      <div style={{
        marginTop: 28, fontSize: 34, fontWeight: 500, lineHeight: 1.4,
        color: 'rgba(16,50,63,0.72)', maxWidth: 1520, textWrap: 'pretty',
      }}>
        A deterministic script runs fixed steps. An <strong style={{ color: C.tealInk, fontWeight: 700 }}>agentic workflow</strong> hands the model a goal instead — and lets it decide the steps, read its own errors, and use judgment. So when reality drifts from the rules, it adapts instead of breaking.
      </div>

      <div style={{
        marginTop: 44, display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 24,
      }}>
        {map.map((m) =>
        <div key={m.broke} style={{
          background: C.white, border: `1px solid ${C.creamDeep}`, borderRadius: 22,
          overflow: 'hidden', display: 'flex', flexDirection: 'column',
        }}>
            <div style={{
            padding: '20px 26px', background: C.creamSoft,
            fontSize: 26, fontWeight: 800, color: 'rgba(16,50,63,0.55)',
            textDecoration: 'line-through', textDecorationColor: 'rgba(232,96,76,0.5)',
            textDecorationThickness: '2px', borderBottom: `1px solid ${C.creamDeep}`,
          }}>{m.broke}</div>
            <div style={{ padding: '24px 26px', display: 'flex', gap: 14, alignItems: 'flex-start' }}>
              <span style={{ color: C.teal, fontSize: 26, fontWeight: 800, lineHeight: 1.2, flexShrink: 0 }}>→</span>
              <div style={{ fontSize: 25, color: C.tealInk, lineHeight: 1.4, textWrap: 'pretty' }}>{m.fix}</div>
            </div>
          </div>
        )}
      </div>

      <div style={{
        marginTop: 'auto', display: 'flex', alignItems: 'center', gap: 24,
        background: C.teal, color: C.cream, borderRadius: 22, padding: '28px 44px',
      }}>
        <div style={{ fontSize: 44, fontWeight: 800, lineHeight: 1, flexShrink: 0, color: C.peach }}>↻</div>
        <div style={{ fontSize: 32, fontWeight: 700, letterSpacing: '-0.01em', lineHeight: 1.15, whiteSpace: 'nowrap' }}>
          Where the script stops cold, the agent keeps going — a human just reviews.
        </div>
      </div>

      <Chrome num={num} total={total} />
    </Slide>);
}

Object.assign(window, { S_WhatIsAgentic });

// ─── How I started: took it to Claude (plain English, no code) ───────────
function S_TookItToClaude({ num, total }) {
  const Arrow = () => (
    <div style={{
      flexShrink: 0, alignSelf: 'center', color: C.coral,
      fontSize: 40, fontWeight: 800, lineHeight: 1, padding: '0 4px',
    }}>→</div>
  );
  const Card = ({ label, children }) => (
    <div style={{
      flex: 1, background: C.creamSoft, border: `1px solid ${C.creamDeep}`, borderRadius: 20, padding: '30px 30px',
      display: 'flex', flexDirection: 'column', gap: 16, minWidth: 0,
    }}>
      <div style={{
        fontFamily: '"Barlow Condensed",system-ui,sans-serif',
        textTransform: 'uppercase', letterSpacing: '0.14em', fontSize: 22,
        fontWeight: 700, color: C.coral,
      }}>{label}</div>
      {children}
    </div>
  );

  return (
    <Slide bg={C.cream} label="Took it to Claude" style={{ justifyContent: 'center' }}>
      <TitleBlock eyebrow="How I started" title={<>To <span style={{ color: C.coral }}>Claude</span>.</>} />

      <div style={{
        marginTop: 32, fontSize: 34, fontWeight: 500, lineHeight: 1.4,
        color: 'rgba(16,50,63,0.72)', maxWidth: 1480, textWrap: 'pretty',
      }}>
        I didn't write a line of code. I handed it the two files and described my job in plain English.
      </div>

      <div style={{ marginTop: 44, display: 'flex', alignItems: 'stretch', gap: 8 }}>
        <Card label="What I handed it">
          <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
            {['The payroll PDF', 'Production Labor.xlsx'].map((f) =>
            <div key={f} style={{
              display: 'flex', alignItems: 'center', gap: 14,
              background: C.white, border: `1px solid ${C.creamDeep}`, borderRadius: 14,
              padding: '16px 18px',
            }}>
              <div style={{
                width: 36, height: 44, borderRadius: 6, background: C.peach, flexShrink: 0,
              }} />
              <div style={{ fontSize: 26, fontWeight: 700, color: C.tealInk }}>{f}</div>
            </div>
            )}
          </div>
        </Card>
        <Arrow />
        <Card label="What I said">
          <div style={{ fontSize: 27, lineHeight: 1.42, color: C.tealInk, textWrap: 'pretty' }}>
            “Here's the PDF, here's the spreadsheet. These numbers go <em style={{ fontStyle: 'normal', color: C.coral, fontWeight: 700 }}>here</em>, those go <em style={{ fontStyle: 'normal', color: C.coral, fontWeight: 700 }}>there</em>. Can you do this for me?”
          </div>
        </Card>
        <Arrow />
        <Card label="What Claude said">
          <div style={{ fontSize: 27, lineHeight: 1.42, color: C.tealInk, textWrap: 'pretty' }}>
            “We can write a <strong style={{ color: C.coral }}>Python script</strong> to do exactly that.”
          </div>
        </Card>
      </div>

      <Chrome num={num} total={total} />
    </Slide>);
}

// ─── A quick primer: what is Python? ─────────────────────────────────────
function S_WhatIsPython({ num, total }) {
  const traits = ['Beginner-friendly', 'Versatile', 'Massive library', 'Standard for AI'];

  return (
    <Slide bg={C.cream} label="What is Python">
      <TitleBlock eyebrow="A quick primer" title="What is Python?" />

      <div style={{
        marginTop: 32, fontSize: 36, fontWeight: 500, lineHeight: 1.4,
        color: 'rgba(16,50,63,0.72)', maxWidth: 1520, textWrap: 'pretty',
      }}>
        A programming language — beginner-friendly, versatile, and what seems to be the industry standard for AI. In plain terms, it's how you hand a computer a repetitive job — open this file, pull these numbers, write them there, send that email — and have it done perfectly, every time, without you. You don't need to write it yourself; you just need to know it exists, and that Claude can write it for you.
      </div>

      <div style={{
        marginTop: 'auto', display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 26,
      }}>
        <div style={{
          background: 'transparent', border: `2px dashed ${C.creamDeep}`, borderRadius: 20,
          padding: '40px 40px', display: 'flex', flexDirection: 'column', gap: 16,
        }}>
          <div style={{
            fontFamily: '"Barlow Condensed",system-ui,sans-serif',
            textTransform: 'uppercase', letterSpacing: '0.14em', fontSize: 22, fontWeight: 700,
            color: 'rgba(16,50,63,0.5)',
          }}>You don't need</div>
          <div style={{ fontSize: 40, fontWeight: 800, color: 'rgba(16,50,63,0.55)', lineHeight: 1.15, letterSpacing: '-0.01em' }}>
            To know how to write it.
          </div>
        </div>
        <div style={{
          background: C.teal, borderRadius: 20,
          padding: '40px 40px', display: 'flex', flexDirection: 'column', gap: 16,
        }}>
          <div style={{
            fontFamily: '"Barlow Condensed",system-ui,sans-serif',
            textTransform: 'uppercase', letterSpacing: '0.14em', fontSize: 22, fontWeight: 700,
            color: C.peach,
          }}>You do need</div>
          <div style={{ fontSize: 40, fontWeight: 800, color: C.cream, lineHeight: 1.15, letterSpacing: '-0.01em' }}>
            To know what it is — and what it can do.
          </div>
        </div>
      </div>

      <Chrome num={num} total={total} />
    </Slide>);
}

Object.assign(window, { S_TookItToClaude, S_WhatIsPython });
