// Hero.jsx — the pre-launch page hero: headline + CTA on the left,
// CSS-animated product window on the right cycling through four format outputs.

window.HeroProductShot = function HeroProductShot() {
  const specialists = window.SPECIALISTS || [];

  // Frameless portraits live at /illustrations-headshots-frameless/ (site root).
  const frameless = (s) => {
    if (!s) return "";
    const filename = s.portrait.split("/").pop();
    return `/illustrations-headshots-frameless/${filename}`;
  };

  return (
    <div className="scs-hero-product" style={{ position: "relative" }}>
      <style>{`
        @keyframes scsFadeUp {
          0%   { opacity: 0; transform: translateY(8px); }
          100% { opacity: 1; transform: translateY(0); }
        }
        @keyframes scsWindowIn {
          0%   { opacity: 0; transform: translateY(12px) scale(0.985); }
          100% { opacity: 1; transform: translateY(0) scale(1); }
        }
        @keyframes scsBlinkCursor {
          0%, 49%   { opacity: 1; }
          50%, 100% { opacity: 0; }
        }
        @keyframes scsDots {
          0%   { content: "."; }
          33%  { content: ".."; }
          66%  { content: "..."; }
          100% { content: "."; }
        }
        .scs-hero-product-window { animation: scsWindowIn 0.8s ease-out; }
        .scs-hero-product-window-float { animation: scsFloat 7s ease-in-out infinite; }
        .scs-hero-draft-line { opacity: 0; animation: scsFadeUp 0.55s ease-out forwards; }
        .scs-hero-specialist-active {
          box-shadow: 0 0 0 3px hsla(12, 72%, 55%, 0.35), 0 6px 16px hsla(12, 72%, 55%, 0.3);
        }
        .scs-hero-cursor::after {
          content: "▎"; display: inline-block; margin-left: 1px;
          color: var(--orange); font-weight: 700;
          animation: scsBlinkCursor 1.1s steps(1) infinite;
        }
        .scs-hero-generating::after {
          content: "."; display: inline-block; width: 14px; text-align: left;
          animation: scsDots 0.9s steps(1) infinite;
        }
        .scs-hero-btn {
          transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
        }
        .scs-hero-btn.is-generating {
          background: hsl(348 40% 22%) !important;
          color: hsl(350 15% 78%) !important;
          transform: scale(0.97);
          box-shadow: none !important;
        }
        @media (max-width: 960px) {
          .scs-hero-product-grid { grid-template-columns: 1fr !important; }
          .scs-hero-product-window-wrap { max-width: 480px; margin: 0 auto; }
          .scs-hero-text-col { text-align: center; }
          .scs-hero-text-col p { margin-left: auto !important; margin-right: auto !important; }
        }
        @media (max-width: 640px) {
          .scs-hero-product-grid { gap: 36px !important; }
          /* Tighten the mock browser chrome so the topic row + artifact have room */
          .scs-hero-product-window > div:nth-of-type(2) { grid-template-columns: 48px 1fr !important; }
          .scs-hero-topic-row { flex-direction: column !important; align-items: stretch !important; gap: 6px !important; }
          .scs-hero-topic-input { width: 100% !important; }
          .scs-hero-gen-button { width: 100% !important; justify-content: center !important; padding: 9px 12px !important; }
          /* The animated demo cursor is misleading on touch; hide on mobile */
          .scs-hero-demo-cursor { display: none !important; }
          /* Stack cover/phone above the list inside artifacts so titles aren't squeezed */
          .scs-hero-artifact-row { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
          .scs-hero-artifact-row > .scs-hero-artifact-media { align-self: center !important; }
        }
      `}</style>

      <div className="scs-hero-product-grid" style={{
        position: "relative", maxWidth: 1280, margin: "0 auto",
        display: "grid", gridTemplateColumns: "1fr 1fr", gap: 56,
        alignItems: "center",
      }}>
        {/* LEFT — text */}
        <div className="scs-hero-text-col">
          <h1 style={{
            fontSize: "clamp(38px, 4.4vw, 62px)",
            lineHeight: 1.12, letterSpacing: "-0.03em",
            margin: "0 0 22px",
          }}>
            Build a one-person content studio<br />
            that produces like a<br />
            <em>ten-person team.</em>
          </h1>
          <p style={{
            fontSize: 19, lineHeight: 1.55, color: "var(--ink-light)",
            maxWidth: 560, margin: 0,
          }}>
            Ten specialists, trained on your voice, drafting content across every format you publish.
            Ready when you sit down to share.
          </p>
        </div>

        {/* RIGHT — animated browser window */}
        <div className="scs-hero-product-window-wrap" style={{ position: "relative", maxWidth: 580 }}>
          <window.HeroStudioWindow specialists={specialists} frameless={frameless} />
        </div>
      </div>
    </div>
  );
};

// ── The animated product window ─────────────────────────────
window.HeroStudioWindow = function HeroStudioWindow({ specialists, frameless }) {
  // Four drafts across visually distinct formats. Same topic, different outputs.
  const TOPIC = "studios of one";
  const drafts = [
    { specialistIdx: 0, formatKey: "newsletter", formatLabel: "Newsletter draft", btn: "newsletter" },
    { specialistIdx: 2, formatKey: "social",     formatLabel: "LinkedIn post",    btn: "post" },
    { specialistIdx: 8, formatKey: "video",      formatLabel: "Short-form video", btn: "video" },
    { specialistIdx: 3, formatKey: "podcast",    formatLabel: "Podcast outline",  btn: "podcast" },
  ];

  // selectedIdx drives sidebar highlight + generate-button label + eyebrow.
  // displayedIdx drives the artifact in the canvas (only updates after generate).
  const [selectedIdx, setSelectedIdx] = React.useState(0);
  const [displayedIdx, setDisplayedIdx] = React.useState(-1);
  const [isGenerating, setIsGenerating] = React.useState(false);
  const [hasGeneratedOnce, setHasGeneratedOnce] = React.useState(false);
  const [topicTyped, setTopicTyped] = React.useState(false);

  // Animated demo cursor
  const windowRef = React.useRef(null);
  const topicRef = React.useRef(null);
  const buttonRef = React.useRef(null);
  const sidebarRefs = React.useRef([]);
  const overflowRef = React.useRef(null);
  const [cursorTarget, setCursorTarget] = React.useState("none"); // "topic" | "specialist" | "generate" | "none"
  const [cursorSpecialistIdx, setCursorSpecialistIdx] = React.useState(0);
  const [cursorPos, setCursorPos] = React.useState({ x: 0, y: 0, visible: false });
  const [pulseKey, setPulseKey] = React.useState(0);

  // Master sequencer — runs once on mount. Drives the whole demo loop.
  React.useEffect(() => {
    let cancelled = false;
    const timers = [];
    const after = (ms, fn) => {
      const t = setTimeout(() => { if (!cancelled) fn(); }, ms);
      timers.push(t);
    };

    let current = 0; // current selected idx (0-3)

    // ── Intro: cursor → topic, type, → generate, click, reveal newsletter ──
    after(450,  () => setCursorTarget("topic"));
    after(1300, () => { setTopicTyped(true); setPulseKey(k => k + 1); });
    after(2500, () => setCursorTarget("generate"));
    after(3500, () => setPulseKey(k => k + 1));
    after(3800, () => { setIsGenerating(true); setCursorTarget("none"); });
    after(4500, () => {
      setDisplayedIdx(0);
      setHasGeneratedOnce(true);
      setIsGenerating(false);
    });

    // ── Looping cycle: select-next-specialist → generate → reveal ──
    const cycle = () => {
      if (cancelled) return;
      const nextIdx = (current + 1) % drafts.length;

      after(2400, () => {
        setCursorSpecialistIdx(nextIdx);
        setCursorTarget("specialist");
      });
      after(3300, () => {
        setPulseKey(k => k + 1);
        setSelectedIdx(nextIdx);
        current = nextIdx;
      });
      after(3700, () => setCursorTarget("generate"));
      after(4700, () => setPulseKey(k => k + 1));
      after(5050, () => { setIsGenerating(true); setCursorTarget("none"); });
      after(5800, () => {
        setDisplayedIdx(nextIdx);
        setIsGenerating(false);
      });
      after(5900, cycle);
    };

    after(4500, cycle);

    return () => {
      cancelled = true;
      timers.forEach(clearTimeout);
    };
  }, []);

  // The "selected" draft (for sidebar/button/eyebrow) and "displayed" draft (for artifact)
  const selectedDraft = drafts[selectedIdx];
  const displayedDraft = displayedIdx >= 0 ? drafts[displayedIdx] : null;
  const specialist = specialists[selectedDraft.specialistIdx] || specialists[0];
  const sidebarSpecialists = specialists.slice(0, 6);

  // Cursor positioner — recompute when target or pointed-at specialist changes
  React.useEffect(() => {
    const recompute = () => {
      if (!windowRef.current) return;
      const wr = windowRef.current.getBoundingClientRect();
      let target = null;
      if (cursorTarget === "topic") target = topicRef.current;
      else if (cursorTarget === "specialist") {
        const sIdx = drafts[cursorSpecialistIdx].specialistIdx;
        target = sIdx <= 5 ? sidebarRefs.current[sIdx] : overflowRef.current;
      } else if (cursorTarget === "generate") target = buttonRef.current;

      if (target && cursorTarget !== "none") {
        const tr = target.getBoundingClientRect();
        setCursorPos({
          x: tr.left - wr.left + tr.width / 2,
          y: tr.top - wr.top + tr.height / 2,
          visible: true,
        });
      } else {
        setCursorPos(p => ({ ...p, visible: false }));
      }
    };
    recompute();
    window.addEventListener("resize", recompute);
    return () => window.removeEventListener("resize", recompute);
  }, [cursorTarget, cursorSpecialistIdx]);

  return (
    <div className="scs-hero-product-window-float" style={{ position: "relative" }}>
      <style>{`
        @keyframes scsCursorPulse {
          0%   { transform: scale(0.45); opacity: 0.85; }
          100% { transform: scale(2.2); opacity: 0; }
        }
      `}</style>
      <div ref={windowRef} className="scs-hero-product-window" style={{
        borderRadius: 16,
        overflow: "hidden",
        background: "var(--white)",
        border: "1px solid var(--border)",
        boxShadow: "0 28px 70px -22px hsla(348, 40%, 25%, 0.35), 0 10px 20px -8px hsla(348, 40%, 25%, 0.12)",
        position: "relative",
      }}>
        {/* Browser chrome */}
        <div style={{
          padding: "10px 14px",
          background: "var(--snow)",
          borderBottom: "1px solid var(--border)",
          display: "flex", alignItems: "center", gap: 9,
        }}>
          <div style={{ display: "flex", gap: 5 }}>
            {["#ff5f57", "#febc2e", "#28c840"].map(c => (
              <span key={c} style={{
                width: 10, height: 10, borderRadius: "50%", background: c,
              }} />
            ))}
          </div>
          <div style={{
            flex: 1, margin: "0 8px",
            padding: "5px 10px", borderRadius: 999,
            background: "var(--white)", border: "1px solid var(--border)",
            fontFamily: "var(--font-mono)", fontSize: 10,
            color: "var(--muted)", textAlign: "center",
            letterSpacing: "0.04em",
          }}>
            solocontent.studio/app
          </div>
        </div>

        {/* Sidebar + main */}
        <div style={{ display: "grid", gridTemplateColumns: "56px 1fr", minHeight: 400 }}>
          {/* Sidebar — matches the real Studio's dark ink sidebar */}
          <div style={{
            background: "var(--ink-deep)",
            padding: "12px 0",
            display: "flex", flexDirection: "column", gap: 9,
            alignItems: "center",
          }}>
            {sidebarSpecialists.map((s, i) => {
              const isActive = i === selectedDraft.specialistIdx;
              return (
                <div
                  key={s.num}
                  ref={el => (sidebarRefs.current[i] = el)}
                  className={isActive ? "scs-hero-specialist-active" : ""}
                  style={{
                    width: 36, height: 36, borderRadius: "50%",
                    background: isActive ? `var(--${s.accent}-3)` : "hsl(348 40% 18%)",
                    border: isActive ? "2px solid var(--orange)" : "2px solid transparent",
                    overflow: "hidden", position: "relative",
                    transition: "all 0.4s ease",
                    display: "flex", alignItems: "center", justifyContent: "center",
                  }}
                >
                  <img src={frameless(s)} alt={s.title} style={{
                    width: "118%", height: "118%", objectFit: "contain",
                    position: "absolute", top: "-9%", left: "-9%",
                    filter: isActive ? "none" : "grayscale(0.3) brightness(0.85)",
                    transition: "filter 0.4s ease",
                  }} />
                </div>
              );
            })}
            <div ref={overflowRef} style={{
              fontFamily: "var(--font-mono)", fontSize: 9,
              color: "hsl(350 15% 55%)", letterSpacing: "0.08em",
              marginTop: 2,
            }}>+4</div>
          </div>

          {/* Main content */}
          <div style={{
            padding: "14px 16px",
            display: "flex", flexDirection: "column", gap: 10,
            position: "relative", overflow: "hidden",
          }}>
            {/* Specialist eyebrow */}
            <div key={`eyebrow-${selectedIdx}`} className="scs-hero-draft-line" style={{
              display: "flex", alignItems: "center", gap: 7,
              animationDelay: "0ms",
            }}>
              <span style={{
                width: 7, height: 7, borderRadius: "50%",
                background: "var(--orange)",
                boxShadow: "0 0 8px hsla(12, 72%, 55%, 0.6)",
                animation: "scsPulse 1.6s ease-in-out infinite",
              }} />
              <span style={{
                fontFamily: "var(--font-mono)", fontSize: 9,
                letterSpacing: "0.14em", textTransform: "uppercase",
                color: `var(--${specialist.accent}-1)`,
              }}>
                {specialist.title} · {selectedDraft.formatLabel}
              </span>
            </div>

            {/* Topic input + generate button row (persistent across cycles) */}
            <div className="scs-hero-topic-row" style={{
              display: "flex", gap: 6, alignItems: "stretch",
              padding: 4,
              background: "var(--snow)",
              border: "1px solid var(--border)",
              borderRadius: 10,
            }}>
              <div ref={topicRef} className="scs-hero-topic-input" style={{
                flex: 1, minWidth: 0,
                padding: "7px 10px",
                background: "var(--white)",
                border: "1px solid var(--border)",
                borderRadius: 7,
                display: "flex", alignItems: "center",
                fontFamily: "var(--font-mono)", fontSize: 10,
                color: "var(--muted)", letterSpacing: "0.04em",
              }}>
                <span style={{ color: "var(--muted)", marginRight: 6, fontSize: 9 }}>TOPIC</span>
                <span className={topicTyped ? "scs-hero-cursor" : ""} style={{
                  color: "var(--ink)",
                  fontFamily: "var(--font-body)",
                  fontWeight: 500,
                  fontSize: 11,
                  letterSpacing: 0,
                  opacity: topicTyped ? 1 : 0,
                  transition: "opacity 0.2s ease",
                }}>
                  {TOPIC}
                </span>
              </div>
              <button
                ref={buttonRef}
                className={`scs-hero-btn scs-hero-gen-button ${isGenerating ? "is-generating" : ""}`}
                style={{
                  padding: "7px 12px", borderRadius: 7, border: "none",
                  background: "var(--orange)", color: "#fff",
                  fontFamily: "var(--font-body)", fontWeight: 600, fontSize: 11,
                  letterSpacing: "0.01em",
                  cursor: "pointer", whiteSpace: "nowrap",
                  boxShadow: "0 2px 8px hsla(12, 72%, 50%, 0.25)",
                  display: "inline-flex", alignItems: "center", gap: 4,
                }}
              >
                {isGenerating ? (
                  <>
                    <span>Generating</span>
                    <span className="scs-hero-generating" />
                  </>
                ) : (
                  <>
                    <span>Generate {selectedDraft.btn}</span>
                    <span style={{ fontSize: 12 }}>→</span>
                  </>
                )}
              </button>
            </div>

            {/* The artifact — keyed on displayedIdx so it re-fades when generation reveals */}
            <div key={`artifact-${displayedIdx}`} style={{ flex: 1, minHeight: 0 }}>
              {displayedDraft && displayedDraft.formatKey === "newsletter" && <window.ArtifactNewsletter />}
              {displayedDraft && displayedDraft.formatKey === "social"     && <window.ArtifactSocial />}
              {displayedDraft && displayedDraft.formatKey === "video"      && <window.ArtifactVideo />}
              {displayedDraft && displayedDraft.formatKey === "podcast"    && <window.ArtifactPodcast />}
            </div>

            {/* Shared status chip — appears once the first draft is revealed */}
            {hasGeneratedOnce && (
            <div
              key={`status-${displayedIdx}`}
              className="scs-hero-draft-line"
              style={{
                display: "flex", gap: 8, alignItems: "center", flexWrap: "wrap",
                animationDelay: "900ms",
              }}
            >
              <span style={{
                fontFamily: "var(--font-mono)", fontSize: 9,
                letterSpacing: "0.12em", textTransform: "uppercase",
                padding: "5px 10px", borderRadius: 999,
                background: "hsl(150 60% 94%)", color: "hsl(150 55% 28%)",
                border: "1px solid hsl(150 50% 82%)",
                fontWeight: 600,
              }}>
                ✓ Solid first draft
              </span>
              <span style={{
                fontFamily: "var(--font-mono)", fontSize: 9,
                color: "var(--muted)", letterSpacing: "0.08em",
                textTransform: "uppercase",
              }}>
                Ready for your human touch
              </span>
            </div>
            )}
          </div>
        </div>

        {/* Animated demo cursor — visits topic → active specialist → generate */}
        <div className="scs-hero-demo-cursor" style={{
          position: "absolute",
          top: 0, left: 0,
          transform: `translate(${cursorPos.x - 4}px, ${cursorPos.y - 4}px)`,
          transition: "transform 0.62s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease",
          pointerEvents: "none",
          opacity: cursorPos.visible ? 1 : 0,
          zIndex: 20,
          willChange: "transform",
        }}>
          {/* click pulse — re-keyed each arrival to retrigger animation */}
          <span
            key={pulseKey}
            aria-hidden="true"
            style={{
              position: "absolute", top: -10, left: -10,
              width: 36, height: 36, borderRadius: "50%",
              border: "2.5px solid var(--orange)",
              animation: "scsCursorPulse 0.85s ease-out forwards",
              pointerEvents: "none",
            }}
          />
          <svg width="30" height="34" viewBox="0 0 30 34" style={{
            filter: "drop-shadow(0 3px 8px hsl(345 58% 4% / 0.45))",
            display: "block",
          }}>
            <path
              d="M3 3 L3 24 L9 19 L13 27 L17 25 L13 17 L21 17 Z"
              fill="white"
              stroke="hsl(345 58% 12%)"
              strokeWidth="1.8"
              strokeLinejoin="round"
            />
          </svg>
        </div>
      </div>

      {/* Personalization badges below the window — appear on first generation
          so they feel like they were applied during the generating moment. */}
      <window.HeroFloatingBadges visible={hasGeneratedOnce} />
    </div>
  );
};

// ── Personalization badges (below the window) ───────────────
window.HeroFloatingBadges = function HeroFloatingBadges({ visible }) {
  // Staggered horizontally with slight vertical offsets so they don't
  // sit on a rigid baseline. Each gently floats once visible.
  const badges = [
    { label: "Your voice applied",         accent: "coral", offsetY: 0,  delayMs: 120,  floatDelay: 0 },
    { label: "Content pillars referenced", accent: "iris",  offsetY: 14, delayMs: 320,  floatDelay: 1.2 },
    { label: "Audience tone matched",      accent: "sage",  offsetY: 4,  delayMs: 520,  floatDelay: 2.4 },
  ];

  return (
    <>
      <style>{`
        @keyframes scsBadgeIn {
          0%   { opacity: 0; transform: translateY(8px) scale(0.94); }
          100% { opacity: 1; transform: translateY(0) scale(1); }
        }
        @keyframes scsBadgeFloat {
          0%, 100% { transform: translateY(0); }
          50%      { transform: translateY(-4px); }
        }
        .scs-hero-badge-wrap {
          opacity: 0;
        }
        .scs-hero-badge-wrap.is-visible {
          animation: scsBadgeIn 0.55s ease-out forwards;
        }
        .scs-hero-badge-inner {
          animation: scsBadgeFloat 5s ease-in-out infinite;
        }
        @media (max-width: 640px) {
          .scs-hero-badges-row { gap: 8px !important; }
          .scs-hero-badge-inner { font-size: 10px !important; padding: 6px 10px !important; }
        }
      `}</style>
      <div className="scs-hero-badges-row" style={{
        marginTop: 28,
        display: "flex", flexWrap: "wrap", gap: 12,
        justifyContent: "center", alignItems: "flex-start",
      }}>
        {badges.map((b) => (
          <div
            key={b.label}
            className={`scs-hero-badge-wrap${visible ? " is-visible" : ""}`}
            style={{
              animationDelay: visible ? `${b.delayMs}ms` : "0ms",
              transform: `translateY(${b.offsetY}px)`,
            }}
          >
            <div
              className="scs-hero-badge-inner"
              style={{
                animationDelay: `${b.floatDelay}s`,
                display: "inline-flex", alignItems: "center", gap: 7,
                padding: "8px 13px",
                background: "var(--white)",
                border: `1px solid var(--${b.accent}-2)`,
                borderRadius: 999,
                boxShadow: "0 10px 24px hsla(348, 30%, 18%, 0.12), 0 2px 6px hsla(348, 30%, 18%, 0.08)",
                fontFamily: "var(--font-body)", fontSize: 11, fontWeight: 600,
                color: "var(--ink)", whiteSpace: "nowrap",
              }}
            >
              <span style={{
                width: 16, height: 16, borderRadius: "50%",
                background: `var(--${b.accent}-2)`, color: "#fff",
                display: "inline-flex", alignItems: "center", justifyContent: "center",
                fontSize: 10, fontWeight: 700, flexShrink: 0,
              }}>✓</span>
              {b.label}
            </div>
          </div>
        ))}
      </div>
    </>
  );
};

// ── NEWSLETTER artifact ─────────────────────────────────────
window.ArtifactNewsletter = function ArtifactNewsletter() {
  return (
    <div style={{
      border: "1px solid var(--border)",
      borderRadius: 10,
      overflow: "hidden",
      background: "var(--white)",
      boxShadow: "0 2px 8px hsla(348, 20%, 30%, 0.06)",
    }}>
      {/* From / Subject strip */}
      <div className="scs-hero-draft-line" style={{
        padding: "7px 12px",
        background: "hsl(210 60% 97%)",
        borderBottom: "1px solid var(--border)",
        fontFamily: "var(--font-mono)", fontSize: 9,
        color: "var(--muted)", letterSpacing: "0.04em",
        animationDelay: "120ms",
      }}>
        <div>From: <span style={{ color: "var(--ink)" }}>caroline@solocontent.studio</span></div>
        <div>Subject: <span style={{ color: "var(--ink)" }}>Studios of one</span></div>
      </div>
      {/* Banner */}
      <div className="scs-hero-draft-line" style={{
        height: 26,
        background: "linear-gradient(100deg, var(--coral-3), var(--gold-3))",
        animationDelay: "220ms",
      }} />
      {/* Body */}
      <div style={{ padding: "11px 14px", display: "flex", flexDirection: "column", gap: 7 }}>
        <h3 className="scs-hero-draft-line" style={{
          fontFamily: "var(--font-body)", fontWeight: 700,
          fontSize: 15, letterSpacing: "-0.005em", lineHeight: 1.2,
          margin: 0, color: "var(--ink)",
          animationDelay: "320ms",
        }}>
          Why solopreneurs are rebranding as studios of one
        </h3>
        <div className="scs-hero-draft-line" style={{
          fontSize: 11, lineHeight: 1.5, color: "var(--ink-light)",
          animationDelay: "440ms",
        }}>
          The word "team" implies a payroll and a Slack workspace. A studio implies intention, craft, and a point of view.
        </div>
        <div className="scs-hero-draft-line" style={{
          fontSize: 11, lineHeight: 1.5, color: "var(--ink-light)",
          animationDelay: "560ms",
        }}>
          This week's letter is about the quiet shift from "solo business" to "studio of one."
        </div>
      </div>
    </div>
  );
};

// ── SOCIAL POST artifact ────────────────────────────────────
window.ArtifactSocial = function ArtifactSocial() {
  return (
    <div style={{
      border: "1px solid var(--border)",
      borderRadius: 10,
      background: "var(--white)",
      boxShadow: "0 2px 8px hsla(348, 20%, 30%, 0.06)",
      padding: "12px 14px",
      display: "flex", flexDirection: "column", gap: 9,
    }}>
      {/* Avatar + name */}
      <div className="scs-hero-draft-line" style={{
        display: "flex", alignItems: "center", gap: 10,
        animationDelay: "120ms",
      }}>
        <div style={{
          width: 32, height: 32, borderRadius: "50%",
          background: "linear-gradient(135deg, var(--coral-3), var(--iris-3))",
          border: "1px solid var(--border)", flexShrink: 0,
        }} />
        <div style={{ flex: 1, minWidth: 0 }}>
          <div style={{
            fontFamily: "var(--font-body)", fontSize: 12, fontWeight: 700,
            color: "var(--ink)", lineHeight: 1.2,
          }}>Caroline Zook</div>
          <div style={{
            fontFamily: "var(--font-mono)", fontSize: 9,
            color: "var(--muted)", letterSpacing: "0.04em", marginTop: 2,
          }}>Founder · The Solo Content Studio · 2h</div>
        </div>
        <span style={{
          fontFamily: "var(--font-mono)", fontSize: 13, color: "var(--muted)",
        }}>⋯</span>
      </div>
      {/* Post body */}
      <div className="scs-hero-draft-line" style={{
        fontSize: 12, lineHeight: 1.5, color: "var(--ink)",
        animationDelay: "260ms",
      }}>
        The hardest part of making content solo isn't writing.
      </div>
      <div className="scs-hero-draft-line" style={{
        fontSize: 12, lineHeight: 1.5, color: "var(--ink)",
        animationDelay: "380ms",
      }}>
        It's remembering who you are, every time, in every format.
      </div>
      <div className="scs-hero-draft-line" style={{
        fontSize: 12, lineHeight: 1.5, color: "var(--ink)",
        animationDelay: "500ms",
      }}>
        I built a studio that does the remembering for me.
      </div>
      {/* Action bar */}
      <div className="scs-hero-draft-line" style={{
        display: "flex", justifyContent: "space-between",
        paddingTop: 7, borderTop: "1px solid var(--border)",
        animationDelay: "640ms",
      }}>
        {["♡ Like", "💬 Comment", "↻ Repost", "⇪ Send"].map((label, i) => (
          <span key={i} style={{
            fontFamily: "var(--font-mono)", fontSize: 9,
            color: "var(--muted)", letterSpacing: "0.04em",
          }}>{label}</span>
        ))}
      </div>
    </div>
  );
};

// ── SHORT-FORM VIDEO artifact ───────────────────────────────
window.ArtifactVideo = function ArtifactVideo() {
  const beats = [
    { label: "HOOK",   text: "Here's the content math nobody did for you." },
    { label: "BEAT",   text: "Nine formats. Four platforms. One of you." },
    { label: "PAYOFF", text: "A studio does the math instead." },
  ];
  return (
    <div className="scs-hero-artifact-row" style={{ display: "flex", gap: 10, alignItems: "stretch" }}>
      {/* 9:16 phone frame */}
      <div className="scs-hero-draft-line scs-hero-artifact-media" style={{
        flexShrink: 0,
        width: 100, aspectRatio: "9 / 16",
        borderRadius: 12, overflow: "hidden",
        background: "linear-gradient(160deg, hsl(210 40% 18%), hsl(258 40% 22%))",
        position: "relative",
        border: "1px solid var(--border)",
        boxShadow: "0 6px 16px hsla(258, 40%, 20%, 0.25)",
        animationDelay: "120ms",
      }}>
        <div style={{
          position: "absolute", top: 7, left: 7,
          fontFamily: "var(--font-mono)", fontSize: 7,
          color: "hsl(350 15% 85%)", letterSpacing: "0.12em",
          textTransform: "uppercase",
        }}>● REC</div>
        <div style={{
          position: "absolute", bottom: 8, left: 6, right: 6,
          background: "hsla(0, 0%, 100%, 0.95)",
          borderRadius: 5, padding: "5px 6px",
          fontFamily: "var(--font-body)", fontWeight: 700,
          fontSize: 9, lineHeight: 1.25, color: "var(--ink)",
          textAlign: "center",
        }}>
          "A studio does the math instead."
        </div>
        <div style={{
          position: "absolute", top: "50%", left: "50%",
          transform: "translate(-50%, -50%)",
          width: 28, height: 28, borderRadius: "50%",
          background: "hsla(0, 0%, 100%, 0.92)",
          display: "flex", alignItems: "center", justifyContent: "center",
          fontSize: 11, color: "var(--ink)",
        }}>▶</div>
      </div>

      {/* Script beats on the right */}
      <div style={{ flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: 6 }}>
        {beats.map((b, i) => (
          <div
            key={b.label}
            className="scs-hero-draft-line"
            style={{
              padding: "6px 9px",
              background: "var(--snow)",
              border: "1px solid var(--border)",
              borderRadius: 7,
              animationDelay: `${260 + i * 140}ms`,
            }}
          >
            <div style={{
              fontFamily: "var(--font-mono)", fontSize: 8,
              letterSpacing: "0.16em", textTransform: "uppercase",
              color: "var(--ice-1)", marginBottom: 2,
            }}>{b.label}</div>
            <div style={{
              fontSize: 10.5, lineHeight: 1.35, color: "var(--ink)",
            }}>{b.text}</div>
          </div>
        ))}
      </div>
    </div>
  );
};

// ── PODCAST artifact ────────────────────────────────────────
// Square cover art on the left, episode outline with timestamped chapters on the right.
window.ArtifactPodcast = function ArtifactPodcast() {
  const chapters = [
    { t: "0:00",  title: "Cold open · The word studio" },
    { t: "2:45",  title: "Why the language change matters" },
    { t: "9:10",  title: "Three shifts in how you work" },
    { t: "17:30", title: "Try this one thing this week" },
  ];
  return (
    <div className="scs-hero-artifact-row" style={{ display: "flex", gap: 11, alignItems: "flex-start" }}>
      {/* Cover art */}
      <div className="scs-hero-draft-line scs-hero-artifact-media" style={{
        flexShrink: 0,
        width: 108, height: 108,
        borderRadius: 10, overflow: "hidden",
        position: "relative",
        background: "linear-gradient(145deg, hsl(34, 70%, 55%), hsl(12, 72%, 50%))",
        border: "1px solid var(--border)",
        boxShadow: "0 6px 16px hsla(12, 72%, 45%, 0.3)",
        animationDelay: "120ms",
        display: "flex", flexDirection: "column", justifyContent: "space-between",
        padding: 9, color: "#fff",
      }}>
        <div style={{
          fontFamily: "var(--font-mono)", fontSize: 8,
          letterSpacing: "0.18em", textTransform: "uppercase",
          opacity: 0.9,
        }}>EP · 24</div>
        <div style={{
          fontFamily: "var(--font-body)", fontWeight: 700,
          fontSize: 14, lineHeight: 1.1, letterSpacing: "-0.005em",
        }}>
          Studios of one
        </div>
      </div>

      {/* Chapters */}
      <div style={{ flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: 4 }}>
        <div className="scs-hero-draft-line" style={{
          fontFamily: "var(--font-mono)", fontSize: 8,
          letterSpacing: "0.16em", textTransform: "uppercase",
          color: "var(--muted)",
          animationDelay: "200ms",
        }}>
          Episode outline
        </div>
        {chapters.map((c, i) => (
          <div
            key={c.t}
            className="scs-hero-draft-line"
            style={{
              display: "flex", gap: 9, alignItems: "baseline",
              padding: "5px 0",
              borderBottom: i < chapters.length - 1 ? "1px solid var(--border)" : "none",
              animationDelay: `${320 + i * 110}ms`,
            }}
          >
            <span style={{
              flexShrink: 0,
              fontFamily: "var(--font-mono)", fontSize: 9,
              color: "var(--orange-deep)", letterSpacing: "0.04em",
              fontWeight: 600, minWidth: 30,
            }}>{c.t}</span>
            <span style={{
              fontSize: 11, lineHeight: 1.35, color: "var(--ink)",
            }}>{c.title}</span>
          </div>
        ))}
      </div>
    </div>
  );
};
