// Shared Nuline website layout components
const { useState, useEffect, useRef } = React;

// ---- Line icons (1.75 stroke, lucide-style) ----
function Icon({ name, size = 18, color = "currentColor", ...p }) {
  // Icon glyphs are decorative — paired with text labels (or aria-labelled parents like
  // the social link / hamburger button), so we hide them from screen readers by default.
  const common = { width: size, height: size, viewBox: "0 0 24 24", fill: "none",
    stroke: color, strokeWidth: 1.75, strokeLinecap: "round", strokeLinejoin: "round",
    "aria-hidden": "true", focusable: "false", ...p };
  switch (name) {
    case "arrow":return <svg {...common}><path d="M5 12h14M13 5l7 7-7 7" /></svg>;
    case "phone":return <svg {...common}><path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6A19.79 19.79 0 012.12 4.18 2 2 0 014.11 2h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7A2 2 0 0122 16.92z" /></svg>;
    case "check":return <svg {...common}><path d="M20 6L9 17l-5-5" /></svg>;
    case "pin":return <svg {...common}><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" /><circle cx="12" cy="10" r="3" /></svg>;
    case "chevron":return <svg {...common}><path d="M6 9l6 6 6-6" /></svg>;
    case "star":return <svg {...common}><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" /></svg>;
    case "clock":return <svg {...common}><circle cx="12" cy="12" r="10" /><polyline points="12 6 12 12 16 14" /></svg>;
    case "mail":return <svg {...common}><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" /><polyline points="22,6 12,13 2,6" /></svg>;
    case "facebook":return <svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" /></svg>;
    case "instagram":return <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" /><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z" /><line x1="17.5" y1="6.5" x2="17.51" y2="6.5" /></svg>;
    case "fence":return <svg {...common}><path d="M3 18V7l2-3 2 3v11M9 18V7l2-3 2 3v11M15 18V7l2-3 2 3v11M2 11h20M2 15h20" /></svg>;
    case "menu":return <svg {...common}><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="18" x2="21" y2="18" /></svg>;
    default:return null;
  }
}

// ---- Fence illustrations (line art, forest color) ----
const FENCE_ILL_LABELS = {
  paling:    "Paling fence illustration",
  lattice:   "Lattice-top fence illustration",
  capping:   "Capped fence illustration",
  retaining: "Retaining wall illustration",
  gate:      "Gate illustration",
  repairs:   "Fence repair illustration"
};
function FenceIll({ variant = "paling", size = 120 }) {
  const c = "#2E4B33",sw = 1.6;
  const common = { width: size, height: size, viewBox: "0 0 120 110", fill: "none",
    stroke: c, strokeWidth: sw, strokeLinecap: "round", strokeLinejoin: "round",
    role: "img", "aria-label": FENCE_ILL_LABELS[variant] || "Fence illustration" };
  if (variant === "paling") {
    return (
      <svg {...common}>
        <line x1="10" y1="100" x2="110" y2="100" strokeWidth="1.2" />
        {[18, 30, 42, 54, 66, 78, 90, 102].map((x, i) =>
        <rect key={i} x={x - 5} y="25" width="10" height="70" rx="1" />
        )}
        <rect x="12" y="38" width="96" height="5" rx="1" />
        <rect x="12" y="75" width="96" height="5" rx="1" />
      </svg>);

  }
  if (variant === "lattice") {
    return (
      <svg {...common}>
        <line x1="10" y1="100" x2="110" y2="100" strokeWidth="1.2" />
        {[18, 30, 42, 54, 66, 78, 90, 102].map((x, i) =>
        <rect key={i} x={x - 5} y="45" width="10" height="50" rx="1" />
        )}
        <rect x="12" y="58" width="96" height="4" rx="1" />
        <rect x="12" y="88" width="96" height="4" rx="1" />
        {/* lattice top */}
        <rect x="14" y="14" width="92" height="28" rx="1" />
        <line x1="20" y1="14" x2="42" y2="42" />
        <line x1="42" y1="14" x2="64" y2="42" />
        <line x1="64" y1="14" x2="86" y2="42" />
        <line x1="86" y1="14" x2="106" y2="42" />
        <line x1="20" y1="42" x2="42" y2="14" />
        <line x1="42" y1="42" x2="64" y2="14" />
        <line x1="64" y1="42" x2="86" y2="14" />
        <line x1="86" y1="42" x2="106" y2="14" />
      </svg>);

  }
  if (variant === "capping") {
    return (
      <svg {...common}>
        <line x1="10" y1="100" x2="110" y2="100" strokeWidth="1.2" />
        {[18, 30, 42, 54, 66, 78, 90, 102].map((x, i) =>
        <rect key={i} x={x - 5} y="28" width="10" height="66" rx="1" />
        )}
        <rect x="8" y="18" width="104" height="8" rx="1.5" />
        <rect x="12" y="42" width="96" height="4" rx="1" />
        <rect x="12" y="78" width="96" height="4" rx="1" />
      </svg>);

  }
  if (variant === "retaining") {
    return (
      <svg {...common}>
        <line x1="10" y1="100" x2="110" y2="100" strokeWidth="1.2" />
        <rect x="15" y="14" width="5" height="80" rx="0.8" />
        <rect x="100" y="14" width="5" height="80" rx="0.8" />
        <rect x="15" y="46" width="90" height="7" rx="0.8" />
        <rect x="15" y="58" width="90" height="7" rx="0.8" />
        <rect x="15" y="70" width="90" height="7" rx="0.8" />
        <rect x="15" y="82" width="90" height="7" rx="0.8" />
      </svg>);

  }
  if (variant === "gate") {
    return (
      <svg {...common}>
        <line x1="10" y1="100" x2="110" y2="100" strokeWidth="1.2" />
        <rect x="20" y="22" width="80" height="72" rx="1" />
        <line x1="20" y1="94" x2="100" y2="22" />
        <rect x="22" y="24" width="10" height="68" rx="0.8" />
        <rect x="88" y="24" width="10" height="68" rx="0.8" />
        <rect x="34" y="28" width="10" height="64" rx="0.8" />
        <rect x="46" y="28" width="10" height="64" rx="0.8" />
        <rect x="58" y="28" width="10" height="64" rx="0.8" />
        <rect x="70" y="28" width="10" height="64" rx="0.8" />
        <circle cx="82" cy="58" r="2" />
      </svg>);

  }
  if (variant === "repairs") {
    return (
      <svg {...common}>
        <line x1="10" y1="100" x2="110" y2="100" strokeWidth="1.2" />
        {[18, 30, 42, 54, 66, 78, 90, 102].map((x, i) =>
        <rect key={i} x={x - 5} y="25" width="10" height="70" rx="1"
        transform={i === 3 ? "rotate(-8 54 60)" : ""} />
        )}
        <rect x="12" y="38" width="96" height="5" rx="1" />
        <rect x="12" y="75" width="96" height="5" rx="1" />
        {/* hammer */}
        <path d="M70 8 L78 16 L92 30" strokeWidth="2" />
        <rect x="62" y="4" width="16" height="10" rx="1.5" transform="rotate(45 70 9)" />
      </svg>);

  }
  return null;
}

// Cross-section illustration for "We Build Fences that Last"
const CROSS_ILL_LABELS = {
  plinth:   "Thicker plinth board cross-section illustration",
  posts:    "Long post in deep concrete footing illustration",
  tight:    "Tightly spaced palings illustration",
  fixings:  "Galvanised steel fasteners illustration",
  timber:   "Treated pine timber post illustration",
  concrete: "Wide concrete footing illustration"
};
function CrossIll({ variant, size = 160 }) {
  const c = "#2E4B33",a = "#C96442",sw = 1.6;
  const common = { width: size, height: size, viewBox: "0 0 160 150", fill: "none",
    stroke: c, strokeWidth: sw, strokeLinecap: "round", strokeLinejoin: "round",
    role: "img", "aria-label": CROSS_ILL_LABELS[variant] || "Fence-build detail illustration" };
  if (variant === "plinth") {
    // Thicker plinth board
    return (
      <svg {...common}>
        {/* palings */}
        {[36, 50, 64, 78, 92, 106, 120].map((x, i) =>
        <rect key={i} x={x - 5} y="30" width="10" height="60" rx="1" />
        )}
        <rect x="28" y="40" width="100" height="5" rx="1" />
        <rect x="28" y="72" width="100" height="5" rx="1" />
        {/* thick plinth */}
        <rect x="24" y="92" width="108" height="14" rx="1.5" stroke={a} strokeWidth="2" />
        <line x1="20" y1="110" x2="140" y2="110" />
        {/* measurement arrow */}
        <line x1="142" y1="92" x2="142" y2="106" stroke={c} strokeWidth="1.2" />
        <path d="M139 94l3-3 3 3M139 104l3 3 3-3" stroke={c} strokeWidth="1.2" />
      </svg>);

  }
  if (variant === "posts") {
    // Post in ground w/ concrete + arrow
    return (
      <svg {...common}>
        <rect x="66" y="10" width="16" height="80" rx="1.5" />
        {/* ground line */}
        <line x1="10" y1="70" x2="150" y2="70" strokeDasharray="4 4" />
        {/* deep hole with concrete */}
        <path d="M55 70 L60 140 L100 140 L105 70" fill={c} fillOpacity="0.08" />
        <path d="M55 70 L60 140 L100 140 L105 70" />
        {/* rocky texture */}
        <circle cx="68" cy="90" r="3" />
        <circle cx="90" cy="100" r="4" />
        <circle cx="75" cy="115" r="2.5" />
        <circle cx="92" cy="125" r="3" />
        <circle cx="70" cy="130" r="2" />
        {/* down arrow */}
        <path d="M74 18 L74 58 M69 50 L74 58 L79 50" stroke={a} strokeWidth="2" />
      </svg>);

  }
  if (variant === "tight") {
    // Palings closer together w/ arrows pointing in
    return (
      <svg {...common}>
        {/* posts */}
        <rect x="18" y="30" width="10" height="80" rx="1" />
        <rect x="132" y="30" width="10" height="80" rx="1" />
        {/* rails */}
        <rect x="22" y="40" width="116" height="5" rx="1" />
        <rect x="22" y="95" width="116" height="5" rx="1" />
        {/* tightly spaced palings */}
        {[38, 50, 62, 74, 86, 98, 110, 122].map((x, i) =>
        <rect key={i} x={x - 4.5} y="30" width="9" height="80" rx="1" />
        )}
        {/* arrows */}
        <path d="M44 20 L50 26 M56 20 L50 26" stroke={a} strokeWidth="2" />
        <path d="M104 20 L98 26 M92 20 L98 26" stroke={a} strokeWidth="2" />
        <line x1="50" y1="26" x2="98" y2="26" stroke={a} strokeWidth="2" strokeDasharray="3 3" />
      </svg>);

  }
  if (variant === "fixings") {
    // Three galvanised fixings: nail, screw, bracket
    return (
      <svg {...common}>
        <line x1="10" y1="135" x2="150" y2="135" strokeWidth="1.2" />
        {/* nail */}
        <ellipse cx="40" cy="28" rx="9" ry="3" fill={c} />
        <line x1="40" y1="30" x2="40" y2="118" strokeWidth="3.5" />
        <path d="M37 116 L40 124 L43 116 Z" fill={c} />
        {/* terracotta sheen on nail shank */}
        <line x1="40" y1="38" x2="40" y2="55" stroke={a} strokeWidth="1.5" />
        {/* screw */}
        <circle cx="80" cy="28" r="7" stroke={c} fill="none" strokeWidth="1.8" />
        <line x1="73" y1="28" x2="87" y2="28" strokeWidth="1.8" />
        <line x1="80" y1="35" x2="80" y2="118" strokeWidth="3" />
        {/* threads */}
        <path d="M75 50 L85 53 M75 60 L85 63 M75 70 L85 73 M75 80 L85 83 M75 90 L85 93 M75 100 L85 103 M75 110 L85 113" strokeWidth="1.1" />
        <path d="M77 116 L80 124 L83 116 Z" fill={c} />
        <line x1="80" y1="40" x2="80" y2="55" stroke={a} strokeWidth="1.5" />
        {/* L bracket with bolt holes */}
        <path d="M115 32 L115 110 L146 110" strokeWidth="3.5" fill="none" strokeLinecap="square" />
        <circle cx="120" cy="44" r="2.5" fill={c} />
        <circle cx="120" cy="60" r="2.5" fill={c} />
        <circle cx="120" cy="76" r="2.5" fill={c} />
        <circle cx="135" cy="105" r="2.5" fill={c} />
      </svg>);

  }
  if (variant === "timber") {
    // Treated pine post with end-grain growth rings + H3 indicator
    return (
      <svg {...common}>
        <line x1="10" y1="135" x2="150" y2="135" strokeWidth="1.2" />
        {/* post */}
        <rect x="55" y="20" width="50" height="110" rx="3" strokeWidth="2" />
        {/* end-grain rings at top */}
        <ellipse cx="80" cy="38" rx="20" ry="9" strokeWidth="1.2" />
        <ellipse cx="80" cy="38" rx="13" ry="6" strokeWidth="1.2" />
        <ellipse cx="80" cy="38" rx="6" ry="3" strokeWidth="1.4" />
        {/* grain lines */}
        <line x1="60" y1="62" x2="100" y2="62" strokeWidth="0.8" opacity="0.55" />
        <line x1="60" y1="76" x2="100" y2="76" strokeWidth="0.8" opacity="0.55" />
        <line x1="60" y1="90" x2="100" y2="90" strokeWidth="0.8" opacity="0.55" />
        <line x1="60" y1="104" x2="100" y2="104" strokeWidth="0.8" opacity="0.55" />
        {/* H3 treatment tag */}
        <rect x="63" y="115" width="34" height="13" rx="2" stroke={a} strokeWidth="1.5" fill="none" />
        <text x="80" y="124.5" textAnchor="middle" fontSize="8" fill={a} fontFamily="Geist, sans-serif" fontWeight="600">H3</text>
      </svg>);

  }
  if (variant === "concrete") {
    // Post embedded in a wide concrete footing - emphasises the concrete mass
    return (
      <svg {...common}>
        {/* dashed ground line */}
        <line x1="10" y1="50" x2="150" y2="50" strokeDasharray="4 4" strokeWidth="1.2" />
        {/* timber post extending up from concrete */}
        <rect x="70" y="10" width="20" height="115" rx="1.5" />
        {/* wide concrete footing - trapezoid below ground, terracotta outline */}
        <path d="M48 50 L112 50 L120 140 L40 140 Z" fill={c} fillOpacity="0.10" stroke={a} strokeWidth="2.5" strokeLinejoin="round" />
        {/* aggregate stones inside concrete */}
        <circle cx="55" cy="68" r="2.5" fill={c} />
        <circle cx="68" cy="80" r="3" fill={c} />
        <circle cx="100" cy="72" r="2.5" fill={c} />
        <circle cx="105" cy="95" r="2" fill={c} />
        <circle cx="58" cy="100" r="2" fill={c} />
        <circle cx="68" cy="115" r="2.5" fill={c} />
        <circle cx="100" cy="120" r="2" fill={c} />
        <circle cx="55" cy="130" r="1.8" fill={c} />
        <circle cx="105" cy="130" r="2" fill={c} />
        {/* depth measurement arrow on the right */}
        <line x1="135" y1="50" x2="135" y2="140" strokeWidth="1.2" />
        <path d="M132 53l3-3 3 3M132 137l3 3 3-3" strokeWidth="1.2" fill="none" />
      </svg>);

  }
  return null;
}

// ---- NAV ----
function Nav({ current }) {
  const [mobileOpen, setMobileOpen] = useState(false);
  const links = [
  { label: "Services", href: "services.html", hasMenu: true },
  { label: "Areas We Service", href: "areas.html" },
  { label: "Gallery", href: "gallery.html" },
  { label: "FAQs", href: "faqs.html" },
  { label: "About", href: "about.html" },
  { label: "Contact", href: "contact.html" }];

  const services = [
  { label: "Paling fence", sub: "Standard treated pine", href: "services.html#paling" },
  { label: "Built-in lattice", sub: "Height + light", href: "services.html#lattice" },
  { label: "Fence capping", sub: "Longer lifespan", href: "services.html#capping" },
  { label: "Retaining walls", sub: "Sleeper & steel", href: "services.html#retaining" }];

  return (
    <nav className="nav nav-tall">
      <div className="nav-inner nav-inner-tall" style={{ textAlign: "center", justifyContent: "center", padding: "16px 32px 16px 52px" }}>
        <a className="brand brand-left" href="index.html">
          <img src="assets/logo-nuline.webp" alt="Nuline Fencing" width="146" height="48" style={{ height: "48px", width: "146.148px", objectFit: "fill" }} />
        </a>
        <div className="links links-center">
          {links.map((l) => l.hasMenu ?
          <div key={l.label} className="dropdown">
              <button className={current === "services" ? "active" : ""} style={{ fontSize: "19px" }}>
                {l.label} <Icon name="chevron" size={14} />
              </button>
              <div className="dropdown-menu">
                {services.map((s) =>
              <a key={s.label} href={s.href}>
                    <span>
                      <span style={{ color: "var(--forest)", fontWeight: 600 }}>{s.label}</span>
                      <span className="d-sub">{s.sub}</span>
                    </span>
                  </a>
              )}
              </div>
            </div> :

          <a key={l.label} href={l.href} className={current === l.label.toLowerCase().split(" ")[0] ? "active" : ""} style={{ fontSize: "19px" }}>{l.label}</a>
          )}
        </div>
        <div className="nav-right">
          <a className="btn btn-terra btn-xl nav-cta-desktop" href="#quote" style={{ textAlign: "center", padding: "16.5px 27px" }}>
            Request quote
          </a>
          <button
            type="button"
            className="hamburger"
            aria-label={mobileOpen ? "Close menu" : "Open menu"}
            aria-expanded={mobileOpen}
            onClick={() => setMobileOpen(!mobileOpen)}>
            <Icon name="menu" size={32} color="#1E3D2F" />
          </button>
        </div>
      </div>
      {mobileOpen && (
        <div className="mobile-menu" role="menu">
          {links.map((l) => (
            <a
              key={l.label}
              href={l.href}
              className="mobile-menu-link"
              role="menuitem"
              onClick={() => setMobileOpen(false)}>
              {l.label}
            </a>
          ))}
          <a
            href="#quote"
            className="mobile-menu-cta"
            role="menuitem"
            onClick={() => setMobileOpen(false)}>
            Request quote
          </a>
        </div>
      )}
    </nav>);}

// ---- FOOTER ----
function Footer() {
  return (
    <React.Fragment>
      <footer className="footer" id="contact">
        <div className="footer-inner">
          <div className="brand-block">
            <img src="assets/logo-nuline-white.png" alt="Nuline Fencing" width="184" height="56" />
            <p style={{ color: "rgb(250, 249, 245)" }}>"Built straight. Built strong. Built to last."</p>
            <div className="socials">
              <a href="#"><Icon name="facebook" size={15} /></a>
              <a href="#"><Icon name="instagram" size={15} /></a>
            </div>
          </div>
          <div>
            <h3>Contact</h3>
            <ul>
              <li><strong>Email</strong> hello@nulinefencing.com.au</li>
              <li><strong>Call</strong> <a href="tel:0406644912">0406 644 912</a></li>
              <li>Mon–Sat · 7am–5pm</li>
              <li>Melbourne, Victoria</li>
            </ul>
          </div>
          <div>
            <h3>Company</h3>
            <ul>
              <li><a href="about.html">About us</a></li>
              <li><a href="services.html">Services</a></li>
              <li><a href="areas.html">Areas we service</a></li>
              <li><a href="gallery.html">Gallery</a></li>
              <li><a href="faqs.html">FAQs</a></li>
            </ul>
          </div>
          <div>
            <h3>Legal</h3>
            <ul>
              <li><a href="privacy-policy.html">Privacy policy</a></li>
              <li><a href="terms-and-conditions.html">Terms &amp; conditions</a></li>
              <li><a href="https://www.justice.vic.gov.au/fencing-law-in-victoria" target="_blank" rel="noopener">Fences Act (Vic)</a></li>
            </ul>
          </div>
        </div>
        <div className="footer-legal">
          <span>© 2026 Nuform Group Pty Ltd · ABN 50 620 610 639</span>
          <span>Proudly supporting Greenfleet</span>
        </div>
      </footer>
    </React.Fragment>);

}

// ---- Credentials band (above footer) ----
function Credentials() {
  return (
    <section className="credentials">
      <div className="credentials-logos">
        <div className="cred-registered">
          <div className="seal">REGIS-<br />TERED</div>
          <div className="t">Registered<span>Building Practitioner</span></div>
        </div>
        <div className="cred-greenfleet">
          <div className="sm">Proudly supporting</div>
          <div className="g">
            <span className="leaf" style={{ color: "#7ab84a" }}>🌿</span>
            Greenfleet
          </div>
        </div>
      </div>
      <div className="credentials-note">Committed to making a sustainable difference</div>
    </section>);

}

// ---- CTA strip (terracotta) ----
function CtaStrip() {
  return (
    <section className="cta-strip">
      <div className="cta-strip-inner">
        <h2>Ready for a fence that stays straight?</h2>
        <div style={{ display: "flex", gap: 12, flexWrap: "wrap" }}>
          <a className="btn btn-white btn-lg" href="#quote">Request a free quote <Icon name="arrow" size={14} /></a>
          <a className="btn btn-ghost btn-lg" href="tel:0406644912">Call 0406 644 912</a>
        </div>
      </div>
    </section>);

}

// ---- Hero (dark wood) ----
function HeroWood({ title, sub, mobileSub, kicker, trustLine, showMark = true, showAward = true, showBtns = true }) {
  return (
    <section className="hero-wood">
      <div className="hero-inner">
        {kicker && <div className="hero-eyebrow">{kicker}</div>}
        <h1 className="hero-title" style={{ color: "rgb(255, 255, 255)" }}>{title}</h1>
        <p className="hero-sub" style={{ color: "#ffffff" }}>{sub}</p>
        {mobileSub && <p className="hero-sub-mobile" style={{ color: "#ffffff" }}>{mobileSub}</p>}
        {showBtns &&
        <div className="hero-ctas">
            <a className="btn btn-terra btn-lg" href="#quote" style={{ boxShadow: "0 0 0 1px var(--terracotta), 0 10px 28px rgba(201,100,66,0.45)" }}>Request quote</a>
            <a className="btn btn-ghost btn-lg" href="tel:0406644912">Call 0406 644 912</a>
          </div>
        }
        {trustLine &&
        <div className="hero-trust" style={{ fontFamily: "var(--font-sans)", fontSize: 13, letterSpacing: 1.6, textTransform: "uppercase", fontWeight: 600, color: "rgba(250,249,245,0.92)", marginTop: 8, textShadow: "0 2px 14px rgba(0,0,0,0.55)" }}>
            {trustLine}
          </div>
        }
        {showMark &&
        <div className="hero-mark">
            {showAward &&
          <div style={{ position: "absolute", top: -10, right: 10, width: 110, height: 110 }}>
                <AwardSeal />
              </div>
          }
            <HouseMark />
            <div className="hero-wordmark">
              <span className="script">Mr</span>
              <span className="main">NULINE</span>
            </div>
          </div>
        }
      </div>
    </section>);

}

function HouseMark() {
  return (
    <svg className="hero-house" viewBox="0 0 300 260" fill="none" role="img" aria-label="Stylised house with paling fence emblem">
      <path d="M150 20 L40 130 L40 240 L260 240 L260 130 Z"
      stroke="rgba(250,249,245,0.55)" strokeWidth="3" />
      <path d="M150 20 L40 130" stroke="rgba(250,249,245,0.55)" strokeWidth="3" />
      <path d="M150 20 L260 130" stroke="rgba(250,249,245,0.55)" strokeWidth="3" />
      {/* interior palings */}
      <line x1="90" y1="145" x2="90" y2="240" stroke="rgba(250,249,245,0.4)" strokeWidth="2" />
      <line x1="130" y1="115" x2="130" y2="240" stroke="rgba(250,249,245,0.4)" strokeWidth="2" />
      <line x1="170" y1="115" x2="170" y2="240" stroke="rgba(250,249,245,0.4)" strokeWidth="2" />
      <line x1="210" y1="145" x2="210" y2="240" stroke="rgba(250,249,245,0.4)" strokeWidth="2" />
    </svg>);

}

function AwardSeal({ size = 110 }) {
  return (
    <svg width={size} height={size} viewBox="0 0 110 110" role="img" aria-label="Quality Business Awards Winner 2024 2025 - Nuline Fencing">
      <defs>
        <path id="arcTop" d="M 15 55 A 40 40 0 0 1 95 55" fill="none" />
        <path id="arcBot" d="M 15 60 A 40 40 0 0 0 95 60" fill="none" />
      </defs>
      {/* laurel */}
      <g stroke="#d4a84a" strokeWidth="2.5" fill="none" strokeLinecap="round">
        <path d="M15 55 Q 10 35 25 20" />
        <path d="M95 55 Q 100 35 85 20" />
        {[22, 30, 38, 46].map((y, i) => <ellipse key={i} cx={15 - i * 0.5} cy={y + i * 2} rx="4" ry="1.8" fill="#d4a84a" transform={`rotate(-${20 + i * 5} ${15} ${y})`} />)}
        {[22, 30, 38, 46].map((y, i) => <ellipse key={i} cx={95 + i * 0.5} cy={y + i * 2} rx="4" ry="1.8" fill="#d4a84a" transform={`rotate(${20 + i * 5} ${95} ${y})`} />)}
      </g>
      <circle cx="55" cy="55" r="38" fill="#162019" stroke="#d4a84a" strokeWidth="2" />
      <text fill="#faf9f5" fontFamily="Geist, sans-serif" fontSize="7" fontWeight="500" textAnchor="middle">
        <textPath href="#arcTop" startOffset="50%">QUALITY BUSINESS</textPath>
      </text>
      <text x="55" y="50" fontFamily="Source Serif 4, serif" fontSize="10" fontWeight="500" fill="#faf9f5" textAnchor="middle">AWARDS</text>
      <rect x="33" y="54" width="44" height="10" fill="#c96442" rx="1" />
      <text x="55" y="61" fontFamily="Geist, sans-serif" fontSize="6.5" fontWeight="600" fill="#faf9f5" textAnchor="middle">NULINE FENCING</text>
      <text x="55" y="74" fontFamily="Source Serif 4, serif" fontSize="9" fontWeight="500" fill="#faf9f5" textAnchor="middle">2024</text>
      <text x="55" y="84" fontFamily="Source Serif 4, serif" fontSize="9" fontWeight="500" fill="#faf9f5" textAnchor="middle">2025</text>
      <text fill="#faf9f5" fontFamily="Geist, sans-serif" fontSize="6" fontWeight="500" textAnchor="middle">
        <textPath href="#arcBot" startOffset="50%">WINNER</textPath>
      </text>
    </svg>);

}

// ---- Quick quote form ----
function QuickQuote() {
  const [submitted, setSubmitted] = useState(false);
  const [form, setForm] = useState({ name: "", phone: "", suburb: "", svc: "Paling / Timber fence", length: "", note: "" });
  const update = (k) => (e) => setForm({ ...form, [k]: e.target.value });
  if (submitted) {
    return (
      <section className="section ivory" id="quote">
        <div className="section-inner" style={{ maxWidth: 640, textAlign: "center" }}>
          <div style={{ width: 64, height: 64, borderRadius: "50%", background: "var(--forest)", color: "var(--ivory)", display: "inline-flex", alignItems: "center", justifyContent: "center", marginBottom: 20 }}>
            <Icon name="check" size={30} color="#faf9f5" />
          </div>
          <h2 className="h2">Thanks - we'll be in touch within 24 hours.</h2>
          <p className="lead" style={{ margin: "18px auto 28px" }}>We read every enquiry ourselves. Expect a quick text or a phone call from Paul within 24 hours.</p>
          <button className="btn btn-outline" onClick={() => setSubmitted(false)}>← Back</button>
        </div>
      </section>);

  }
  return (
    <section className="section ivory" id="quote">
      <div className="section-inner" style={{ maxWidth: 1140 }}>
        <div style={{ textAlign: "center", maxWidth: 920, margin: "0 auto 56px" }}>
          <span className="eyebrow" style={{ fontSize: "24px", display: "inline-block", marginBottom: 14 }}>Free quote</span>
          <h2 style={{ fontFamily: "var(--font-serif)", fontWeight: 500, fontSize: "clamp(38px, 5.5vw, 72px)", lineHeight: 1.12, color: "var(--forest)", margin: 0, letterSpacing: "-0.5px", textWrap: "balance" }}>
            Rough measurements are fine. We re-measure on site.
          </h2>
        </div>
        <div className="qq-grid">
        <div>
          <p className="lead" style={{ marginTop: 0 }}>Tell us a bit about your fence. We'll come out, walk the line, and send a written quote within 24 hours.</p>
          <ul style={{ listStyle: "none", padding: 0, margin: "28px 0 0", display: "flex", flexDirection: "column", gap: 10 }}>
            {["You speak to Paul", "Written fixed-price quote - no surprises", "Old fence removal included*", "Fully insured - $20M public liability"].map((t) =>
            <li key={t} style={{ display: "flex", gap: 12, alignItems: "flex-start", fontFamily: "var(--font-sans)", fontSize: 15, color: "#0d0d0d" }}>
                <Icon name="check" size={18} color="#c96442" /> {t}
              </li>
            )}
          </ul>
          <p style={{ fontFamily: "var(--font-sans)", fontSize: 12, color: "var(--fg-tertiary)", lineHeight: 1.5, margin: "12px 0 0", paddingLeft: 30 }}>
            *Excludes trees, bushes, vines and green waste. Additional charges may apply.
          </p>
        </div>
        <form action="https://formspree.io/f/xwvywwbq" method="POST" className="card" style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 16 }}>
          <input type="hidden" name="_subject" value="New fence enquiry from Nuline Fencing website" />
          <input type="hidden" name="_next" value="https://nulinefencing.com.au/thank-you.html" />
          <label style={{ gridColumn: "span 1" }} className="qq-field">
            <span>Your name</span>
            <input name="Name" value={form.name} onChange={update("name")} placeholder="Jane Doe" required />
          </label>
          <label className="qq-field">
            <span>Phone</span>
            <input name="Phone" value={form.phone} onChange={update("phone")} placeholder="0400 000 000" required />
          </label>
          <label style={{ gridColumn: "span 2" }} className="qq-field">
            <span>Suburb</span>
            <input name="Suburb" value={form.suburb} onChange={update("suburb")} placeholder="e.g. Brunswick, Reservoir, Hawthorn" required />
          </label>
          <label className="qq-field">
            <span>Fence type</span>
            <select name="Fence_type" value={form.svc} onChange={update("svc")}>
              <option>Paling / Timber fence</option>
              <option>Built-in lattice</option>
              <option>Fence capping</option>
              <option>Retaining wall</option>
              <option>Not sure yet</option>
            </select>
          </label>
          <label className="qq-field">
            <span>Approx. length</span>
            <input name="Approx_length" value={form.length} onChange={update("length")} placeholder="e.g. 22 metres" />
          </label>
          <label style={{ gridColumn: "span 2" }} className="qq-field">
            <span>Anything we should know</span>
            <textarea name="Notes" rows={3} value={form.note} onChange={update("note")}
            placeholder="Sloped site, tricky access, neighbour on board, etc." />
          </label>
          <div className="qq-submit-row" style={{ gridColumn: "span 2", display: "flex", justifyContent: "space-between", alignItems: "center", marginTop: 8 }}>
            <span style={{ fontFamily: "var(--font-sans)", fontSize: 12, color: "var(--fg-tertiary)" }}>We'll reply within 24 hours.</span>
            <button type="submit" className="btn btn-terra btn-lg qq-submit-btn">Send enquiry <Icon name="arrow" size={14} /></button>
          </div>
          <p style={{ gridColumn: "span 2", textAlign: "center", margin: "16px auto 0", maxWidth: 420, fontFamily: "var(--font-sans)", fontSize: 12, color: "#6B6B6B", lineHeight: 1.55 }}>
            Have photos of your existing fence or a style you like? Send them to <a href="mailto:hello@nulinefencing.com.au" style={{ color: "#3d3d3a", borderBottom: "1px solid var(--ring-warm)" }}>hello@nulinefencing.com.au</a> with your name and suburb.
          </p>
        </form>
        </div>
      </div>
    </section>);

}

// ---- Reviews band (shared across pages) ----
function ReviewsBand() {
  const reviews = [
  { name: "Bree Miller", date: "22 December 2025", text: "Thanks for our new fences Andrew. From quote to install it was all efficient and the process smooth. Really enjoying the new fence height area and added privacy." },
  { name: "Andrew Kollmorgen", date: "20 December 2025", text: "These guys build a top quality fence, really solid & will last." },
  { name: "Anthony Carson", date: "20 December 2025", text: "Highly recommend Nuline Fencing. Dave's advice was invaluable. Having a builder involved made a real difference. We are extremely happy with the outcome. Thank you Dave." }];

  return (
    <section className="reviews-band">
      <div className="reviews-inner">
        <div className="reviews-head">
          <h2 className="reviews-title">Feedback from our happy customers</h2>
          <div className="award-seal">
            <div style={{ width: 96, height: 96 }}><AwardSeal size={96} /></div>
            <div className="award-text">
              <div className="t1">Winner</div>
              <div className="t2">For the best fencing contractor in the City of Bayside</div>
              <a>Learn more →</a>
            </div>
          </div>
        </div>
        <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", flexWrap: "wrap", gap: 16 }}>
          <div className="google-bar">
            <div className="g-logo"><span>G</span><span>o</span><span>o</span><span>g</span><span>l</span><span>e</span></div>
            <span className="g-excellent">Excellent</span>
            <span className="g-stars">★★★★★</span>
            <span className="g-meta">4.9 · 52 reviews</span>
          </div>
          <a className="btn btn-terra">Write a review</a>
        </div>
        <div className="review-grid" style={{ marginTop: 24, position: "relative" }}>
          <button className="review-arrows prev" aria-label="Prev">‹</button>
          {reviews.map((r) =>
          <div key={r.name} className="review">
              <div className="g-mark" />
              <div className="review-head">
                <div>
                  <div className="review-name">{r.name}</div>
                  <div className="review-date">{r.date}</div>
                </div>
              </div>
              <div className="stars">★★★★★<span className="verified">✓</span></div>
              <p>{r.text}</p>
            </div>
          )}
          <button className="review-arrows next" aria-label="Next">›</button>
        </div>
        <div className="review-dots">
          <span className="active" /><span /><span /><span />
        </div>
      </div>
    </section>);

}

Object.assign(window, {
  Icon, FenceIll, CrossIll, HouseMark, AwardSeal,
  Nav, Footer, Credentials, CtaStrip, HeroWood, QuickQuote, ReviewsBand
});