// app.jsx — MIBH Commercial Roofing.
// Multi-page (hash-routed) marketing site written for the GC audience: MIBH is the
// roofing subcontractor South Florida general contractors bid and build with.
// Type system: Archivo (display, heavy) · IBM Plex Sans (body) · IBM Plex Mono (spec stamps).
//
// NOTE: Numbers/claims flagged /*VERIFY*/ come from the blueprint as placeholders and must
// be confirmed against reality before this ever goes to production.

const { useState, useEffect, useRef, useMemo } = React;

const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
  "theme": "dark",
  "accent": "#c28933"
}/*EDITMODE-END*/;

const ACCENT_SWATCHES = ["#c28933", "#e0ae55", "#c9412a", "#7fa3b8"];

const PHONE_DISPLAY = "(305) 746-7307";
const PHONE_HREF = "tel:+13057467307";
const BIDS_EMAIL = "bids@mibhcommercialroofing.com";
const BIDS_HREF = "mailto:" + BIDS_EMAIL + "?subject=" + encodeURIComponent("Bid Request — MIBH Commercial Roofing") +
  "&body=" + encodeURIComponent("Project / GC:\nLocation:\nRoof size (sqft):\nSystem (if known):\nTarget dry-in / turnover date:\nPlans attached: ");

// ────────────────────────────────────────────────────────────────────────────
// ROUTING — tiny hash router. #/services, #/work, etc. Anything else → home.
// ────────────────────────────────────────────────────────────────────────────
const NAV = [
  { label: "Services", route: "services" },
  { label: "Systems", route: "systems" },
  { label: "Work", route: "work" },
  { label: "About", route: "about" },
  { label: "Markets", route: "markets" },
];
const ROUTES = NAV.map(n => n.route);

function currentRoute() {
  const h = (window.location.hash || "").replace(/^#\/?/, "").split(/[?#]/)[0].toLowerCase();
  return ROUTES.includes(h) ? h : "home";
}
function useHashRoute() {
  const [route, setRoute] = useState(currentRoute);
  useEffect(() => {
    const onHash = () => { setRoute(currentRoute()); window.scrollTo(0, 0); };
    window.addEventListener("hashchange", onHash);
    return () => window.removeEventListener("hashchange", onHash);
  }, []);
  return route;
}

// ────────────────────────────────────────────────────────────────────────────
// Spec-stamp — the signature "engineering stamp" device. Mono, tracked, gold tick.
// Reserved for FACTS only (NOA #, wind rating, license, sqft) — never prose.
// ────────────────────────────────────────────────────────────────────────────
function Stamp({ children, tick = true, style }) {
  return (
    <span style={{ display: "inline-flex", alignItems: "center", gap: 8, font: "500 11px/1 var(--mono)", letterSpacing: ".1em", textTransform: "uppercase", color: "var(--fg-2)", ...style }}>
      {tick && <span style={{ color: "var(--accent)" }}>▸</span>}
      {children}
    </span>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// NAV
// ────────────────────────────────────────────────────────────────────────────
function Nav({ scrolled, route }) {
  return (
    <header style={{
      position: "fixed", top: 0, left: 0, right: 0, zIndex: 50,
      transition: "background .3s ease, border-color .3s ease, backdrop-filter .3s ease",
      background: scrolled ? "rgba(14,13,11,.82)" : "transparent",
      backdropFilter: scrolled ? "blur(14px) saturate(140%)" : "none",
      WebkitBackdropFilter: scrolled ? "blur(14px) saturate(140%)" : "none",
      borderBottom: `1px solid ${scrolled ? "var(--line)" : "transparent"}`,
    }}>
      <div style={{ maxWidth: 1440, margin: "0 auto", padding: "18px 40px", display: "flex", alignItems: "center", justifyContent: "space-between", gap: 32 }}>
        <a href="#/" style={{ display: "flex", alignItems: "center", gap: 12 }}>
          <img src="assets/mibh-mark.png" alt="MIBH Commercial Roofing" style={{ height: 38, width: "auto", display: "block" }} />
          <div>
            <div style={{ font: "800 15px/1 var(--display)", letterSpacing: ".02em" }}>MIBH</div>
            <div style={{ font: "500 9.5px/1.2 var(--mono)", letterSpacing: ".18em", color: "var(--fg-3)", textTransform: "uppercase", marginTop: 3 }}>Commercial Roofing</div>
          </div>
        </a>
        <nav style={{ display: "flex", gap: 28, alignItems: "center" }}>
          {NAV.map(({ label, route: r }) => {
            const active = route === r;
            return (
              <a key={r} href={`#/${r}`} style={{ font: "500 13px/1 var(--sans)", color: active ? "var(--accent)" : "var(--fg-2)", letterSpacing: ".01em" }}
                 onMouseOver={e => e.currentTarget.style.color = "var(--fg)"}
                 onMouseOut={e => e.currentTarget.style.color = active ? "var(--accent)" : "var(--fg-2)"}>{label}</a>
            );
          })}
        </nav>
        <div style={{ display: "flex", alignItems: "center", gap: 14 }}>
          <a href={PHONE_HREF} style={{ font: "500 12.5px/1 var(--mono)", letterSpacing: ".05em", color: "var(--fg-2)" }}>{PHONE_DISPLAY}</a>
          <Btn kind="solid" as="a" href={BIDS_HREF} style={{ padding: "10px 16px", fontSize: 12.5 }}>Invite us to bid <Arrow size={12} /></Btn>
        </div>
      </div>
    </header>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// PAGE HEADER — shared masthead for the sub-pages (sits under the fixed nav).
// ────────────────────────────────────────────────────────────────────────────
function PageHeader({ index, kicker, title, lede }) {
  return (
    <section style={{ position: "relative", background: "var(--bg)", borderBottom: "1px solid var(--line)", padding: "156px 40px 66px" }}>
      <div style={{ maxWidth: 1440, margin: "0 auto" }}>
        <Stamp style={{ color: "var(--accent)" }}>{index}</Stamp>
        {kicker && <div style={{ marginTop: 12, font: "500 11px/1.4 var(--mono)", letterSpacing: ".1em", textTransform: "uppercase", color: "var(--fg-3)" }}>{kicker}</div>}
        <h1 style={{ margin: "22px 0 0", maxWidth: 1120, font: "800 clamp(40px,6vw,84px)/0.98 var(--display)", letterSpacing: "-.035em" }}>{title}</h1>
        {lede && <p style={{ margin: "26px 0 0", maxWidth: 660, font: "400 18px/1.6 var(--sans)", color: "var(--fg-2)" }}>{lede}</p>}
      </div>
    </section>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// HERO
// ────────────────────────────────────────────────────────────────────────────
function Hero() {
  const videoRef = useRef(null);
  useEffect(() => {
    const v = videoRef.current;
    if (!v) return;
    // React doesn't reliably set the DOM `muted` property — iOS blocks autoplay
    // without it. Force it, then kick playback (and retry on first interaction,
    // which covers iOS Low Power Mode where autoplay is hard-blocked).
    v.muted = true;
    v.defaultMuted = true;
    v.setAttribute("muted", "");
    v.setAttribute("playsinline", "");
    v.setAttribute("webkit-playsinline", "");
    const play = () => { const p = v.play(); if (p && p.catch) p.catch(() => {}); };
    play();
    const kick = () => play();
    document.addEventListener("touchstart", kick, { once: true, passive: true });
    document.addEventListener("click", kick, { once: true });
    return () => {
      document.removeEventListener("touchstart", kick);
      document.removeEventListener("click", kick);
    };
  }, []);
  return (
    <section data-screen-label="01 Hero" id="top" style={{ position: "relative", minHeight: "100vh", overflow: "hidden", color: "var(--fg)", display: "flex", flexDirection: "column" }}>
      {/* hero video — real asset, preserved from the original site */}
      <video
        ref={videoRef}
        src="assets/hero-roof.mp4"
        autoPlay muted loop playsInline preload="auto"
        controls={false} disablePictureInPicture
        style={{ position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", zIndex: 0 }}
      />
      {/* legibility overlay */}
      <div style={{ position: "absolute", inset: 0, zIndex: 1, pointerEvents: "none", background:
        "linear-gradient(180deg, rgba(14,13,11,.66) 0%, rgba(14,13,11,.20) 32%, rgba(14,13,11,.30) 58%, rgba(14,13,11,.90) 100%)," +
        "radial-gradient(120% 80% at 50% 50%, rgba(14,13,11,0) 45%, rgba(14,13,11,.55) 100%)" }} />

      <div style={{ position: "relative", zIndex: 2, flex: 1, width: "100%", maxWidth: 1440, margin: "0 auto", padding: "160px 40px 56px", display: "flex", flexDirection: "column", justifyContent: "space-between", gap: 64 }}>
        <div>
          {/* eyebrow spec labels */}
          <div style={{ display: "flex", flexWrap: "wrap", gap: 20, marginBottom: 28 }}>
            <Stamp>Miami-Dade NOA</Stamp>
            <Stamp>Wind 175 MPH</Stamp>
            <Stamp>Licensed CCC1336817</Stamp>
          </div>
          <h1 style={{ margin: 0, font: "800 clamp(46px, 7vw, 100px)/0.98 var(--display)", letterSpacing: "-.035em" }}>
            Roofing your GC<br/>
            can <span style={{ color: "var(--accent)" }}>build on.</span>
          </h1>
          <p style={{ margin: "34px 0 0", maxWidth: 640, font: "400 17.5px/1.6 var(--sans)", color: "var(--fg-2)" }}>
            South Florida GCs send us the plans — we send back an accurate, code-engineered
            bid and a roof that passes inspection the first time. On your schedule, under one license.
          </p>
          <div style={{ marginTop: 34, display: "flex", gap: 12, flexWrap: "wrap" }}>
            <Btn kind="solid" as="a" href={BIDS_HREF}>Invite us to bid <Arrow size={13} /></Btn>
            <Btn kind="ghost" as="a" href={PHONE_HREF}>Call {PHONE_DISPLAY}</Btn>
          </div>
        </div>

        {/* bottom stat row */}
        <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 0, borderTop: "1px solid var(--line)", paddingTop: 22 }}>
          {[
            ["20+", "Years roofing S. FL" /*VERIFY*/],
            ["175 MPH", "Wind-rated assemblies"],
            ["1", "License · one sub"],
            ["350+", "Roofs delivered" /*VERIFY*/],
          ].map(([n, l], i) => (
            <div key={i} style={{ paddingLeft: i ? 24 : 0, borderLeft: i ? "1px solid var(--line)" : "none" }}>
              <div style={{ font: "800 clamp(28px, 2.6vw, 40px)/1 var(--display)", letterSpacing: "-.02em" }}>{n}</div>
              <div style={{ marginTop: 8, font: "500 11px/1.3 var(--mono)", letterSpacing: ".06em", textTransform: "uppercase", color: "var(--fg-3)" }}>{l}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// TRUST BAR (marquee)
// ────────────────────────────────────────────────────────────────────────────
function TrustBar() {
  const items = [
    "Licensed Roofing CCC1336817",
    "Miami-Dade NOA assemblies",
    "In-house structural engineering",
    "GAF Certified",
    "Single-source warranty",
  ];
  const row = [...items, ...items];
  return (
    <section data-screen-label="02 Trust Bar" style={{ background: "var(--bg-2)", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)" }}>
      <div style={{ overflow: "hidden", padding: "22px 0" }}>
        <div className="trust-marquee" style={{ display: "flex", gap: 64, whiteSpace: "nowrap", willChange: "transform" }}>
          {row.map((t, i) => (
            <div key={i} style={{ display: "flex", alignItems: "center", gap: 16 }}>
              <span style={{ width: 6, height: 6, background: "var(--accent)", display: "inline-block" }} />
              <span style={{ font: "500 12.5px/1 var(--mono)", color: "var(--fg-2)", letterSpacing: ".06em", textTransform: "uppercase" }}>{t}</span>
            </div>
          ))}
        </div>
      </div>
      <style>{`
        .trust-marquee{animation: marquee 48s linear infinite;}
        @keyframes marquee { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
      `}</style>
    </section>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// THE WEDGE — why a GC subs the roof to us, not just anyone with a price
// ────────────────────────────────────────────────────────────────────────────
function Wedge() {
  const cards = [
    { k: "On schedule", b: "We build to your critical path. Dry-in dates hit, other trades never wait on the roof, and turnover doesn't slip because of us." },
    { k: "Engineered & permitted", b: "NOA-approved assemblies, wind-uplift calcs, and permit submittals handled in-house — your PM never chases the AHJ." },
    { k: "One accountable sub", b: "One license holds the crew, the QC, and the warranty. No finger-pointing at closeout, no callbacks landing back on you." },
  ];
  return (
    <section data-screen-label="03 Wedge" id="why" style={{ background: "var(--bg)", padding: "120px 40px", borderTop: "1px solid var(--line)" }}>
      <div style={{ maxWidth: 1440, margin: "0 auto" }}>
        <SectionHead index="01 / The difference" kicker="Why GCs sub the roof to us"
          title={<>The roof is <span style={{ color: "var(--accent)" }}>schedule, inspection, and warranty risk.</span> We take all three.</>}
          lede="A GC doesn't need another number — you need a roofing sub who bids it right, hits the dry-in date, and passes inspection without a callback. In the HVHZ, that's the whole job." />

        <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 1, background: "var(--line)", border: "1px solid var(--line)" }}>
          {cards.map((c, i) => (
            <div key={c.k} style={{ background: "var(--bg)", padding: "40px 36px 44px" }}>
              <Stamp>{`0${i + 1}`}</Stamp>
              <h3 style={{ margin: "20px 0 12px", font: "800 26px/1.1 var(--display)", letterSpacing: "-.02em" }}>{c.k}</h3>
              <p style={{ margin: 0, font: "400 15px/1.6 var(--sans)", color: "var(--fg-2)" }}>{c.b}</p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// SERVICES — six headline services (grid is reused on the Services page)
// ────────────────────────────────────────────────────────────────────────────
const SERVICES = [
  { tag: "Service 01", title: "TPO &amp; Single-Ply", lead: "Welded membrane for flat decks.", body: "60–80 mil TPO and PVC, hot-air welded into one continuous watertight surface over tapered insulation. HVHZ-rated attachment, Miami-Dade NOA-approved assemblies.", spec: "TPO · PVC · 60–80 mil", img: "assets/services/svc-01-tpo.jpg" },
  { tag: "Service 02", title: "Standing Seam Metal", lead: "The HVHZ workhorse.", body: "Concealed-fastener panels engineered for superior wind uplift and a 40–50 year service life. Galvalume and aluminum on NOA-approved clip systems.", spec: "Metal · 40–50 yr life", img: "assets/services/svc-02-metal.jpg" },
  { tag: "Service 03", title: "Modified Bitumen &amp; BUR", lead: "Proven multi-ply redundancy.", body: "SBS and APP modified bitumen and built-up roofing with granulated, reflective cap sheets — where layered redundancy matters most. NOA-approved.", spec: "SBS · APP · BUR", img: "assets/services/svc-03-modbit.jpg" },
  { tag: "Service 04", title: "Coatings &amp; Restoration", lead: "Add years without a tear-off.", body: "Silicone and acrylic fluid-applied systems that extend roof life 10–15 years — often a maintenance line item instead of a capital replacement on your budget.", spec: "Silicone · Acrylic", img: "assets/services/svc-04-coatings.jpg" },
  { tag: "Service 05", title: "Preventive Maintenance", lead: "Protect the warranty.", body: "Semi-annual and post-storm inspections, photo reports, drain and flashing service, sealant renewal, and a running roof-asset record. The cheapest roof is the one you maintain.", spec: "Inspect · Report · Renew", img: "assets/services/svc-05-maintenance.jpg" },
  { tag: "Service 06", title: "Storm &amp; Leak Repair", lead: "When water's coming in.", body: "24/7 emergency response: temporary dry-in today, permanent engineered repair this week. Leak detection and insurance-ready photo documentation.", spec: "24/7 · Dry-in · Repair", img: "assets/services/svc-06-storm.jpg" },
];

function ServicesGrid() {
  const [hover, setHover] = useState(null);
  return (
    <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 1, background: "var(--line)", border: "1px solid var(--line)" }}>
      {SERVICES.map((d, i) => (
        <article key={i}
          onMouseEnter={() => setHover(i)} onMouseLeave={() => setHover(null)}
          style={{ background: "var(--bg-2)", padding: 0, position: "relative", overflow: "hidden", cursor: "pointer" }}>
          <div style={{ position: "relative", aspectRatio: "704 / 1130", overflow: "hidden", background: "#0f0e0b" }}>
            <img src={d.img} alt={d.title.replace(/&amp;/g, "&")} loading="lazy" decoding="async"
              style={{ position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", objectPosition: "center", transition: "transform .4s ease", transform: hover === i ? "scale(1.03)" : "none" }} />
          </div>
          <div style={{ padding: "26px 30px 30px" }}>
            <div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline" }}>
              <Stamp style={{ color: "var(--accent)" }}>{d.tag}</Stamp>
            </div>
            <h3 style={{ margin: "16px 0 6px", font: "800 24px/1.1 var(--display)", letterSpacing: "-.02em" }} dangerouslySetInnerHTML={{ __html: d.title }} />
            <div style={{ font: "600 14px/1.4 var(--sans)", color: "var(--fg)", marginBottom: 10 }}>{d.lead}</div>
            <p style={{ margin: 0, font: "400 14.5px/1.6 var(--sans)", color: "var(--fg-2)" }} dangerouslySetInnerHTML={{ __html: d.body }} />
            <div style={{ marginTop: 20, display: "inline-flex", alignItems: "center", gap: 8, color: "var(--fg)", font: "600 12px/1 var(--mono)", letterSpacing: ".06em", textTransform: "uppercase", borderBottom: "1px solid var(--line-strong)", paddingBottom: 6 }}>
              {d.spec} <Arrow size={12} style={{ transform: hover === i ? "translateX(4px)" : "none", transition: "transform .2s" }} />
            </div>
          </div>
        </article>
      ))}
    </div>
  );
}

function ServicesPage() {
  return (
    <div>
      <PageHeader index="Services" kicker="What we install"
        title={<>Every roofing scope a GC needs, <span style={{ color: "var(--accent)" }}>on one sub.</span></>}
        lede="Flat, metal, restoration, maintenance, and emergency repair — bid accurately and installed to Miami-Dade code by one licensed, accountable contractor." />
      <section style={{ background: "var(--bg-2)", padding: "80px 40px 60px" }}>
        <div style={{ maxWidth: 1440, margin: "0 auto" }}>
          <ServicesGrid />
          {/* Recurring GC note — every scope comes with the paperwork a PM needs */}
          <div style={{ marginTop: 28, padding: "22px 26px", border: "1px solid var(--line)", background: "var(--bg)", display: "flex", gap: 16, alignItems: "baseline", flexWrap: "wrap" }}>
            <Stamp style={{ color: "var(--accent)" }}>For general contractors</Stamp>
            <p style={{ margin: 0, flex: "1 1 420px", font: "400 14.5px/1.6 var(--sans)", color: "var(--fg-2)" }}>
              Every scope is provided with full submittals, NOA product approvals, manufacturer + workmanship
              warranties, and a closeout package — sequenced to your project timeline and your other trades.
            </p>
          </div>
          <div style={{ marginTop: 40, display: "flex", gap: 12, flexWrap: "wrap", alignItems: "center" }}>
            <Btn kind="solid" as="a" href={BIDS_HREF}>Invite us to bid this scope <Arrow size={13} /></Btn>
            <Btn kind="ghost" as="a" href="#/systems">See the roof systems <Arrow size={12} /></Btn>
          </div>
        </div>
      </section>

      {/* Scopes we self-perform */}
      <section style={{ background: "var(--bg)", padding: "80px 40px 110px", borderTop: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1440, margin: "0 auto" }}>
          <SectionHead index="Services / 02" kicker="No sub-subbing the roof" title="Scopes we self-perform." lede={null} />
          <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 1, background: "var(--line)", border: "1px solid var(--line)" }}>
            {[
              ["New construction", "Threshold-inspection roofing on ground-up commercial builds."],
              ["Re-roof &amp; overlay", "On occupied commercial buildings — phased, with interiors protected."],
              ["Tenant build-out / TI", "Roofing for tenant improvements coordinated to the fit-out schedule."],
              ["Sheet metal &amp; edge metal", "Flashing, coping, and edge metal fabricated and installed in-house."],
              ["Coatings &amp; restoration", "Fluid-applied systems that extend roof life without a tear-off."],
              ["Penetrations &amp; curbs", "Rooftop penetration detailing and curb flashing coordinated with your MEP subs."],
            ].map(([t, b], i) => (
              <div key={i} style={{ background: "var(--bg)", padding: "30px 28px 34px" }}>
                <Stamp style={{ color: "var(--accent)" }}>{`0${i + 1}`}</Stamp>
                <h3 style={{ margin: "16px 0 8px", font: "800 19px/1.15 var(--display)", letterSpacing: "-.02em" }} dangerouslySetInnerHTML={{ __html: t }} />
                <p style={{ margin: 0, font: "400 14px/1.6 var(--sans)", color: "var(--fg-2)" }} dangerouslySetInnerHTML={{ __html: b }} />
              </div>
            ))}
          </div>
        </div>
      </section>
    </div>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// SYSTEMS — the assemblies we spec and stand behind
// ────────────────────────────────────────────────────────────────────────────
const SYSTEMS = [
  { code: "SYS-01", name: "TPO &amp; PVC Single-Ply", use: "Low-slope · large-format decks", spec: "60–80 mil · hot-air welded · fully-adhered or mechanically-attached", noa: "Miami-Dade NOA", life: "20–30 yr", note: "The default for warehouse, retail, and flat commercial decks. One continuous welded membrane with HVHZ-rated attachment engineered to the deck and wind zone." },
  { code: "SYS-02", name: "Standing Seam Metal", use: "Architectural · steep-slope", spec: "Concealed-fastener · Galvalume / aluminum · NOA clip systems", noa: "Miami-Dade NOA", life: "40–50 yr", note: "The HVHZ workhorse where wind uplift and service life matter most — and the assembly that reads on an architectural elevation." },
  { code: "SYS-03", name: "Modified Bitumen &amp; BUR", use: "High-redundancy multi-ply", spec: "SBS / APP · granulated reflective cap · multi-ply", noa: "Miami-Dade NOA", life: "20–25 yr", note: "Layered redundancy for residential decks, plazas, and roofs that take foot traffic and rooftop equipment." },
  { code: "SYS-04", name: "Silicone &amp; Acrylic Coatings", use: "Restoration in lieu of tear-off", spec: "Fluid-applied · primer · reinforcing fabric", noa: "System-dependent", life: "+10–15 yr", note: "Extend a sound roof a decade-plus without a tear-off — often a maintenance expense on the budget rather than a capital replacement." },
];

function SystemsPage() {
  return (
    <div>
      <PageHeader index="Systems" kicker="Engineered assemblies"
        title={<>The assemblies we'll <span style={{ color: "var(--accent)" }}>spec and stand behind</span> on your job.</>}
        lede="Every system we bid is a Miami-Dade NOA-approved assembly detailed to the deck, the wind zone, and the AHJ — not a product off a shelf. Here's how we choose." />
      <section style={{ background: "var(--bg)", padding: "70px 40px 110px" }}>
        <div style={{ maxWidth: 1440, margin: "0 auto", border: "1px solid var(--line)" }}>
          {SYSTEMS.map((s, i) => (
            <div key={s.code} style={{ display: "grid", gridTemplateColumns: "220px 1fr 260px", gap: 40, padding: "38px 36px", borderTop: i ? "1px solid var(--line)" : "none", alignItems: "start" }}>
              <div>
                <Stamp style={{ color: "var(--accent)" }}>{s.code}</Stamp>
                <h3 style={{ margin: "16px 0 8px", font: "800 26px/1.08 var(--display)", letterSpacing: "-.02em" }} dangerouslySetInnerHTML={{ __html: s.name }} />
                <div style={{ font: "500 12px/1.4 var(--mono)", letterSpacing: ".05em", textTransform: "uppercase", color: "var(--fg-3)" }}>{s.use}</div>
              </div>
              <p style={{ margin: 0, font: "400 15.5px/1.65 var(--sans)", color: "var(--fg-2)" }}>{s.note}</p>
              <dl style={{ margin: 0, display: "grid", gap: 12 }}>
                {[["Build-up", s.spec], ["Approval", s.noa], ["Service life", s.life]].map(([k, v]) => (
                  <div key={k} style={{ display: "grid", gridTemplateColumns: "96px 1fr", gap: 12, paddingBottom: 12, borderBottom: "1px solid var(--line)" }}>
                    <dt style={{ font: "500 10.5px/1.4 var(--mono)", letterSpacing: ".1em", textTransform: "uppercase", color: "var(--fg-3)" }}>{k}</dt>
                    <dd style={{ margin: 0, font: "400 13.5px/1.5 var(--sans)", color: "var(--fg)" }} dangerouslySetInnerHTML={{ __html: v }} />
                  </div>
                ))}
              </dl>
            </div>
          ))}
        </div>
        <div style={{ maxWidth: 1440, margin: "40px auto 0" }}>
          <Btn kind="solid" as="a" href={BIDS_HREF}>Get an assembly spec'd &amp; bid <Arrow size={13} /></Btn>
        </div>
      </section>
    </div>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// PROCESS — four steps, documented (lives on home)
// ────────────────────────────────────────────────────────────────────────────
function Process() {
  const steps = [
    { n: "01", t: "Bid", b: "A detailed, itemized bid backed by a photo-documented condition report. Line-by-line scope and a fixed price you can drop straight into your proposal — no surprises at buyout." },
    { n: "02", t: "Engineer", b: "An NOA-approved assembly detailed to the building's wind loads. Membrane selection, wind-uplift calcs, and permit submittals across Miami-Dade, Broward, and Palm Beach." },
    { n: "03", t: "Install", b: "Phased tear-off with nightly dry-in, deck repair, insulation, membrane, and flashing — daily photo logs, in-line QC, and a build that passes inspection the first time." },
    { n: "04", t: "Warranty", b: "Final and threshold inspections, manufacturer field check, and a single-source warranty — workmanship and manufacturer — with the closeout package your PM needs to turn over." },
  ];
  return (
    <section data-screen-label="05 Process" id="process" style={{ background: "#f1ede5", color: "#0e0d0b", padding: "120px 40px" }}>
      <div style={{ maxWidth: 1440, margin: "0 auto" }}>
        <SectionHead theme="light" index="02 / Process" kicker="Bid-to-warranty" title="Four steps. Documented at every one."
          lede="From bid to warranty, documented at every step — the paper trail your PM, the AHJ, and the owner all need. The same cadence runs whether it's a 5-week coating or a 200,000 sqft tear-off." />

        <div style={{ position: "relative", marginTop: 24 }}>
          <div style={{ position: "absolute", top: 22, left: 0, right: 0, height: 1, background: "rgba(14,13,11,.18)" }} />
          <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 28 }}>
            {steps.map((s, i) => (
              <div key={s.n} style={{ paddingTop: 0 }}>
                <div style={{ position: "relative", height: 44 }}>
                  <div style={{ position: "absolute", top: 16, left: 0, width: 14, height: 14, borderRadius: "50%", background: i === 0 ? "var(--accent)" : "#0e0d0b", border: "3px solid #f1ede5", boxShadow: "0 0 0 1px rgba(14,13,11,.18)" }} />
                </div>
                <div style={{ font: "500 11px/1.3 var(--mono)", letterSpacing: ".12em", color: "rgba(14,13,11,.45)", textTransform: "uppercase" }}>Step {s.n}</div>
                <h4 style={{ margin: "10px 0 14px", font: "800 30px/1.05 var(--display)", letterSpacing: "-.02em" }}>{s.t}</h4>
                <p style={{ margin: 0, font: "400 14.5px/1.6 var(--sans)", color: "rgba(14,13,11,.68)" }}>{s.b}</p>
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// WORK — five case studies, written for the GC who hired us
// ────────────────────────────────────────────────────────────────────────────
const PROJECTS = [
  { id: "P-241", type: "TPO Re-Roof", title: "Doral Retail Plaza Re-Roof", city: "Doral, FL", gc: "Retail build-out GC · national tenant program", scope: "32,000 sqft failed BUR → fully-adhered 60-mil TPO on tapered ISO, over an occupied plaza", systems: "GAF EverGuard TPO 60-mil · Miami-Dade NOA · 25-yr NDL", result: "Bid held to the dollar — zero change orders. Closed out two days ahead of the GC's tenant-turnover date." /*VERIFY*/, timeline: "2024 · 6 weeks", img: "drone — TPO membrane on retail plaza", video: "assets/projects/doral-retail.mp4" },
  { id: "P-214", type: "New-Construction TPO", title: "Doral Logistics Warehouse", city: "Doral, FL", gc: "Design-build industrial GC", scope: "212,000 sqft mechanically-attached TPO on new metal deck", systems: "Carlisle TPO 60-mil · R-30 ISO · wind-rated attachment", result: "Dried-in on the CM's critical-path date so interior trades never waited. Full drone + photo QC log delivered at closeout.", timeline: "2023 · 11 weeks", img: "drone — warehouse TPO field" },
  { id: "P-238", type: "PVC Single-Ply", title: "Las Olas Retail Center", city: "Fort Lauderdale, FL", gc: "Mixed-use GC", scope: "86,200 sqft PVC re-roof phased around live tenant fit-outs", systems: "Sika Sarnafil PVC 80-mil · tapered ISO · 20-yr", result: "Sequenced to the GC's fit-out schedule with nightly dry-in — no tenant downtime. Punch list cleared in a single walk.", timeline: "2024 · 12 weeks", img: "drone — PVC membrane retail roof" },
  { id: "P-229", type: "Mod-Bit / BUR", title: "Oceanview Condominium Re-Roof", city: "Hollywood, FL", gc: "Coastal residential GC", scope: "Multi-ply SBS over a 9-story occupied residential deck", systems: "SBS mod-bit · granular cap · full flashing rebuild · Miami-Dade NOA", result: "NOA package and warranty registered before the GC's substantial-completion deadline. Watertight through hurricane season.", timeline: "2023 · 16 weeks", img: "elevation — mod-bit roof on condo" },
  { id: "P-208", type: "Silicone Restoration", title: "Aventura Mixed-Use Restoration", city: "Aventura, FL", gc: "CM · capital projects", scope: "64,000 sqft silicone restorative coating in lieu of a full tear-off", systems: "Silicone · primer · reinforcing fabric · 15-yr", result: "Restoration bid came in ~60% under tear-off — booked as maintenance, not capital. Zero disruption to the CM's occupied tenants.", timeline: "2022 · 6 weeks", img: "rooftop — silicone coating spray" },
];

function WorkGallery() {
  const [active, setActive] = useState(0);
  const p = PROJECTS[active];
  return (
    <div style={{ maxWidth: 1440, margin: "0 auto" }}>
      <div style={{ display: "grid", gridTemplateColumns: "1.4fr 1fr", gap: 0, border: "1px solid var(--line)", marginBottom: 40 }}>
        <div style={{ position: "relative", minHeight: 520 }}>
          {p.video ? (
            <video
              key={p.video}
              ref={el => { if (el) { el.muted = true; el.setAttribute("muted", ""); el.setAttribute("playsinline", ""); const pr = el.play(); if (pr && pr.catch) pr.catch(() => {}); } }}
              src={p.video}
              autoPlay muted loop playsInline preload="auto" controls={false} disablePictureInPicture
              style={{ position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", background: "#0f0e0b" }}
            />
          ) : (
            <Placeholder mono={p.img} label={`${p.id} · ${p.city.toUpperCase()}`} style={{ position: "absolute", inset: 0 }} />
          )}
          <div style={{ position: "absolute", left: 24, bottom: 24, right: 24, display: "flex", justifyContent: "space-between", alignItems: "flex-end" }}>
            <Stamp tick={false} style={{ background: "rgba(14,13,11,.6)", padding: "6px 10px", border: "1px solid var(--line)", color: "var(--accent)" }}>● Drone · 4K · {p.id}</Stamp>
            <Stamp tick={false} style={{ background: "rgba(14,13,11,.6)", padding: "6px 10px", border: "1px solid var(--line)" }}>{p.timeline.split(" · ")[0]}</Stamp>
          </div>
        </div>
        <div style={{ padding: "40px 40px", borderLeft: "1px solid var(--line)" }}>
          <div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline" }}>
            <Stamp style={{ color: "var(--accent)" }}>{p.type}</Stamp>
            <Stamp tick={false} style={{ color: "var(--fg-3)" }}>{p.id}</Stamp>
          </div>
          <h3 style={{ margin: "18px 0 22px", font: "800 32px/1.05 var(--display)", letterSpacing: "-.025em" }}>{p.title}</h3>
          <Rule />
          <dl style={{ margin: "20px 0 0", display: "grid", gridTemplateColumns: "1fr", gap: 14 }}>
            {[["Delivered for", p.gc], ["Location", p.city], ["Scope", p.scope], ["Systems", p.systems], ["Result", p.result]].map(([k, v]) => (
              <div key={k} style={{ display: "grid", gridTemplateColumns: "120px 1fr", gap: 16, paddingBottom: 14, borderBottom: "1px solid var(--line)" }}>
                <dt style={{ font: "500 11px/1.3 var(--mono)", letterSpacing: ".1em", textTransform: "uppercase", color: "var(--fg-3)" }}>{k}</dt>
                <dd style={{ margin: 0, font: "400 14.5px/1.5 var(--sans)", color: k === "Result" ? "var(--accent)" : "var(--fg)" }}>{v}</dd>
              </div>
            ))}
          </dl>
          <div style={{ marginTop: 28 }}>
            <Btn kind="ghost" as="a" href={BIDS_HREF} className="neon-case">Invite us to bid this scope <Arrow size={12} /></Btn>
          </div>
        </div>
      </div>

      <div style={{ display: "grid", gridTemplateColumns: `repeat(${PROJECTS.length}, 1fr)`, gap: 12 }}>
        {PROJECTS.map((pr, i) => (
          <button key={pr.id} onClick={() => setActive(i)}
            style={{
              background: i === active ? "rgba(241,237,229,.06)" : "transparent",
              border: i === active ? "1px solid var(--accent)" : "1px solid var(--line)",
              color: "var(--fg)", textAlign: "left", padding: "14px 14px 16px", cursor: "pointer",
              transition: "background .2s, border-color .2s",
            }}
            onMouseOver={e => { if (i !== active) e.currentTarget.style.borderColor = "var(--line-strong)" }}
            onMouseOut={e => { if (i !== active) e.currentTarget.style.borderColor = "var(--line)" }}>
            <div style={{ display: "flex", justifyContent: "space-between" }}>
              <Stamp style={{ color: i === active ? "var(--accent)" : "var(--fg-3)" }}>{pr.id}</Stamp>
              <Stamp tick={false} style={{ color: "var(--fg-3)" }}>{pr.timeline.split(" · ")[0]}</Stamp>
            </div>
            <div style={{ marginTop: 14, font: "600 14px/1.3 var(--sans)", letterSpacing: "-.005em" }}>{pr.title}</div>
            <div style={{ marginTop: 6, font: "400 11.5px/1.3 var(--mono)", letterSpacing: ".05em", color: "var(--fg-3)" }}>{pr.city}</div>
          </button>
        ))}
      </div>
    </div>
  );
}

function WorkPage() {
  return (
    <div>
      <PageHeader index="Work" kicker="Selected projects, 2022—2024"
        title={<>Delivered for the GCs who <span style={{ color: "var(--accent)" }}>bid us.</span></>}
        lede="Five South Florida projects, each judged the way a GC judges a sub: bid held, schedule hit, inspection passed, closeout clean." />
      <section style={{ background: "var(--bg)", padding: "70px 40px 110px" }}>
        <WorkGallery />
      </section>
    </div>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// ABOUT
// ────────────────────────────────────────────────────────────────────────────
function AboutPage() {
  const creds = [
    ["CCC1336817", "State-licensed roofing"],
    ["Since 2006", "Roofing South Florida"],
    ["Miami-Dade NOA", "Approved assemblies"],
    ["GAF Certified", "Manufacturer-backed"],
    ["Fully insured", "GL + workers' comp"],
    ["350+", "Roofs delivered" /*VERIFY*/],
  ];
  const why = [
    ["We hit your dates", "We schedule to your critical path and coordinate mobilization around the other trades. Your CO doesn't wait on the roof."],
    ["We pass inspection the first time", "NOA-compliant assemblies, HVHZ detailing, and an in-house structural engineer mean threshold and final inspections don't bounce."],
    ["Clean paperwork, start to finish", "Submittals, product approvals (NOAs), shop drawings, pay apps, lien waivers, and a full closeout package with warranties."],
    ["Fully insured, COI on request", "General liability, workers' comp, and auto — with a certificate of insurance issued to your requirements, fast."],
    ["We work around your tenants", "Occupied-building logistics: phased tear-off, nightly dry-in, and interiors protected — no downtime for the building's operations."],
    ["One point of contact", "A dedicated project manager who answers the phone, coordinates penetrations and curbs with your MEP subs, and keeps you ahead of surprises."],
  ];
  const coordination = [
    ["Preconstruction & submittals", "We turn around NOAs, product data, and shop drawings fast so nothing stalls approval."],
    ["Coordinated mobilization", "We set our start to your schedule, not ours."],
    ["Trade coordination", "We sequence around mechanical, plumbing, and electrical rooftop work and detail every penetration."],
    ["Inspections", "We're on-site for threshold and final — and we know the AHJs across Miami-Dade, Broward, and Palm Beach."],
    ["Closeout", "As-builts, warranties (manufacturer + workmanship), final lien releases, and O&M docs — handed over, not chased."],
  ];
  return (
    <div>
      <PageHeader index="About" kicker="MIBH Construction · Commercial Roofing Division"
        title={<>The roofing sub South Florida GCs <span style={{ color: "var(--accent)" }}>keep on the bid list.</span></>}
        lede="Since 2006, MIBH has run the roofing scope for general contractors and construction managers across Miami-Dade, Broward, and Palm Beach — the buildings where the roof is on the critical path and the AHJ is unforgiving." />

      <section style={{ background: "var(--bg-2)", padding: "80px 40px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1440, margin: "0 auto", display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 64, alignItems: "start" }}>
          <div>
            <h2 style={{ margin: 0, font: "800 clamp(28px,3vw,42px)/1.08 var(--display)", letterSpacing: "-.025em" }}>A roofing sub that thinks like a GC.</h2>
            <p style={{ margin: "22px 0 0", font: "400 16px/1.7 var(--sans)", color: "var(--fg-2)" }}>
              Most roofers sell a price. On a real project, the price is the easy part — the risk is the schedule,
              the inspection, and the warranty callback that lands back on the GC six months later. We built MIBH's
              commercial division around removing that risk: engineered assemblies, permit authority in-house, and one
              license that owns the crew, the QC, and the warranty from bid to turnover.
            </p>
            <p style={{ margin: "18px 0 0", font: "400 16px/1.7 var(--sans)", color: "var(--fg-2)" }}>
              That's why GCs and CMs keep us on the bid list: we hand back a number we stand behind, hit the dry-in
              date, and pass inspection the first time — so the roof is the line item you stop worrying about.
            </p>
            <div style={{ marginTop: 30, display: "flex", gap: 12, flexWrap: "wrap" }}>
              <Btn kind="solid" as="a" href={BIDS_HREF}>Invite us to bid <Arrow size={13} /></Btn>
              <Btn kind="ghost" as="a" href="#/work">See the work <Arrow size={12} /></Btn>
            </div>
          </div>
          <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 1, background: "var(--line)", border: "1px solid var(--line)" }}>
            {creds.map(([n, l]) => (
              <div key={n} style={{ background: "var(--bg-2)", padding: "28px 26px" }}>
                <div style={{ font: "800 24px/1.05 var(--display)", letterSpacing: "-.02em", color: "var(--fg)" }}>{n}</div>
                <div style={{ marginTop: 8, font: "500 11px/1.4 var(--mono)", letterSpacing: ".06em", textTransform: "uppercase", color: "var(--fg-3)" }}>{l}</div>
              </div>
            ))}
          </div>
        </div>
      </section>

      <section style={{ background: "var(--bg)", padding: "80px 40px 90px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1440, margin: "0 auto" }}>
          <SectionHead index="About / 02" kicker="What a GC gets" title="Why GCs put MIBH on the bid list." lede={null} />
          <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 1, background: "var(--line)", border: "1px solid var(--line)" }}>
            {why.map(([k, b], i) => (
              <div key={k} style={{ background: "var(--bg)", padding: "34px 28px 38px" }}>
                <Stamp>{`0${i + 1}`}</Stamp>
                <h3 style={{ margin: "18px 0 10px", font: "800 20px/1.15 var(--display)", letterSpacing: "-.02em" }}>{k}</h3>
                <p style={{ margin: 0, font: "400 14px/1.6 var(--sans)", color: "var(--fg-2)" }}>{b}</p>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* How we work with your team — GC coordination process */}
      <section style={{ background: "var(--bg-2)", padding: "80px 40px 110px" }}>
        <div style={{ maxWidth: 1440, margin: "0 auto" }}>
          <SectionHead index="About / 03" kicker="How we work as your subcontractor" title="How we work with your team." lede={null} />
          <div style={{ border: "1px solid var(--line)" }}>
            {coordination.map(([t, b], i) => (
              <div key={t} style={{ display: "grid", gridTemplateColumns: "64px 260px 1fr", gap: 32, padding: "26px 32px", borderTop: i ? "1px solid var(--line)" : "none", alignItems: "baseline" }}>
                <div style={{ font: "800 26px/1 var(--display)", color: "var(--accent)", letterSpacing: "-.02em" }}>{`0${i + 1}`}</div>
                <h3 style={{ margin: 0, font: "800 20px/1.15 var(--display)", letterSpacing: "-.02em" }}>{t}</h3>
                <p style={{ margin: 0, font: "400 14.5px/1.6 var(--sans)", color: "var(--fg-2)" }}>{b}</p>
              </div>
            ))}
          </div>
          <div style={{ marginTop: 32, font: "500 12px/1.6 var(--mono)", letterSpacing: ".05em", textTransform: "uppercase", color: "var(--fg-3)" }}>
            Serving Miami-Dade · Broward · Palm Beach — Hollywood, FL
          </div>
        </div>
      </section>
    </div>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// MARKETS
// ────────────────────────────────────────────────────────────────────────────
const MARKET_ROWS = [
  ["Retail &amp; shopping plazas", "Occupied re-roofs sequenced to your tenant fit-out schedule, with nightly dry-in and zero downtime."],
  ["Warehouse &amp; industrial", "Large-format TPO and metal engineered for wide, high-uplift spans — dried in on the CM's critical path."],
  ["Office &amp; medical", "Quiet, phased work and documentation that keeps facilities running and inspectors satisfied."],
  ["Condo &amp; HOA", "Board-ready proposals, reserve-study support, and the closeout package a residential GC needs."],
  ["Hospitality", "Guest-experience-first scheduling and reflective, efficient systems that hold up on the coast."],
  ["New construction", "NOA-compliant assemblies that pass threshold inspection the first time, on the GC's schedule."],
];

function MarketsGrid() {
  return (
    <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 1, background: "var(--line)", border: "1px solid var(--line)" }}>
      {MARKET_ROWS.map(([t, b], i) => (
        <div key={i} style={{ background: "var(--bg)", padding: "36px 32px 40px" }}>
          <Stamp style={{ color: "var(--accent)" }}>{`0${i + 1}`}</Stamp>
          <h3 style={{ margin: "18px 0 10px", font: "800 21px/1.15 var(--display)", letterSpacing: "-.02em" }} dangerouslySetInnerHTML={{ __html: t }} />
          <p style={{ margin: 0, font: "400 14.5px/1.6 var(--sans)", color: "var(--fg-2)" }}>{b}</p>
        </div>
      ))}
    </div>
  );
}

function MarketsPage() {
  return (
    <div>
      <PageHeader index="Markets" kicker="We know your building type"
        title={<>Different buildings, different roofs. <span style={{ color: "var(--accent)" }}>We know the difference.</span></>}
        lede="The building types South Florida GCs put us on — each with the assembly, schedule, and documentation it demands." />
      <section style={{ background: "var(--bg)", padding: "70px 40px 110px" }}>
        <div style={{ maxWidth: 1440, margin: "0 auto" }}>
          <MarketsGrid />
          <div style={{ marginTop: 40 }}>
            <Btn kind="solid" as="a" href={BIDS_HREF}>Invite us to bid <Arrow size={13} /></Btn>
          </div>
        </div>
      </section>
    </div>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// HOME
// ────────────────────────────────────────────────────────────────────────────
function HomePage() {
  return (
    <div>
      <Hero />
      <TrustBar />
      <Wedge />
      <Process />
    </div>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// FINAL CTA + FOOTER (shared — appended to every page)
// ────────────────────────────────────────────────────────────────────────────
function FinalCTA() {
  const footCols = [
    ["Company", [["Home", "#/"], ["About MIBH", "#/about"], ["Our Work", "#/work"], ["Contact", BIDS_HREF], ["Careers", "#"]]],
    ["Services", [["TPO &amp; Single-Ply", "#/services"], ["Standing Seam Metal", "#/services"], ["Modified Bitumen &amp; BUR", "#/services"], ["Coatings &amp; Restoration", "#/services"], ["Systems overview", "#/systems"]]],
    ["Markets", [["Retail &amp; Plazas", "#/markets"], ["Warehouse &amp; Industrial", "#/markets"], ["Office &amp; Medical", "#/markets"], ["Condo &amp; HOA", "#/markets"], ["New Construction", "#/markets"]]],
    ["For GCs", [["Invite us to bid", BIDS_HREF], ["Emergency Repair", PHONE_HREF], ["Warranty Info", "#"], ["Financing", "#"]]],
  ];
  return (
    <section data-screen-label="10 Final CTA" id="contact" style={{ position: "relative", background: "var(--bg-2)", borderTop: "1px solid var(--line)", padding: "140px 40px 80px", overflow: "hidden" }}>
      <svg style={{ position: "absolute", inset: 0, width: "100%", height: "100%", opacity: .25, pointerEvents: "none" }} preserveAspectRatio="xMidYMid slice" viewBox="0 0 1600 900">
        <defs>
          <pattern id="cta-stripe" patternUnits="userSpaceOnUse" width="22" height="22" patternTransform="rotate(-22)">
            <rect width="22" height="22" fill="transparent" />
            <rect width="1" height="22" fill="rgba(241,237,229,.18)" />
          </pattern>
        </defs>
        <rect width="1600" height="900" fill="url(#cta-stripe)" />
      </svg>

      <div style={{ position: "relative", maxWidth: 1440, margin: "0 auto", display: "grid", gridTemplateColumns: "1.2fr 1fr", gap: 80, alignItems: "end", paddingBottom: 80 }}>
        <div>
          <Stamp style={{ color: "var(--accent)" }}>Add us to your bid list</Stamp>
          <h2 style={{ margin: "20px 0 0", font: "800 clamp(48px, 6.5vw, 96px)/0.98 var(--display)", letterSpacing: "-.035em" }}>
            GCs trust us<br/>to bid their<br/><span style={{ color: "var(--accent)" }}>jobs.</span>
          </h2>
          <p style={{ margin: "28px 0 0", maxWidth: 560, font: "400 17px/1.6 var(--sans)", color: "var(--fg-2)" }}>
            Send us the plans and get a scoped, itemized roofing bid you can drop straight
            into your proposal — accurate, on time, and backed by a licensed roofer who
            stands behind the number.
          </p>
          <div style={{ marginTop: 20, font: "500 12px/1.6 var(--mono)", letterSpacing: ".05em", color: "var(--fg-3)" }}>
            Bids: <a href={BIDS_HREF} style={{ color: "var(--accent)" }}>{BIDS_EMAIL}</a>
          </div>
        </div>
        <div style={{ display: "flex", flexDirection: "column", gap: 12, alignItems: "flex-start" }}>
          <Btn kind="solid" as="a" href={BIDS_HREF} style={{ width: "100%", justifyContent: "space-between" }}>Invite us to bid <Arrow /></Btn>
          <Btn kind="light" as="a" href={PHONE_HREF} style={{ width: "100%", justifyContent: "space-between" }}>Call {PHONE_DISPLAY} <Arrow /></Btn>
          <div style={{ marginTop: 14, font: "400 11.5px/1.5 var(--mono)", color: "var(--fg-3)", letterSpacing: ".04em" }}>
            Same-business-day response<br/>
            Commercial · Industrial · Condo/HOA · New construction
          </div>
        </div>
      </div>

      <Rule style={{ position: "relative" }} />

      <footer style={{ position: "relative", maxWidth: 1440, margin: "0 auto", paddingTop: 40, display: "grid", gridTemplateColumns: "1.4fr repeat(4, 1fr)", gap: 32 }}>
        <div>
          <div style={{ display: "flex", alignItems: "center", gap: 12 }}>
            <img src="assets/mibh-mark.png" alt="MIBH" style={{ height: 34, width: "auto", display: "block" }} />
            <div style={{ font: "800 14px/1 var(--display)", letterSpacing: ".02em" }}>MIBH</div>
          </div>
          <div style={{ marginTop: 14, font: "400 11.5px/1.7 var(--mono)", color: "var(--fg-3)", letterSpacing: ".03em" }}>
            MIBH Construction LLC<br/>
            Commercial Roofing Division<br/>
            Licensed &amp; Insured · CCC1336817<br/>
            Hollywood, FL · Since 2006<br/>
            {PHONE_DISPLAY}<br/>
            Serving Miami-Dade, Broward &amp; Palm Beach
          </div>
        </div>
        {footCols.map(([h, links]) => (
          <div key={h}>
            <Stamp tick={false} style={{ color: "var(--fg-3)" }}>{h}</Stamp>
            <ul style={{ margin: "16px 0 0", padding: 0, listStyle: "none", display: "flex", flexDirection: "column", gap: 8 }}>
              {links.map(([l, href]) => (
                <li key={l}><a href={href} style={{ font: "400 13px/1.3 var(--sans)", color: "var(--fg-2)" }} dangerouslySetInnerHTML={{ __html: l }} /></li>
              ))}
            </ul>
          </div>
        ))}
      </footer>

      <div style={{ position: "relative", maxWidth: 1440, margin: "48px auto 0", display: "flex", justifyContent: "space-between", font: "400 11px/1.4 var(--mono)", letterSpacing: ".06em", color: "var(--fg-3)", textTransform: "uppercase" }}>
        <span>© 2026 MIBH Construction LLC · CCC1336817 · All rights reserved</span>
        <span>Engineered to withstand · South Florida</span>
      </div>
    </section>
  );
}

// ────────────────────────────────────────────────────────────────────────────
// APP
// ────────────────────────────────────────────────────────────────────────────
function App() {
  const [t, setTweak] = useTweaks(TWEAK_DEFAULTS);
  const [scrolled, setScrolled] = useState(false);
  const route = useHashRoute();

  useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 40);
    window.addEventListener("scroll", onScroll, { passive: true });
    return () => window.removeEventListener("scroll", onScroll);
  }, []);

  useEffect(() => {
    const root = document.documentElement;
    const isLight = t.theme === "light";
    const isConcrete = t.theme === "concrete";

    if (isLight) {
      root.style.setProperty("--bg", "#faf8f3");
      root.style.setProperty("--bg-2", "#f1ece1");
      root.style.setProperty("--fg", "#0e0e10");
      root.style.setProperty("--fg-2", "rgba(14,14,16,.64)");
      root.style.setProperty("--fg-3", "rgba(14,14,16,.44)");
      root.style.setProperty("--line", "rgba(14,14,16,.14)");
      root.style.setProperty("--line-strong", "rgba(14,14,16,.32)");
    } else if (isConcrete) {
      root.style.setProperty("--bg", "#1c1a16");
      root.style.setProperty("--bg-2", "#23201b");
      root.style.setProperty("--fg", "#efe9dc");
      root.style.setProperty("--fg-2", "rgba(239,233,220,.62)");
      root.style.setProperty("--fg-3", "rgba(239,233,220,.38)");
      root.style.setProperty("--line", "rgba(239,233,220,.14)");
      root.style.setProperty("--line-strong", "rgba(239,233,220,.32)");
    } else {
      root.style.setProperty("--bg", "#0e0e10");
      root.style.setProperty("--bg-2", "#141416");
      root.style.setProperty("--fg", "#faf8f3");
      root.style.setProperty("--fg-2", "rgba(250,248,243,.64)");
      root.style.setProperty("--fg-3", "rgba(250,248,243,.40)");
      root.style.setProperty("--line", "rgba(250,248,243,.14)");
      root.style.setProperty("--line-strong", "rgba(250,248,243,.32)");
    }
    root.style.setProperty("--accent", t.accent);
    root.style.setProperty("--accent-ink", "#0e0d0b");
  }, [t.theme, t.accent]);

  const pages = {
    home: <HomePage />,
    services: <ServicesPage />,
    systems: <SystemsPage />,
    work: <WorkPage />,
    about: <AboutPage />,
    markets: <MarketsPage />,
  };

  return (
    <div>
      <Nav scrolled={scrolled} route={route} />
      <main>
        {pages[route] || <HomePage />}
        <FinalCTA />
      </main>

      <TweaksPanel>
        <TweakSection label="Theme" />
        <TweakRadio label="Mode" value={t.theme} options={["dark", "light", "concrete"]} onChange={v => setTweak("theme", v)} />
        <TweakColor label="Accent" value={t.accent} options={ACCENT_SWATCHES} onChange={v => setTweak("accent", v)} />
      </TweaksPanel>
    </div>
  );
}

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