// Mobile Services page

const { useState: svS, useEffect: svE, useRef: svR } = React;

function ServicesHero() {
  return (
    <section style={{ paddingTop: "calc(var(--nav-h) + 32px)", paddingBottom: 36, background: "var(--bone)" }}>
      <div className="container">
        <LineEyebrow style={{ marginBottom: 20 }}>What we do</LineEyebrow>
        <h1 className="serif" style={{ fontSize: 52, lineHeight: 0.98, letterSpacing: "-0.022em", marginBottom: 22 }}>
          <Reveal>Stone protection,</Reveal>
          <Reveal delay={140}>
            <span style={{ color: "var(--maroon)", fontStyle: "italic", display: "block" }}>engineered to last.</span>
          </Reveal>
        </h1>
        <Reveal delay={300}>
          <p className="body" style={{ marginBottom: 0 }}>
            A virtually invisible protective layer engineered to preserve the beauty of natural stone — bonded to your countertops in one day, warranted for life.
          </p>
        </Reveal>
      </div>
    </section>
  );
}

// The System — dark photo bg with explainer card overlay
function System() {
  return (
    <section style={{ position: "relative", background: "var(--black)", color: "var(--bone)", overflow: "hidden" }}>
      <div style={{ position: "relative", height: 320 }}>
        <img src="../assets/work-satin-3.png" alt="" style={{
          position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover",
          filter: "brightness(0.45) saturate(0.8)",
        }}/>
        <div style={{ position: "absolute", inset: 0, background: "linear-gradient(to bottom, rgba(10,9,8,0.3), rgba(10,9,8,0.85))" }}/>
        <div className="container" style={{ position: "relative", height: "100%", display: "flex", flexDirection: "column", justifyContent: "flex-end", paddingBottom: 28 }}>
          <Reveal>
            <div className="serif" style={{ fontSize: 30, lineHeight: 1.1, letterSpacing: "-0.018em", color: "var(--bone)", marginBottom: 12 }}>
              The first line of defense<br/>
              <em style={{ color: "var(--bronze)" }}>between your stone and the life around it.</em>
            </div>
            <div className="mono" style={{ fontSize: 10, letterSpacing: "0.18em", textTransform: "uppercase", color: "rgba(245,242,237,0.6)" }}>
              Certified StoneGuard® Installer
            </div>
          </Reveal>
        </div>
      </div>

      <div style={{ background: "var(--bone)", color: "var(--ink)", padding: "44px var(--gutter) 56px" }}>
        <Reveal>
          <LineEyebrow style={{ marginBottom: 20 }}>01 · The System</LineEyebrow>
          <h2 className="serif" style={{ fontSize: 34, lineHeight: 1.05, letterSpacing: "-0.02em", marginBottom: 18 }}>
            The StoneGuard® System.
          </h2>
          <p className="body" style={{ marginBottom: 24 }}>
            An advanced, nearly invisible barrier engineered to preserve the beauty of natural stone. It bonds to the surface, takes the abuse that stone can't, and leaves your countertop looking identical to the day it was installed.
          </p>
          <ul style={{ listStyle: "none", borderTop: "1px solid var(--line)" }}>
            {[
              { t: "Nearly invisible",       d: "You see stone, not a coating." },
              { t: "Stain-proof, etch-proof", d: "Red wine, lemon, tomato. All safe." },
              { t: "Heat resistant",         d: "Hot pans set down without fear." },
              { t: "Food safe, non-yellowing", d: "Certified for kitchen use." },
            ].map((r, i) => (
              <li key={i} style={{ padding: "14px 0", borderBottom: "1px solid var(--line)" }}>
                <div className="mono" style={{ fontSize: 10, letterSpacing: "0.16em", textTransform: "uppercase", color: "var(--ink)", marginBottom: 4 }}>
                  {String(i + 1).padStart(2, "0")} · {r.t}
                </div>
                <div style={{ fontSize: 13, color: "var(--mute)" }}>{r.d}</div>
              </li>
            ))}
          </ul>
        </Reveal>
      </div>
    </section>
  );
}

// Two-service section (re-use of home's pattern but standalone)
function ServiceCards({ onInquire }) {
  const services = [
    {
      name: "StoneGuard® Clear",
      sub: "Polished finish",
      desc: "A virtually invisible film for polished marble — stain-proof, etch-proof, heat-resistant. Marble looks identical, just stops getting ruined.",
      bullets: ["Polished & glossy surfaces", "Stain Proof", "Etch Proof", "Lifetime Warranty"],
      img: "../assets/work-clear-6.jpg",
    },
    {
      name: "StoneGuard® Satin",
      sub: "Honed finish",
      desc: "Engineered for honed stone. Protects the full surface, preserves the tactile softness, and adds depth that brings out the stone's natural color.",
      bullets: ["Honed surfaces", "Matches matte finish perfectly", "Food-safe & non-yellowing", "Enhances depth and colors"],
      img: "../assets/work-satin-2.png",
    },
  ];
  return (
    <section style={{ padding: "60px 0", background: "var(--cream)" }}>
      <div className="container" style={{ marginBottom: 26 }}>
        <Reveal>
          <LineEyebrow style={{ marginBottom: 14 }}>02 · Two Finishes</LineEyebrow>
          <h2 className="serif" style={{ fontSize: 32, lineHeight: 1.04, letterSpacing: "-0.02em" }}>
            One outcome: <em style={{ color: "var(--maroon)" }}>a countertop that stays like new.</em>
          </h2>
        </Reveal>
      </div>
      <div className="container" style={{ display: "grid", gap: 20 }}>
        {services.map((s, i) => (
          <Reveal key={i} delay={i * 100}>
            <article style={{ background: "var(--bone)", border: "1px solid var(--line)" }}>
              <div className="img-wrap" style={{ aspectRatio: "5/4" }}>
                <img src={s.img} alt={s.name} />
              </div>
              <div style={{ padding: 22 }}>
                <div className="mono" style={{ fontSize: 10, letterSpacing: "0.16em", color: "var(--mute)", marginBottom: 10, textTransform: "uppercase" }}>
                  {s.sub}
                </div>
                <h3 className="serif" style={{ fontSize: 28, letterSpacing: "-0.015em", lineHeight: 1.05, marginBottom: 12 }}>{s.name}</h3>
                <p className="body" style={{ fontSize: 14, marginBottom: 18 }}>{s.desc}</p>
                <ul style={{ listStyle: "none", marginBottom: 18, borderTop: "1px solid var(--line)" }}>
                  {s.bullets.map((b, j) => (
                    <li key={j} style={{ padding: "11px 0", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 10, fontSize: 13 }}>
                      <svg width="11" height="11" viewBox="0 0 12 12"><path d="M2 6l3 3 5-7" stroke="var(--maroon)" strokeWidth="1.5" fill="none"/></svg>
                      {b}
                    </li>
                  ))}
                </ul>
                <button onClick={onInquire} className="btn btn-ghost btn-block">
                  Get a quote
                  <svg width="11" height="11" viewBox="0 0 12 12" fill="none"><path d="M1 6h10m0 0L6 1m5 5L6 11" stroke="currentColor" strokeWidth="1.2"/></svg>
                </button>
              </div>
            </article>
          </Reveal>
        ))}
      </div>
    </section>
  );
}

// Applications — 2-col room grid
function Applications() {
  const apps = [
    { name: "Kitchens",         img: "../assets/work-clear-1.jpg" },
    { name: "Master Baths",     img: "../assets/work-clear-2.jpg" },
    { name: "Dining Tables",    img: "../assets/work-clear-4.jpg" },
    { name: "Bars & Built-ins", img: "../assets/work-clear-5.jpg" },
    { name: "Outdoor Kitchens", img: "../assets/hero-5313.jpg" },
    { name: "Vanities & Tops",  img: "../assets/work-satin-3.png" },
  ];
  return (
    <section style={{ padding: "70px 0", background: "var(--bone)" }}>
      <div className="container">
        <Reveal>
          <div style={{ textAlign: "center", marginBottom: 36 }}>
            <LineEyebrow style={{ justifyContent: "center", marginBottom: 14 }}>Applications</LineEyebrow>
            <h2 className="serif" style={{ fontSize: 32, lineHeight: 1.05, letterSpacing: "-0.02em" }}>
              In every room <em style={{ color: "var(--maroon)" }}>of the home.</em>
            </h2>
          </div>
        </Reveal>
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 14 }}>
          {apps.map((a, i) => (
            <Reveal key={i} delay={i * 50}>
              <figure>
                <div className="img-wrap" style={{ aspectRatio: "4/5" }}>
                  <img src={a.img} alt={a.name} />
                </div>
                <figcaption style={{ marginTop: 10, display: "flex", justifyContent: "space-between", alignItems: "baseline" }}>
                  <div className="serif" style={{ fontSize: 15, letterSpacing: "-0.01em" }}>{a.name}</div>
                  <div className="mono" style={{ fontSize: 9, letterSpacing: "0.14em", textTransform: "uppercase", color: "var(--mute)" }}>
                    {String(i + 1).padStart(2, "0")}
                  </div>
                </figcaption>
              </figure>
            </Reveal>
          ))}
        </div>
      </div>
    </section>
  );
}

// ─────────────────────────────────────────────
// FUTURE SERVICES — annex tease of products in development
// ─────────────────────────────────────────────
function FutureServices() {
  const items = [
    { name: "Restoration Service", status: "Q3 2026", desc: "Full marble polishing and etch repair as a standalone service — for clients who don't yet want a film, but need their stone brought back." },
  ];
  return (
    <section style={{ padding: "60px 0 70px", background: "var(--bone)", borderTop: "1px solid var(--line)" }}>
      <div className="container">
        <Reveal>
          <LineEyebrow style={{ marginBottom: 14 }}>03 · On the way</LineEyebrow>
          <h2 className="serif" style={{ fontSize: 30, lineHeight: 1.06, letterSpacing: "-0.018em", marginBottom: 24 }}>
            More services <em style={{ color: "var(--maroon)" }}>on the way.</em>
          </h2>
        </Reveal>
        <div style={{ display: "grid", gap: 14 }}>
          {items.map((it, i) => (
            <Reveal key={it.name} delay={i * 80}>
              <div style={{
                padding: "20px 22px",
                border: "1px dashed var(--line)",
                background: "var(--cream)",
              }}>
                <div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 10 }}>
                  <div className="mono" style={{ fontSize: 10, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--mute)" }}>
                    Coming soon
                  </div>
                  <span className="mono" style={{
                    fontSize: 9, letterSpacing: "0.18em", textTransform: "uppercase",
                    padding: "4px 8px",
                    background: "var(--bronze)", color: "var(--ink)",
                  }}>{it.status}</span>
                </div>
                <h3 className="serif" style={{ fontSize: 24, letterSpacing: "-0.01em", marginBottom: 8 }}>{it.name}</h3>
                <p className="body" style={{ fontSize: 13, marginBottom: 0 }}>{it.desc}</p>
              </div>
            </Reveal>
          ))}
        </div>
      </div>
    </section>
  );
}

// ─────────────────────────────────────────────
// COMPARISON — drag (or scrub) between Clear & Satin on the same photo
// Touch-native: drag the handle left-right, or tap one side to reveal.
// ─────────────────────────────────────────────
function ServiceComparison() {
  const [pos, setPos] = svS(50); // 0-100, percent revealed of the right side (Satin)
  const dragRef = svR(null);
  const draggingRef = svR(false);
  svE(() => {
    const el = dragRef.current; if (!el) return;
    const onMove = (clientX) => {
      const rect = el.getBoundingClientRect();
      const x = ((clientX - rect.left) / rect.width) * 100;
      setPos(Math.max(0, Math.min(100, x)));
    };
    const onDown = (e) => { draggingRef.current = true; onMove(e.touches ? e.touches[0].clientX : e.clientX); e.preventDefault(); };
    const onMv = (e) => { if (!draggingRef.current) return; onMove(e.touches ? e.touches[0].clientX : e.clientX); };
    const onUp = () => { draggingRef.current = false; };
    el.addEventListener("touchstart", onDown, { passive: false });
    el.addEventListener("touchmove",  onMv,   { passive: false });
    el.addEventListener("touchend",   onUp);
    el.addEventListener("mousedown",  onDown);
    window.addEventListener("mousemove", onMv);
    window.addEventListener("mouseup",   onUp);
    return () => {
      el.removeEventListener("touchstart", onDown);
      el.removeEventListener("touchmove",  onMv);
      el.removeEventListener("touchend",   onUp);
      el.removeEventListener("mousedown",  onDown);
      window.removeEventListener("mousemove", onMv);
      window.removeEventListener("mouseup",   onUp);
    };
  }, []);
  return (
    <section style={{ padding: "70px 0", background: "var(--bone)", borderTop: "1px solid var(--line)" }}>
      <div className="container" style={{ marginBottom: 22 }}>
        <Reveal>
          <LineEyebrow style={{ marginBottom: 14 }}>04 · Compare</LineEyebrow>
          <h2 className="serif" style={{ fontSize: 32, lineHeight: 1.04, letterSpacing: "-0.02em", marginBottom: 12 }}>
            Similar stones. <em style={{ color: "var(--maroon)" }}>Two finishes.</em>
          </h2>
          <p className="body" style={{ fontSize: 14 }}>Drag the handle to switch between the polished Clear film and the matte Satin film on similar stones.</p>
        </Reveal>
      </div>

      <div style={{ position: "relative", margin: "0 var(--gutter)" }} ref={dragRef}>
        <div style={{ position: "relative", aspectRatio: "4/5", overflow: "hidden", touchAction: "none", cursor: "ew-resize" }}>
          {/* Bottom: Satin (right side) */}
          <img src="../assets/work-satin-2.png" alt="StoneGuard Satin on honed marble" style={{
            position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover",
          }}/>
          {/* Top: Clear (left side) — clipped at pos */}
          <div style={{ position: "absolute", inset: 0, clipPath: `inset(0 ${100 - pos}% 0 0)` }}>
            <img src="../assets/work-clear-6.jpg" alt="StoneGuard Clear on polished marble" style={{
              position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover",
            }}/>
          </div>
          {/* Labels */}
          <div style={{
            position: "absolute", top: 14, left: 14,
            padding: "6px 10px", background: "rgba(245,242,237,0.92)",
            fontFamily: "'JetBrains Mono', monospace", fontSize: 9, letterSpacing: "0.18em",
            textTransform: "uppercase", color: "var(--ink)",
          }}>Clear · Polished</div>
          <div style={{
            position: "absolute", top: 14, right: 14,
            padding: "6px 10px", background: "rgba(20,20,18,0.85)",
            fontFamily: "'JetBrains Mono', monospace", fontSize: 9, letterSpacing: "0.18em",
            textTransform: "uppercase", color: "var(--bone)",
          }}>Satin · Honed</div>
          {/* The divider + handle */}
          <div style={{
            position: "absolute", top: 0, bottom: 0, left: `${pos}%`,
            width: 2, background: "var(--bone)",
            boxShadow: "0 0 14px rgba(0,0,0,0.4)",
            transform: "translateX(-50%)",
            pointerEvents: "none",
          }}/>
          <div style={{
            position: "absolute", top: "50%", left: `${pos}%`,
            transform: "translate(-50%, -50%)",
            width: 52, height: 52, borderRadius: "50%",
            background: "var(--bone)",
            border: "2px solid var(--ink)",
            display: "grid", placeItems: "center",
            boxShadow: "0 8px 24px rgba(0,0,0,0.3)",
            pointerEvents: "none",
            transition: draggingRef.current ? "none" : "transform .2s",
          }}>
            <svg width="22" height="14" viewBox="0 0 22 14" fill="none">
              <path d="M6 1L1 7l5 6M16 1l5 6-5 6M3 7h16" stroke="var(--ink)" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
          </div>
        </div>
      </div>

      <div className="container" style={{ marginTop: 18, display: "grid", gridTemplateColumns: "1fr 1fr", gap: 14 }}>
        <div>
          <div className="mono" style={{ fontSize: 9, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--maroon)", marginBottom: 4 }}>Clear</div>
          <div className="serif" style={{ fontSize: 17, letterSpacing: "-0.01em" }}>For polished stone</div>
          <p className="body-sm" style={{ marginTop: 6 }}>Optically clear. Enhances the reflective depth of polished marble.</p>
        </div>
        <div>
          <div className="mono" style={{ fontSize: 9, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--maroon)", marginBottom: 4 }}>Satin</div>
          <div className="serif" style={{ fontSize: 17, letterSpacing: "-0.01em" }}>For honed stone</div>
          <p className="body-sm" style={{ marginTop: 6 }}>Matched-matte. Preserves the soft tactility of honed finishes.</p>
        </div>
      </div>
    </section>
  );
}

// ─────────────────────────────────────────────
// WHAT IT IS — expandable spec accordion (4 facts)
// ─────────────────────────────────────────────
function WhatItIs() {
  const facts = [
    {
      q: "What is StoneGuard?",
      a: "A precision-engineered protective film, hand-applied to your stone. Roughly the thickness of a human hair. It bonds to the surface and acts as the wear layer — taking the rings, scratches, and etches, instead of your stone.",
      spec: [
        ["Material",     "Multi-layer urethane film"],
        ["Thickness",    "~8 mil (0.2 mm)"],
        ["Bond type",    "Pressure-activated, residue-free removal"],
        ["Cure time",    "24 hours after install"],
      ],
    },
    {
      q: "What does it actually stop?",
      a: "Stains from wine, oil, coffee, citrus. Etches from acidic foods. Scratches from cutting and sliding pans. Heat up to 420°F. The film is the surface that takes the abuse — your stone never sees it.",
      spec: [
        ["Stains",       "Sealed top layer is non-porous"],
        ["Etches",       "Acid-resistant"],
        ["Scratches",    "Self-healing surface to a depth"],
        ["Heat",         "Tested to 420°F continuous"],
      ],
    },
    {
      q: "Will I see it?",
      a: "No. Clear is optically matched to polished stone — most clients can't find the edge after install. Satin is engineered to match honed and matte finishes exactly. We hand-trim every edge to disappear into the stone's existing seams.",
      spec: [
        ["Clarity",      "Clear, UV-stable, non-yellowing"],
        ["Match",        "Polished or honed"],
        ["Edges",        "Hand-trimmed, no visible seam"],
      ],
    },
    {
      q: "Can it be removed?",
      a: "Yes, cleanly, by us. The adhesive is engineered for a residue-free release. Sell the home, renovate, change your mind — the stone underneath is exactly as it was the day we installed.",
      spec: [
        ["Removal",      "Professional, residue-free"],
        ["Stone",        "Unchanged from pre-install"],
        ["Re-install",   "Possible after cleaning"],
      ],
    },
  ];

  return (
    <section style={{ padding: "70px 0", background: "var(--cream)" }}>
      <div className="container" style={{ marginBottom: 32 }}>
        <Reveal>
          <LineEyebrow style={{ marginBottom: 14 }}>05 · What it actually is</LineEyebrow>
          <h2 className="serif" style={{ fontSize: 30, lineHeight: 1.05, letterSpacing: "-0.018em" }}>
            A film as thin as a human hair, doing the job of a coaster, a cutting board, and a trivet — <em style={{ color: "var(--maroon)" }}>permanently.</em>
          </h2>
        </Reveal>
      </div>

      <div className="container">
        {/* Cross-section diagram — simple, illustrative */}
        <Reveal>
          <FilmDiagramMobile />
        </Reveal>

        <div style={{ marginTop: 36, borderTop: "1px solid var(--line)" }}>
          {facts.map((f, i) => <FactRow key={i} fact={f} index={i} />)}
        </div>
      </div>
    </section>
  );
}

function FactRow({ fact, index }) {
  const [open, setOpen] = svS(false);
  return (
    <Reveal delay={index * 50}>
      <div style={{ borderBottom: "1px solid var(--line)" }}>
        <button onClick={() => setOpen(!open)} style={{
          width: "100%", padding: "18px 0", textAlign: "left",
          display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 14,
        }}>
          <div style={{ flex: 1 }}>
            <div className="mono" style={{ fontSize: 9, letterSpacing: "0.2em", textTransform: "uppercase", color: "var(--mute)", marginBottom: 6, fontVariantNumeric: "tabular-nums" }}>
              0{index + 1}
            </div>
            <h3 className="serif" style={{ fontSize: 20, letterSpacing: "-0.01em", lineHeight: 1.2, marginBottom: 8 }}>
              {fact.q}
            </h3>
            <p className="body" style={{ fontSize: 13 }}>{fact.a}</p>
          </div>
          <span style={{
            flexShrink: 0, marginTop: 28,
            fontFamily: "'JetBrains Mono', monospace", fontSize: 10, letterSpacing: "0.18em",
            textTransform: "uppercase", color: "var(--ink)",
            display: "inline-flex", alignItems: "center", gap: 6,
          }}>
            <span>{open ? "Hide" : "Specs"}</span>
            <span style={{
              display: "inline-block", width: 8, height: 8,
              borderRight: "1px solid currentColor", borderBottom: "1px solid currentColor",
              transform: open ? "rotate(-135deg) translate(-1px, -1px)" : "rotate(45deg)",
              transition: "transform .3s",
            }}/>
          </span>
        </button>
        <div style={{
          display: "grid",
          gridTemplateRows: open ? "1fr" : "0fr",
          transition: "grid-template-rows .35s cubic-bezier(.2,.7,.2,1)",
        }}>
          <div style={{ overflow: "hidden" }}>
            <div style={{ padding: "0 0 22px", marginTop: 8 }}>
              <ul style={{ listStyle: "none", borderTop: "1px solid var(--line)" }}>
                {fact.spec.map(([k, v], j) => (
                  <li key={j} style={{
                    padding: "10px 0", borderBottom: "1px solid var(--line)",
                    display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 14, alignItems: "baseline",
                  }}>
                    <span className="mono" style={{ fontSize: 9, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--mute)" }}>{k}</span>
                    <span style={{ fontSize: 13, color: "var(--ink)" }}>{v}</span>
                  </li>
                ))}
              </ul>
            </div>
          </div>
        </div>
      </div>
    </Reveal>
  );
}

// Simple cross-section: stone slab → adhesive → film → wear
function FilmDiagramMobile() {
  return (
    <div style={{ background: "var(--bone)", padding: 18, border: "1px solid var(--line)" }}>
      <div className="mono" style={{ fontSize: 9, letterSpacing: "0.2em", textTransform: "uppercase", color: "var(--mute)", marginBottom: 12 }}>
        Cross-section · Actual scale exaggerated 20×
      </div>
      <svg viewBox="0 0 320 130" style={{ width: "100%", height: "auto", display: "block" }}>
        {/* Stone slab */}
        <rect x="0" y="60" width="320" height="60" fill="#D9D2C6" />
        <path d="M20 80 Q60 70, 100 78 T180 76 T260 82 T320 80" stroke="#9B8567" strokeWidth="0.6" fill="none" opacity="0.6"/>
        <path d="M0 100 Q40 95, 80 100 T160 102 T240 98 T320 105" stroke="#9B8567" strokeWidth="0.4" fill="none" opacity="0.5"/>
        {/* Adhesive */}
        <rect x="0" y="56" width="320" height="4" fill="#C9A961" opacity="0.4"/>
        {/* Film */}
        <rect x="0" y="50" width="320" height="6" fill="#E8D4A8" opacity="0.5"/>
        {/* Wear */}
        <rect x="0" y="46" width="320" height="4" fill="#fff" opacity="0.7"/>

        {/* Callouts */}
        <line x1="80" y1="48" x2="80" y2="20" stroke="var(--maroon)" strokeWidth="0.5"/>
        <text x="80" y="14" fontFamily="'JetBrains Mono'" fontSize="7" letterSpacing="0.18em" fill="var(--maroon)" textAnchor="middle">NANO CERAMIC · 1 mil</text>

        <line x1="180" y1="53" x2="180" y2="32" stroke="var(--ink)" strokeWidth="0.5"/>
        <text x="180" y="26" fontFamily="'JetBrains Mono'" fontSize="7" letterSpacing="0.18em" fill="var(--ink)" textAnchor="middle">FILM · 5 mil</text>

        <line x1="260" y1="58" x2="260" y2="44" stroke="var(--mute)" strokeWidth="0.5"/>
        <text x="260" y="38" fontFamily="'JetBrains Mono'" fontSize="7" letterSpacing="0.18em" fill="var(--mute)" textAnchor="middle">ADHESIVE</text>

        <text x="160" y="100" fontFamily="'Instrument Serif'" fontSize="11" fontStyle="italic" fill="var(--ink-2)" textAnchor="middle">your stone</text>
      </svg>
      <a href="../assets/stoneguard-patent-US9980567.pdf" target="_blank" rel="noopener" className="mono" style={{
        display: "inline-flex", alignItems: "center", gap: 8,
        marginTop: 14, paddingBottom: 2,
        fontSize: 9, letterSpacing: "0.18em", textTransform: "uppercase",
        color: "var(--ink)", borderBottom: "1px solid var(--line)",
      }}>
        Protected by U.S. Patent 9,980,567 · View
        <svg width="9" height="9" viewBox="0 0 14 14" fill="none"><path d="M1 7h12m0 0L7 1m6 6L7 13" stroke="currentColor" strokeWidth="1.2"/></svg>
      </a>
    </div>
  );
}

// ─────────────────────────────────────────────
// WHY US — 4 pillars on dark
// ─────────────────────────────────────────────
function WhyUs() {
  const pillars = [
    { h: "We only do this.",                    p: "Surface protection is the entire business. Not a tile shop, not a fabricator, not a side service. Specialists, not generalists." },
    { h: "Certified by the manufacturer.",      p: "We're a Certified StoneGuard® installer. That's a relationship the brand only extends to teams whose work they'll stand behind." },
    { h: "Lifetime warranty, in writing.",      p: "If the film fails, we're back. No subcontractor lottery. No expiration date. The same two installers who applied it answer the call." },
    { h: "Five stars, every review.",           p: "Five-star average across Google and Houzz. Thousands of homes. Read them all on the home page if you'd like." },
  ];
  return (
    <section style={{ padding: "80px 0", background: "var(--ink)", color: "var(--bone)" }}>
      <div className="container">
        <Reveal>
          <div className="mono" style={{ fontSize: 10, letterSpacing: "0.2em", textTransform: "uppercase", color: "rgba(245,242,237,0.5)", marginBottom: 18, display: "inline-flex", alignItems: "center", gap: 10 }}>
            <span style={{ display: "inline-block", width: 22, height: 1, background: "currentColor" }}/>
            06 · Why us
          </div>
        </Reveal>
        <h2 className="serif" style={{ fontSize: 40, lineHeight: 0.98, letterSpacing: "-0.022em", marginBottom: 40 }}>
          <Reveal>There are other installers.</Reveal>
          <Reveal delay={140}>
            <span style={{ color: "var(--bronze)", fontStyle: "italic", display: "block" }}>This is what makes us different.</span>
          </Reveal>
        </h2>

        <div style={{ borderTop: "1px solid rgba(245,242,237,0.18)" }}>
          {pillars.map((p, i) => (
            <Reveal key={i} delay={i * 80}>
              <div style={{
                padding: "26px 0",
                borderBottom: "1px solid rgba(245,242,237,0.18)",
                display: "grid", gridTemplateColumns: "32px 1fr", gap: 14,
              }}>
                <div className="mono" style={{ fontSize: 11, letterSpacing: "0.18em", color: "var(--bronze)", fontVariantNumeric: "tabular-nums", paddingTop: 6 }}>
                  0{i + 1}
                </div>
                <div>
                  <h3 className="serif" style={{ fontSize: 24, letterSpacing: "-0.015em", lineHeight: 1.12, marginBottom: 8 }}>{p.h}</h3>
                  <p style={{ fontSize: 14, lineHeight: 1.55, color: "rgba(245,242,237,0.75)" }}>{p.p}</p>
                </div>
              </div>
            </Reveal>
          ))}
        </div>
      </div>
    </section>
  );
}

// ─────────────────────────────────────────────
// PROCESS — 6 steps from "I'm worried" to "I forgot it was there"
// ─────────────────────────────────────────────
function ServicesProcess() {
  const steps = [
    { no: "01", t: "You find us.",             d: "Most clients arrive through social, a referral, or a fabricator who's seen our work. You submit an inquiry — it takes about a minute.", side: "DAY 0" },
    { no: "02", t: "Consultation.",            d: "We discuss your project, your specific stone, and how we can best service you.",                                                         side: "DAY 1–2" },
    { no: "03", t: "Measurements.",            d: "We walk you through the measurement process we use to price the installation.",                                                          side: "DAY 2" },
    { no: "04", t: "We send the quote.",       d: "An itemized quote based on the exact square footage and finish. No surprises later.",                                                    side: "DAY 3" },
    { no: "05", t: "We schedule and install.", d: "Two installers, one day, your kitchen. Template, prep, lay, hand-trim, cure. You can use the counters that night.",                      side: "INSTALL" },
    { no: "06", t: "You forget it's there.",   d: "By the next morning, the film has fully cured and disappeared into the stone. You'll never think about coasters again.",                 side: "FOREVER" },
  ];
  return (
    <section style={{ padding: "80px 0", background: "var(--cream)" }}>
      <div className="container">
        <Reveal>
          <LineEyebrow style={{ marginBottom: 14 }}>07 · The Process</LineEyebrow>
          <h2 className="serif" style={{ fontSize: 32, lineHeight: 1.04, letterSpacing: "-0.02em", marginBottom: 18 }}>
            Six steps from <em style={{ color: "var(--maroon)" }}>"I'm worried"</em> to <em style={{ color: "var(--maroon)" }}>"I forgot it was there."</em>
          </h2>
          <p className="body" style={{ fontSize: 14, marginBottom: 30 }}>
            The whole arc usually takes a week. The install itself is one day.
          </p>
        </Reveal>

        <div style={{ position: "relative" }}>
          <div style={{
            position: "absolute", top: 22, bottom: 22, left: 19,
            width: 1, background: "var(--line)",
          }}/>
          {steps.map((s, i) => (
            <Reveal key={i} delay={i * 70}>
              <div style={{ display: "flex", gap: 18, paddingBottom: 26, position: "relative" }}>
                <div style={{
                  width: 40, height: 40, borderRadius: "50%",
                  background: "var(--maroon)",
                  border: "3px solid var(--cream)",
                  outline: "1px solid var(--maroon)",
                  display: "grid", placeItems: "center",
                  flexShrink: 0,
                  fontFamily: "'JetBrains Mono', monospace", fontSize: 11, letterSpacing: "0.05em",
                  color: "var(--bronze)",
                  zIndex: 1,
                }}>{s.no}</div>
                <div style={{ flex: 1, paddingTop: 4 }}>
                  <div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline", gap: 10, marginBottom: 6 }}>
                    <h3 className="serif" style={{ fontSize: 20, letterSpacing: "-0.01em" }}>{s.t}</h3>
                    <span className="mono" style={{ fontSize: 9, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--maroon)", whiteSpace: "nowrap" }}>
                      {s.side}
                    </span>
                  </div>
                  <p style={{ fontSize: 14, lineHeight: 1.55, color: "var(--ink-2)" }}>{s.d}</p>
                </div>
              </div>
            </Reveal>
          ))}
        </div>
      </div>
    </section>
  );
}

Object.assign(window, {
  ServicesHero, System, ServiceCards, Applications,
  FutureServices, ServiceComparison, WhatItIs, WhyUs, ServicesProcess,
});
