/* global React */
/* Industry view · How CMO teams spend their time today vs the AI-augmented future */

const CMO_STEPS = [
  { label: "Planning & setup",          h: 110, alt: false },
  { label: "Writing & editing",         h: 130, alt: false },
  { label: "Campaign execution",        h: 150, alt: false },
  { label: "Measurement & optimisation",h: 170, alt: false },
  { label: "Growth strategy",           h: 190, alt: false },
  { label: "Capital deployment",        h: 220, alt: true  },
];

const indStyles = {
  /* Section 1 — Today */
  section: {
    background: "var(--k-cotton)",
    color: "var(--k-charcoal)",
    padding: "140px 56px 80px",
    borderTop: "1px solid var(--k-stone)",
  },
  sectionLast: {
    background: "var(--k-cotton)",
    color: "var(--k-charcoal)",
    padding: "0 56px 160px",
  },
  inner: { maxWidth: 1320, margin: "0 auto" },
  head: {
    display: "grid", gridTemplateColumns: "1fr 1fr", gap: 80, alignItems: "end",
    marginBottom: 56,
  },
  eyebrow: { fontSize: 11, letterSpacing: "0.22em", textTransform: "uppercase", color: "var(--k-poppy)", marginBottom: 24, fontWeight: 600 },
  title: { fontFamily: "var(--serif)", fontWeight: 400, fontSize: "clamp(36px, 4.2vw, 60px)", lineHeight: 1.12, letterSpacing: "-0.01em", margin: 0 },
  sub: { fontSize: 17, lineHeight: 1.6, color: "var(--k-muted)", maxWidth: 480 },

  /* CMO bars — ascending purple */
  cmoRow: {
    display: "flex", alignItems: "flex-end",
    gap: 16,
    padding: "36px 0 28px",
    marginBottom: 40,
  },
  cmoStep: (h, alt) => ({
    flex: 1, height: h,
    background: alt ? "#7C5DBF" : "#C9B6F2",
    borderRadius: 4,
    display: "flex", alignItems: "center", justifyContent: "center",
    padding: "12px 14px",
    color: alt ? "var(--k-cotton)" : "var(--k-charcoal)",
    fontSize: 13, lineHeight: 1.2,
    fontWeight: 500, textAlign: "center",
  }),
  cmoBrace: {
    height: 24, position: "relative",
    marginTop: -10, marginBottom: 8,
  },
  cmoStat: {
    textAlign: "center",
    marginTop: 8, fontSize: 14,
    color: "var(--k-charcoal)",
    display: "flex", justifyContent: "center", alignItems: "baseline",
    gap: 18, flexWrap: "wrap",
  },
  cmoStatNum: {
    fontFamily: "var(--serif)", fontSize: 64, lineHeight: 1,
    color: "#7C5DBF", fontWeight: 400, letterSpacing: "-0.02em",
  },
  cmoStatText: { fontSize: 16, color: "var(--k-charcoal)", maxWidth: 380, textAlign: "left", lineHeight: 1.4 },
  cmoSrc: { fontSize: 11, color: "var(--k-muted)", letterSpacing: "0.1em", marginTop: 6 },

  /* Future rails */
  rail: {
    height: 38, borderRadius: 999,
    display: "flex", alignItems: "center", padding: "0 22px",
    fontWeight: 600, fontSize: 13,
    color: "var(--k-cotton)",
    marginTop: 14, letterSpacing: "0.02em",
  },
  railIntel: { background: "#D8C6F2", color: "var(--k-charcoal)" },
  railAgent: { background: "#7C5DBF" },
  railLead:  { background: "#5E3F9C", color: "var(--k-cotton)", justifyContent: "center" },
  futureChips: {
    display: "flex", gap: 16, marginTop: 48,
    alignItems: "center", flexWrap: "wrap",
  },
  fchip: {
    background: "var(--k-poppy)",
    color: "var(--k-cotton)",
    padding: "16px 28px",
    borderRadius: 10,
    fontWeight: 700, fontSize: 16,
    boxShadow: "0 10px 24px rgba(249,99,83,0.22)",
  },
  fchipArrow: { color: "var(--k-poppy)", fontSize: 24, fontFamily: "var(--serif)" },
  fchipNote: { marginLeft: "auto", fontSize: 14, color: "var(--k-muted)", maxWidth: 420, lineHeight: 1.55 },
};

function IndustryView() {
  return (
    <React.Fragment>
      {/* === Today === */}
      <section id="industry" style={indStyles.section} data-screen-label="05 Industry · Today">
        <div style={indStyles.inner}>
          <div style={indStyles.head}>
            <div>
              <div style={indStyles.eyebrow}>Industry view · Today · Where the time goes</div>
              <h2 style={indStyles.title}>
                CRM teams are stretched on <span className="serif-i" style={{color: "#7C5DBF"}}>execution</span>,<br/>
                not strategy.
              </h2>
            </div>
            <p style={indStyles.sub}>
              The work that compounds — strategy, growth, capital allocation —
              sits at the right of the chart. The work that consumes the day —
              planning, writing, execution — sits at the left. The 22.3M-contact,
              350M-send-a-year reality at N Brown sits squarely on the left.
            </p>
          </div>

          <div style={indStyles.cmoRow}>
            {CMO_STEPS.map((s, i) => (
              <div key={i} style={indStyles.cmoStep(s.h, s.alt)}>{s.label}</div>
            ))}
          </div>

          <div style={indStyles.cmoBrace}>
            <svg viewBox="0 0 1000 24" preserveAspectRatio="none" style={{width: "calc(83.3% - 16px)", height: 24, display: "block"}}>
              <path d="M2,2 C2,16 60,20 500,20 C940,20 998,16 998,2"
                fill="none" stroke="#F08A7E" strokeWidth="1.4"/>
            </svg>
          </div>

          <div style={indStyles.cmoStat}>
            <div style={indStyles.cmoStatNum}>80%</div>
            <div>
              <div style={indStyles.cmoStatText}>of CMO time spent in operational review, not strategy.</div>
              <div style={indStyles.cmoSrc}>SOURCE · DELOITTE CMO BENCHMARK</div>
            </div>
          </div>
        </div>
      </section>

      {/* === Future === */}
      <section style={indStyles.sectionLast} data-screen-label="05 Industry · Future">
        <div style={indStyles.inner}>
          <div style={indStyles.head}>
            <div>
              <div style={indStyles.eyebrow}>Industry view · The future · You set direction, AI runs the work</div>
              <h2 style={indStyles.title}>
                N Brown sets the strategy.<br/>
                <span className="serif-i" style={{color: "var(--k-poppy)"}}>AI runs the execution layer.</span>
              </h2>
            </div>
            <p style={indStyles.sub}>
              The Klaviyo Intelligence Layer takes the operational load off the
              team. Agent-assisted workloads handle planning, writing, execution
              and measurement. CRM and FS leadership stay on growth strategy and
              capital deployment — the part only a human can do well.
            </p>
          </div>

          <div style={indStyles.cmoRow}>
            {CMO_STEPS.map((s, i) => (
              <div key={i} style={indStyles.cmoStep(s.h, s.alt)}>{s.label}</div>
            ))}
          </div>

          {/* Intelligence + agent rails — span first five, then human-led caps the last */}
          <div style={{display: "grid", gridTemplateColumns: "5fr 1fr", gap: 16, marginTop: -6}}>
            <div>
              <div style={{...indStyles.rail, ...indStyles.railIntel}}>Klaviyo Intelligence Layer</div>
              <div style={{...indStyles.rail, ...indStyles.railAgent}}>Agent-assisted workloads</div>
            </div>
            <div>
              <div style={{...indStyles.rail, ...indStyles.railLead}}>Human-led</div>
            </div>
          </div>

          <div style={indStyles.futureChips}>
            <div style={indStyles.fchip}>Klaviyo Composer</div>
            <span style={indStyles.fchipArrow}>→</span>
            <div style={indStyles.fchip}>Klaviyo MCP Server</div>
            <span style={indStyles.fchipNote}>
              Two surfaces, one engine. Composer inside Klaviyo, MCP outside it —
              both grounded in the same N Brown account data. Up next, the AI
              that does it.
            </span>
          </div>
        </div>
      </section>
    </React.Fragment>
  );
}
