/* global React, INK, CREAM, PULSE, GENS, GradText, CTAButton, Reveal, useReveal, SB_EASE, PC_ACCENTS */
// Photo Control feature page — one section per ability, each accenting the real UI.
const { useState: pcS } = React;

const PCBadge = ({ label, ac = '#813CED', bg = CREAM }) =>
  <div style={{ display: 'inline-flex', alignItems: 'center', gap: 8, marginBottom: 18, borderRadius: 9999, padding: '7px 14px', background: bg, boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.1)' }}>
    <span style={{ width: 7, height: 7, borderRadius: '50%', background: ac }} />
    <span style={{ fontSize: 11.5, fontWeight: 700, color: INK }}>{label}</span>
  </div>;

const PCPanelCard = ({ children }) =>
  <div style={{ borderRadius: 20, background: '#fff', boxShadow: '0 24px 48px rgba(28,27,27,0.14), inset 0 0 0 1px rgba(28,27,27,0.08)', padding: 20 }}>{children}</div>;

const PCSectionShell = ({ label, ac, h1, h2, sub, note, panel, flip = false, lean = 'right', bg = '#fff' }) => (
  <section style={{ background: bg, padding: '110px 56px' }}>
    <div style={{ maxWidth: 1140, margin: '0 auto', display: 'grid', gridTemplateColumns: flip ? '1.1fr 0.9fr' : '0.9fr 1.1fr', gap: 64, alignItems: 'center' }}>
      <div style={{ order: flip ? 2 : 1 }}>
        <Reveal delay={90}>
          <h2 style={{ font: '800 52px/1 var(--font-sans)', letterSpacing: '-0.03em', color: INK, margin: '0 0 18px', textWrap: 'balance' }}>{h1}<br /><GradText>{h2}</GradText></h2>
        </Reveal>
        <Reveal delay={170}><p style={{ fontSize: 17, lineHeight: 1.55, color: 'var(--text-secondary)', margin: '0 0 28px', maxWidth: 420 }}>{sub}</p></Reveal>
        <Reveal delay={250}><CTAButton>Join for free</CTAButton></Reveal>
        {note && <Reveal delay={330}><div style={{ marginTop: 26, fontSize: 13, color: 'var(--text-tertiary)' }}>{note}</div></Reveal>}
      </div>
      <Reveal delay={160} y={28} style={{ order: flip ? 1 : 2 }}>
        <div style={{ transform: lean === 'left' ? 'rotate(-1.3deg) perspective(1400px) rotateY(4deg)' : 'rotate(1.3deg) perspective(1400px) rotateY(-4deg)', transformOrigin: 'center' }}>{panel}</div>
      </Reveal>
    </div>
  </section>
);

// ---------- § 01 Setting ----------
const PC_SETTINGS = [
  { src: 'assets/settings/my-room.png', name: 'My bedroom', tag: 'Saved · 4 photos' },
  { src: 'assets/control/room.png', name: 'Hotel suite', tag: 'Saved · 4 photos' }];

const SettingPanel = () => {
  const [sel, setSel] = pcS(0);
  return (
    <PCPanelCard>
      <div style={{ display: 'flex', alignItems: 'baseline', gap: 8, marginBottom: 12 }}>
        <span style={{ fontSize: 12.5, fontWeight: 700, color: INK }}>Settings</span>
        <span style={{ fontSize: 11.5, fontWeight: 600, color: 'var(--text-tertiary)' }}>· saved environments</span>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 10 }}>
        {PC_SETTINGS.map((s, i) =>
          <div key={s.name} onClick={() => setSel(i)} style={{ position: 'relative', borderRadius: 13, 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: 7, bottom: 7, fontSize: 9.5, fontWeight: 700, color: '#fff', background: 'rgba(20,16,23,0.6)', backdropFilter: 'blur(6px)', borderRadius: 9999, padding: '3px 9px' }}>{s.name}</span>
            <span style={{ position: 'absolute', top: 7, right: 7, fontSize: 8, fontWeight: 700, letterSpacing: '0.06em', textTransform: 'uppercase', color: sel === i ? '#fff' : 'rgba(28,27,27,0.65)',
              background: sel === i ? 'var(--brand-purple-500)' : 'rgba(252,248,248,0.9)', borderRadius: 9999, padding: '3px 8px', whiteSpace: 'nowrap' }}>{sel === i ? 'In use' : s.tag}</span>
          </div>
        )}
        <div style={{ borderRadius: 13, aspectRatio: '1/1.05', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 7,
          outline: '1.5px dashed rgba(28,27,27,0.18)', outlineOffset: -1, cursor: 'pointer' }}>
          <span style={{ width: 30, height: 30, borderRadius: '50%', background: 'rgb(246,243,242)', display: 'grid', placeItems: 'center' }}>
            <svg width="13" height="13" 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: 11.5, fontWeight: 600, color: 'var(--text-secondary)' }}>Save a setting</span>
        </div>
      </div>
      <div style={{ marginTop: 12, fontSize: 11.5, color: 'var(--text-secondary)' }}>A setting is built from a few reference photos of the real room — then every photo in the set shoots there. Same light, same corner, same world.</div>
    </PCPanelCard>);
};

// ---------- § 02 Outfit — the Outfit library modal ----------
const OL_CATS = [
  { k: 'top', label: 'Tops', all: 107, up: 2, subs: [['Crop Tops', 9], ['Bodysuits', 6], ['Bralettes & Bra Tops', 6], ['Going-Out Tops', 6], ['Sheer & Lace Tops', 3], ['Sports Bras & Acti…', 15], ['Tees & T-Shirts', 12], ['Tanks & Camis', 9]],
    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, up: 1, subs: [['Skirts', 14], ['Denim', 12], ['Shorts', 9], ['Leggings', 8], ['Trousers', 10], ['Micro & Minis', 7]],
    items: ['assets/garments/bottom-mini-oxblood.webp', 'assets/garments/bottom-denim-lightwash.webp'] },
  { k: 'shoes', label: 'Shoes', all: 30, up: 0, subs: [['Heels', 12], ['Boots', 8], ['Sneakers', 6], ['Sandals', 4]],
    items: ['assets/garments/shoe-stiletto-gold.webp', 'assets/garments/shoe-thigh-black.webp'] },
  { k: 'acc', label: 'Accessories', all: 60, up: 1, subs: [['Jewelry', 18], ['Belts & Garters', 9], ['Bags', 12], ['Hosiery', 11]],
    items: ['assets/garments/acc-garter-black.webp', 'assets/control/collar-silver.png'] }];
const OL_SLOTS = [['top', 'TOP'], ['bottom', 'BOT'], ['shoes', 'SHO'], ['acc', 'ACC']];

const OutfitPanelPC = () => {
  const [cat, setCat] = pcS(0);
  const [sel, setSel] = pcS({ top: 0, bottom: null, shoes: null, acc: null });
  const c = OL_CATS[cat];
  return (
    <div style={{ borderRadius: 20, background: '#fff', boxShadow: '0 24px 48px rgba(28,27,27,0.14), inset 0 0 0 1px rgba(28,27,27,0.08)', overflow: 'hidden' }}>
      <div style={{ display: 'flex', alignItems: 'center', gap: 11, padding: '15px 18px 13px', borderBottom: '1px solid rgba(28,27,27,0.07)' }}>
        <span style={{ width: 34, height: 34, borderRadius: 10, background: 'rgb(250,243,235)', display: 'grid', placeItems: 'center', flexShrink: 0 }}>
          <svg width="16" height="16" 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={{ flex: 1, minWidth: 0 }}>
          <span style={{ display: 'block', fontSize: 14.5, fontWeight: 800, letterSpacing: '-0.01em', color: INK }}>Outfit library</span>
          <span style={{ display: 'block', fontSize: 11, color: 'var(--text-secondary)' }}>Your saved pieces — pick one per category.</span>
        </span>
        <span style={{ width: 26, height: 26, borderRadius: '50%', background: 'rgb(246,243,242)', display: 'grid', placeItems: 'center', cursor: 'pointer' }}>
          <svg width="10" height="10" viewBox="0 0 16 16" fill="none"><path d="M4 4l8 8M12 4l-8 8" stroke="rgba(28,27,27,0.55)" strokeWidth="1.8" strokeLinecap="round" /></svg></span>
      </div>
      <div style={{ display: 'flex', alignItems: 'center', gap: 6, padding: '11px 18px' }}>
        {OL_CATS.map((g, i) =>
          <span key={g.k} onClick={() => setCat(i)} style={{ borderRadius: 9999, padding: '7px 13px', fontSize: 11.5, fontWeight: i === cat ? 700 : 600, cursor: 'pointer', transition: 'all 0.18s',
            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>)}
        <span style={{ flex: 1 }} />
        <span style={{ whiteSpace: 'nowrap', display: 'inline-flex', alignItems: 'center', gap: 6, borderRadius: 9999, padding: '7px 12px', background: 'rgb(246,243,242)', fontSize: 10.5, color: 'rgba(28,27,27,0.45)' }}>
          <svg width="11" height="11" viewBox="0 0 16 16" fill="none"><circle cx="7" cy="7" r="4.5" stroke="rgba(28,27,27,0.4)" strokeWidth="1.6" /><path d="M10.5 10.5L14 14" stroke="rgba(28,27,27,0.4)" strokeWidth="1.6" strokeLinecap="round" /></svg>
          Search all pieces…</span>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: '132px 1fr', gap: 0, padding: '0 18px' }}>
        <div style={{ paddingRight: 12 }}>
          <div style={{ fontSize: 8.5, fontWeight: 700, letterSpacing: '0.1em', textTransform: 'uppercase', color: 'rgba(28,27,27,0.4)', padding: '4px 8px 6px' }}>{c.label}</div>
          <div style={{ display: 'flex', flexDirection: 'column', gap: 1 }}>
            <span style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', borderRadius: 8, padding: '5px 8px', fontSize: 10.5, fontWeight: 600, color: 'rgba(28,27,27,0.65)', cursor: 'pointer' }}>
              <span style={{ display: 'inline-flex', alignItems: 'center', gap: 5 }}><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="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" /></svg>Uploads</span>
              <span style={{ fontSize: 9.5, color: 'rgba(28,27,27,0.4)' }}>{c.up}</span></span>
            <span style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', borderRadius: 8, padding: '5px 8px', fontSize: 10.5, fontWeight: 700, background: INK, color: '#fff' }}>
              All<span style={{ fontSize: 9.5, opacity: 0.7 }}>{c.all}</span></span>
            {c.subs.map(([s, n]) =>
              <span key={s} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 6, borderRadius: 8, padding: '5px 8px', fontSize: 10.5, fontWeight: 600, color: 'rgba(28,27,27,0.65)', cursor: 'pointer' }}>
                <span style={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{s}</span>
                <span style={{ fontSize: 9.5, color: 'rgba(28,27,27,0.4)' }}>{n}</span></span>)}
          </div>
        </div>
        <div>
          <div style={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between', padding: '4px 0 8px' }}>
            <span style={{ fontSize: 12.5, fontWeight: 800, color: INK }}>All {c.label}</span>
            <span style={{ fontSize: 10, color: 'rgba(28,27,27,0.45)' }}>{c.all} items</span>
          </div>
          <div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: 8 }}>
            <div style={{ borderRadius: 11, aspectRatio: '1/0.94', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 6,
              outline: '1.5px dashed rgba(28,27,27,0.18)', outlineOffset: -1, cursor: 'pointer' }}>
              <span style={{ width: 28, height: 28, borderRadius: '50%', background: 'rgb(246,243,242)', display: 'grid', placeItems: 'center' }}>
                <svg width="12" height="12" 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: 10, 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: 11, 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: 6, left: 6, width: 17, height: 17, borderRadius: '50%', background: 'var(--brand-purple-500)', display: 'grid', placeItems: 'center' }}>
                    <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.4" strokeLinecap="round" strokeLinejoin="round" /></svg></span>}
                  <span style={{ position: 'absolute', right: 6, bottom: 6, width: 18, height: 18, borderRadius: '50%', background: 'rgba(28,27,27,0.55)', display: 'grid', placeItems: 'center' }}>
                    <svg width="8" height="8" viewBox="0 0 16 16" fill="none"><path d="M6 10l6-6M8 4h4v4" stroke="#fff" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" /></svg></span>
                </div>);
            })}
            {c.items.length < 3 &&
              <div style={{ borderRadius: 11, 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: 10, fontWeight: 700, color: 'var(--text-tertiary)', textAlign: 'center', padding: '0 10px' }}>+ {c.all - c.items.length} more</span>
              </div>}
          </div>
        </div>
      </div>
      <div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '13px 18px 15px', borderTop: '1px solid rgba(28,27,27,0.07)', marginTop: 14 }}>
        {OL_SLOTS.map(([k, l]) => {
          const g = OL_CATS.find(x => x.k === k);
          const has = sel[k] !== null && sel[k] !== undefined;
          return (
            <span key={k} style={{ width: 32, height: 32, borderRadius: 9, 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: 7, fontWeight: 800, letterSpacing: '0.08em', color: 'rgba(28,27,27,0.35)' }}>{l}</span>}
            </span>);
        })}
        <span style={{ flex: 1, textAlign: 'right', fontSize: 10.5, color: 'var(--text-secondary)', paddingRight: 4 }}>Pick pieces to build the look</span>
        <span style={{ borderRadius: 9999, padding: '8px 15px', fontSize: 11, fontWeight: 700, color: INK, boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.12)', cursor: 'pointer' }}>Cancel</span>
        <span style={{ whiteSpace: 'nowrap', display: 'inline-flex', alignItems: 'center', gap: 5, borderRadius: 9999, padding: '8px 15px', fontSize: 11, fontWeight: 700, color: '#fff', background: PULSE, cursor: 'pointer', boxShadow: '0 8px 20px -4px rgba(104,19,212,0.45)' }}>
          <svg width="10" height="10" 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>);
};

// ---------- § 03 Shot style ----------
const PC_SHOTS = [
  ['assets/shots/pov_selfie.webp', 'POV iPhone selfie'], ['assets/shots/mirror.webp', 'Mirror selfie'],
  ['assets/shots/candid.webp', 'Candid shot'], ['assets/shots/studio.webp', 'Studio'], ['assets/shots/ringlight.webp', 'Ringlight']];

const ShotStyleSection = () => {
  const [sel, setSel] = pcS(0);
  return (
    <section style={{ background: CREAM, padding: '110px 56px' }}>
      <div style={{ maxWidth: 1140, margin: '0 auto', textAlign: 'center' }}>
        <Reveal delay={90}>
          <h2 style={{ font: '800 52px/1 var(--font-sans)', letterSpacing: '-0.03em', color: INK, margin: '0 0 18px' }}>Select any<br /><GradText>shot style.</GradText></h2>
        </Reveal>
        <Reveal delay={170}>
          <p style={{ fontSize: 17, lineHeight: 1.55, color: 'var(--text-secondary)', margin: '0 auto 46px', maxWidth: 520 }}>
            Five camera presets, one tap apart — the same scene reads completely differently through each. Tap one.
          </p>
        </Reveal>
        <div style={{ display: 'flex', justifyContent: 'center', gap: 14, flexWrap: 'wrap' }}>
          {PC_SHOTS.map(([src, name], i) =>
            <Reveal key={name} delay={180 + i * 80} y={22}>
              <div onClick={() => setSel(i)} style={{ width: 176, cursor: 'pointer', transform: `rotate(${i % 2 ? 1.4 : -1.4}deg)` }}>
                <div style={{ position: 'relative', borderRadius: 15, overflow: 'hidden', aspectRatio: '3/4.1',
                  outline: sel === i ? '2.5px solid var(--brand-purple-500)' : '1px solid rgba(28,27,27,0.1)', outlineOffset: -1,
                  boxShadow: sel === i ? '0 20px 40px rgba(28,27,27,0.16)' : '0 10px 24px rgba(28,27,27,0.08)',
                  transform: sel === i ? 'translateY(-8px)' : 'none', transition: `all 0.35s ${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%' }} />
                  {sel === i && <span style={{ position: 'absolute', top: 8, right: 8, width: 20, height: 20, borderRadius: '50%', background: 'var(--brand-purple-500)', display: 'grid', placeItems: 'center' }}>
                    <svg width="11" height="11" 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>
                <div style={{ marginTop: 11, fontSize: 12, fontWeight: sel === i ? 800 : 600, color: sel === i ? INK : 'rgba(28,27,27,0.55)', transition: 'all 0.2s' }}>{name}</div>
              </div>
            </Reveal>
          )}
        </div>
      </div>
    </section>);
};

// ---------- § 04 Expression ----------
const PC_EXPR = [
  ['soft_smile', 'Soft smile'], ['playful_laugh', 'Playful 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 ExpressionPanel = () => {
  const [sel, setSel] = pcS(3);
  return (
    <PCPanelCard>
      <div style={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between', marginBottom: 12 }}>
        <span style={{ fontSize: 12.5, fontWeight: 700, color: INK }}>Expression <span style={{ fontWeight: 600, color: 'var(--text-tertiary)' }}>· ten moods</span></span>
        <span style={{ fontSize: 11, fontWeight: 700, color: 'var(--brand-purple-700)' }}>{PC_EXPR[sel][1]}</span>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 8 }}>
        {PC_EXPR.map(([k, name], i) =>
          <div key={k} onClick={() => setSel(i)} style={{ cursor: 'pointer', textAlign: 'center' }}>
            <div style={{ position: 'relative', borderRadius: 11, overflow: 'hidden', aspectRatio: '1',
              outline: sel === i ? '2px solid var(--brand-purple-500)' : '1px solid rgba(28,27,27,0.1)', outlineOffset: -1, transition: `all 0.25s ${SB_EASE}` }}>
              <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 style={{ marginTop: 6, fontSize: 9, fontWeight: sel === i ? 800 : 600, color: sel === i ? INK : 'rgba(28,27,27,0.5)', whiteSpace: 'nowrap' }}>{name}</div>
          </div>
        )}
      </div>
      <div style={{ marginTop: 12, fontSize: 11.5, color: 'var(--text-secondary)' }}>Applied without touching the prompt — the face changes, nothing else does.</div>
    </PCPanelCard>);
};

// ---------- § 05 Object ----------
const ObjectPanel = () => (
  <PCPanelCard>
    <div style={{ display: 'flex', alignItems: 'baseline', gap: 8, marginBottom: 6 }}>
      <span style={{ fontSize: 12.5, fontWeight: 700, color: INK }}>Objects</span>
      <span style={{ fontSize: 11.5, fontWeight: 600, color: 'var(--text-tertiary)' }}>· 1 of 4 · props</span>
    </div>
    <div style={{ fontSize: 12, color: 'var(--text-tertiary)', marginBottom: 12 }}>A handbag, a coffee cup, a phone — anything held or placed in frame. Up to 4 per set.</div>
    <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 10, marginBottom: 12 }}>
      <div style={{ position: 'relative', borderRadius: 14, overflow: 'hidden', aspectRatio: '4/3.2', 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: 7, bottom: 6, fontSize: 9.5, fontWeight: 700, color: '#fff', background: 'rgba(28,27,27,0.55)', backdropFilter: 'blur(6px)', borderRadius: 9999, padding: '3px 8px' }}>Your product ↗</span>
      </div>
      <div style={{ position: 'relative', borderRadius: 14, overflow: 'hidden', aspectRatio: '4/3.2', 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: 7, bottom: 6, fontSize: 9.5, fontWeight: 700, color: '#fff', background: 'rgba(28,27,27,0.55)', backdropFilter: 'blur(6px)', borderRadius: 9999, padding: '3px 8px' }}>From library</span>
      </div>
      <div style={{ borderRadius: 14, aspectRatio: '4/3.2', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 7,
        outline: '1.5px dashed rgba(28,27,27,0.18)', outlineOffset: -1, cursor: 'pointer' }}>
        <span style={{ width: 30, height: 30, borderRadius: '50%', background: 'rgb(246,243,242)', display: 'grid', placeItems: 'center' }}>
          <svg width="13" height="13" 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: 11.5, fontWeight: 600, color: 'var(--text-secondary)' }}>Add a prop</span>
      </div>
    </div>
    <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 7, borderRadius: 12, height: 40, cursor: 'pointer', boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.1)' }}>
      <svg width="13" height="13" viewBox="0 0 16 16" fill="none"><path d="M2.5 2.5h4.5v4.5H2.5zM9 2.5h4.5v4.5H9zM2.5 9h4.5v4.5H2.5zM9 9h4.5v4.5H9z" stroke="var(--brand-purple-600)" strokeWidth="1.4" /></svg>
      <span style={{ fontSize: 12, fontWeight: 600, color: 'var(--brand-purple-600)' }}>Choose from library</span>
    </div>
  </PCPanelCard>
);

const SettingSection = () => <PCSectionShell label="Setting" ac={PC_ACCENTS.Setting} h1="Any setting." h2="One click." lean="left"
  sub="Pick a saved environment — your bedroom, a hotel pool, a Havana street — and every photo shoots there. No prompting, no describing: one click sets the scene." panel={<SettingPanel />} />;
const OutfitSection = () => <PCSectionShell label="Outfit" ac={PC_ACCENTS.Outfit} h1="Upload any outfit." h2="They wear it." flip lean="right" bg={CREAM}
  sub="Photograph a garment you own — or pick from 700+ pieces — and put your Character in it, exactly, in every shot of the set."
  note="One piece per type builds the look: top, bottom, shoes, accessory." panel={<OutfitPanelPC />} />;
const ExpressionSection = () => <PCSectionShell label="Expression" ac={PC_ACCENTS.Expression} h1="Any mood" h2="in 1-click." lean="left"
  sub="Ten expressions from soft smile to seductive, applied without touching the prompt. Tap through them — the face changes, the scene holds." panel={<ExpressionPanel />} />;
const ObjectSection = () => <PCSectionShell label="Object" ac={PC_ACCENTS.Object} h1="Upload or choose" h2="custom objects." flip lean="right" bg={CREAM}
  sub="Up to four objects in frame — including your brand-deal product, pixel-consistent in every shot of the set."
  note="Brands: this is how the product stays recognizable across a whole campaign." panel={<ObjectPanel />} />;

// ---------- § 06 — Where it goes next ----------
const PCP_PANEL = { borderRadius: '12px 12px 0 0', background: '#fff', boxShadow: '0 10px 24px rgba(28,27,27,0.10), inset 0 0 0 1px rgba(28,27,27,0.08)', padding: 10, height: '100%', boxSizing: 'border-box', display: 'flex', flexDirection: 'column' };
const PC_NEXT = [
  { t: 'Create Image', d: 'Your controls ride along on every generate — type the scene, the direction is already set.', kind: 'image', href: '/create-image' },
  { t: 'Create Video', d: 'The same five dimensions hold when it moves — outfit, room and product stay locked on film.', kind: 'video', href: '/create-video' },
  { t: 'Photo Shoot', d: 'One directed photo becomes a locked set of ten. Same outfit, same room, ten angles.', kind: 'shoot', href: '/#05 Photo Shoot' }];

const PCPipeMedia = ({ kind }) => (
  <div style={{ height: 210, background: 'rgb(246,243,242)', padding: '16px 16px 0', boxSizing: 'border-box' }}>
    {kind === 'image' &&
      <div style={PCP_PANEL}>
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 6, flex: 1, minHeight: 0, marginBottom: 8 }}>
          {['assets/create/out-mirror.webp', 'assets/create/out-garden.webp', 'assets/create/out-gym.webp'].map((src, i) =>
            <div key={src} style={{ position: 'relative', borderRadius: 7, overflow: 'hidden', boxShadow: i === 0 ? '0 0 0 2px 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%' }} /></div>)}
        </div>
        <div style={{ display: 'flex', gap: 7, alignItems: 'center' }}>
          <span style={{ flex: 1, borderRadius: 8, background: 'rgb(235,231,231)', padding: '7px 10px', fontSize: 9.5, fontWeight: 500, color: 'rgba(28,27,27,0.75)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>mirror selfie in my bedroom</span>
          <span style={{ display: 'inline-flex', alignItems: 'center', gap: 4, borderRadius: 8, padding: '7px 11px', background: PULSE, color: '#fff', fontSize: 8.5, fontWeight: 800, letterSpacing: '0.05em' }}>GENERATE <span style={{ fontSize: 8 }}>✦</span></span>
        </div>
      </div>}
    {kind === 'video' &&
      <div style={PCP_PANEL}>
        <div style={{ position: 'relative', flex: 1, minHeight: 0, borderRadius: 8, overflow: 'hidden', background: 'rgb(246,243,242)', marginBottom: 8 }}>
          <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 style={{ position: 'absolute', left: 7, bottom: 7, display: 'inline-flex', alignItems: 'center', gap: 4, fontSize: 8.5, fontWeight: 700, color: '#fff', background: 'rgba(28,27,27,0.55)', backdropFilter: 'blur(6px)', borderRadius: 9999, padding: '3px 8px' }}>
            <svg width="6" height="7" viewBox="0 0 8 10" fill="#fff"><path d="M0 0l8 5-8 5z" /></svg>0:08</span>
        </div>
        <div style={{ display: 'flex', gap: 5 }}>
          {['Scarlett', '9:16', 'Photo Control'].map(c =>
            <span key={c} style={{ borderRadius: 9999, padding: '5px 10px', fontSize: 8.5, fontWeight: 600, whiteSpace: 'nowrap', background: 'rgb(246,243,242)', boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.08)', color: INK }}>{c}</span>)}
        </div>
      </div>}
    {kind === 'shoot' &&
      <div style={PCP_PANEL}>
        <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 8 }}>
          <span style={{ fontSize: 10.5, fontWeight: 700, color: INK }}>Lazy morning · set</span>
          <span style={{ fontSize: 8.5, fontWeight: 700, color: 'var(--brand-purple-700)', background: 'var(--brand-purple-50)', border: '1px solid var(--brand-purple-200)', borderRadius: 9999, padding: '2px 8px', whiteSpace: 'nowrap' }}>10 shots</span>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 6, flex: 1, minHeight: 0 }}>
          {[1, 2, 3, 4, 5, 6].map((n, i) =>
            <div key={n} style={{ position: 'relative', borderRadius: 7, overflow: 'hidden', boxShadow: i === 0 ? '0 0 0 2px 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%' }} /></div>)}
        </div>
      </div>}
  </div>
);

const PCPipelineSection = () => (
  <section style={{ background: '#fff', padding: '110px 56px' }}>
    <div style={{ maxWidth: 1140, margin: '0 auto' }}>
      <div style={{ display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between', gap: 40, flexWrap: 'wrap', marginBottom: 46 }}>
        <div style={{ maxWidth: 560 }}>
          <Reveal delay={90}>
            <h2 style={{ font: '800 52px/1 var(--font-sans)', letterSpacing: '-0.03em', color: INK, margin: '0 0 16px', textWrap: 'balance' }}>
              Direct once.<br /><GradText>It holds everywhere.</GradText>
            </h2>
          </Reveal>
          <Reveal delay={170}>
            <p style={{ fontSize: 17, lineHeight: 1.55, color: 'var(--text-secondary)', margin: 0 }}>
              The five controls ride along on everything the studio makes.
            </p>
          </Reveal>
        </div>
        <Reveal delay={240} style={{ paddingBottom: 8 }}>
          <a href="/" style={{ fontSize: 13.5, fontWeight: 600, color: 'var(--brand-purple-700)' }}>See the full tour →</a>
        </Reveal>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 18 }}>
        {PC_NEXT.map((c, i) =>
          <Reveal key={c.t} delay={i * 110} y={26}>
            <a href={c.href} style={{ display: 'block', borderRadius: 18, overflow: 'hidden', background: CREAM, boxShadow: 'inset 0 0 0 1px rgba(28,27,27,0.08)', color: 'inherit',
              transform: `rotate(${i === 1 ? 1 : -1}deg) perspective(1200px) rotateY(${i === 1 ? -2 : 2}deg)` }}>
              <PCPipeMedia kind={c.kind} />
              <div style={{ padding: '18px 20px 22px' }}>
                <div style={{ fontSize: 17, fontWeight: 700, letterSpacing: '-0.01em', color: INK, marginBottom: 7 }}>{c.t}</div>
                <div style={{ fontSize: 13.5, lineHeight: 1.5, color: 'var(--text-secondary)' }}>{c.d}</div>
              </div>
            </a>
          </Reveal>
        )}
      </div>
    </div>
  </section>
);

Object.assign(window, { SettingSection, OutfitSection, ShotStyleSection, ExpressionSection, ObjectSection, PCPipelineSection });
