// US Demolition — Header + Hero + Pain + Solution sections
const DS1 = window.USDemolitionDesignSystem_311b2f;
const { Button: Btn1, Badge: Bdg1, Card: Crd1, SectionHeading: SHd1, Stat: St1 } = DS1;

const PAIN_ICONS = {
  warning: `<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="var(--gold-500)" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>`,
  clock: `<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="var(--gold-500)" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>`,
  dollar: `<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="var(--gold-500)" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="1" x2="12" y2="23"/><path d="M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"/></svg>`,
  layers: `<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="var(--gold-500)" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 2 7 12 12 22 7 12 2"/><polyline points="2 17 12 22 22 17"/><polyline points="2 12 12 17 22 12"/></svg>`
};

const PHONE = '+1 (239) 603-3998';

/* ── Hamburger state ── */
let _mobileMenuOpen = false;
function setMobileMenu(v) {_mobileMenuOpen = v;}

/* ────────────────────────────────────────────
   HEADER
──────────────────────────────────────────── */
function SiteHeader({ onEstimate }) {
  const [open, setOpen] = React.useState(false);
  const [scrolled, setScrolled] = React.useState(false);
  React.useEffect(() => {
    const h = () => setScrolled(window.scrollY > 30);
    window.addEventListener('scroll', h, { passive: true });
    return () => window.removeEventListener('scroll', h);
  }, []);
  const navLinks = [
  { label: 'Services', href: '#services' },
  { label: 'Projects', href: '#projects' },
  { label: 'Process', href: '#process' },
  { label: 'About', href: '#about' },
  { label: 'FAQ', href: '#faq' },
  { label: 'Contact', href: '#contact' }];

  const hdrStyle = {
    position: 'fixed', top: 0, left: 0, right: 0, zIndex: 100,
    background: scrolled ? 'rgba(6,6,6,0.97)' : 'rgba(6,6,6,0.80)',
    backdropFilter: 'blur(16px)',
    borderBottom: scrolled ? '1px solid var(--steel-500)' : '1px solid rgba(58,58,66,0.5)',
    transition: 'background 0.3s var(--ease-out), border-color 0.3s var(--ease-out)',
    boxShadow: scrolled ? '0 2px 24px rgba(0,0,0,0.5)' : 'none',
  };
  return (
    <header style={hdrStyle}>
      <div style={{ maxWidth: '1200px', margin: '0 auto', padding: '0 40px', display: 'flex', alignItems: 'center', justifyContent: 'space-between', height: '72px' }}>
        <a href="#" style={{ display: 'flex', alignItems: 'center', textDecoration: 'none', flexShrink: 0 }}>
          <img src="assets/logo-horizontal.png" alt="US Demolition" style={{ height: '52px', width: 'auto' }} />
        </a>
        {/* Desktop nav */}
        <nav style={{ display: 'flex', alignItems: 'center', gap: '28px' }} className="usd-desktop-nav">
          {navLinks.map((l) =>
          <a key={l.label} href={l.href} style={{ fontFamily: 'var(--font-heading)', fontWeight: 600, fontSize: '13px', textTransform: 'uppercase', letterSpacing: '.14em', color: 'var(--ash-200)', textDecoration: 'none', transition: 'color 0.15s' }}
          onMouseEnter={(e) => e.target.style.color = 'var(--gold-400)'}
          onMouseLeave={(e) => e.target.style.color = 'var(--ash-200)'}>
            {l.label}</a>
          )}
          <div style={{ display: 'flex', alignItems: 'center', gap: '16px', paddingLeft: '20px', borderLeft: '1px solid var(--steel-500)' }}>
            <a href={'tel:' + PHONE.replace(/\D/g, '')} style={{ fontFamily: 'var(--font-heading)', fontWeight: 700, fontSize: '14px', color: 'var(--gold-300)', letterSpacing: '.04em', textDecoration: 'none', whiteSpace: 'nowrap' }}>{PHONE}</a>
            <Btn1 variant="primary" size="sm" onClick={onEstimate}>Free Estimate</Btn1>
          </div>
        </nav>
        {/* Mobile hamburger */}
        <button onClick={() => setOpen(!open)} style={{ display: 'none', background: 'none', border: 'none', cursor: 'pointer', padding: '8px', color: 'var(--white)' }} className="usd-hamburger" aria-label="Menu">
          {open ?
          <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M18 6L6 18M6 6l12 12" /></svg> :
          <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M3 12h18M3 6h18M3 18h18" /></svg>}
        </button>
      </div>
      {/* Mobile drawer */}
      {open &&
      <div style={{ background: 'rgba(6,6,6,0.99)', borderTop: '1px solid var(--steel-500)', padding: '24px 24px 36px' }}>
          {navLinks.map((l) =>
        <a key={l.label} href={l.href} onClick={() => setOpen(false)} style={{ display: 'block', fontFamily: 'var(--font-heading)', fontWeight: 600, fontSize: '15px', textTransform: 'uppercase', letterSpacing: '.14em', color: 'var(--ash-100)', textDecoration: 'none', padding: '14px 0', borderBottom: '1px solid var(--steel-500)' }}>{l.label}</a>
        )}
          <div style={{ marginTop: '28px', display: 'flex', flexDirection: 'column', gap: '12px' }}>
            <a href={'tel:' + PHONE.replace(/\D/g, '')} style={{ fontFamily: 'var(--font-heading)', fontWeight: 700, fontSize: '20px', color: 'var(--gold-300)', textDecoration: 'none', textAlign: 'center', padding: '8px 0' }}>{PHONE}</a>
            <Btn1 variant="primary" size="lg" onClick={() => { setOpen(false); onEstimate(); }} style={{ width: '100%' }}>Get a Free Estimate</Btn1>
          </div>
        </div>
      }
    </header>);
}

/* ────────────────────────────────────────────
   HERO
──────────────────────────────────────────── */
function SiteHero({ onEstimate }) {
  return (
    <section style={{ position: 'relative', minHeight: '100vh', display: 'flex', alignItems: 'center', overflow: 'hidden', paddingTop: '72px' }}>
      <video autoPlay muted loop playsInline poster="assets/concrete-demo-1.jpg" style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'center' }}>
        <source src="assets/demo-reel-1.mp4" type="video/mp4" />
      </video>
      {/* Overlays */}
      <div style={{ position: 'absolute', inset: 0, background: 'linear-gradient(110deg, rgba(6,6,6,0.95) 0%, rgba(6,6,6,0.78) 45%, rgba(6,6,6,0.30) 100%)' }} />
      <div style={{ position: 'absolute', inset: 0, background: 'linear-gradient(to top, rgba(6,6,6,0.97) 0%, rgba(6,6,6,0) 45%)' }} />
      {/* Gold accent bar */}
      <div style={{ position: 'absolute', top: 72, left: 0, width: '4px', height: '180px', background: 'var(--grad-gold)' }} />

      <div style={{ position: 'relative', maxWidth: '1200px', margin: '0 auto', padding: '80px 40px 120px', width: '100%' }}>
        <div style={{ maxWidth: '760px' }}>
          {/* Eyebrow badge */}
          <div style={{ display: 'inline-flex', alignItems: 'center', gap: '10px', background: 'rgba(224,168,46,0.1)', border: '1px solid rgba(224,168,46,0.35)', borderRadius: '4px', padding: '7px 14px', marginBottom: '28px' }}>
            <span style={{ width: '7px', height: '7px', borderRadius: '50%', background: 'var(--gold-500)', flexShrink: 0 }} />
            <span style={{ fontFamily: 'var(--font-heading)', fontWeight: 600, fontSize: '12px', textTransform: 'uppercase', letterSpacing: '.2em', color: 'var(--gold-400)' }}>Licensed & Insured · South Florida</span>
          </div>
          {/* H1 */}
          <h1 style={{ margin: 0, fontFamily: 'var(--font-display)', textTransform: 'uppercase', fontSize: 'clamp(4.2rem, 8.5vw, 9rem)', lineHeight: 0.92, letterSpacing: '-0.01em', color: 'var(--white)' }}>
            INTERIOR HOME<br />DEMOLITION<br />
            <span style={{ background: 'var(--grad-gold)', WebkitBackgroundClip: 'text', backgroundClip: 'text', color: 'transparent' }}>IN FLORIDA</span>
          </h1>
          {/* Gold rule */}
          <div style={{ width: '72px', height: '3px', background: 'var(--grad-gold)', margin: '28px 0' }} />
          {/* Sub */}
          <p style={{ margin: 0, fontFamily: 'var(--font-body)', fontSize: 'clamp(1.1rem, 1.9vw, 1.4rem)', lineHeight: 1.65, color: 'var(--ash-100)', maxWidth: '560px' }}>
            Safe, clean, and precise demolition services for homeowners, contractors, remodelers, and commercial properties across South Florida.
          </p>
          {/* CTAs */}
          <div style={{ display: 'flex', gap: '14px', marginTop: '40px', flexWrap: 'wrap' }}>
            <Btn1 variant="primary" size="lg" onClick={onEstimate}>Get a Free Estimate</Btn1>
            <Btn1 variant="secondary" size="lg" onClick={() => document.getElementById('services').scrollIntoView({ behavior: 'smooth' })}>View Our Services</Btn1>
          </div>
          {/* Tagline */}
          <p style={{ margin: '40px 0 0', fontFamily: 'var(--font-heading)', fontWeight: 600, fontSize: '13px', textTransform: 'uppercase', letterSpacing: '.22em', color: 'var(--gold-500)' }}>Built to Break. Built to Deliver.</p>
          {/* Trust strip */}
          <div style={{ display: 'flex', gap: '28px', marginTop: '28px', flexWrap: 'wrap', alignItems: 'center' }}>
            {['Licensed & Insured', 'Free Estimates', 'Full Debris Removal', 'Dust-Controlled'].map(t => (
              <div key={t} style={{ display: 'flex', alignItems: 'center', gap: '7px' }}>
                <span style={{ color: 'var(--gold-500)', fontSize: '14px' }}>✓</span>
                <span style={{ fontFamily: 'var(--font-body)', fontSize: '13px', color: 'var(--ash-200)' }}>{t}</span>
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>);
}

/* ────────────────────────────────────────────
   PAIN SECTION
──────────────────────────────────────────── */
function SitePain() {
  return (
    <section style={{ background: 'var(--black-950)', padding: '88px 40px', borderTop: '1px solid var(--steel-500)' }}>
      <div style={{ maxWidth: '1200px', margin: '0 auto', display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '64px', alignItems: 'center' }} className="usd-pain-grid">
        <div>
          <p style={{ margin: '0 0 12px', fontFamily: 'var(--font-heading)', fontWeight: 600, fontSize: '13px', textTransform: 'uppercase', letterSpacing: '.2em', color: 'var(--gold-500)' }}>The Problem</p>
          <h2 style={{ margin: 0, fontFamily: 'var(--font-display)', textTransform: 'uppercase', fontSize: 'clamp(2rem, 4vw, 3.4rem)', lineHeight: 0.95, color: 'var(--white)' }}>
            DEMOLITION SHOULD NOT DELAY YOUR PROJECT
          </h2>
          <div style={{ width: '56px', height: '3px', background: 'var(--grad-gold)', margin: '24px 0' }} />
          <p style={{ margin: 0, fontFamily: 'var(--font-body)', fontSize: '17px', lineHeight: 1.7, color: 'var(--text-muted)' }}>
            Before you build, renovate or clear a property, the site needs to be handled safely and professionally. Poor demolition creates delays, mess, safety risks and unexpected costs.
          </p>
          <p style={{ margin: '18px 0 0', fontFamily: 'var(--font-body)', fontSize: '17px', lineHeight: 1.7, color: 'var(--text-muted)' }}>
            US Demolition removes what's in the way and prepares the space for the next phase — clean, fast, and done right the first time.
          </p>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '16px' }}>
          {[
          { iconKey: 'warning', label: 'Safety Risks', desc: 'Untrained crews cut corners on hazardous materials and structural work.' },
          { iconKey: 'clock', label: 'Project Delays', desc: 'Poor planning and slow execution pushes your entire timeline back.' },
          { iconKey: 'dollar', label: 'Hidden Costs', desc: 'Incomplete site work leads to expensive rework for the next contractor.' },
          { iconKey: 'layers', label: 'Site Mess', desc: 'Debris left behind blocks the next construction phase from starting.' }].
          map((item) =>
          <div key={item.label} style={{ background: 'var(--surface-card)', border: '1px solid var(--steel-500)', borderRadius: '6px', padding: '24px 20px', transition: 'border-color 0.2s' }}
          onMouseEnter={e => e.currentTarget.style.borderColor = 'var(--gold-700)'}
          onMouseLeave={e => e.currentTarget.style.borderColor = 'var(--steel-500)'}>
              <div style={{ marginBottom: '12px', lineHeight: 0 }} dangerouslySetInnerHTML={{ __html: PAIN_ICONS[item.iconKey] }} />
              <h4 style={{ margin: '0 0 8px', fontFamily: 'var(--font-heading)', fontWeight: 700, fontSize: '14px', textTransform: 'uppercase', letterSpacing: '.1em', color: 'var(--white)' }}>{item.label}</h4>
              <p style={{ margin: 0, fontFamily: 'var(--font-body)', fontSize: '13px', lineHeight: 1.6, color: 'var(--text-muted)' }}>{item.desc}</p>
            </div>
          )}
        </div>
      </div>
    </section>);
}

/* ────────────────────────────────────────────
   SOLUTION SECTION
──────────────────────────────────────────── */
function SiteSolution() {
  const items = [
  { title: 'Interior Demolition', desc: 'Selective tear-outs for remodels — drywall, flooring, kitchens, bathrooms and full gut-outs.' },
  { title: 'Residential Demolition', desc: 'Full house teardowns, garages and additions handled safely and professionally.' },
  { title: 'Concrete Removal', desc: 'Driveways, slabs, patios, pool decks and foundations removed clean and hauled off.' },
  { title: 'Commercial Demolition', desc: 'Offices, retail spaces and business properties cleared with minimal disruption.' },
  { title: 'Site Clearing & Grading', desc: 'Lot clearing, grading and debris removal — site ready for construction.' },
  { title: 'Debris Removal', desc: 'All demo material hauled and disposed of. Site left swept and organized.' }];

  return (
    <section style={{ background: 'var(--black-900)', padding: '96px 40px' }}>
      <div style={{ maxWidth: '1200px', margin: '0 auto' }}>
        <SHd1 eyebrow="Our Solution" title="We Clear the Way for Your Next Project" align="center" />
        <p style={{ textAlign: 'center', fontFamily: 'var(--font-body)', fontSize: '18px', lineHeight: 1.7, color: 'var(--text-muted)', maxWidth: '600px', margin: '20px auto 52px' }}>
          From the first swing to the final sweep — we execute with precision and leave you a clean, ready site.
        </p>
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '20px' }} className="usd-solution-grid">
          {items.map((item, i) =>
          <div key={item.title} style={{ background: 'var(--surface-card)', border: '1px solid var(--steel-500)', borderTop: '3px solid var(--gold-700)', borderRadius: '6px', padding: '28px 24px', transition: 'border-color 0.2s, transform 0.2s' }}
          onMouseEnter={(e) => {e.currentTarget.style.borderTopColor = 'var(--gold-400)'; e.currentTarget.style.borderColor = 'var(--gold-500)'; e.currentTarget.style.transform = 'translateY(-3px)';}}
          onMouseLeave={(e) => {e.currentTarget.style.borderTopColor = 'var(--gold-700)'; e.currentTarget.style.borderColor = 'var(--steel-500)'; e.currentTarget.style.transform = 'translateY(0)';}}>
            <div style={{ fontFamily: 'var(--font-display)', fontSize: '36px', lineHeight: 1, background: 'var(--grad-gold)', WebkitBackgroundClip: 'text', backgroundClip: 'text', color: 'transparent', marginBottom: '14px' }}>
              {String(i + 1).padStart(2, '0')}
            </div>
            <h3 style={{ margin: '0 0 10px', fontFamily: 'var(--font-heading)', fontWeight: 700, fontSize: '16px', textTransform: 'uppercase', letterSpacing: '.08em', color: 'var(--white)' }}>{item.title}</h3>
            <p style={{ margin: 0, fontFamily: 'var(--font-body)', fontSize: '14px', lineHeight: 1.65, color: 'var(--text-muted)' }}>{item.desc}</p>
          </div>
          )}
        </div>
      </div>
    </section>);
}

window.SiteHeader = SiteHeader;
window.SiteHero = SiteHero;
window.SitePain = SitePain;
window.SiteSolution = SiteSolution;
