/* global React, INK, CREAM, PULSE, GENS, GradText, CTAButton, Reveal, useReveal, SB_EASE, PC_ACCENTS,
   MShell, MHead, MGenerate */
// Photo Control feature page — mobile layout.
const { useState: pcmS } = React;

const MPCHero = () => {
  const [ref, on] = useReveal(0.25);
  return (
    <section style={{ background: CREAM, padding: '0 22px 56px' }}>
      <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '16px 0 30px' }}>
        <span style={{ display: 'inline-flex', alignItems: 'center', gap: 7 }}>
          <img loading="lazy" decoding="async" src="assets/logo-icon.png" alt="" style={{ width: 19, height: 19, objectFit: 'contain' }} />
          <span style={{ fontSize: 16, fontWeight: 800, letterSpacing: '-0.03em', color: INK }}>sozee</span>
        </span>
      </div>
      <div style={{ textAlign: 'center' }}>
        <Reveal>
          <div style={{ display: 'inline-flex', alignItems: 'center', gap: 7, marginBottom: 16, borderRadius: 9999, padding: '6px 12px', background: '#fff', boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.1)' }}>
            <a href="/" style={{ fontSize: 10.5, fontWeight: 600, color: 'rgba(28,27,27,0.55)' }}>Features</a>
            <span style={{ fontSize: 10, color: 'rgba(28,27,27,0.35)' }}>/</span>
            <span style={{ fontSize: 10.5, fontWeight: 700, color: INK }}>Photo Control</span>
          </div>
        </Reveal>
        <Reveal delay={90}>
          <h1 style={{ font: '800 44px/1 var(--font-sans)', letterSpacing: '-0.03em', color: INK, margin: '0 0 16px', textWrap: 'balance' }}>
            Don’t prompt it.<br /><GradText>Direct it.</GradText>
          </h1>
        </Reveal>
        <Reveal delay={170}>
          <p style={{ fontSize: 14.5, lineHeight: 1.58, color: 'var(--text-secondary)', margin: '0 0 24px' }}>
            Five dimensions you set before you generate — Setting, Outfit, Shot style, Expression, Object — from presets and your own libraries.
          </p>
        </Reveal>
        <Reveal delay={250} style={{ marginBottom: 34 }}><CTAButton size="sm">Start directing</CTAButton></Reveal>
      </div>
      <Reveal delay={200} y={26}>
        <div ref={ref} style={{ transform: 'rotate(1.2deg) perspective(1200px) rotateY(-3deg)', borderRadius: 20, background: '#fff', boxShadow: '0 20px 44px rgba(28,27,27,0.12), inset 0 0 0 1px rgba(28,27,27,0.08)', padding: 13 }}>
          <div style={{ display: 'grid', gridTemplateColumns: '0.92fr 1.08fr', gap: 8, height: 250, marginBottom: 10 }}>
            <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gridTemplateRows: '1fr 1fr 1fr', gap: 6 }}>
              {[['assets/control/top-red.webp', 'Outfit', '#fff'], ['assets/control/skirt-black.webp', 'Outfit', '#fff'],
                ['assets/control/shot-mirror.webp', 'Shot', null], ['assets/control/expression-surprised.jpg', 'Mood', null],
                ['assets/control/collar-silver.png', 'Object', '#fff'], ['assets/control/room.png', 'Setting', null]].map(([src, label, bg], i) =>
                <div key={i} style={{ position: 'relative', borderRadius: 8, overflow: 'hidden', background: bg || '#eee', boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.08)',
                  opacity: on ? 1 : 0, transition: `opacity 0.45s ${SB_EASE} ${i * 70}ms` }}>
                  <img loading="lazy" decoding="async" src={src} alt="" style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'center 20%' }} />
                  <span style={{ position: 'absolute', left: 4, bottom: 4, fontSize: 6.5, fontWeight: 700, letterSpacing: '0.05em', textTransform: 'uppercase', color: '#fff', background: 'rgba(20,16,23,0.6)', borderRadius: 9999, padding: '2px 6px' }}>{label}</span>
                </div>
              )}
            </div>
            <div style={{ position: 'relative', borderRadius: 11, overflow: 'hidden' }}>
              <img loading="lazy" decoding="async" src="assets/control/result-selfie.webp" alt="" style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'center 20%',
                opacity: on ? 1 : 0, filter: on ? 'none' : 'blur(12px)', transition: `opacity 0.7s ${SB_EASE} 400ms, filter 0.9s ${SB_EASE} 400ms` }} />
              <span style={{ position: 'absolute', left: 7, bottom: 7, fontSize: 7.5, fontWeight: 700, color: '#fff', background: 'rgba(28,27,27,0.55)', borderRadius: 9999, padding: '2px 7px' }}>The shot</span>
            </div>
          </div>
          <div style={{ display: 'flex', gap: 5, flexWrap: 'wrap', marginBottom: 10 }}>
            <span style={{ display: 'inline-flex', alignItems: 'center', gap: 4, borderRadius: 9999, padding: '4px 9px', fontSize: 9, fontWeight: 600, background: 'rgb(246,243,242)', boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.08)', color: INK }}>
              <span style={{ width: 11, height: 11, borderRadius: '50%', backgroundImage: `url(${GENS[0].src})`, backgroundSize: 'cover', backgroundPosition: 'center 15%' }} />Scarlett
            </span>
            {Object.entries(PC_ACCENTS).map(([n, ac]) =>
              <span key={n} style={{ display: 'inline-flex', alignItems: 'center', gap: 4, borderRadius: 9999, padding: '4px 9px', fontSize: 9, fontWeight: 600, background: 'rgb(246,243,242)', boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.08)', color: INK }}>
                <span style={{ width: 5, height: 5, borderRadius: '50%', background: ac }} />{n}</span>)}
          </div>
          <MGenerate count={1} />
        </div>
      </Reveal>
    </section>);
};

// eyebrows are hero-only on mobile — keep the heading, drop the pill
const MPCBadgeHead = ({ title, sub }) => <MHead title={title} sub={sub} />;

// § 01 Setting
const MPC_SETTINGS = [
  { src: 'assets/settings/my-room.png', name: 'My bedroom' }, { src: 'assets/control/room.png', name: 'Hotel suite' }];
const MPCSetting = () => {
  const [sel, setSel] = pcmS(0);
  return (
    <MShell bg="#fff">
      <MPCBadgeHead label="Photo Control · Setting" ac={PC_ACCENTS.Setting} title={<span>Any setting.<br /><GradText>One click.</GradText></span>}
        sub="A setting is built from a few reference photos of the real room — then every photo shoots there. One click sets the scene." />
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8, marginTop: 26, transform: 'rotate(-1.2deg) perspective(1200px) rotateY(3deg)' }}>
        {MPC_SETTINGS.map((s, i) =>
          <div key={s.name} onClick={() => setSel(i)} style={{ position: 'relative', borderRadius: 12, overflow: 'hidden', aspectRatio: '1/1.05', cursor: 'pointer',
            outline: sel === i ? '2px solid var(--brand-purple-500)' : '1px solid rgba(28,27,27,0.1)', outlineOffset: -1 }}>
            <img loading="lazy" decoding="async" src={s.src} alt="" style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover' }} />
            <span style={{ position: 'absolute', left: 6, bottom: 6, fontSize: 8.5, fontWeight: 700, color: '#fff', background: 'rgba(20,16,23,0.6)', borderRadius: 9999, padding: '2px 8px' }}>{s.name}</span>
          </div>
        )}
        <div style={{ borderRadius: 12, aspectRatio: '1/1.05', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 6,
          outline: '1.5px dashed rgba(28,27,27,0.18)', outlineOffset: -1 }}>
          <span style={{ width: 26, height: 26, borderRadius: '50%', background: 'rgb(246,243,242)', display: 'grid', placeItems: 'center' }}>
            <svg width="11" height="11" viewBox="0 0 16 16" fill="none"><path d="M8 3v10M3 8h10" stroke="rgba(28,27,27,0.55)" strokeWidth="1.8" strokeLinecap="round" /></svg></span>
          <span style={{ fontSize: 10.5, fontWeight: 600, color: 'var(--text-secondary)' }}>Save a setting</span>
        </div>
      </div>
    </MShell>);
};

// § 02 Outfit — compact Outfit library
const MOL_CATS = [
  { k: 'top', label: 'Tops', all: 107, items: ['assets/garments/top-crop-white.webp', 'assets/garments/top-velvet-emerald.webp', 'assets/garments/top-bodysuit-black.webp'] },
  { k: 'bottom', label: 'Bottoms', all: 60, items: ['assets/garments/bottom-mini-oxblood.webp', 'assets/garments/bottom-denim-lightwash.webp'] },
  { k: 'shoes', label: 'Shoes', all: 30, items: ['assets/garments/shoe-stiletto-gold.webp', 'assets/garments/shoe-thigh-black.webp'] },
  { k: 'acc', label: 'Accessories', all: 60, items: ['assets/garments/acc-garter-black.webp', 'assets/control/collar-silver.png'] }];

const MPCOutfit = () => {
  const [cat, setCat] = pcmS(0);
  const [sel, setSel] = pcmS({ top: 0, bottom: null, shoes: null, acc: null });
  const c = MOL_CATS[cat];
  return (
    <MShell>
      <MPCBadgeHead label="Photo Control · Outfit" ac={PC_ACCENTS.Outfit} title={<span>Upload any outfit.<br /><GradText>They wear it.</GradText></span>}
        sub="Photograph a garment you own — or pick from 700+ pieces — and put your Character in it, exactly, in every shot." />
      <div style={{ borderRadius: 18, background: '#fff', boxShadow: '0 12px 32px rgba(28,27,27,0.10), inset 0 0 0 1px rgba(28,27,27,0.08)', overflow: 'hidden', marginTop: 26, transform: 'rotate(1.2deg) perspective(1200px) rotateY(-3deg)' }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: 9, padding: '12px 13px 10px', borderBottom: '1px solid rgba(28,27,27,0.07)' }}>
          <span style={{ width: 28, height: 28, borderRadius: 8, background: 'rgb(250,243,235)', display: 'grid', placeItems: 'center', flexShrink: 0 }}>
            <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="#C77D3A" strokeWidth="1.8" strokeLinejoin="round"><path d="M9 4l3 2 3-2 5 3-2 4-2-1v10H6V10l-2 1-2-4z" /></svg></span>
          <span style={{ minWidth: 0, textAlign: 'left' }}>
            <span style={{ display: 'block', fontSize: 12, fontWeight: 800, color: INK }}>Outfit library</span>
            <span style={{ display: 'block', fontSize: 9.5, color: 'var(--text-secondary)' }}>Your saved pieces — pick one per category.</span>
          </span>
        </div>
        <div className="m-nosb" style={{ display: 'flex', gap: 5, padding: '10px 13px 0', overflowX: 'auto' }}>
          {MOL_CATS.map((g, i) =>
            <span key={g.k} onClick={() => setCat(i)} style={{ borderRadius: 9999, padding: '6px 11px', fontSize: 10, fontWeight: i === cat ? 700 : 600, cursor: 'pointer', whiteSpace: 'nowrap', flexShrink: 0,
              background: i === cat ? INK : '#fff', color: i === cat ? '#fff' : 'rgba(28,27,27,0.6)',
              boxShadow: i === cat ? 'none' : 'inset 0 0 0 1px rgba(28,27,27,0.12)' }}>{g.label}</span>)}
        </div>
        <div style={{ padding: '10px 13px 0' }}>
          <div style={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between', marginBottom: 7 }}>
            <span style={{ fontSize: 10.5, fontWeight: 800, color: INK }}>All {c.label}</span>
            <span style={{ fontSize: 9, color: 'rgba(28,27,27,0.45)' }}>{c.all} items</span>
          </div>
          <div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: 7 }}>
            <div style={{ borderRadius: 10, aspectRatio: '1/0.94', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 5,
              outline: '1.5px dashed rgba(28,27,27,0.18)', outlineOffset: -1 }}>
              <span style={{ width: 24, height: 24, borderRadius: '50%', background: 'rgb(246,243,242)', display: 'grid', placeItems: 'center' }}>
                <svg width="10" height="10" viewBox="0 0 16 16" fill="none"><path d="M8 10V3M5 5.5L8 2.5l3 3M3 10.5v3h10v-3" stroke="rgba(28,27,27,0.55)" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" /></svg></span>
              <span style={{ fontSize: 8.5, fontWeight: 600, color: 'var(--text-secondary)' }}>Upload your own</span>
            </div>
            {c.items.map((src, i) => {
              const on = sel[c.k] === i;
              return (
                <div key={src} onClick={() => setSel({ ...sel, [c.k]: on ? null : i })} style={{ position: 'relative', borderRadius: 10, overflow: 'hidden', aspectRatio: '1/0.94', cursor: 'pointer', background: '#fff',
                  outline: on ? '2px solid var(--brand-purple-500)' : '1px solid rgba(28,27,27,0.1)', outlineOffset: -1 }}>
                  <img loading="lazy" decoding="async" src={src} alt="" style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover' }} />
                  {on && <span style={{ position: 'absolute', top: 5, left: 5, width: 15, height: 15, borderRadius: '50%', background: 'var(--brand-purple-500)', display: 'grid', placeItems: 'center' }}>
                    <svg width="8" height="8" viewBox="0 0 16 16" fill="none"><path d="M3 8.4l3.2 3.2L13.5 4" stroke="#fff" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" /></svg></span>}
                </div>);
            })}
            {c.items.length < 3 &&
              <div style={{ borderRadius: 10, aspectRatio: '1/0.94', display: 'grid', placeItems: 'center', background: 'rgb(250,247,247)', boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.07)' }}>
                <span style={{ fontSize: 8.5, fontWeight: 700, color: 'var(--text-tertiary)' }}>+ {c.all - c.items.length} more</span>
              </div>}
          </div>
        </div>
        <div style={{ display: 'flex', alignItems: 'center', gap: 6, padding: '11px 13px 13px', borderTop: '1px solid rgba(28,27,27,0.07)', marginTop: 11 }}>
          {[['top', 'TOP'], ['bottom', 'BOT'], ['shoes', 'SHO'], ['acc', 'ACC']].map(([k, l]) => {
            const g = MOL_CATS.find(x => x.k === k);
            const has = sel[k] !== null && sel[k] !== undefined;
            return (
              <span key={k} style={{ width: 27, height: 27, borderRadius: 8, overflow: 'hidden', display: 'grid', placeItems: 'center', flexShrink: 0,
                outline: has ? '1.5px solid var(--brand-purple-400)' : '1px dashed rgba(28,27,27,0.2)', outlineOffset: -1, background: '#fff' }}>
                {has ? <img loading="lazy" decoding="async" src={g.items[sel[k]]} alt="" style={{ width: '100%', height: '100%', objectFit: 'cover' }} /> :
                  <span style={{ fontSize: 6, fontWeight: 800, letterSpacing: '0.06em', color: 'rgba(28,27,27,0.35)' }}>{l}</span>}
              </span>);
          })}
          <span style={{ flex: 1 }} />
          <span style={{ display: 'inline-flex', alignItems: 'center', gap: 4, borderRadius: 9999, padding: '7px 13px', fontSize: 9.5, fontWeight: 700, color: '#fff', background: PULSE, boxShadow: '0 8px 20px -4px rgba(104,19,212,0.45)' }}>
            <svg width="9" height="9" viewBox="0 0 16 16" fill="none"><path d="M3 8.4l3.2 3.2L13.5 4" stroke="#fff" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" /></svg>Save to outfit</span>
        </div>
      </div>
    </MShell>);
};

// § 03 Shot style
const MPC_SHOTS = [
  ['assets/shots/pov_selfie.webp', 'POV selfie'], ['assets/shots/mirror.webp', 'Mirror'], ['assets/shots/candid.webp', 'Candid'],
  ['assets/shots/studio.webp', 'Studio'], ['assets/shots/ringlight.webp', 'Ringlight']];
const MPCShots = () => {
  const [sel, setSel] = pcmS(0);
  return (
    <MShell bg="#fff">
      <MPCBadgeHead label="Photo Control · Shot style" ac={PC_ACCENTS['Shot style']} title={<span>Select any<br /><GradText>shot style.</GradText></span>}
        sub="Five camera presets, one tap apart — the same scene reads completely differently through each." />
      <div className="m-nosb" style={{ display: 'flex', gap: 9, overflowX: 'auto', margin: '26px -22px 0', padding: '10px 22px 4px' }}>
        {MPC_SHOTS.map(([src, name], i) =>
          <div key={name} onClick={() => setSel(i)} style={{ width: 118, flexShrink: 0, cursor: 'pointer', transform: `rotate(${i % 2 ? 1.3 : -1.3}deg)` }}>
            <div style={{ position: 'relative', borderRadius: 12, overflow: 'hidden', aspectRatio: '3/4.1',
              outline: sel === i ? '2px solid var(--brand-purple-500)' : '1px solid rgba(28,27,27,0.1)', outlineOffset: -1,
              transform: sel === i ? 'translateY(-5px)' : 'none', transition: `all 0.3s ${SB_EASE}` }}>
              <img loading="lazy" decoding="async" src={src} alt={name} style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'center 15%' }} />
            </div>
            <div style={{ marginTop: 8, fontSize: 10, fontWeight: sel === i ? 800 : 600, color: sel === i ? INK : 'rgba(28,27,27,0.5)', textAlign: 'center' }}>{name}</div>
          </div>
        )}
      </div>
    </MShell>);
};

// § 04 Expression
const MPC_EXPR = [['soft_smile', 'Soft smile'], ['playful_laugh', 'Laugh'], ['playful_wink', 'Wink'], ['seductive', 'Seductive'], ['biting_lip', 'Biting lip'],
  ['blow_kiss', 'Blow a kiss'], ['innocent', 'Innocent'], ['neutral', 'Neutral'], ['surprised', 'Surprised'], ['tongue_out', 'Tongue out']];
const MPCExpression = () => {
  const [sel, setSel] = pcmS(3);
  return (
    <MShell>
      <MPCBadgeHead label="Photo Control · Expression" ac={PC_ACCENTS.Expression} title={<span>Any mood<br /><GradText>in 1-click.</GradText></span>}
        sub="Ten expressions from soft smile to seductive, applied without touching the prompt." />
      <div style={{ borderRadius: 16, background: '#fff', boxShadow: '0 12px 32px rgba(28,27,27,0.10), inset 0 0 0 1px rgba(28,27,27,0.08)', padding: 12, marginTop: 26, transform: 'rotate(-1.2deg) perspective(1200px) rotateY(3deg)' }}>
        <div style={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between', marginBottom: 10 }}>
          <span style={{ fontSize: 11, fontWeight: 700, color: INK }}>Expression</span>
          <span style={{ fontSize: 10, fontWeight: 700, color: 'var(--brand-purple-700)' }}>{MPC_EXPR[sel][1]}</span>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 6 }}>
          {MPC_EXPR.map(([k, name], i) =>
            <div key={k} onClick={() => setSel(i)} style={{ cursor: 'pointer' }}>
              <div style={{ position: 'relative', borderRadius: 8, overflow: 'hidden', aspectRatio: '1',
                outline: sel === i ? '2px solid var(--brand-purple-500)' : '1px solid rgba(28,27,27,0.1)', outlineOffset: -1 }}>
                <img loading="lazy" decoding="async" src={`assets/expressions/${k}.jpg`} alt={name} style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'center 12%',
                  filter: sel === i ? 'none' : 'saturate(0.8)' }} />
              </div>
            </div>
          )}
        </div>
        <div style={{ marginTop: 10, fontSize: 10.5, color: 'var(--text-secondary)' }}>The face changes, nothing else does.</div>
      </div>
    </MShell>);
};

// § 05 Object
const MPCObject = () => (
  <MShell bg="#fff">
    <MPCBadgeHead label="Photo Control · Object" ac={PC_ACCENTS.Object} title={<span>Upload or choose<br /><GradText>custom objects.</GradText></span>}
      sub="Up to four objects in frame — including your brand-deal product, pixel-consistent in every shot of the set." />
    <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8, marginTop: 26, transform: 'rotate(1.2deg) perspective(1200px) rotateY(-3deg)' }}>
      <div style={{ position: 'relative', borderRadius: 11, overflow: 'hidden', aspectRatio: '4/3.4', boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.1)' }}>
        <img loading="lazy" decoding="async" src="assets/garments/acc-garter-black.webp" alt="" style={{ width: '100%', height: '100%', objectFit: 'cover', background: '#fff' }} />
        <span style={{ position: 'absolute', left: 5, bottom: 5, fontSize: 7.5, fontWeight: 700, color: '#fff', background: 'rgba(28,27,27,0.55)', borderRadius: 9999, padding: '2px 7px' }}>Your product ↗</span>
      </div>
      <div style={{ position: 'relative', borderRadius: 11, overflow: 'hidden', aspectRatio: '4/3.4', boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.1)' }}>
        <img loading="lazy" decoding="async" src="assets/control/collar-silver.png" alt="" style={{ width: '100%', height: '100%', objectFit: 'cover', background: '#fff' }} />
        <span style={{ position: 'absolute', left: 5, bottom: 5, fontSize: 7.5, fontWeight: 700, color: '#fff', background: 'rgba(28,27,27,0.55)', borderRadius: 9999, padding: '2px 7px' }}>Library</span>
      </div>
      <div style={{ borderRadius: 11, aspectRatio: '4/3.4', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 5,
        outline: '1.5px dashed rgba(28,27,27,0.18)', outlineOffset: -1 }}>
        <span style={{ width: 24, height: 24, borderRadius: '50%', background: 'rgb(246,243,242)', display: 'grid', placeItems: 'center' }}>
          <svg width="10" height="10" viewBox="0 0 16 16" fill="none"><path d="M8 3v10M3 8h10" stroke="rgba(28,27,27,0.55)" strokeWidth="1.8" strokeLinecap="round" /></svg></span>
        <span style={{ fontSize: 9.5, fontWeight: 600, color: 'var(--text-secondary)' }}>Add a prop</span>
      </div>
    </div>
    <Reveal delay={200}>
      <div style={{ marginTop: 14, fontSize: 11, color: 'var(--text-tertiary)', textAlign: 'center' }}>Brands: this is how the product stays recognizable across a campaign.</div>
    </Reveal>
  </MShell>
);

// § 06 pipeline
const MPC_NEXT = [
  { t: 'Create Image', d: 'Your controls ride along on every generate.', kind: 'image', href: '/create-image' },
  { t: 'Create Video', d: 'The five dimensions hold when it moves.', kind: 'video', href: '/create-video' },
  { t: 'Photo Shoot', d: 'One directed photo becomes a locked set of ten.', kind: 'shoot', href: '/#05 Photo Shoot' }];

const MPCPipeMedia = ({ kind }) => (
  <div style={{ width: 96, borderRadius: 11, overflow: 'hidden', flexShrink: 0, aspectRatio: '4/4.4', background: '#fff', boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.08)', padding: 5, boxSizing: 'border-box', display: 'flex', flexDirection: 'column', gap: 4 }}>
    {kind === 'image' && <React.Fragment>
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4, flex: 1, minHeight: 0 }}>
        {['assets/create/out-mirror.webp', 'assets/create/out-garden.webp'].map((src, i) =>
          <span key={src} style={{ position: 'relative', borderRadius: 5, overflow: 'hidden', boxShadow: i === 0 ? '0 0 0 1.5px var(--brand-purple-500)' : 'inset 0 0 0 1px rgba(28,27,27,0.08)' }}>
            <img loading="lazy" decoding="async" src={src} alt="" style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'center 20%' }} /></span>)}
      </div>
      <span style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 3, borderRadius: 6, padding: '4px 0', background: PULSE, color: '#fff', fontSize: 6.5, fontWeight: 800, letterSpacing: '0.05em' }}>GENERATE ✦</span>
    </React.Fragment>}
    {kind === 'video' &&
      <span style={{ position: 'relative', flex: 1, minHeight: 0, borderRadius: 6, overflow: 'hidden', background: 'rgb(246,243,242)', display: 'block' }}>
        <video src="assets/video/explore-1.mp4" autoPlay muted loop playsInline preload="metadata" style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'center 12%' }} />
      </span>}
    {kind === 'shoot' &&
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4, flex: 1, minHeight: 0 }}>
        {[1, 2, 3, 4].map((n, i) =>
          <span key={n} style={{ position: 'relative', borderRadius: 5, overflow: 'hidden', boxShadow: i === 0 ? '0 0 0 1.5px var(--brand-purple-500)' : 'inset 0 0 0 1px rgba(28,27,27,0.08)' }}>
            <img loading="lazy" decoding="async" src={`assets/shoot/set-${n}.webp`} alt="" style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'center 20%' }} /></span>)}
      </div>}
  </div>
);

const MPCPipeline = () => (
  <MShell>
    <MHead title={<span>Direct once.<br /><GradText>It holds everywhere.</GradText></span>}
      sub="The five controls ride along on everything the studio makes." />
    <div style={{ display: 'flex', flexDirection: 'column', gap: 12, marginTop: 28 }}>
      {MPC_NEXT.map((c, i) =>
        <Reveal key={c.t} delay={i * 90} y={20}>
          <a href={c.href} style={{ display: 'flex', gap: 12, borderRadius: 16, overflow: 'hidden', background: '#fff', boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.08)', color: 'inherit', padding: 10, transform: `rotate(${i % 2 ? 0.9 : -0.9}deg)` }}>
            <MPCPipeMedia kind={c.kind} />
            <div style={{ minWidth: 0, alignSelf: 'center' }}>
              <div style={{ fontSize: 14.5, fontWeight: 700, letterSpacing: '-0.01em', color: INK, marginBottom: 4 }}>{c.t}</div>
              <div style={{ fontSize: 11.5, lineHeight: 1.5, color: 'var(--text-secondary)' }}>{c.d}</div>
            </div>
          </a>
        </Reveal>
      )}
    </div>
    <Reveal delay={280} style={{ textAlign: 'center', marginTop: 20 }}>
      <a href="/" style={{ fontSize: 12.5, fontWeight: 600, color: 'var(--brand-purple-700)' }}>See the full tour →</a>
    </Reveal>
  </MShell>
);

const MPCPage = () => (
  <React.Fragment>
    <div style={{ fontFamily: 'var(--font-sans)', maxWidth: 430, margin: '0 auto', boxShadow: '0 0 0 1px rgba(28,27,27,0.06), 0 0 60px rgba(28,27,27,0.08)', overflow: 'clip' }}>
      <div data-screen-label="Hero — Photo Control"><MPCHero /></div>
      <div data-screen-label="01 Setting"><MPCSetting /></div>
      <div data-screen-label="02 Outfit"><MPCOutfit /></div>
      <div data-screen-label="03 Shot style"><MPCShots /></div>
      <div data-screen-label="04 Expression"><MPCExpression /></div>
      <div data-screen-label="05 Object"><MPCObject /></div>
      <div data-screen-label="06 In the studio"><MPCPipeline /></div>
      <div data-screen-label="07 Pricing"><window.MPricingSection /></div>
      <div data-screen-label="08 FAQ"><window.MFAQSection /></div>
      <div data-screen-label="CTA + Footer"><window.MFinalSection /></div>
    </div>
    <window.MCISticky />
    <window.SozeeNavMobile siteHref="/" localLabels={{ '/photo-control': 'Hero — Photo Control', '04 Photo Control': 'Hero — Photo Control', '15 Pricing': '07 Pricing', '16 FAQ': '08 FAQ' }} />
  </React.Fragment>
);

Object.assign(window, { MPCPage });
