// homepage.jsx — full Wired CIO homepage. Uses OPSYS chrome from op-system.jsx.

const HP = OPSYS;

function HpHero() {
  return (
    <section style={{ background: HP.paper, borderBottom: `1px solid ${HP.rule}` }}>
      <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", background: HP.paperSoft, borderBottom: `1px solid ${HP.rule}`, fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.12em", color: HP.inkMute, textTransform: "uppercase" }}>
        {["ICP · 25–250 EMPLOYEES", "MICROSOFT-ALIGNED", "RUN · GROW · ALIGN", "EST. CHICAGO"].map((s, i) => (
          <div key={i} style={{ padding: "10px 24px", borderRight: i < 3 ? `1px solid ${HP.rule}` : "none" }}>{s}</div>
        ))}
      </div>
      <div style={{ padding: "84px 56px 0", display: "grid", gridTemplateColumns: "1fr 360px", gap: 64, alignItems: "start" }}>
        <div>
          <h1 style={{ fontFamily: HP.sans, fontWeight: 600, fontSize: 92, lineHeight: 0.96, letterSpacing: "-0.04em", color: HP.ink, margin: 0, textWrap: "balance" }}>
            The IT department of the future,
            <br />
            <span style={{ color: HP.signal, fontWeight: 600 }}>built for you.</span>
          </h1>
          <p style={{ fontFamily: HP.sans, fontSize: 21, lineHeight: 1.45, color: HP.inkSoft, margin: "32px 0 36px", maxWidth: 720 }}>
            There’s the technology that runs your business, and the technology that helps it grow. We do both — and we’re equipped for the regulatory frameworks that gate doing business in the industries that matter most.
          </p>
          <div style={{ display: "flex", gap: 8 }}>
            <a href="#contact" style={{ fontFamily: HP.sans, fontSize: 14, fontWeight: 600, color: HP.paper, background: HP.ink, padding: "14px 22px", textDecoration: "none", display: "flex", alignItems: "center", gap: 10 }}>
              Start a conversation <span style={{ color: HP.signalLite }}>→</span>
            </a>
            <a href="#how-we-work" style={{ fontFamily: HP.sans, fontSize: 14, fontWeight: 600, color: HP.ink, border: `1px solid ${HP.ink}`, padding: "13px 22px", textDecoration: "none" }}>
              See how we work
            </a>
          </div>
        </div>
        <aside style={{ background: HP.inkPanel, color: HP.paper, padding: 24, fontFamily: HP.mono, fontSize: 12, lineHeight: 1.6 }}>
          <div style={{ display: "flex", justifyContent: "space-between", marginBottom: 16 }}>
            <span style={{ color: HP.signalLite, letterSpacing: "0.12em", fontSize: 10 }}>POSITIONING.MD · v1.1</span>
            <span style={{ color: "rgba(247,246,241,0.4)", fontSize: 10 }}>LOCKED</span>
          </div>
          <div style={{ color: "rgba(247,246,241,0.85)" }}>
            <span style={{ color: HP.signalLite }}>$</span> wcio --describe
          </div>
          <div style={{ color: "rgba(247,246,241,0.6)", marginTop: 12, fontSize: 11 }}>
            <div>→ <span style={{ color: HP.paper }}>RUN</span> // tech that runs the business</div>
            <div>→ <span style={{ color: HP.paper }}>GROW</span> // tech that grows the business</div>
            <div>→ <span style={{ color: HP.paper }}>ALIGN</span> // FDA · CMMC · HIPAA · SOC 2</div>
          </div>
          <div style={{ borderTop: "1px solid rgba(255,255,255,0.1)", marginTop: 16, paddingTop: 14, color: "rgba(247,246,241,0.55)" }}>
            <div>SCOPE · most providers do one. we do both.</div>
            <div>TERMS · no minimums. no long contracts.</div>
            <div>DEPTH · M365 · BC · D365 · POWER BI · FABRIC · COPILOT</div>
          </div>
        </aside>
      </div>
      <div style={{ marginTop: 84, borderTop: `1px solid ${HP.rule}`, display: "grid", gridTemplateColumns: "repeat(4, 1fr)" }}>
        {STATS.map((s, i) => (
          <div key={i} style={{ padding: "28px 28px 24px", borderRight: i < 3 ? `1px solid ${HP.rule}` : "none" }}>
            <div style={{ fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.12em", color: HP.inkMute, marginBottom: 12 }}>
              {String(i + 1).padStart(2, "0")} / {String(STATS.length).padStart(2, "0")}
            </div>
            <div style={{ fontFamily: HP.sans, fontWeight: 600, fontSize: 38, lineHeight: 1, letterSpacing: "-0.03em", color: HP.ink }}>
              {s.value}
            </div>
            <div style={{ fontFamily: HP.sans, fontSize: 13, color: HP.inkSoft, marginTop: 10, lineHeight: 1.4 }}>{s.label}</div>
            {s.note && <div style={{ fontFamily: HP.mono, fontSize: 10, color: HP.inkMute, marginTop: 6 }}>{s.note}</div>}
          </div>
        ))}
      </div>
    </section>
  );
}

function HpLogos() {
  return (
    <section style={{ background: HP.paperSoft, padding: "26px 56px", borderBottom: `1px solid ${HP.rule}`, display: "flex", alignItems: "center", gap: 32 }}>
      <span style={{ fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.14em", textTransform: "uppercase", color: HP.inkMute, flex: "0 0 auto" }}>
        // OPERATING WITH
      </span>
      <div style={{ display: "flex", gap: 36, flexWrap: "wrap" }}>
        {CLIENT_LOGOS.map((c) => <ClientLogo key={c.name} name={c.name} mono={HP.ink} font={HP.sans} />)}
      </div>
    </section>
  );
}

function HpClaim() {
  return (
    <section id="how-we-work" style={{ background: HP.paper, padding: "120px 56px", borderBottom: `1px solid ${HP.rule}` }}>
      <div style={{ display: "grid", gridTemplateColumns: "200px 1fr", gap: 48, marginBottom: 56 }}>
        <OpTag color={HP.signal}>§ THE CLAIM</OpTag>
        <h2 style={{ fontFamily: HP.sans, fontSize: 52, lineHeight: 1.02, letterSpacing: "-0.03em", color: HP.ink, fontWeight: 600, margin: 0, textWrap: "balance" }}>
          Most MSPs run things. Most consultancies build things. The gap between them is where every IT problem lives.
        </h2>
      </div>
      <div style={{ display: "grid", gridTemplateColumns: "200px 1fr 1fr", gap: 48 }}>
        <div></div>
        <p style={{ fontFamily: HP.sans, fontSize: 17, lineHeight: 1.6, color: HP.inkSoft, margin: 0 }}>
          We do both. The team that keeps your endpoints alive is the same team that ships your Power BI rollout, your Business Central migration, your Copilot governance. The strategy holds together because the same people own it.
        </p>
        <p style={{ fontFamily: HP.sans, fontSize: 17, lineHeight: 1.6, color: HP.inkSoft, margin: 0 }}>
          And we’re equipped for the regulatory frameworks — FDA, CMMC, HIPAA, SOC 2 — where doing business depends on getting compliance right. Not as a checkbox. As a primary practice area.
        </p>
      </div>
      <div style={{ marginTop: 72, border: `1px solid ${HP.ruleStrong}`, background: HP.paperSoft }}>
        <div style={{ display: "grid", gridTemplateColumns: "180px repeat(3, 1fr)", background: HP.ink, color: HP.paper, fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.14em", textTransform: "uppercase" }}>
          {["FRAME", "RUN", "GROW", "ALIGN"].map((h, i) => (
            <div key={i} style={{ padding: "14px 20px", borderRight: i < 3 ? "1px solid rgba(255,255,255,0.1)" : "none", color: i === 0 ? "rgba(247,246,241,0.5)" : i === 3 ? HP.signalLite : HP.paper }}>{h}</div>
          ))}
        </div>
        {[
          ["WHAT IT IS", "Tech that runs your business", "Tech that helps it grow", "Frameworks that gate doing business"],
          ["WHO USES IT", "Everyone, all day", "Specific teams driving outcomes", "Auditors, regulators, your board"],
          ["GOOD LOOKS LIKE", "Boring. Reliable. Invisible.", "Powerful. Used. Drives decisions.", "Auditable. Continuous. Real."],
          ["MOST PROVIDERS", "Do this adequately", "Claim it, can't deliver", "Treat as checkbox"],
          ["WIRED CIO", "Do this well", "This is where depth shows", "Primary practice area"],
        ].map((row, i) => (
          <div key={i} style={{ display: "grid", gridTemplateColumns: "180px repeat(3, 1fr)", borderTop: `1px solid ${HP.rule}`, background: i === 4 ? HP.paper : "transparent" }}>
            {row.map((c, j) => (
              <div key={j} style={{ padding: "16px 20px", borderRight: j < 3 ? `1px solid ${HP.rule}` : "none", fontFamily: j === 0 ? HP.mono : HP.sans, fontSize: j === 0 ? 11 : 14, letterSpacing: j === 0 ? "0.12em" : "0", textTransform: j === 0 ? "uppercase" : "none", color: j === 0 ? HP.inkMute : i === 4 ? HP.ink : HP.inkSoft, fontWeight: i === 4 && j > 0 ? 600 : 400 }}>{c}</div>
            ))}
          </div>
        ))}
      </div>
    </section>
  );
}

function HpHubs() {
  const slug = (s) => s.toLowerCase().replace(/&\s+/g, "").replace(/\s+/g, "-");
  return (
    <section style={{ background: HP.paper, padding: "120px 56px", borderBottom: `1px solid ${HP.rule}` }}>
      <div style={{ display: "grid", gridTemplateColumns: "200px 1fr", gap: 48, marginBottom: 48 }}>
        <OpTag color={HP.signal}>§ HUBS</OpTag>
        <div>
          <h2 style={{ fontFamily: HP.sans, fontSize: 44, lineHeight: 1.02, letterSpacing: "-0.03em", color: HP.ink, fontWeight: 600, margin: "0 0 12px" }}>
            Four hubs. One team. Microsoft-deep across all of them.
          </h2>
          <p style={{ fontFamily: HP.sans, fontSize: 16, color: HP.inkMute, margin: 0, maxWidth: 640 }}>
            Compliance is a primary practice area, not a footnote. Sub-services per hub link through to the hub landing.
          </p>
        </div>
      </div>
      <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 1, background: HP.ruleStrong, border: `1px solid ${HP.ruleStrong}` }}>
        {HUBS.map((h, i) => (
          <a key={h.id} href={h.href} style={{ padding: 28, background: HP.paper, textDecoration: "none", color: "inherit", display: "flex", flexDirection: "column", minHeight: 360, transition: "background .15s" }}
             onMouseEnter={(e) => (e.currentTarget.style.background = HP.paperSoft)}
             onMouseLeave={(e) => (e.currentTarget.style.background = HP.paper)}>
            <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 26 }}>
              <span style={{ fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.14em", color: h.verb === "Align" ? HP.signal : HP.inkMute, fontWeight: 600 }}>
                HUB.0{i + 1} · {h.verb.toUpperCase()}
              </span>
              {[
                <svg key={0} width="20" height="20" viewBox="0 0 20 20"><rect x="2" y="2" width="7" height="7" fill={HP.ink}/><rect x="11" y="2" width="7" height="7" fill={HP.ink} opacity=".4"/><rect x="2" y="11" width="7" height="7" fill={HP.ink} opacity=".4"/><rect x="11" y="11" width="7" height="7" fill={HP.ink}/></svg>,
                <svg key={1} width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="8" fill="none" stroke={HP.ink} strokeWidth="1.5"/><circle cx="10" cy="10" r="3.5" fill={HP.ink}/></svg>,
                <svg key={2} width="20" height="20" viewBox="0 0 20 20"><path d="M2 14 L7 9 L11 12 L18 5" fill="none" stroke={HP.ink} strokeWidth="1.8"/><circle cx="2" cy="14" r="1.5" fill={HP.ink}/><circle cx="18" cy="5" r="1.5" fill={HP.ink}/></svg>,
                <svg key={3} width="20" height="20" viewBox="0 0 20 20"><path d="M10 2 L17 6 V11 C17 14.5 14 17 10 18 C6 17 3 14.5 3 11 V6 Z" fill="none" stroke={HP.signal} strokeWidth="1.5"/><path d="M7 10 L9 12 L13 8" fill="none" stroke={HP.signal} strokeWidth="1.5"/></svg>,
              ][i]}
            </div>
            <h3 style={{ fontFamily: HP.sans, fontSize: 26, fontWeight: 600, lineHeight: 1.1, letterSpacing: "-0.02em", color: HP.ink, margin: "0 0 10px" }}>
              {h.verb} · {h.name}
            </h3>
            <p style={{ fontFamily: HP.sans, fontSize: 14, lineHeight: 1.45, color: HP.inkSoft, margin: "0 0 22px" }}>{h.blurb}</p>
            <ul style={{ listStyle: "none", padding: 0, margin: 0, fontFamily: HP.mono, fontSize: 12, color: HP.inkSoft, borderTop: `1px solid ${HP.rule}` }}>
              {h.items.map((it) => (
                <li key={it} style={{ padding: "9px 0", borderBottom: `1px solid ${HP.rule}`, display: "flex", justifyContent: "space-between", alignItems: "center" }}>
                  <span>{it}</span>
                  <span style={{ color: HP.inkMute, fontSize: 10 }}>↗</span>
                </li>
              ))}
            </ul>
            <div style={{ marginTop: "auto", paddingTop: 22, fontFamily: HP.sans, fontSize: 13, fontWeight: 600, color: HP.signal }}>
              Open hub →
            </div>
          </a>
        ))}
      </div>
    </section>
  );
}

function HpCase() {
  return (
    <section style={{ background: HP.ink, color: HP.paper, padding: "120px 56px" }}>
      <div style={{ display: "grid", gridTemplateColumns: "200px 1fr", gap: 48, marginBottom: 48 }}>
        <span style={{ fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.14em", color: HP.signalLite, border: "1px solid rgba(255,255,255,0.18)", padding: "3px 7px", justifySelf: "start", display: "inline-block", alignSelf: "start" }}>§ CASE</span>
        <h2 style={{ fontFamily: HP.sans, fontSize: 48, lineHeight: 1.02, letterSpacing: "-0.03em", fontWeight: 600, margin: 0, textWrap: "balance" }}>
          Fourteen reports → one platform their tenants log into.
        </h2>
      </div>
      <div style={{ display: "grid", gridTemplateColumns: "200px 1fr 1fr", gap: 48 }}>
        <div>
          <div style={{ fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.14em", color: "rgba(247,246,241,0.5)", marginBottom: 12 }}>CLIENT</div>
          <div style={{ fontFamily: HP.sans, fontSize: 18, fontWeight: 600 }}>{CASE_STUDY.client}</div>
          <div style={{ fontFamily: HP.sans, fontSize: 13, color: "rgba(247,246,241,0.6)", marginTop: 4 }}>{CASE_STUDY.vertical}</div>
          <div style={{ fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.14em", color: "rgba(247,246,241,0.5)", margin: "28px 0 12px" }}>STACK</div>
          <div style={{ display: "flex", flexWrap: "wrap", gap: 6 }}>
            {["POWER BI", "FABRIC", "BC"].map((s) => (
              <span key={s} style={{ fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.1em", border: "1px solid rgba(255,255,255,0.18)", padding: "4px 8px", color: HP.signalLite }}>{s}</span>
            ))}
          </div>
        </div>
        <p style={{ fontFamily: HP.sans, fontSize: 17, lineHeight: 1.55, color: "rgba(247,246,241,0.85)", margin: 0 }}>{CASE_STUDY.narrative}</p>
        <div>
          {CASE_STUDY.metrics.map((m, i) => (
            <div key={i} style={{ borderTop: i === 0 ? "1px solid rgba(255,255,255,0.15)" : "none", borderBottom: "1px solid rgba(255,255,255,0.15)", padding: "16px 0", display: "grid", gridTemplateColumns: "auto 1fr", gap: 18, alignItems: "baseline" }}>
              <span style={{ fontFamily: HP.sans, fontWeight: 600, fontSize: 28, lineHeight: 1, letterSpacing: "-0.02em", color: HP.signalLite, minWidth: 100 }}>{m.v}</span>
              <span style={{ fontFamily: HP.sans, fontSize: 13, color: "rgba(247,246,241,0.7)", lineHeight: 1.4 }}>{m.l}</span>
            </div>
          ))}
          <a href={CASE_STUDY.href} style={{ display: "inline-block", marginTop: 28, fontFamily: HP.sans, fontSize: 14, fontWeight: 600, color: HP.ink, background: HP.signalLite, padding: "12px 20px", textDecoration: "none" }}>
            Read the case study →
          </a>
        </div>
      </div>
    </section>
  );
}

function HpFounders() {
  return (
    <section id="about" style={{ background: HP.paper, padding: "120px 56px", borderBottom: `1px solid ${HP.rule}` }}>
      <div style={{ display: "grid", gridTemplateColumns: "200px 1fr", gap: 48, marginBottom: 48 }}>
        <OpTag color={HP.signal}>§ TEAM</OpTag>
        <h2 style={{ fontFamily: HP.sans, fontSize: 44, lineHeight: 1.02, letterSpacing: "-0.03em", color: HP.ink, fontWeight: 600, margin: 0, maxWidth: 800 }}>
          Real people, named credentials. Armin and Phil are the public-facing voice.
        </h2>
      </div>
      <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 1, background: HP.ruleStrong, border: `1px solid ${HP.ruleStrong}` }}>
        {FOUNDERS.map((f, i) => (
          <div key={f.name} style={{ background: HP.paper, display: "grid", gridTemplateRows: "auto auto auto auto 1fr auto" }}>
            <PortraitPlaceholder initials={f.initials} bg={i < 2 ? HP.ink : HP.paperSoft} fg={i < 2 ? HP.signalLite : HP.ink} ratio="5 / 4" note={i < 2 ? "FEATURED · TBD" : "TBD"} />
            <div style={{ padding: "20px 22px 8px", borderTop: `1px solid ${HP.rule}` }}>
              <div style={{ fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.12em", color: i < 2 ? HP.signal : HP.inkMute, marginBottom: 8 }}>{f.role.toUpperCase()}</div>
              <h3 style={{ fontFamily: HP.sans, fontSize: 20, fontWeight: 600, letterSpacing: "-0.01em", color: HP.ink, margin: 0 }}>{f.name}</h3>
            </div>
            <p style={{ padding: "0 22px 22px", fontFamily: HP.sans, fontSize: 13, lineHeight: 1.55, color: HP.inkSoft, margin: 0 }}>{f.line}</p>
            <div style={{ borderTop: `1px solid ${HP.rule}`, padding: "10px 22px", fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.1em", color: HP.inkMute, display: "flex", justifyContent: "space-between" }}>
              <span>PROFILE</span><span>0{i + 1} / 04</span>
            </div>
          </div>
        ))}
      </div>
    </section>
  );
}

function HpInsights() {
  return (
    <section id="insights" style={{ background: HP.paperSoft, padding: "120px 56px", borderBottom: `1px solid ${HP.rule}` }}>
      <div style={{ display: "grid", gridTemplateColumns: "200px 1fr auto", gap: 48, alignItems: "baseline", marginBottom: 36 }}>
        <OpTag color={HP.signal}>§ INSIGHTS</OpTag>
        <h2 style={{ fontFamily: HP.sans, fontSize: 36, lineHeight: 1.05, letterSpacing: "-0.025em", color: HP.ink, fontWeight: 600, margin: 0 }}>
          What we’ve been writing.
        </h2>
        <a href="#insights" style={{ fontFamily: HP.sans, fontSize: 14, fontWeight: 600, color: HP.signal, textDecoration: "none" }}>All insights →</a>
      </div>
      <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 1, background: HP.rule, border: `1px solid ${HP.rule}` }}>
        {INSIGHTS.map((p, i) => (
          <a key={i} href="#" style={{ padding: 24, background: HP.paper, textDecoration: "none", color: "inherit", display: "flex", flexDirection: "column", minHeight: 280 }}>
            <div style={{ display: "flex", justifyContent: "space-between", marginBottom: 18, fontFamily: HP.mono, fontSize: 10, letterSpacing: "0.12em", color: HP.inkMute }}>
              <span style={{ color: HP.signal }}>{p.tag}</span><span>{p.minutes} MIN</span>
            </div>
            <h3 style={{ fontFamily: HP.sans, fontSize: 19, fontWeight: 600, lineHeight: 1.2, letterSpacing: "-0.015em", color: HP.ink, margin: "0 0 12px" }}>{p.title}</h3>
            <p style={{ fontFamily: HP.sans, fontSize: 13, lineHeight: 1.5, color: HP.inkSoft, margin: 0 }}>{p.excerpt}</p>
            <div style={{ marginTop: "auto", paddingTop: 22, fontFamily: HP.mono, fontSize: 10, color: HP.inkMute, letterSpacing: "0.08em" }}>BY {p.author.toUpperCase()}</div>
          </a>
        ))}
      </div>
    </section>
  );
}

function HpFlex() {
  return (
    <section style={{ background: HP.paper, padding: "120px 56px", borderBottom: `1px solid ${HP.rule}` }}>
      <div style={{ display: "grid", gridTemplateColumns: "200px 1fr", gap: 48, marginBottom: 36 }}>
        <OpTag color={HP.signal}>§ TERMS</OpTag>
        <h2 style={{ fontFamily: HP.sans, fontSize: 52, lineHeight: 1.02, letterSpacing: "-0.03em", color: HP.ink, fontWeight: 600, margin: 0 }}>
          On your terms, not ours.
        </h2>
      </div>
      <div style={{ display: "grid", gridTemplateColumns: "200px 1fr", gap: 48 }}>
        <div></div>
        <div style={{ borderTop: `1px solid ${HP.rule}` }}>
          {COPY.flex.map((f, i) => (
            <div key={i} style={{ display: "grid", gridTemplateColumns: "60px 24px 1fr", gap: 24, padding: "22px 0", borderBottom: `1px solid ${HP.rule}`, alignItems: "center" }}>
              <span style={{ fontFamily: HP.mono, fontSize: 11, color: HP.signal, letterSpacing: "0.1em" }}>✓ TRUE</span>
              <span style={{ fontFamily: HP.mono, fontSize: 11, color: HP.inkMute }}>0{i + 1}</span>
              <span style={{ fontFamily: HP.sans, fontSize: 22, lineHeight: 1.3, color: HP.ink, fontWeight: 500 }}>{f}</span>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

function HomePage() {
  return (
    <>
      <OpHeader active={null} />
      <HpHero />
      <HpLogos />
      <HpClaim />
      <HpHubs />
      <HpCase />
      <HpFounders />
      <HpInsights />
      <HpFlex />
      <OpClosingCta />
      <OpFooter />
    </>
  );
}

ReactDOM.createRoot(document.getElementById("root")).render(<HomePage />);
