// v2 page shared components.
// (pmc-v2, owner-operator-v2, tax-recapture-v2).
//
// Re-uses the brand atoms from components.jsx (Wordmark, Eyebrow, Rule,
// TrustBadge, Section, SectionHead, FeatureStack) and adds:
//   • PageNav         — top nav with real <a href> links between v2 pages
//   • SegmentSwitch   — slim navy bar offering the other audience path
//   • Hero            — extended to accept an `eyebrow` slot above the headline
//   • SummaryCard     — multi-item white card to the right of the hero
//   • ServiceBlock    — image + content + companion visual, alt/reverse variants
//   • FlowVisual      — numbered card with steps + outcome footer
//   • FooterCTA       — clean-slate CTA strip with two buttons (primary + spark)
//   • PageFooter      — three-link footer with brand wordmark + privacy

// Overwrite the components.jsx Hero with a version that supports eyebrow.
function HeroV2({ eyebrow, headline, sub, badge, card, image, imageAlt }) {
  return (
    <section style={{
      background: "#25476c",
      padding: "100px clamp(24px, 7vw, 112px) 80px",
    }}>
      <div style={{
        maxWidth: 1280, margin: "0 auto",
        display: "grid",
        gridTemplateColumns: "minmax(0, 1.2fr) minmax(0, 1fr)",
        gap: 48, alignItems: "center",
      }}>
        <div>
          {eyebrow && (
            <span style={{
              display: "inline-block",
              color: "#f9a727",
              fontSize: 12,
              fontWeight: 700,
              letterSpacing: "2px",
              textTransform: "uppercase",
              marginBottom: 18,
            }}>{eyebrow}</span>
          )}
          <h1 style={{
            color: "#fff", fontWeight: 900,
            fontSize: "clamp(38px, 4.5vw, 58px)",
            letterSpacing: "-2px", lineHeight: 1.07, margin: "0 0 18px",
          }}>{headline}</h1>
          <p style={{
            color: "rgba(255,255,255,0.78)",
            fontSize: 18, lineHeight: 1.55, maxWidth: 540, margin: "0 0 24px",
          }}>{sub}</p>
          {badge && <TrustBadge tokens={badge} onDark/>}
        </div>
        {image ? (
          <div style={{
            borderRadius: 16,
            overflow: "hidden",
            aspectRatio: "4 / 3",
            boxShadow: "0 18px 40px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.18)",
          }}>
            <img src={image} alt={imageAlt || ""} style={{
              width: "100%", height: "100%", objectFit: "cover", display: "block",
            }}/>
          </div>
        ) : card}
      </div>
    </section>
  );
}
// Make `Hero` resolve to the V2 version inside this script's scope.
// (components.jsx's Hero stays available as window.Hero for index.html.)
const Hero = HeroV2;

// ────────────────────────────────────────────────────────────
// PageNav — top nav for standalone v2 pages
// ────────────────────────────────────────────────────────────
function PageNav({ current }) {
  const items = [
    { id: "home",   label: "Home",              href: "/" },
    { id: "pmc",    label: "Property Managers", href: "/pmc" },
    { id: "owner",  label: "Property Owners",   href: "/owner-operator" },
    { id: "tax",    label: "Tax Recapture",     href: "/tax-recapture" },
    { id: "energy", label: "Energy Revenue",    href: "/energy-revenue.html" },
  ];
  return (
    <nav style={{
      background: "#1a3352",
      padding: "18px clamp(24px, 7vw, 112px)",
      display: "flex",
      alignItems: "center",
      justifyContent: "space-between",
      gap: 24,
      flexWrap: "wrap",
    }}>
      <a href="index.html" style={{ textDecoration: "none" }}>
        <Wordmark onDark/>
      </a>
      <div style={{ display: "flex", gap: 26, alignItems: "center", flexWrap: "wrap" }}>
        {items.map(it => (
          <a key={it.id} href={it.href}
             style={{
               color: current === it.id ? "#fff" : "rgba(255,255,255,0.78)",
               fontSize: 14, fontWeight: 500, textDecoration: "none",
               borderBottom: current === it.id ? "1px solid #f9a727" : "1px solid transparent",
               paddingBottom: 2,
               transition: "color 220ms",
             }}>
            {it.label}
          </a>
        ))}
        <a href={window.VIDEO_INTRO_3MIN || "#"} rel="noopener" className="btn"
           onClick={function (e) {
             if (window.openVideoGate) {
               e.preventDefault();
               window.openVideoGate({
                 videoSrc: window.VIDEO_INTRO_3MIN,
                 videoTitle: "Three-minute introduction",
                 videoId: "intro",
                 endCta: { type: "audience-picker" }
               });
             }
           }}
           style={{
             padding: "10px 18px 10px 12px", fontSize: 13,
             display: "inline-flex", alignItems: "center", gap: 8,
           }}>
          <span aria-hidden="true" style={{
            width: 20, height: 20, borderRadius: "50%",
            background: "rgba(255,255,255,0.18)",
            display: "inline-flex", alignItems: "center", justifyContent: "center",
            flexShrink: 0,
          }}>
            <svg width="8" height="9" viewBox="0 0 8 9" fill="none" aria-hidden="true">
              <path d="M0.5 0.5L7.5 4.5L0.5 8.5V0.5Z" fill="currentColor"/>
            </svg>
          </span>
          Three-minute introduction
        </a>
      </div>
    </nav>
  );
}

// ────────────────────────────────────────────────────────────
// SegmentSwitch — slim navy bar above hero
// ────────────────────────────────────────────────────────────
function SegmentSwitch({ href, label, cta }) {
  return (
    <div style={{
      background: "#1a3352",
      padding: "14px clamp(24px, 7vw, 112px)",
      borderTop: "1px solid rgba(255,255,255,0.06)",
    }}>
      <div style={{ maxWidth: 1280, margin: "0 auto",
                    display: "flex", alignItems: "center", gap: 10, flexWrap: "wrap" }}>
        <span style={{ color: "rgba(255,255,255,0.6)", fontSize: 13 }}>{label}</span>
        <a href={href}
           style={{ color: "#f9a727", fontSize: 13, fontWeight: 600, textDecoration: "none" }}>
          {cta} →
        </a>
      </div>
    </div>
  );
}

// ────────────────────────────────────────────────────────────
// SummaryCard — multi-item white card placed in hero
// ────────────────────────────────────────────────────────────
function SummaryCard({ eyebrow, title, items, footer }) {
  return (
    <div style={{
      background: "#fff",
      borderRadius: 16,
      padding: "28px 30px",
      boxShadow: "0 18px 40px rgba(0,0,0,0.20), 0 2px 8px rgba(0,0,0,0.10)",
    }}>
      <span style={{
        color: "#f14721", fontSize: 11, fontWeight: 700, letterSpacing: "2px",
        textTransform: "uppercase", display: "block", marginBottom: 10,
      }}>{eyebrow}</span>
      <h3 style={{
        color: "#25476c", fontWeight: 800, fontSize: 22, margin: "0 0 22px",
        lineHeight: 1.25,
      }}>{title}</h3>

      {items.map((it, i) => (
        <div key={i} style={{
          display: "grid",
          gridTemplateColumns: "32px 1fr",
          gap: 14,
          padding: "14px 0",
          borderTop: i === 0 ? "1px solid #dde4ec" : 0,
          borderBottom: "1px solid #dde4ec",
          alignItems: "start",
        }}>
          <span aria-hidden="true" style={{
            width: 32, height: 32, borderRadius: 8,
            background: it.tone === "amber" ? "rgba(249,167,39,0.12)" : "rgba(37,71,108,0.08)",
            display: "inline-flex", alignItems: "center", justifyContent: "center",
          }}>
            {it.tone === "amber" ? (
              <svg width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="#f9a727" strokeWidth="2.4"><path strokeLinecap="round" strokeLinejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z"/></svg>
            ) : (
              <svg width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="#25476c" strokeWidth="2.4"><path strokeLinecap="round" strokeLinejoin="round" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16l3.5-2 3.5 2 3.5-2 3.5 2z"/></svg>
            )}
          </span>
          <div>
            <div style={{ fontWeight: 800, fontSize: 15, color: "#25476c", marginBottom: 4 }}>{it.label}</div>
            <div style={{ fontSize: 14, color: "#5a6a7a", lineHeight: 1.55 }}>{it.body}</div>
          </div>
        </div>
      ))}

      {footer && (
        <div style={{
          display: "flex", alignItems: "center", gap: 10,
          marginTop: 16, color: "#25476c", fontSize: 13, fontWeight: 600,
        }}>
          <svg width="14" height="14" fill="none" viewBox="0 0 24 24" stroke="#f9a727" strokeWidth="2.5"><path strokeLinecap="round" strokeLinejoin="round" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg>
          {footer}
        </div>
      )}
    </div>
  );
}

// ────────────────────────────────────────────────────────────
// ServiceBlock — full alternating section
//   Layout: optional image strip, then 2-col [content | visual]
// ────────────────────────────────────────────────────────────
function ServiceBlock({
  alt = false, reverse = false,
  image, imageAlt,
  tag, eyebrow, title, intro,
  features, cta, visual,
}) {
  const bg = alt ? "var(--clean-slate)" : "#fff";
  const left = (
    <div>
      {tag && (
        <div style={{
          display: "inline-flex", alignItems: "center", gap: 8,
          background: "rgba(37,71,108,0.06)", borderRadius: 999,
          padding: "5px 12px", fontSize: 12, fontWeight: 700,
          color: "#25476c", letterSpacing: "0.4px", marginBottom: 16,
        }}>
          <span style={{
            width: 6, height: 6, borderRadius: "50%", background: "#f9a727",
          }}/>
          {tag}
        </div>
      )}
      <Eyebrow>{eyebrow}</Eyebrow>
      <Rule/>
      <h2 style={{
        color: "#25476c", fontWeight: 900,
        fontSize: "clamp(28px, 3.4vw, 38px)",
        letterSpacing: "-0.6px", lineHeight: 1.15, margin: "0 0 18px",
      }}>{title}</h2>
      {intro && (
        <p style={{ color: "#5a6a7a", fontSize: 17, lineHeight: 1.65,
                    maxWidth: 560, margin: "0 0 24px" }}>{intro}</p>
      )}
      <FeatureStack items={features}/>
      {cta && (() => {
        const renderCta = (c, idx) => (
          c.video ? (
            <a key={idx} href={c.href} rel="noopener" className="btn"
               onClick={function (e) {
                 if (window.openVideoGate) {
                   e.preventDefault();
                   window.openVideoGate({
                     videoSrc: c.href,
                     videoTitle: c.videoTitle || c.label,
                     videoId: c.videoId,
                     endCta: c.endCta
                   });
                 }
               }}
               style={{
                 padding: "14px 22px 14px 14px",
                 fontSize: "var(--fs-button)",
                 display: "inline-flex", alignItems: "center", gap: 10,
               }}>
              <span aria-hidden="true" style={{
                width: 22, height: 22, borderRadius: "50%",
                background: "rgba(255,255,255,0.18)",
                display: "inline-flex", alignItems: "center", justifyContent: "center",
                flexShrink: 0,
              }}>
                <svg width="9" height="10" viewBox="0 0 8 9" fill="none" aria-hidden="true">
                  <path d="M0.5 0.5L7.5 4.5L0.5 8.5V0.5Z" fill="currentColor"/>
                </svg>
              </span>
              {c.label}
            </a>
          ) : (
            <a key={idx} href={c.href} className="btn btn--spark"
               style={{ display: "inline-flex", alignItems: "center", gap: 8 }}>
              {c.label}
              <svg width="14" height="14" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth="2.5"><path strokeLinecap="round" strokeLinejoin="round" d="M17 8l4 4m0 0l-4 4m4-4H3"/></svg>
            </a>
          )
        );
        const ctas = Array.isArray(cta) ? cta : [cta];
        return (
          <div style={{ marginTop: 28, display: "flex", flexWrap: "wrap", gap: 12, alignItems: "center" }}>
            {ctas.map(renderCta)}
          </div>
        );
      })()}
    </div>
  );
  return (
    <Section bg={bg} style={{ paddingTop: 80, paddingBottom: 96 }}>
      {image && (
        <div style={{
          borderRadius: 16, overflow: "hidden",
          marginBottom: 56,
          boxShadow: "0 8px 24px rgba(26,51,82,0.10), 0 1px 4px rgba(26,51,82,0.06)",
          aspectRatio: "16 / 9",
        }}>
          <img src={image} alt={imageAlt || ""}
               style={{ width: "100%", height: "100%", objectFit: "cover", display: "block" }}/>
        </div>
      )}
      <div style={{
        display: "grid",
        gridTemplateColumns: "minmax(0, 1fr) minmax(0, 1fr)",
        gap: 56, alignItems: "start",
      }}>
        {reverse
          ? (<>
              <div>{visual}</div>
              {left}
            </>)
          : (<>
              {left}
              <div>{visual}</div>
            </>)
        }
      </div>
    </Section>
  );
}

// ────────────────────────────────────────────────────────────
// FlowVisual — numbered card next to a ServiceBlock
// ────────────────────────────────────────────────────────────
function FlowVisual({ title, steps, result }) {
  return (
    <div style={{
      background: "#fff",
      border: "1px solid #dde4ec",
      borderRadius: 16,
      padding: "28px 32px",
      boxShadow: "0 4px 16px rgba(26,51,82,0.06), 0 1px 4px rgba(26,51,82,0.04)",
    }}>
      <div style={{
        fontSize: 11, fontWeight: 700, letterSpacing: "2px", textTransform: "uppercase",
        color: "#f14721", marginBottom: 8,
      }}>How it works</div>
      <div style={{
        fontSize: 18, fontWeight: 800, color: "#25476c",
        margin: "0 0 18px", letterSpacing: "-0.2px",
      }}>{title}</div>

      <div>
        {steps.map((s, i) => (
          <div key={i} style={{
            display: "grid",
            gridTemplateColumns: "32px 1fr",
            gap: 14,
            padding: "14px 0",
            borderTop: "1px solid #dde4ec",
            alignItems: "start",
          }}>
            <span style={{
              width: 28, height: 28, borderRadius: "50%",
              background: "#25476c", color: "#fff",
              display: "inline-flex", alignItems: "center", justifyContent: "center",
              fontWeight: 700, fontSize: 13, letterSpacing: "0.3px",
            }}>{i + 1}</span>
            <div>
              <div style={{ fontWeight: 700, fontSize: 15, color: "#25476c", marginBottom: 4 }}>{s.label}</div>
              <div style={{ fontSize: 14, color: "#5a6a7a", lineHeight: 1.55 }}>{s.body}</div>
            </div>
          </div>
        ))}
      </div>

      {result && (
        <div style={{
          marginTop: 22,
          padding: "16px 18px",
          background: "#f4f3ef",
          borderRadius: 12,
          borderLeft: "3px solid #f9a727",
        }}>
          <div style={{
            fontSize: 11, fontWeight: 700, letterSpacing: "2px", textTransform: "uppercase",
            color: "#5a6a7a", marginBottom: 6,
          }}>{result.label}</div>
          <div style={{ fontSize: 15, fontWeight: 600, color: "#25476c", lineHeight: 1.5 }}>{result.body}</div>
        </div>
      )}
    </div>
  );
}

// ────────────────────────────────────────────────────────────
// RevenueFlow — vertical linear flow graphic (numbered nodes strung along an amber wire)
// ────────────────────────────────────────────────────────────
const _flowIcons = {
  doc:  <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><polyline points="9 15 11 17 15 13"/></svg>,
  bolt: <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>,
  coin: <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="9"/><path d="M15 9.5h-3.75a1.75 1.75 0 0 0 0 3.5h2.5a1.75 1.75 0 0 1 0 3.5H9.5"/><path d="M12 6.5v2M12 16.5v2"/></svg>,
  exit: <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>,
  search: <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16" y2="16"/></svg>,
  sign:  <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L13 14l-4 1 1-4 8.5-8.5z"/></svg>,
  gear:  <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h0a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h0a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v0a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>,
};

function RevenueFlow({ title, eyebrow = "How it works", steps, result, iconKeys = ["doc","bolt","coin","exit"], chromeless = false }) {
  const RAIL_X = 28; // px — center of the vertical "wire"
  const NODE = 56;   // px — node diameter

  return (
    <div style={chromeless ? {} : {
      background: "#fff",
      border: "1px solid #dde4ec",
      borderRadius: 16,
      padding: "28px 32px 32px",
      boxShadow: "0 4px 16px rgba(26,51,82,0.06), 0 1px 4px rgba(26,51,82,0.04)",
    }}>
      {eyebrow && (
        <div style={{
          fontSize: 11, fontWeight: 700, letterSpacing: "2px", textTransform: "uppercase",
          color: "#f14721", marginBottom: 8,
        }}>{eyebrow}</div>
      )}
      {title && (
        <div style={{
          fontSize: 18, fontWeight: 800, color: "#25476c",
          margin: "0 0 22px", letterSpacing: "-0.2px",
        }}>{title}</div>
      )}

      <div style={{ position: "relative", paddingLeft: 0 }}>
        {steps.map((s, i) => {
          const isLast = i === steps.length - 1;
          return (
            <div key={i} style={{ position: "relative" }}>
              {/* Step row */}
              <div style={{
                display: "grid",
                gridTemplateColumns: `${RAIL_X * 2}px 1fr`,
                gap: 18,
                alignItems: "start",
                paddingTop: i === 0 ? 0 : 0,
              }}>
                {/* Icon node */}
                <div style={{ position: "relative", width: RAIL_X * 2, height: NODE, display: "flex", justifyContent: "center" }}>
                  <div style={{
                    width: NODE, height: NODE, borderRadius: "50%",
                    background: "#25476c",
                    color: "#f9a727",
                    display: "flex", alignItems: "center", justifyContent: "center",
                    boxShadow: "0 4px 10px rgba(26,51,82,0.18), 0 1px 3px rgba(26,51,82,0.10)",
                    border: "3px solid #fff",
                    position: "relative",
                    zIndex: 1,
                  }}>
                    {_flowIcons[iconKeys[i]] || null}
                  </div>
                  {/* Step-number chip */}
                  <span style={{
                    position: "absolute",
                    top: -4, right: 4,
                    width: 22, height: 22, borderRadius: "50%",
                    background: "#f9a727", color: "#25476c",
                    display: "inline-flex", alignItems: "center", justifyContent: "center",
                    fontWeight: 800, fontSize: 11, letterSpacing: "0.3px",
                    border: "2px solid #fff",
                    zIndex: 2,
                  }}>{i + 1}</span>
                </div>
                {/* Text */}
                <div style={{ paddingTop: 6 }}>
                  <div style={{
                    fontWeight: 800, fontSize: 16, color: "#25476c",
                    lineHeight: 1.3, marginBottom: 4, letterSpacing: "-0.2px",
                  }}>{s.label}</div>
                  {s.body && (
                    <div style={{ fontSize: 14, color: "#5a6a7a", lineHeight: 1.55 }}>{s.body}</div>
                  )}
                </div>
              </div>

              {/* Connector wire to next node (sits underneath the next icon) */}
              {!isLast && (
                <div style={{
                  width: RAIL_X * 2,
                  display: "flex", justifyContent: "center",
                  height: 28,
                }}>
                  <svg width="14" height="28" viewBox="0 0 14 28" style={{ display: "block" }}>
                    <line x1="7" y1="0" x2="7" y2="22" stroke="#f9a727" strokeWidth="2.5" strokeLinecap="round"/>
                    <polyline points="3,18 7,24 11,18" fill="none" stroke="#f9a727" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
                  </svg>
                </div>
              )}
            </div>
          );
        })}
      </div>

      {result && (
        <div style={{
          marginTop: 32,
          padding: "16px 18px",
          background: "#f4f3ef",
          borderRadius: 12,
          borderLeft: "3px solid #f9a727",
        }}>
          <div style={{
            fontSize: 11, fontWeight: 700, letterSpacing: "2px", textTransform: "uppercase",
            color: "#5a6a7a", marginBottom: 6,
          }}>{result.label}</div>
          <div style={{ fontSize: 15, fontWeight: 600, color: "#25476c", lineHeight: 1.5 }}>{result.body}</div>
        </div>
      )}
    </div>
  );
}

// ────────────────────────────────────────────────────────────
// FooterCTA — page footer CTA strip (clean-slate)
// ────────────────────────────────────────────────────────────
function FooterCTA({ eyebrow, headline, sub, ctaPrimary, ctaSecondary, bg = "#fff" }) {
  return (
    <section style={{
      background: bg,
      padding: "100px clamp(24px, 7vw, 112px)",
      textAlign: "center",
    }}>
      <div style={{ maxWidth: 720, margin: "0 auto" }}>
        {eyebrow && <Eyebrow>{eyebrow}</Eyebrow>}
        <h2 style={{
          color: "#25476c", fontWeight: 900,
          fontSize: "clamp(28px, 3.5vw, 42px)",
          letterSpacing: "-0.8px", margin: "8px 0 16px", lineHeight: 1.15,
        }}>{headline}</h2>
        <p style={{
          color: "#5a6a7a", fontSize: 18,
          lineHeight: 1.55, margin: "0 0 28px",
        }}>{sub}</p>
        <div style={{ display: "flex", gap: 12, justifyContent: "center", flexWrap: "wrap" }}>
          {ctaPrimary && (
            <a href={ctaPrimary.href || "#"}
               onClick={ctaPrimary.onClick ? (e) => { e.preventDefault(); ctaPrimary.onClick(); } : undefined}
               className="btn btn--spark"
               style={{ display: "inline-flex", alignItems: "center", gap: 8 }}>
              {ctaPrimary.label}
              <svg width="14" height="14" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth="2.5"><path strokeLinecap="round" strokeLinejoin="round" d="M17 8l4 4m0 0l-4 4m4-4H3"/></svg>
            </a>
          )}
          {ctaSecondary && (
            <a href={ctaSecondary.href || "#"}
               onClick={ctaSecondary.onClick ? (e) => { e.preventDefault(); ctaSecondary.onClick(); } : undefined}
               className="btn btn--spark"
               style={{ display: "inline-flex", alignItems: "center", gap: 8 }}>
              {ctaSecondary.label}
              <svg width="14" height="14" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth="2.5"><path strokeLinecap="round" strokeLinejoin="round" d="M17 8l4 4m0 0l-4 4m4-4H3"/></svg>
            </a>
          )}
        </div>
      </div>
    </section>
  );
}

// ────────────────────────────────────────────────────────────
// PageFooter — multi-link bottom footer
// ────────────────────────────────────────────────────────────
function PageFooter() {
  return (
    <footer style={{
      background: "#1a3352",
      padding: "40px clamp(24px, 7vw, 112px)",
      borderTop: "1px solid rgba(255,255,255,0.08)",
    }}>
      <div style={{
        maxWidth: 1280, margin: "0 auto",
        display: "flex", alignItems: "center", justifyContent: "space-between",
        flexWrap: "wrap", gap: 20,
      }}>
        <a href="index.html" style={{ textDecoration: "none" }}>
          <Wordmark onDark size={18}/>
        </a>
        <ul style={{ listStyle: "none", display: "flex", gap: 24, margin: 0, padding: 0, flexWrap: "wrap" }}>
          <li><a href="pmc.html"           style={fLink}>Property Managers</a></li>
          <li><a href="owner-operator.html" style={fLink}>Property Owners</a></li>
          <li><a href="tax-recapture.html"  style={fLink}>Tax Recapture</a></li>
          <li><a href="privacy.html"           style={fLink}>Privacy</a></li>
          <li><a href="mailto:info@powercordenergy.com" style={fLink}>Contact</a></li>
        </ul>
      </div>
      <p style={{
        margin: "20px auto 0", maxWidth: 1280,
        color: "rgba(255,255,255,0.45)", fontSize: 12, lineHeight: 1.6,
      }}>
        © 2026 PowerCord Energy LLC. All rights reserved. &nbsp;|&nbsp;
        3400 N. Central Expwy, Stes. 110-277, Richardson, Texas 75080
      </p>
    </footer>
  );
}
const fLink = { color: "rgba(255,255,255,0.7)", fontSize: 13, textDecoration: "none" };

// Expose so individual page scripts can use them.
// NOTE: each Babel <script> has its own local scope, so `const Hero = HeroV2`
// above only applies inside this file. To let page scripts write `<Hero>`
// and resolve to the V2 hero, we overwrite `window.Hero` here. components.jsx's
// original Hero is still safe to use inside index.html because its `App` script
// references `Hero` from its own local scope chain — but we re-export it here
// just in case anyone else needs it.
Object.assign(window, {
  HeroV2, Hero: HeroV2,           // <Hero> in v2 page scripts → HeroV2
  PageNav, SegmentSwitch, SummaryCard,
  ServiceBlock, FlowVisual,
  FooterCTA,                      // overrides components.jsx FooterCTA (different signature)
  PageFooter,
});
