/* ARES Technology — section components */

/* ---------- NAV ---------- */
function Nav({ onCta }) {
  const [scrolled, setScrolled] = React.useState(false);
  React.useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 8);
    window.addEventListener('scroll', onScroll, { passive: true });
    onScroll();
    return () => window.removeEventListener('scroll', onScroll);
  }, []);

  const links = [
    ['How it works', 'how'],
    ['What\u2019s included', 'pricing'],
    ['Who it\u2019s for', 'who'],
    ['FAQ', 'faq'],
  ];

  return (
    <header
      style={{
        position: 'sticky',
        top: 0,
        zIndex: 30,
        backdropFilter: 'saturate(140%) blur(14px)',
        WebkitBackdropFilter: 'saturate(140%) blur(14px)',
        background: scrolled ? 'rgba(244,246,250,0.82)' : 'transparent',
        borderBottom: scrolled ? '1px solid var(--line)' : '1px solid transparent',
        transition: 'background 160ms ease, border-color 160ms ease',
      }}
    >
      <div
        style={{
          maxWidth: 'var(--maxw)',
          margin: '0 auto',
          padding: '14px 28px',
          display: 'flex',
          alignItems: 'center',
          gap: 32,
        }}
      >
        <a href="#top" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
          <Logomark />
          <span style={{ fontWeight: 500, fontSize: 17, letterSpacing: '-0.01em' }}>
            ARES <span style={{ color: 'var(--muted)' }}>Technology</span>
          </span>
        </a>
        <nav style={{ display: 'flex', gap: 22, marginLeft: 12 }} className="nav-links">
          {links.map(([label, id]) => (
            <a
              key={id}
              href={`#${id}`}
              style={{
                fontSize: 14,
                color: 'var(--ink-2)',
                padding: '6px 0',
              }}
            >
              {label}
            </a>
          ))}
        </nav>
        <div style={{ marginLeft: 'auto', display: 'flex', gap: 10, alignItems: 'center' }}>
          <a
            href="#contact"
            style={{
              fontSize: 14,
              color: 'var(--ink-2)',
              padding: '8px 12px',
            }}
          >
            Contact
          </a>
          <AccentBtn onClick={onCta} style={{ padding: '10px 16px', fontSize: 14 }}>
            Request a Free Preview
          </AccentBtn>
        </div>
      </div>
      <style>{`
        @media (max-width: 820px) {
          .nav-links { display: none !important; }
        }
      `}</style>
    </header>
  );
}

function Logomark() {
  return (
    <span
      aria-hidden
      style={{
        width: 28,
        height: 28,
        borderRadius: 8,
        background: 'var(--ink)',
        color: 'white',
        display: 'inline-flex',
        alignItems: 'center',
        justifyContent: 'center',
        position: 'relative',
      }}
    >
      <svg width="16" height="16" viewBox="0 0 16 16" fill="none">
        <path d="M2 13L8 2L14 13H11.5L8 6.8L4.5 13H2Z" fill="white" />
        <rect x="6" y="10" width="4" height="1.4" fill="var(--ink)" />
      </svg>
      <span
        className="logomark-glow"
        style={{
          position: 'absolute',
          right: -2,
          bottom: -2,
          width: 8,
          height: 8,
          borderRadius: 99,
          background: 'var(--accent)',
          border: '2px solid var(--paper)',
        }}
      />
    </span>
  );
}

/* Anthropic sunburst logo mark (plain black) */
function AnthropicMark({ size = 18 }) {
  const rays = 12;
  const cx = 12, cy = 12, r1 = 2.6, r2 = 10.6;
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" aria-hidden="true">
      {Array.from({ length: rays }).map((_, i) => {
        const a = (i * 360 / rays) * Math.PI / 180;
        return (
          <line
            key={i}
            x1={cx + Math.cos(a) * r1}
            y1={cy + Math.sin(a) * r1}
            x2={cx + Math.cos(a) * r2}
            y2={cy + Math.sin(a) * r2}
            stroke="var(--ink)"
            strokeWidth="1.7"
            strokeLinecap="round"
          />
        );
      })}
    </svg>
  );
}

/* Splits text into individually-swooping letters; `start` offsets the wave delay */
function SwoopLetters({ text, start = 0, style }) {
  return text.split('').map((ch, i) => (
    <span key={i} className="ps-letter" style={{ '--ps-i': start + i, ...style }}>
      {ch}
    </span>
  ));
}

/* Small "Powered by Anthropic" badge — the whole phrase swoops letter by letter */
function PoweredByAnthropic() {
  const pre = 'Powered by ';
  const word = 'Anthropic';
  return (
    <div style={{ position: 'relative', display: 'flex', justifyContent: 'center', padding: '6px 28px 0' }}>
      <span
        style={{
          display: 'inline-flex',
          alignItems: 'baseline',
          gap: 9,
          background: 'var(--paper-2)',
          border: '1px solid var(--line)',
          borderRadius: 99,
          padding: '7px 16px 7px 13px',
          boxShadow: '0 1px 2px rgba(11,18,32,0.04)',
        }}
      >
        <span style={{ alignSelf: 'center', display: 'inline-flex' }}>
          <AnthropicMark size={18} />
        </span>
        <span style={{ display: 'inline-flex', alignItems: 'baseline' }} aria-label="Powered by Anthropic">
          <SwoopLetters
            text={pre}
            start={0}
            style={{ fontSize: 13.5, fontWeight: 600, color: 'var(--ink-2)', letterSpacing: '0.005em' }}
          />
          <SwoopLetters
            text={word}
            start={pre.length}
            style={{ fontSize: 16, fontWeight: 700, color: 'var(--ink)', letterSpacing: '-0.02em' }}
          />
        </span>
      </span>
    </div>
  );
}

/* ---------- HERO ---------- */
function Hero({ onPrimary, onSecondary, headlineVariant = 'a' }) {
  const headline =
    headlineVariant === 'a' ? (
      (() => {
        // Word-by-word cascade. Wrap each word in a .hero-word span with its
        // own stagger delay. "previews" keeps the highlight treatment.
        const parts = [
          { text: 'Private' },
          { text: 'website' },
          { text: 'previews', highlight: true },
          { text: 'for' },
          { text: 'local' },
          { text: 'businesses' },
          { text: 'without' },
          { text: 'a' },
          { text: 'proper' },
          { text: 'website.' },
        ];
        return (
          <>
            {parts.map((p, i) => (
              <React.Fragment key={i}>
                <span className="hero-word" style={{ '--hero-word-delay': (60 + i * 80) + 'ms' }}>
                  <span className="wi">
                    {p.highlight ? <span className="hero-highlight">{p.text}</span> : p.text}
                  </span>
                </span>
                {i < parts.length - 1 && ' '}
              </React.Fragment>
            ))}
          </>
        );
      })()
    ) : (
      <>Private website previews for local businesses without a website.</>
    );

  const bullets = [
    'Built for local trades and service businesses',
    'First websites from £249',
    'Professional 1-2 page builds from £349',
    'You own your domain separately',
    'Mobile-ready, simple, professional',
  ];

  return (
    <section id="top" style={{ position: 'relative', overflow: 'hidden' }}>
      {/* faint grid backdrop */}
      <div
        aria-hidden
        style={{
          position: 'absolute',
          inset: 0,
          backgroundImage:
            'linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px)',
          backgroundSize: '52px 52px',
          maskImage: 'radial-gradient(ellipse 70% 55% at 50% 30%, black 30%, transparent 75%)',
          WebkitMaskImage: 'radial-gradient(ellipse 70% 55% at 50% 30%, black 30%, transparent 75%)',
          opacity: 0.55,
        }}
      />
      {/* Floating ambient dots — depth, hint of motion behind hero content */}
      <div aria-hidden style={{ position: 'absolute', inset: 0, pointerEvents: 'none', overflow: 'hidden' }}>
        {[
          { top: '14%', left: '6%',  size: 8,  color: 'var(--accent)',     opacity: 0.45, dur: '7s',  delay: '0s'   },
          { top: '22%', left: '88%', size: 6,  color: 'var(--accent-ink)', opacity: 0.4,  dur: '8s',  delay: '0.6s' },
          { top: '68%', left: '4%',  size: 10, color: 'var(--accent-soft)',opacity: 0.9,  dur: '9s',  delay: '1.2s' },
          { top: '58%', left: '92%', size: 12, color: 'var(--accent-soft)',opacity: 0.8,  dur: '6.5s',delay: '0.4s' },
          { top: '42%', left: '14%', size: 5,  color: 'var(--accent)',     opacity: 0.3,  dur: '7.5s',delay: '1.8s' },
          { top: '78%', left: '50%', size: 6,  color: 'var(--accent)',     opacity: 0.25, dur: '8s',  delay: '2.4s' },
          { top: '18%', left: '46%', size: 4,  color: 'var(--accent-ink)', opacity: 0.5,  dur: '6s',  delay: '1s'   },
        ].map((d, i) => (
          <span
            key={i}
            className="float-y"
            style={{
              position: 'absolute',
              top: d.top, left: d.left,
              width: d.size, height: d.size,
              borderRadius: 99,
              background: d.color,
              opacity: d.opacity,
              '--float-dur': d.dur, '--float-delay': d.delay,
            }}
          />
        ))}
      </div>

      <div style={{ position: 'relative', paddingTop: 24 }}>
        <PoweredByAnthropic />
      </div>

      <div
        style={{
          position: 'relative',
          maxWidth: 'var(--maxw)',
          margin: '0 auto',
          padding: '28px 28px 24px',
          display: 'grid',
          gridTemplateColumns: '1.05fr 0.95fr',
          gap: 56,
          alignItems: 'center',
        }}
        className="hero-grid"
      >
        <div style={{ display: 'flex', flexDirection: 'column', gap: 24 }}>
          <Eyebrow accent>UK &amp; international · based in Surrey &amp; South West London</Eyebrow>
          <h1
            className="hero-enter"
            style={{
              fontSize: 'clamp(38px, 5.2vw, 64px)',
              lineHeight: 1.04,
              letterSpacing: '-0.03em',
              fontWeight: 600,
              maxWidth: 620,
              animationDelay: '60ms',
            }}
          >
            {headline}
          </h1>
          <p className="hero-enter" style={{ fontSize: 19, color: 'var(--ink-2)', maxWidth: 540, lineHeight: 1.5, animationDelay: '180ms' }}>
            We create a private preview of what your first professional website
            could look like. If you like it, we can help get it live
            from <strong style={{ color: 'var(--ink)' }}>£249</strong>.
          </p>
          <div className="hero-cta-row hero-enter" style={{ display: 'flex', gap: 12, flexWrap: 'wrap', marginTop: 4, alignItems: 'center', animationDelay: '300ms' }}>
            <AccentBtn onClick={onPrimary} style={{ padding: '16px 24px', fontSize: 16 }} className="cta-shimmer">
              Request a private preview
            </AccentBtn>
            <SecondaryBtn onClick={onSecondary} style={{ padding: '16px 22px', fontSize: 15 }}>
              See sample layouts
            </SecondaryBtn>
          </div>
          <p className="hero-enter" style={{ fontSize: 13.5, color: 'var(--muted)', maxWidth: 540, marginTop: 2, animationDelay: '380ms' }}>
            No obligation. Preview only. Your website is only made live if you approve it.
          </p>
          <ul
            className="hero-bullets"
            style={{
              listStyle: 'none',
              padding: 0,
              margin: '14px 0 0',
              display: 'grid',
              gridTemplateColumns: '1fr 1fr',
              gap: '10px 22px',
              maxWidth: 560,
            }}
          >
            {bullets.map((b, i) => (
              <li key={b} style={{ display: 'flex', gap: 10, fontSize: 14.5, color: 'var(--ink-2)', '--bullet-delay': (520 + i * 90) + 'ms' }}>
                <span style={{ color: 'var(--accent)', marginTop: 3, flexShrink: 0 }}>
                  <Icon.check />
                </span>
                {b}
              </li>
            ))}
          </ul>
        </div>

        <div className="tilt-wrap">
          <div className="tilt hero-preview-enter">
            <HeroPreviewCard />
          </div>
        </div>
      </div>

      {/* Small trust line — runs across the bottom of the hero */}
      <div
        style={{
          position: 'relative',
          maxWidth: 'var(--maxw)',
          margin: '0 auto',
          padding: '0 28px 32px',
          display: 'flex',
          justifyContent: 'center',
        }}
      >
        <span
          className="mono"
          style={{
            display: 'inline-flex',
            alignItems: 'center',
            gap: 8,
            fontSize: 12,
            color: 'var(--muted)',
            border: '1px solid var(--line)',
            background: 'var(--paper-2)',
            padding: '7px 14px',
            borderRadius: 99,
          }}
        >
          <span aria-hidden className="pulse-dot" style={{ color: 'var(--accent)', display: 'inline-flex', width: 14, height: 14, alignItems: 'center', justifyContent: 'center', borderRadius: 99 }}>
            <Icon.pin />
          </span>
          Based in Surrey &amp; South West London · supporting UK and international small businesses
        </span>
      </div>

      {/* Scroll hint — bouncing chevron pointing to the sample layouts */}
      <div
        style={{
          position: 'relative',
          maxWidth: 'var(--maxw)',
          margin: '0 auto',
          padding: '0 28px 40px',
          display: 'flex',
          justifyContent: 'center',
        }}
      >
        <button
          type="button"
          className="scroll-hint"
          onClick={() => {
            const el = document.getElementById('samples');
            if (!el) return;
            const top = el.getBoundingClientRect().top + window.scrollY - 64;
            window.scrollTo({ top, behavior: 'smooth' });
          }}
          aria-label="Scroll to sample preview layouts"
        >
          <span className="mono" style={{
            fontSize: 11,
            letterSpacing: '0.1em',
            textTransform: 'uppercase',
            display: 'inline-flex',
            alignItems: 'center',
            gap: 6,
          }}>
            Scroll to see all our sample sites
          </span>
          <svg className="scroll-chevron" width="18" height="18" viewBox="0 0 18 18" fill="none">
            <path d="M4 7L9 12L14 7" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" />
          </svg>
        </button>
      </div>

      <style>{`
        @media (max-width: 900px) {
          .hero-grid { grid-template-columns: 1fr !important; gap: 36px !important; padding-top: 36px !important; }
        }
      `}</style>
    </section>
  );
}

/* Hero preview — a polished mini "browser" that auto-cycles through industries */
function HeroPreviewCard() {
  const [idx, setIdx] = React.useState(0);
  const [paused, setPaused] = React.useState(false);
  // Once the visitor steps through manually, stop the auto-advance so it
  // doesn't jump while they're looking.
  const [interacted, setInteracted] = React.useState(false);

  // Mocks are defined in sample-mocks.jsx and globalised via Object.assign(window, ...)
  // We access them via window.* so React's render-time lookup happens after both
  // scripts have loaded.
  const previews = [
    { slug: 'kingston-plumbing', label: 'Plumber',   getMock: () => window.PlumberMock  },
    { slug: 'epsom-roofing',     label: 'Roofer',    getMock: () => window.RooferMock   },
    { slug: 'surbiton-clean',    label: 'Cleaning',  getMock: () => window.CleaningMock },
    { slug: 'cobham-driveways',  label: 'Driveways', getMock: () => window.DrivewayMock },
    { slug: 'wimbledon-moves',   label: 'Removals',  getMock: () => window.RemovalMock  },
    { slug: 'croydon-electric',   label: 'Electrician', getMock: () => window.ElectricianMock },
    { slug: 'guildford-gardens',  label: 'Landscaper',  getMock: () => window.LandscaperMock  },
    { slug: 'woking-builders',    label: 'Builder',    getMock: () => window.BuilderMock },
    { slug: 'richmond-tree-care', label: 'Tree surgeon', getMock: () => window.TreeSurgeonMock },
  ];

  React.useEffect(() => {
    if (paused || interacted) return;
    const t = setInterval(() => setIdx((i) => (i + 1) % previews.length), 3800);
    return () => clearInterval(t);
  }, [paused, interacted, previews.length]);

  const go = (delta) => {
    setInteracted(true);
    setIdx((i) => (i + delta + previews.length) % previews.length);
  };

  const current = previews[idx];
  const Mock = current.getMock();

  return (
    <div
      style={{ position: 'relative' }}
      onMouseEnter={() => setPaused(true)}
      onMouseLeave={() => setPaused(false)}
    >
      {/* Floating stamp */}
      <div
        className="mono"
        style={{
          position: 'absolute',
          top: -14,
          left: 18,
          zIndex: 3,
          background: 'var(--ink)',
          color: 'white',
          fontSize: 11,
          letterSpacing: '0.08em',
          textTransform: 'uppercase',
          padding: '5px 9px',
          borderRadius: 6,
          boxShadow: '0 6px 16px -8px rgba(11,18,32,0.4)',
          display: 'inline-flex',
          alignItems: 'center',
          gap: 6,
        }}
      >
        <span className="pulse-dot" style={{
          width: 6, height: 6, borderRadius: 99,
          background: '#FF6E5E', display: 'inline-block',
        }} />
        Private preview · not yet live
      </div>

      {/* Floating industry tab */}
      <div
        className="mono"
        style={{
          position: 'absolute',
          top: -14,
          right: 18,
          zIndex: 3,
          background: 'var(--cta)',
          color: 'white',
          fontSize: 10.5,
          letterSpacing: '0.08em',
          textTransform: 'uppercase',
          padding: '5px 10px',
          borderRadius: 6,
          boxShadow: '0 6px 16px -8px rgba(46,107,255,0.5)',
        }}
      >
        Sample · {current.label}
      </div>

      <div
        style={{
          background: 'white',
          borderRadius: 18,
          border: '1px solid var(--line)',
          boxShadow: 'var(--shadow-pop)',
          overflow: 'hidden',
        }}
      >
        {/* Browser chrome */}
        <div
          style={{
            display: 'flex',
            alignItems: 'center',
            gap: 8,
            padding: '12px 14px',
            borderBottom: '1px solid var(--line)',
            background: '#FFFFFF',
          }}
        >
          <span style={{ display: 'flex', gap: 6 }}>
            <i style={{ width: 10, height: 10, borderRadius: 99, background: '#FF6E5E' }} />
            <i style={{ width: 10, height: 10, borderRadius: 99, background: '#F0C24A' }} />
            <i style={{ width: 10, height: 10, borderRadius: 99, background: '#7BC68E' }} />
          </span>
          <div
            className="mono"
            style={{
              marginLeft: 12,
              flex: 1,
              fontSize: 11,
              background: 'var(--paper)',
              border: '1px solid var(--line)',
              borderRadius: 6,
              padding: '5px 10px',
              color: 'var(--muted)',
              display: 'flex',
              alignItems: 'center',
              gap: 6,
              minWidth: 0,
              overflow: 'hidden',
            }}
          >
            <Icon.globe />
            <span style={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
              preview.ares.tech/<span key={current.slug} className="slide-fade" style={{ color: 'var(--ink-2)' }}>{current.slug}</span>
            </span>
          </div>
        </div>

        {/* Mock body — crossfades on industry change */}
        <div key={idx} className="slide-fade" style={{ minHeight: 320 }}>
          {Mock ? <Mock /> : <HeroPreviewFallback />}
        </div>

        {/* Footer info bar */}
        <div
          className="mono"
          style={{
            display: 'flex',
            justifyContent: 'space-between',
            alignItems: 'center',
            padding: '10px 14px',
            borderTop: '1px solid var(--line)',
            background: 'var(--paper)',
            fontSize: 11,
            color: 'var(--muted)',
          }}
        >
          <span>1 page · sample {idx + 1} of {previews.length}</span>
          <span>From £249 · £349 professional</span>
        </div>
      </div>

      {/* Manual controls — step back / forward through the sample previews */}
      <div
        style={{
          marginTop: 14,
          display: 'flex',
          justifyContent: 'center',
          alignItems: 'center',
          gap: 14,
        }}
      >
        <button
          type="button"
          className="preview-nav lift"
          aria-label="Previous sample preview"
          onClick={() => go(-1)}
        >
          <svg width="16" height="16" viewBox="0 0 18 18" fill="none">
            <path d="M11 4L6 9L11 14" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" />
          </svg>
        </button>

        <div
          role="tablist"
          aria-label="Preview industries"
          style={{ display: 'flex', alignItems: 'center', gap: 8 }}
        >
          {previews.map((p, i) => (
            <button
              key={p.slug}
              role="tab"
              aria-selected={i === idx}
              aria-label={'View ' + p.label + ' preview'}
              onClick={() => { setInteracted(true); setIdx(i); }}
              style={{
                cursor: 'pointer',
                border: 'none',
                padding: 0,
                background: i === idx ? 'var(--cta)' : 'var(--line-strong)',
                width: i === idx ? 22 : 8,
                height: 6,
                borderRadius: 99,
                transition: 'width 320ms cubic-bezier(0.2,0.8,0.2,1), background 220ms ease',
              }}
            />
          ))}
        </div>

        <button
          type="button"
          className="preview-nav lift"
          aria-label="Next sample preview"
          onClick={() => go(1)}
        >
          <svg width="16" height="16" viewBox="0 0 18 18" fill="none">
            <path d="M7 4L12 9L7 14" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" />
          </svg>
        </button>
      </div>
    </div>
  );
}

function HeroPreviewFallback() {
  // Tiny fallback shown only if sample mocks haven't loaded yet (race condition guard).
  return (
    <div style={{ padding: 22, display: 'flex', flexDirection: 'column', gap: 12 }}>
      <StripedPlaceholder label="loading preview…" ratio="16 / 9" radius={10} />
    </div>
  );
}

/* ---------- PROBLEM ---------- */
function Problem() {
  const cards = [
    { label: 'No proper website', sub: 'Just a Facebook page or directory listing.' },
    { label: 'No quote form', sub: 'New customers have nowhere obvious to ask.' },
    { label: 'No click-to-call page', sub: 'Phone enquiries get lost or never come in.' },
    { label: 'No owned online presence', sub: 'Your business lives on someone else’s platform.' },
    { label: 'Relying on directories', sub: 'Facebook, Checkatrade, Yell, Google listings.' },
    { label: 'Losing trust to competitors', sub: 'Rivals with simple sites look more credible.' },
    { label: 'Hard to share with new leads', sub: 'No clean link to send when someone asks for your details.' },
    { label: 'No control over what shows up', sub: 'Old posts, wrong hours, missing services — and no way to fix them.' },
  ];
  return (
    <section style={{ padding: '88px 28px' }}>
      <div style={{ maxWidth: 'var(--maxw)', margin: '0 auto' }}>
        <SectionHeader
          eyebrow="The problem"
          title={
            <>
              Still relying only on Google,<br />
              Facebook or directories?
            </>
          }
          intro="Many local businesses have strong reviews, good work, and loyal customers — but no proper website. People searching online may not see the full picture, trust the business, or request a quote."
        />
        <div
          style={{
            marginTop: 40,
            display: 'grid',
            gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 260px), 1fr))',
            gap: 14,
          }}
          className="reveal-stagger"
        >
          {cards.map((c, i) => (
            <div
              key={c.label}
              className="lift"
              style={{
                background: 'white',
                border: '1px solid var(--line)',
                borderRadius: 16,
                padding: '20px 20px 22px',
                display: 'flex',
                flexDirection: 'column',
                gap: 8,
                minHeight: 140,
                position: 'relative',
              }}
            >
              <span className="mono" style={{
                fontSize: 12,
                color: 'var(--muted)',
                background: 'white',
                border: '1px solid var(--line)',
                borderRadius: 10,
                width: 44, height: 44,
                display: 'inline-flex',
                alignItems: 'center',
                justifyContent: 'center',
                fontWeight: 600,
                letterSpacing: '0.02em',
                flexShrink: 0,
              }}>
                {String(i + 1).padStart(2, '0')}
              </span>
              <div style={{ display: 'flex', gap: 10, alignItems: 'flex-start' }}>
                <span style={{ marginTop: 4, color: '#C13C3C' }}>
                  <Icon.x />
                </span>
                <span style={{ fontSize: 17, fontWeight: 500, letterSpacing: '-0.01em' }}>{c.label}</span>
              </div>
              <p style={{ fontSize: 14, color: 'var(--muted)', marginLeft: 24 }}>{c.sub}</p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ---------- HOW IT WORKS ---------- */
function HowItWorks() {
  const [active, setActive] = React.useState(0);
  const steps = [
    {
      title: 'We check your current online presence',
      desc: 'A quick look at your Google profile, social pages, and any reviews — to understand what local customers already see.',
      icon: '01',
    },
    {
      title: 'We create a private website preview',
      desc: 'You get a private link to a one-page mockup with your business name, services, and contact details placed in a clean professional layout.',
      icon: '02',
    },
    {
      title: 'You review the preview',
      desc: 'No pressure, no contract. Look at it on your phone, share it with a partner or team member, and tell us what you’d change.',
      icon: '03',
    },
    {
      title: 'If you like it, we polish it and get it live',
      desc: 'One revision round, real photos and copy plugged in, basic local SEO set up. Then we launch.',
      icon: '04',
    },
    {
      title: 'You pay for and own your own domain',
      desc: 'You buy your domain in your own name through a service like Cloudflare or 123-Reg. We help connect it — but it always belongs to you.',
      icon: '05',
    },
  ];

  return (
    <section id="how" style={{ padding: '88px 28px', background: 'var(--paper-2)', borderTop: '1px solid var(--line)', borderBottom: '1px solid var(--line)' }}>
      <div style={{ maxWidth: 'var(--maxw)', margin: '0 auto' }}>
        <div className="section-spotlight">
        <SectionHeader
          eyebrow="How it works"
          title="From a private preview to a live website in five clear steps."
          intro="The preview is not your official website until you approve it. There’s no obligation to go live — and no surprise costs along the way."
        />
        </div>

        <div
          style={{
            marginTop: 44,
            display: 'grid',
            gridTemplateColumns: '0.95fr 1.05fr',
            gap: 36,
          }}
          className="how-grid"
        >
          {/* Steps list */}
          <ol
            style={{
              listStyle: 'none',
              padding: 0,
              margin: 0,
              display: 'flex',
              flexDirection: 'column',
              gap: 2,
            }}
          >
            {steps.map((s, i) => {
              const isActive = i === active;
              return (
                <li key={s.title}>
                  <button
                    onClick={() => setActive(i)}
                    style={{
                      width: '100%',
                      textAlign: 'left',
                      display: 'flex',
                      gap: 16,
                      alignItems: 'flex-start',
                      padding: '18px 18px 18px 14px',
                      borderRadius: 12,
                      border: '1px solid ' + (isActive ? 'var(--line-strong)' : 'transparent'),
                      background: isActive ? 'white' : 'transparent',
                      cursor: 'pointer',
                      transition: 'background 140ms ease, border-color 140ms ease',
                    }}
                  >
                    <span
                      className={isActive ? 'mono step-active' : 'mono'}
                      style={{
                        width: 44,
                        height: 44,
                        borderRadius: 10,
                        background: isActive ? 'var(--ink)' : 'white',
                        color: isActive ? 'white' : 'var(--ink-2)',
                        border: '1px solid ' + (isActive ? 'var(--ink)' : 'var(--line)'),
                        display: 'inline-flex',
                        alignItems: 'center',
                        justifyContent: 'center',
                        fontSize: 14,
                        fontWeight: 600,
                        letterSpacing: '0.02em',
                        flexShrink: 0,
                        transition: 'background 220ms ease, color 220ms ease',
                      }}
                    >
                      {s.icon}
                    </span>
                    <span style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
                      <span style={{ fontSize: 17, fontWeight: 500, letterSpacing: '-0.01em' }}>
                        {s.title}
                      </span>
                      <span style={{ fontSize: 14, color: 'var(--muted)' }}>{s.desc}</span>
                    </span>
                  </button>
                </li>
              );
            })}
          </ol>

          {/* Right-side illustration */}
          <HowIllustration step={active} />
        </div>
      </div>
      <style>{`
        @media (max-width: 920px) {
          .how-grid { grid-template-columns: 1fr !important; }
        }
      `}</style>
    </section>
  );
}

function HowIllustration({ step }) {
  const labels = [
    'STEP 01 · audit',
    'STEP 02 · preview',
    'STEP 03 · review',
    'STEP 04 · polish & launch',
    'STEP 05 · your domain',
  ];
  return (
    <div
      style={{
        position: 'sticky',
        top: 96,
        background: 'white',
        border: '1px solid var(--line)',
        borderRadius: 20,
        padding: 22,
        minHeight: 420,
        display: 'flex',
        flexDirection: 'column',
        gap: 16,
        boxShadow: 'var(--shadow-card)',
      }}
    >
      <div className="mono" style={{ display: 'flex', justifyContent: 'space-between', fontSize: 11, color: 'var(--muted)', letterSpacing: '0.08em' }}>
        <span>{labels[step]}</span>
        <span>{step + 1} / 5</span>
      </div>

      <div style={{ flex: 1, position: 'relative' }}>
        <div key={step} className="slide-fade" style={{ height: '100%' }}>
          {step === 0 && <AuditSlide />}
          {step === 1 && <PreviewSlide />}
          {step === 2 && <ReviewSlide />}
          {step === 3 && <LaunchSlide />}
          {step === 4 && <DomainSlide />}
        </div>
      </div>

      <div style={{ display: 'flex', gap: 4 }}>
        {[0, 1, 2, 3, 4].map((i) => (
          <span
            key={i}
            style={{
              flex: 1,
              height: 3,
              borderRadius: 2,
              background: i <= step ? 'var(--ink)' : 'var(--line)',
              transition: 'background 200ms ease',
            }}
          />
        ))}
      </div>
    </div>
  );
}

function AuditSlide() {
  const items = [
    { label: 'Google business profile', val: 'Reviews found' },
    { label: 'Facebook page', val: 'Active' },
    { label: 'Standalone website', val: 'Not found', warn: true },
    { label: 'Domain registered', val: 'Not found', warn: true },
    { label: 'Click-to-call', val: 'Missing', warn: true },
  ];
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
      {items.map((it) => (
        <div key={it.label} style={{ display: 'flex', justifyContent: 'space-between', padding: '12px 14px', border: '1px solid var(--line)', borderRadius: 10, fontSize: 14 }}>
          <span style={{ color: 'var(--ink-2)' }}>{it.label}</span>
          <span className="mono" style={{ fontSize: 12, color: it.warn ? '#A0322A' : 'var(--ink-2)' }}>
            {it.val}
          </span>
        </div>
      ))}
    </div>
  );
}

function PreviewSlide() {
  // Cycle through the polished industry mocks so this step shows a real preview,
  // not just placeholders. Auto-rotates so the user sees variety even if they linger.
  const previews = [
    { slug: 'kingston-plumbing', label: 'Plumber',   getMock: () => window.PlumberMock  },
    { slug: 'epsom-roofing',     label: 'Roofer',    getMock: () => window.RooferMock   },
    { slug: 'surbiton-clean',    label: 'Cleaning',  getMock: () => window.CleaningMock },
    { slug: 'cobham-driveways',  label: 'Driveways', getMock: () => window.DrivewayMock },
    { slug: 'wimbledon-moves',   label: 'Removals',  getMock: () => window.RemovalMock  },
    { slug: 'croydon-electric',   label: 'Electrician', getMock: () => window.ElectricianMock },
    { slug: 'guildford-gardens',  label: 'Landscaper',  getMock: () => window.LandscaperMock  },
    { slug: 'woking-builders',    label: 'Builder',    getMock: () => window.BuilderMock },
    { slug: 'richmond-tree-care', label: 'Tree surgeon', getMock: () => window.TreeSurgeonMock },
  ];
  const [idx, setIdx] = React.useState(0);
  React.useEffect(() => {
    const t = setInterval(() => setIdx((i) => (i + 1) % previews.length), 3000);
    return () => clearInterval(t);
  }, [previews.length]);
  const current = previews[idx];
  const Mock = current.getMock();

  return (
    <div style={{
      position: 'relative',
      borderRadius: 10,
      overflow: 'hidden',
      border: '1px solid var(--line)',
      background: 'white',
      boxShadow: '0 6px 18px -10px rgba(11,18,32,0.18)',
    }}>
      {/* Browser chrome */}
      <div style={{
        padding: '8px 12px',
        borderBottom: '1px solid var(--line)',
        display: 'flex', alignItems: 'center', gap: 8,
        background: '#FFFFFF',
      }}>
        <span style={{ display: 'flex', gap: 4 }}>
          <i style={{ width: 7, height: 7, borderRadius: 99, background: '#FF6E5E' }} />
          <i style={{ width: 7, height: 7, borderRadius: 99, background: '#F0C24A' }} />
          <i style={{ width: 7, height: 7, borderRadius: 99, background: '#7BC68E' }} />
        </span>
        <div className="mono" style={{
          flex: 1, fontSize: 10, color: 'var(--muted)',
          background: 'var(--paper)', border: '1px solid var(--line)',
          borderRadius: 5, padding: '3px 8px',
          display: 'flex', alignItems: 'center', gap: 5,
          overflow: 'hidden', minWidth: 0,
        }}>
          <Icon.globe />
          <span style={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
            preview.ares.tech/<span key={current.slug} className="slide-fade" style={{ color: 'var(--ink-2)' }}>{current.slug}</span>
          </span>
        </div>
        <span className="mono" style={{
          fontSize: 9, letterSpacing: '0.06em', textTransform: 'uppercase',
          color: 'var(--accent-ink)', background: 'var(--accent-soft)',
          border: '1px solid var(--accent)', padding: '2px 5px',
          borderRadius: 3, whiteSpace: 'nowrap',
        }}>
          {current.label}
        </span>
      </div>
      {/* Live mock */}
      <div key={idx} className="slide-fade" style={{ minHeight: 280 }}>
        {Mock ? <Mock /> : null}
      </div>
      {/* Tab indicator dots */}
      <div style={{
        padding: '8px 12px',
        borderTop: '1px solid var(--line)',
        display: 'flex', justifyContent: 'center', gap: 6,
        background: 'var(--paper)',
      }}>
        {previews.map((p, i) => (
          <button
            key={p.slug}
            type="button"
            aria-label={p.label + ' preview'}
            onClick={() => setIdx(i)}
            style={{
              cursor: 'pointer', border: 'none', padding: 0,
              background: i === idx ? 'var(--cta)' : 'var(--line-strong)',
              width: i === idx ? 18 : 6, height: 5,
              borderRadius: 99,
              transition: 'width 280ms cubic-bezier(0.2,0.8,0.2,1), background 200ms ease',
            }}
          />
        ))}
      </div>
    </div>
  );
}

function ReviewSlide() {
  const notes = [
    { who: 'You', text: 'Looks good. Can the phone number be bigger on mobile?' },
    { who: 'ARES', text: 'Done. Pushed an updated preview link.' },
    { who: 'You', text: 'Swap the second photo for our team van shot.' },
    { who: 'ARES', text: 'Swapped. Ready when you are.' },
  ];
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
      {notes.map((n, i) => (
        <div
          key={i}
          style={{
            alignSelf: n.who === 'You' ? 'flex-end' : 'flex-start',
            maxWidth: '82%',
            background: n.who === 'You' ? 'var(--accent-soft)' : 'white',
            border: '1px solid ' + (n.who === 'You' ? 'var(--accent)' : 'var(--line)'),
            borderRadius: 12,
            padding: '10px 13px',
            fontSize: 14,
          }}
        >
          <span className="mono" style={{ fontSize: 10, color: 'var(--muted)', letterSpacing: '0.08em', textTransform: 'uppercase', display: 'block', marginBottom: 4 }}>
            {n.who}
          </span>
          {n.text}
        </div>
      ))}
    </div>
  );
}

function LaunchSlide() {
  const items = ['Final copy in', 'Photos plugged in', 'Local SEO set', 'Form connected', 'Mobile checked', 'Going live'];
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
      {items.map((it, i) => {
        const done = i < items.length - 1;
        return (
          <div key={it} style={{ display: 'flex', gap: 10, alignItems: 'center', padding: '10px 12px', border: '1px solid var(--line)', borderRadius: 10, fontSize: 14 }}>
            <span style={{
              width: 18, height: 18, borderRadius: 99,
              border: '1.5px solid ' + (done ? 'var(--ok)' : 'var(--line-strong)'),
              background: done ? 'var(--ok)' : 'white',
              color: 'white',
              display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
            }}>
              {done && <Icon.check />}
            </span>
            <span style={{ color: done ? 'var(--ink-2)' : 'var(--ink)' }}>{it}</span>
            {!done && <span className="mono" style={{ marginLeft: 'auto', fontSize: 11, color: 'var(--accent-ink)' }}>in progress</span>}
          </div>
        );
      })}
    </div>
  );
}

function DomainSlide() {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
      <div style={{ border: '1px solid var(--line)', borderRadius: 12, padding: 14, background: '#FFFFFF', display: 'flex', flexDirection: 'column', gap: 8 }}>
        <span className="mono" style={{ fontSize: 10, color: 'var(--muted)', letterSpacing: '0.1em', textTransform: 'uppercase' }}>Registrar invoice</span>
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline' }}>
          <span style={{ fontSize: 18, letterSpacing: '-0.01em' }}>yourbusiness.co.uk</span>
          <span className="mono" style={{ fontSize: 12, color: 'var(--ink-2)' }}>£8 – £15 / yr</span>
        </div>
        <span style={{ fontSize: 13, color: 'var(--muted)' }}>Bought in your name. Owned by you. Always.</span>
      </div>
      <div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '10px 12px', border: '1px dashed var(--line-strong)', borderRadius: 10, fontSize: 13, color: 'var(--muted)' }}>
        <Icon.pin />
        <span>ARES helps connect the domain, but never holds it on your behalf.</span>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }}>
        {['Cloudflare', '123-Reg', 'Namecheap'].map((r) => (
          <div key={r} className="mono" style={{ textAlign: 'center', padding: '8px 6px', border: '1px solid var(--line)', borderRadius: 8, fontSize: 11, color: 'var(--ink-2)' }}>
            {r}
          </div>
        ))}
      </div>
    </div>
  );
}

function PriceFigure({ value }) {
  // Splits "From £249" / "£349" / "From £79" so the £ symbol is rendered amber
  // and the numeric figure stays in the strong ink colour. The digit span
  // carries data-countup so the motion system can animate from 0 on view.
  const match = String(value).match(/^(\s*[Ff]rom\s+)?£(\d[\d,.]*)(.*)$/);
  if (!match) {
    return <span style={{ fontSize: 48, letterSpacing: '-0.035em', fontWeight: 600, lineHeight: 1 }}>{value}</span>;
  }
  const [, fromPrefix, number, trailing] = match;
  const cleanNum = number.replace(/[,.]/g, '');
  return (
    <span style={{ display: 'inline-flex', alignItems: 'baseline', gap: 4, lineHeight: 1 }}>
      <span style={{ color: 'var(--accent)', fontSize: 48, letterSpacing: '-0.035em', fontWeight: 600, lineHeight: 1 }}>
        £
      </span>
      <span
        data-countup={cleanNum}
        style={{ color: 'var(--ink)', fontSize: 48, letterSpacing: '-0.035em', fontWeight: 600, lineHeight: 1, fontVariantNumeric: 'tabular-nums' }}
      >
        {number}{trailing}
      </span>
    </span>
  );
}

/* ExtraPagesAddon — small add-on row beneath the 3 main packages.
   Indicative prices; adjust as needed. */
function ExtraPagesAddon({ onCta }) {
  const tiers = [
    {
      n: 1,
      label: '+1 page',
      price: '+£99',
      desc: 'Add an extra page — e.g. About, Services detail, or Pricing.',
    },
    {
      n: 2,
      label: '+2 pages',
      price: '+£179',
      desc: 'Two additional pages — typically Services + About, or Services + Gallery.',
    },
    {
      n: 3,
      label: '+3 pages',
      price: '+£249',
      desc: 'A small multi-page site — Services, About, Gallery, plus your home page.',
    },
  ];
  return (
    <div
      style={{
        marginTop: 22,
        background: 'var(--paper-2)',
        border: '1px solid var(--line)',
        borderRadius: 20,
        padding: 24,
        display: 'grid',
        gridTemplateColumns: '0.85fr 2.15fr',
        gap: 24,
        alignItems: 'stretch',
      }}
      className="extra-pages-grid"
    >
      <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
        <Eyebrow>Need more pages?</Eyebrow>
        <h3 style={{ fontSize: 22, letterSpacing: '-0.02em', fontWeight: 600 }}>
          Add 1–3 pages, depending on your business.
        </h3>
        <p style={{ fontSize: 14, color: 'var(--muted)', lineHeight: 1.5 }}>
          The £249 entry is one page. The £349 professional covers 1 or 2 pages.
          If you need more — a detailed Services page, About, separate Gallery,
          or a Pricing page — add them on at the rates below.
        </p>
        <div style={{ marginTop: 4 }}>
          <SecondaryBtn onClick={onCta} style={{ padding: '10px 16px', fontSize: 14, whiteSpace: 'nowrap' }}>
            Ask about extra pages
          </SecondaryBtn>
        </div>
      </div>

      <ul
        style={{
          listStyle: 'none',
          padding: 0,
          margin: 0,
          display: 'grid',
          gridTemplateColumns: 'repeat(3, 1fr)',
          gap: 12,
        }}
        className="extra-pages-tiers"
      >
        {tiers.map((t) => (
          <li
            key={t.n}
            style={{
              background: '#FFFFFF',
              border: '1px solid var(--line)',
              borderRadius: 14,
              padding: '16px 16px 14px',
              display: 'flex',
              flexDirection: 'column',
              gap: 8,
              position: 'relative',
            }}
          >
            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
              <span
                className="mono"
                style={{
                  fontSize: 10.5,
                  letterSpacing: '0.08em',
                  textTransform: 'uppercase',
                  color: 'var(--muted)',
                }}
              >
                {t.label}
              </span>
              <span
                aria-hidden
                style={{
                  display: 'inline-flex',
                  gap: 3,
                }}
              >
                {[0, 1, 2].map((i) => (
                  <i
                    key={i}
                    style={{
                      width: 6,
                      height: 8,
                      borderRadius: 1.5,
                      background: i < t.n ? 'var(--accent)' : 'var(--line-strong)',
                    }}
                  />
                ))}
              </span>
            </div>
            <div style={{ display: 'flex', alignItems: 'baseline', gap: 4 }}>
              <span style={{ fontSize: 28, fontWeight: 600, letterSpacing: '-0.02em', color: 'var(--accent)' }}>
                +£
              </span>
              <span style={{ fontSize: 28, fontWeight: 600, letterSpacing: '-0.02em', color: 'var(--ink)', fontVariantNumeric: 'tabular-nums' }} data-countup={t.price.replace(/^[^\d]*/, '')}>
                {t.price.replace(/^[^\d]*/, '')}
              </span>
              <span className="mono" style={{ fontSize: 11, color: 'var(--muted)' }}>
                one-off
              </span>
            </div>
            <p style={{ fontSize: 12.5, color: 'var(--muted)', lineHeight: 1.45 }}>
              {t.desc}
            </p>
          </li>
        ))}
      </ul>

      <style>{`
        @media (max-width: 940px) {
          .extra-pages-grid { grid-template-columns: 1fr !important; }
        }
        @media (max-width: 720px) {
          .extra-pages-tiers { grid-template-columns: 1fr !important; }
        }
      `}</style>
    </div>
  );
}

/* ---------- PRICING ---------- */
function Pricing({ onCta }) {
  const cards = [
    {
      id: 'entry',
      title: 'First Website',
      price: 'From £249',
      priceSub: 'one-off',
      badge: 'Lowest entry price',
      badgeTone: 'neutral',
      description:
        'A simple first online presence.',
      includes: [
        'Private preview',
        'Mobile-ready one-page layout',
        'Click-to-call section',
        'Simple contact section',
        'Launch support',
      ],
      notIncluded: [
        'Domain purchase',
        'Multiple pages',
        'Full SEO campaign',
        'Booking system',
        'E-commerce',
        'Unlimited edits',
        'Ongoing support unless added monthly',
      ],
      cta: 'Request Entry Preview',
    },
    {
      id: 'pro',
      title: '1-2 page',
      price: '£349',
      priceSub: 'one-off',
      badge: 'Most chosen',
      badgeTone: 'accent',
      featured: true,
      description:
        'For trades and local service businesses that want a stronger first website.',
      includes: [
        'Stronger 1-2 page layout',
        'Services section',
        'Gallery or placeholder gallery',
        'Contact / quote form layout',
        'Basic local SEO title and description',
        'One revision round',
      ],
      cta: 'Get My Preview',
    },
    {
      id: 'support',
      title: 'Updates & Support',
      price: 'From £79',
      priceSub: '/ month',
      badge: 'Optional',
      badgeTone: 'neutral',
      description:
        'Optional after launch.',
      includes: [
        'Small content updates',
        'Basic support',
        'Minor layout changes',
        'Ongoing help after launch',
      ],
      cta: 'Ask About Support',
    },
  ];

  return (
    <section id="pricing" style={{ padding: '88px 28px' }}>
      <div style={{ maxWidth: 'var(--maxw)', margin: '0 auto' }}>
        <SectionHeader
          eyebrow="Simple website packages"
          title="Simple Website Packages"
          intro="Lean, professional websites for local businesses that need to get online quickly — without agency pricing."
        />

        <div
          style={{
            marginTop: 40,
            display: 'grid',
            gridTemplateColumns: 'repeat(3, 1fr)',
            gap: 18,
            alignItems: 'stretch',
          }}
          className="price-grid reveal-stagger"
        >
          {cards.map((c) => (
            <PriceCard key={c.id} card={c} onCta={onCta} />
          ))}
        </div>

        {/* Pricing disclaimer */}
        <p
          className="mono"
          style={{
            marginTop: 14,
            fontSize: 12,
            color: 'var(--muted)',
            textAlign: 'center',
          }}
        >
          Domain purchase is separate. You pay for and own your own domain.
        </p>

        {/* Extra-pages add-on row */}
        <ExtraPagesAddon onCta={onCta} />

        {/* Domain ownership card — kept directly below the three packages */}
        <div
          style={{
            marginTop: 22,
            background: 'white',
            border: '1px solid var(--line)',
            borderRadius: 18,
            padding: 22,
            display: 'grid',
            gridTemplateColumns: '0.95fr 1.05fr',
            gap: 28,
            alignItems: 'center',
          }}
          className="domain-grid"
        >
          <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
            <Eyebrow>Domain ownership</Eyebrow>
            <h3 style={{ fontSize: 22, letterSpacing: '-0.02em' }}>You own your domain, separately.</h3>
          </div>
          <p style={{ fontSize: 14.5, color: 'var(--ink-2)', lineHeight: 1.5 }}>
            Domain purchase is not included in any package. You pay for and own
            your domain separately. We can help you choose and connect it, but
            it stays in your name — usually around{' '}
            <span className="mono" style={{ color: 'var(--ink-2)' }}>£8–£15/year</span> through Cloudflare, 123-Reg, or Namecheap.
          </p>
        </div>
      </div>
      <style>{`
        @media (max-width: 1040px) {
          .price-grid { grid-template-columns: 1fr 1fr !important; }
          .price-card-pro { grid-column: 1 / -1; }
        }
        @media (max-width: 720px) {
          .price-grid { grid-template-columns: 1fr !important; }
          .price-card-pro { grid-column: auto; }
          .domain-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
        }
      `}</style>
    </section>
  );
}

function PriceCard({ card, onCta }) {
  const featured = !!card.featured;
  const labelClass = card.id === 'pro' ? 'price-card-pro' : '';

  // Badge style — accent (most chosen) is amber filled; neutral is outline
  const badgeStyle = card.badgeTone === 'accent'
    ? {
        background: 'var(--accent)',
        color: 'white',
        border: '1px solid var(--accent)',
      }
    : {
        background: featured ? '#1B2030' : 'var(--paper-2)',
        color: featured ? 'white' : 'var(--ink-2)',
        border: '1px solid ' + (featured ? '#232A3A' : 'var(--line)'),
      };

  return (
    <article
      className={(labelClass + ' lift' + (featured ? ' featured-lift' : '')).trim()}
      style={{
        position: 'relative',
        background: featured ? 'var(--paper-2)' : 'var(--paper-2)',
        color: 'var(--ink)',
        border: '1px solid ' + (featured ? 'var(--accent)' : 'var(--line)'),
        borderRadius: 20,
        padding: '28px 26px 26px',
        display: 'flex',
        flexDirection: 'column',
        gap: 16,
        overflow: 'hidden',
        boxShadow: featured ? '0 6px 18px -8px rgba(14,123,123,0.22), 0 2px 8px rgba(28,27,26,0.05)' : 'var(--shadow-card)',
        transform: featured ? 'translateY(-6px)' : 'none',
      }}
    >
      {featured && (
        <>
          <div className="sweep" aria-hidden style={{ '--sweep-delay': '4s' }} />
          <div
            aria-hidden
            style={{
              position: 'absolute',
              inset: 0,
              opacity: 0.55,
              backgroundImage: 'radial-gradient(circle at 90% -10%, var(--accent-soft), transparent 55%)',
              pointerEvents: 'none',
            }}
          />
        </>
      )}

      <div style={{ position: 'relative', display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 12 }}>
        <span className="mono" style={{
          fontSize: 11,
          color: 'var(--muted)',
          letterSpacing: '0.08em',
          textTransform: 'uppercase',
        }}>
          {card.title}
        </span>
        <span
          className={"mono" + (card.badgeTone === 'accent' ? ' badge-breathe' : '')}
          style={{
            fontSize: 10.5,
            padding: '4px 9px',
            borderRadius: 99,
            letterSpacing: '0.06em',
            textTransform: 'uppercase',
            whiteSpace: 'nowrap',
            ...badgeStyle,
          }}
        >
          {card.badge}
        </span>
      </div>

      <div style={{ position: 'relative', display: 'flex', flexDirection: 'column', gap: 6 }}>
        <div style={{ display: 'flex', alignItems: 'baseline', gap: 8 }}>
          <PriceFigure value={card.price} />
          <span className="mono" style={{
            fontSize: 12,
            color: 'var(--muted)',
          }}>
            {card.priceSub}
          </span>
        </div>
        <span className="mono" style={{ fontSize: 11.5, color: 'var(--muted)' }}>
          You own and pay for your domain separately.
        </span>
      </div>

      <p style={{
        position: 'relative',
        fontSize: 14.5,
        color: 'var(--ink-2)',
        lineHeight: 1.5,
        minHeight: 60,
      }}>
        {card.description}
      </p>

      <ul style={{
        position: 'relative',
        listStyle: 'none',
        padding: 0,
        margin: 0,
        display: 'flex',
        flexDirection: 'column',
        gap: 8,
        flex: 1,
      }}>
        {card.includes.map((it) => (
          <li key={it} style={{
            display: 'flex',
            gap: 10,
            fontSize: 13.5,
            color: 'var(--ink-2)',
            lineHeight: 1.4,
          }}>
            <span style={{
              color: 'var(--accent)',
              marginTop: 3,
              flexShrink: 0,
            }}>
              <Icon.check />
            </span>
            {it}
          </li>
        ))}
      </ul>

      {card.notIncluded && (
        <details style={{
          position: 'relative',
          fontSize: 12.5,
          color: 'var(--muted)',
          borderTop: '1px solid var(--line)',
          paddingTop: 12,
        }}>
          <summary style={{ cursor: 'pointer', userSelect: 'none' }}>
            What’s not included
          </summary>
          <ul style={{
            listStyle: 'none',
            padding: '10px 0 0',
            margin: 0,
            display: 'flex',
            flexDirection: 'column',
            gap: 4,
          }}>
            {card.notIncluded.map((it) => (
              <li key={it} style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
                <span style={{ color: 'var(--muted)' }}><Icon.x /></span>
                {it}
              </li>
            ))}
          </ul>
        </details>
      )}

      <div style={{ position: 'relative', marginTop: 4 }}>
        {featured ? (
          <AccentBtn onClick={onCta} style={{ width: '100%', justifyContent: 'center' }}>
            {card.cta}
          </AccentBtn>
        ) : (
          <SecondaryBtn onClick={onCta} style={{ width: '100%', justifyContent: 'center' }}>
            {card.cta}
          </SecondaryBtn>
        )}
      </div>
    </article>
  );
}

/* ---------- MONTHLY SUPPORT ---------- */
function Monthly({ onCta }) {
  const incl = [
    { t: 'Hosting support', d: 'Stays online and up-to-date.' },
    { t: 'Small text & image updates', d: 'Quick changes when your services or hours change.' },
    { t: 'Basic maintenance', d: 'Plugin and security updates handled for you.' },
    { t: 'Technical help', d: 'Email or message us when something’s off.' },
    { t: 'Ongoing support', d: 'A real person to ask, not a ticket queue.' },
  ];
  return (
    <section style={{ padding: '0 28px 88px' }}>
      <div
        style={{
          maxWidth: 'var(--maxw)',
          margin: '0 auto',
          background: 'white',
          border: '1px solid var(--line)',
          borderRadius: 22,
          padding: 32,
          display: 'grid',
          gridTemplateColumns: '0.9fr 1.1fr',
          gap: 32,
          alignItems: 'center',
        }}
        className="month-grid"
      >
        <div style={{ display: 'flex', flexDirection: 'column', gap: 18 }}>
          <Eyebrow>Optional updates &amp; support</Eyebrow>
          <h2 style={{ fontSize: 'clamp(26px, 3vw, 36px)', letterSpacing: '-0.025em', lineHeight: 1.08 }}>
            Manage it yourself, or let us look after it.
          </h2>
          <p style={{ fontSize: 16, color: 'var(--ink-2)' }}>
            Optional updates and support from £79/month, after your site is live.
            Cancel anytime.
          </p>
          <div className="figure-pulse" style={{
            display: 'flex', alignItems: 'baseline', gap: 10,
            padding: '14px 16px', border: '1px solid var(--line)', borderRadius: 12,
            background: 'var(--paper)',
            alignSelf: 'flex-start',
          }}>
            <span style={{ fontSize: 36, letterSpacing: '-0.03em', fontWeight: 500 }}>
              <span style={{ color: 'var(--accent)' }}>£</span>
              <span style={{ color: 'var(--ink)' }} data-countup="79">79</span>
            </span>
            <span className="mono" style={{ fontSize: 12, color: 'var(--muted)' }}>/ month, cancel anytime</span>
          </div>
          <div>
            <SecondaryBtn onClick={onCta}>Ask about monthly support</SecondaryBtn>
          </div>
        </div>
        <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 2 }}>
          {incl.map((x) => (
            <li key={x.t} style={{ display: 'flex', gap: 14, padding: '14px 0', borderBottom: '1px solid var(--line)' }}>
              <span style={{
                width: 28, height: 28, borderRadius: 8,
                background: 'var(--accent-soft)', color: 'var(--accent-ink)',
                display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
                flexShrink: 0,
              }}>
                <Icon.check />
              </span>
              <div>
                <div style={{ fontSize: 15, fontWeight: 500 }}>{x.t}</div>
                <div style={{ fontSize: 13.5, color: 'var(--muted)' }}>{x.d}</div>
              </div>
            </li>
          ))}
        </ul>
      </div>
      <style>{`
        @media (max-width: 900px) {
          .month-grid { grid-template-columns: 1fr !important; }
        }
      `}</style>
    </section>
  );
}

/* ---------- WHO IT'S FOR ---------- */
function WhoFor() {
  const trades = [
    'Plumbers', 'Roofers', 'Electricians', 'Builders', 'Landscapers',
    'Painters & decorators', 'Plasterers', 'Driveway installers',
    'Tree surgeons', 'Cleaning companies', 'Removal companies', 'Security installers',
  ];
  const areas = [
    // Surrey + South-West London (our origin)
    'Surrey', 'South West London', 'Greater London',
    'Kingston', 'Surbiton', 'Epsom', 'Sutton', 'Worcester Park', 'New Malden',
    'Wimbledon', 'Croydon', 'Twickenham', 'Richmond',
    'Guildford', 'Woking', 'Weybridge', 'Cobham', 'Esher',
    // South East
    'Reading', 'Slough', 'Brighton', 'Crawley', 'Maidstone', 'Tunbridge Wells',
    'Oxford', 'Milton Keynes', 'Southampton', 'Portsmouth',
    // South West
    'Bristol', 'Bath', 'Exeter', 'Plymouth', 'Bournemouth',
    // Midlands
    'Birmingham', 'Coventry', 'Leicester', 'Nottingham', 'Derby',
    // North
    'Manchester', 'Liverpool', 'Leeds', 'Sheffield', 'Newcastle', 'York',
    // Scotland, Wales, NI
    'Edinburgh', 'Glasgow', 'Cardiff', 'Swansea', 'Belfast',
    // International — remote previews for English-speaking markets
    'Dublin', 'Cork', 'Galway',
    'New York', 'Boston', 'Chicago', 'Los Angeles', 'Miami',
    'Toronto', 'Vancouver', 'Montreal',
    'Sydney', 'Melbourne', 'Brisbane', 'Perth',
    'Auckland', 'Wellington',
  ];
  return (
    <section id="who" style={{ padding: '88px 28px', background: 'var(--paper-2)', borderTop: '1px solid var(--line)', borderBottom: '1px solid var(--line)' }}>
      <div style={{ maxWidth: 'var(--maxw)', margin: '0 auto' }}>
        <SectionHeader
          eyebrow="Who it’s for"
          title="Built for local service businesses with real customers and no proper website yet."
          intro="Best for businesses with real reviews, a public phone number, and an actual trade — not online-only services."
        />

        <div style={{
          marginTop: 36,
          display: 'grid',
          gridTemplateColumns: 'repeat(auto-fill, minmax(180px, 1fr))',
          gap: 10,
        }} className="reveal-stagger">
          {trades.map((t, i) => (
            <div
              key={t}
              className="lift"
              style={{
                background: 'white',
                border: '1px solid var(--line)',
                borderRadius: 12,
                padding: '14px 16px',
                fontSize: 15,
                fontWeight: 500,
                letterSpacing: '-0.005em',
                display: 'flex',
                alignItems: 'center',
                gap: 10,
              }}
            >
              <span
                className="wave-dot"
                style={{
                  width: 6,
                  height: 6,
                  borderRadius: 99,
                  background: 'var(--accent)',
                  display: 'inline-block',
                  '--wave-delay': (i * 160) + 'ms',
                }}
              />
              {t}
            </div>
          ))}
        </div>

        <div style={{
          marginTop: 36,
          background: 'white',
          border: '1px solid var(--line)',
          borderRadius: 18,
          overflow: 'hidden',
        }}>
          <div style={{
            padding: '20px 22px 14px',
            display: 'flex',
            alignItems: 'center',
            gap: 16,
            flexWrap: 'wrap',
            borderBottom: '1px solid var(--line)',
          }}>
            <Eyebrow>Areas served</Eyebrow>
            <span style={{ fontSize: 14, color: 'var(--muted)' }}>
              UK · Ireland · US · Canada · Australia · New Zealand
            </span>
          </div>
          <div className="marquee-wrap" style={{ padding: '14px 0' }}>
            <div className="marquee-track">
              {[...areas, ...areas].map((a, i) => (
                <span
                  key={i}
                  style={{
                    fontSize: 13,
                    padding: '6px 12px',
                    border: '1px solid var(--line)',
                    borderRadius: 99,
                    color: 'var(--ink-2)',
                    background: 'var(--paper)',
                    display: 'inline-flex',
                    alignItems: 'center',
                    gap: 6,
                    flexShrink: 0,
                  }}
                >
                  <Icon.pin />
                  {a}
                </span>
              ))}
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ---------- WHY ARES ---------- */
function WhyAres() {
  const reasons = [
    ['You see the preview before deciding', 'No risky upfront builds — look at it first.'],
    ['Clear fixed pricing', 'It’s £249 or £349. Not “starting from”, not a surprise.'],
    ['No confusing agency jargon', 'Plain English from start to finish.'],
    ['Built for local quote requests', 'Click-to-call and a simple contact form, not a brochure.'],
    ['Focused launch', 'A focused page or two beats five neglected ones.'],
    ['You own your domain', 'Always in your name, with your registrar.'],
    ['No unlimited-edit traps', 'One revision round, honestly described.'],
    ['Optional support, not forced', 'Take monthly support if you want it, or don’t.'],
  ];
  return (
    <section style={{ padding: '88px 28px' }}>
      <div style={{ maxWidth: 'var(--maxw)', margin: '0 auto' }}>
        <SectionHeader
          eyebrow="Why ARES Technology"
          title="A small, honest local-business website service. No agency theatre."
        />
        <div style={{
          marginTop: 40,
          display: 'grid',
          gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 260px), 1fr))',
          gap: 0,
          border: '1px solid var(--line)',
          borderRadius: 22,
          background: 'white',
          overflow: 'hidden',
        }}
        className="reveal-stagger"
        >
          {reasons.map(([t, d], i) => (
            <div
              key={t}
              style={{
                padding: '24px 22px',
                borderRight: '1px solid var(--line)',
                borderBottom: '1px solid var(--line)',
                display: 'flex',
                flexDirection: 'column',
                gap: 6,
                minHeight: 130,
                transition: 'background 220ms ease',
                cursor: 'default',
              }}
              onMouseEnter={(e) => { e.currentTarget.style.background = 'var(--paper)'; }}
              onMouseLeave={(e) => { e.currentTarget.style.background = 'transparent'; }}
            >
              <span className="mono" style={{
                fontSize: 12,
                color: 'var(--accent-ink)',
                letterSpacing: '0.02em',
                background: 'var(--accent-soft)',
                border: '1px solid var(--line)',
                borderRadius: 10,
                width: 44, height: 44,
                display: 'inline-flex',
                alignItems: 'center',
                justifyContent: 'center',
                fontWeight: 600,
                flexShrink: 0,
                alignSelf: 'flex-start',
              }}>
                {String(i + 1).padStart(2, '0')}
              </span>
              <div style={{ fontSize: 17, fontWeight: 500, letterSpacing: '-0.01em' }}>{t}</div>
              <div style={{ fontSize: 14, color: 'var(--muted)' }}>{d}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ---------- HUMAN TRUST ---------- */
function HumanTrust({ onCta }) {
  const trust = [
    { t: 'Private preview first', d: 'See it before you commit.' },
    { t: 'Transparent fixed pricing', d: 'No surprise quotes. £249 or £349.' },
    { t: 'You own your domain', d: 'Bought in your name, kept in your name.' },
    { t: 'Real email contact', d: 'arestechnology.io@proton.me' },
  ];
  return (
    <section style={{ padding: '88px 28px' }}>
      <div style={{ maxWidth: 'var(--maxw)', margin: '0 auto' }}>
        <article style={{
          background: 'var(--paper-2)',
          border: '1px solid var(--line)',
          borderRadius: 24,
          padding: 'clamp(28px, 4vw, 44px)',
          display: 'grid',
          gridTemplateColumns: '1.1fr 0.9fr',
          gap: 36,
          alignItems: 'flex-start',
          boxShadow: 'var(--shadow-card)',
        }}
        className="human-trust-grid">
          <div className="reveal-stagger" style={{ display: 'flex', flexDirection: 'column', gap: 18 }}>
            <Eyebrow accent>Real operator · clear process</Eyebrow>
            <h2 style={{
              fontSize: 'clamp(26px, 3.2vw, 38px)',
              lineHeight: 1.08,
              letterSpacing: '-0.025em',
              fontWeight: 600,
              maxWidth: 520,
            }}>
              Built by a real person, not a faceless agency.
            </h2>
            <p style={{ fontSize: 16, color: 'var(--ink-2)', lineHeight: 1.55, maxWidth: 540 }}>
              ARES Technology is a lean website-preview service built for local
              businesses that need a proper online presence without the usual
              agency pressure. The process is simple: we create a private preview,
              show you what your first website could look like, and only move
              forward if you approve it.
            </p>
            <p style={{ fontSize: 15, color: 'var(--muted)', lineHeight: 1.55, maxWidth: 540 }}>
              We keep pricing clear, domains separate, and expectations honest.
              No fake testimonials, no guaranteed ranking claims, and no
              pressure to commit before you have seen the preview.
            </p>
            <p style={{
              fontSize: 13.5,
              color: 'var(--muted)',
              display: 'inline-flex',
              alignItems: 'center',
              gap: 8,
              maxWidth: 540,
            }}>
              <span style={{ color: 'var(--accent)', display: 'inline-flex' }}>
                <Icon.pin />
              </span>
              Based in Surrey &amp; South West London — supporting UK and international small businesses.
            </p>
            <div style={{ marginTop: 6 }}>
              <AccentBtn onClick={onCta}>Request a private preview</AccentBtn>
            </div>
          </div>

          <ul className="reveal-stagger" style={{
            listStyle: 'none',
            padding: 0,
            margin: 0,
            display: 'flex',
            flexDirection: 'column',
            gap: 12,
          }}>
            {trust.map((it, i) => (
              <li key={it.t}
                  className="lift"
                  style={{
                    background: 'var(--paper)',
                    border: '1px solid var(--line)',
                    borderRadius: 14,
                    padding: '14px 16px',
                    display: 'flex',
                    gap: 14,
                    alignItems: 'flex-start',
                  }}>
                <span style={{
                  width: 28, height: 28, borderRadius: 8,
                  background: 'var(--accent-soft)', color: 'var(--accent-ink)',
                  display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
                  flexShrink: 0,
                }}>
                  <Icon.check />
                </span>
                <div style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
                  <span style={{ fontSize: 15, fontWeight: 600, color: 'var(--ink)', letterSpacing: '-0.005em' }}>
                    {it.t}
                  </span>
                  {it.t === 'Real email contact' ? (
                    <a
                      href="mailto:arestechnology.io@proton.me"
                      className="mono"
                      style={{ fontSize: 13, color: 'var(--cta)', borderBottom: '1px solid currentColor', alignSelf: 'flex-start' }}
                    >
                      {it.d}
                    </a>
                  ) : (
                    <span style={{ fontSize: 13.5, color: 'var(--muted)' }}>{it.d}</span>
                  )}
                </div>
              </li>
            ))}
          </ul>
        </article>
      </div>
      <style>{`
        @media (max-width: 900px) {
          .human-trust-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
        }
      `}</style>
    </section>
  );
}

/* ---------- EXAMPLE PREVIEW ---------- */
function ExamplePreview() {
  const sections = [
    { id: 'hero', label: 'Hero area', d: 'Business name, headline, and a clear call to action.' },
    { id: 'services', label: 'Services section', d: 'The two to five things you actually do, in plain English.' },
    { id: 'reviews', label: 'Reviews / reputation', d: 'Space for star rating or a link to your Google profile.' },
    { id: 'gallery', label: 'Gallery', d: 'A handful of real photos of your work or team.' },
    { id: 'areas', label: 'Areas served', d: 'The towns and postcodes you cover.' },
    { id: 'contact', label: 'Contact form', d: 'Name, phone, postcode, message — that’s it.' },
    { id: 'call', label: 'Click-to-call', d: 'One tap and the phone dials. Always visible on mobile.' },
  ];
  const [active, setActive] = React.useState('hero');
  const [userActed, setUserActed] = React.useState(false);

  // Idle auto-cycle through sections so the preview feels alive when no one's
  // interacting. Stops the moment a user hovers or clicks anything.
  React.useEffect(() => {
    if (userActed) return;
    const t = setInterval(() => {
      setActive((curr) => {
        const ids = sections.map((s) => s.id);
        const i = ids.indexOf(curr);
        return ids[(i + 1) % ids.length];
      });
    }, 2200);
    return () => clearInterval(t);
  }, [userActed]);

  const touch = () => { if (!userActed) setUserActed(true); };
  const setActiveAndTouch = (id) => { touch(); setActive(id); };

  return (
    <section style={{ padding: '88px 28px', background: 'var(--paper-2)', borderTop: '1px solid var(--line)', borderBottom: '1px solid var(--line)' }}>
      <div style={{ maxWidth: 'var(--maxw)', margin: '0 auto' }}>
        <SectionHeader
          eyebrow="Example preview"
          title="What your preview could include."
          intro="A placeholder mockup of the kind of one-page layout we build. Hover the sections to see what each one is for."
        />

        <div style={{ marginTop: 40, display: 'grid', gridTemplateColumns: '1fr 0.85fr', gap: 32 }} className="ex-grid">
          {/* Mock site */}
          <div style={{
            background: 'white',
            border: '1px solid var(--line)',
            borderRadius: 18,
            boxShadow: 'var(--shadow-card)',
            overflow: 'hidden',
          }}>
            <div style={{
              padding: '10px 14px',
              borderBottom: '1px solid var(--line)',
              display: 'flex', gap: 8, alignItems: 'center',
              background: '#FFFFFF',
            }}>
              <span style={{ display: 'flex', gap: 6 }}>
                <i style={{ width: 9, height: 9, borderRadius: 99, background: '#FF6E5E' }} />
                <i style={{ width: 9, height: 9, borderRadius: 99, background: '#F0C24A' }} />
                <i style={{ width: 9, height: 9, borderRadius: 99, background: '#7BC68E' }} />
              </span>
              <span className="mono" style={{ fontSize: 11, color: 'var(--muted)', marginLeft: 8 }}>
                preview.ares.tech/your-business
              </span>
            </div>
            <ExampleMockSite active={active} setActive={setActiveAndTouch} />
          </div>

          {/* Legend */}
          <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
            {sections.map((s) => {
              const isActive = active === s.id;
              return (
                <button
                  key={s.id}
                  onMouseEnter={() => setActiveAndTouch(s.id)}
                  onFocus={() => setActiveAndTouch(s.id)}
                  onClick={() => setActiveAndTouch(s.id)}
                  style={{
                    textAlign: 'left',
                    padding: '14px 16px',
                    background: isActive ? 'white' : 'transparent',
                    border: '1px solid ' + (isActive ? 'var(--line-strong)' : 'transparent'),
                    borderRadius: 12,
                    cursor: 'pointer',
                    display: 'flex',
                    gap: 12,
                    alignItems: 'flex-start',
                    transition: 'background 120ms ease, border-color 120ms ease',
                  }}
                >
                  <span style={{
                    width: 8, height: 8, borderRadius: 99,
                    background: isActive ? 'var(--accent)' : 'var(--line-strong)',
                    marginTop: 7, flexShrink: 0,
                  }} />
                  <span>
                    <span style={{ fontSize: 15, fontWeight: 500, display: 'block' }}>{s.label}</span>
                    <span style={{ fontSize: 13.5, color: 'var(--muted)' }}>{s.d}</span>
                  </span>
                </button>
              );
            })}
            <div style={{ fontSize: 12, color: 'var(--muted)', padding: '10px 16px 0' }} className="mono">
              Placeholder mockup. No real client names shown.
            </div>
          </div>
        </div>
      </div>
      <style>{`
        @media (max-width: 940px) {
          .ex-grid { grid-template-columns: 1fr !important; }
        }
      `}</style>
    </section>
  );
}

function ExampleMockSite({ active, setActive }) {
  const highlight = (id) => ({
    outline: active === id ? '2px solid var(--accent)' : '2px solid transparent',
    outlineOffset: 2,
    borderRadius: 10,
    transition: 'outline-color 140ms ease',
    cursor: 'pointer',
  });
  const hov = (id) => ({
    onMouseEnter: () => setActive(id),
    onFocus: () => setActive(id),
    tabIndex: 0,
  });
  return (
    <div style={{ padding: 22, display: 'flex', flexDirection: 'column', gap: 14 }}>
      {/* Hero */}
      <div {...hov('hero')} style={{ ...highlight('hero'), padding: 4, display: 'flex', flexDirection: 'column', gap: 8 }}>
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
          <span style={{ fontSize: 16, fontWeight: 500 }}>[ Your Business ] Co.</span>
          <span className="mono" style={{ fontSize: 10, color: 'var(--muted)' }}>menu · contact · call</span>
        </div>
        <StripedPlaceholder label="hero photo" ratio="16 / 7" radius={8} />
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
          <span style={{ fontSize: 18, letterSpacing: '-0.015em' }}>Trusted local trade in your area.</span>
          <span style={{ fontSize: 11, padding: '4px 8px', borderRadius: 6, background: 'var(--ink)', color: 'white' }} className="mono">CTA</span>
        </div>
      </div>

      {/* Services */}
      <div {...hov('services')} style={{ ...highlight('services'), padding: 4 }}>
        <span className="mono" style={{ fontSize: 10, color: 'var(--muted)', letterSpacing: '0.08em', textTransform: 'uppercase' }}>Services</span>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 6, marginTop: 6 }}>
          {['Service 1', 'Service 2', 'Service 3'].map((s) => (
            <div key={s} style={{ padding: '10px 12px', border: '1px solid var(--line)', borderRadius: 8, fontSize: 12, color: 'var(--ink-2)' }}>
              {s}
            </div>
          ))}
        </div>
      </div>

      {/* Reviews */}
      <div {...hov('reviews')} style={{ ...highlight('reviews'), padding: 4 }}>
        <span className="mono" style={{ fontSize: 10, color: 'var(--muted)', letterSpacing: '0.08em', textTransform: 'uppercase' }}>Reputation</span>
        <div style={{ marginTop: 6, padding: '10px 12px', border: '1px solid var(--line)', borderRadius: 8, fontSize: 12, color: 'var(--muted)', display: 'flex', justifyContent: 'space-between' }}>
          <span>Link to your Google reviews — no fake testimonials.</span>
          <span className="mono">★ ★ ★ ★ ★</span>
        </div>
      </div>

      {/* Gallery */}
      <div {...hov('gallery')} style={{ ...highlight('gallery'), padding: 4 }}>
        <span className="mono" style={{ fontSize: 10, color: 'var(--muted)', letterSpacing: '0.08em', textTransform: 'uppercase' }}>Gallery</span>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr 1fr', gap: 6, marginTop: 6 }}>
          <StripedPlaceholder label="photo" ratio="1 / 1" radius={6} />
          <StripedPlaceholder label="photo" ratio="1 / 1" radius={6} />
          <StripedPlaceholder label="photo" ratio="1 / 1" radius={6} />
          <StripedPlaceholder label="photo" ratio="1 / 1" radius={6} />
        </div>
      </div>

      {/* Areas */}
      <div {...hov('areas')} style={{ ...highlight('areas'), padding: 4 }}>
        <span className="mono" style={{ fontSize: 10, color: 'var(--muted)', letterSpacing: '0.08em', textTransform: 'uppercase' }}>Areas served</span>
        <div style={{ marginTop: 6, display: 'flex', flexWrap: 'wrap', gap: 4 }}>
          {['Kingston', 'Surbiton', 'Epsom', 'Sutton', 'Wimbledon', 'Twickenham'].map((a) => (
            <span key={a} style={{ fontSize: 11, padding: '3px 8px', border: '1px solid var(--line)', borderRadius: 99, color: 'var(--ink-2)' }}>{a}</span>
          ))}
        </div>
      </div>

      {/* Contact */}
      <div {...hov('contact')} style={{ ...highlight('contact'), padding: 4 }}>
        <span className="mono" style={{ fontSize: 10, color: 'var(--muted)', letterSpacing: '0.08em', textTransform: 'uppercase' }}>Contact form</span>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 6, marginTop: 6 }}>
          <div style={{ height: 28, border: '1px solid var(--line)', borderRadius: 6 }} />
          <div style={{ height: 28, border: '1px solid var(--line)', borderRadius: 6 }} />
          <div style={{ height: 28, border: '1px solid var(--line)', borderRadius: 6, gridColumn: '1 / 3' }} />
          <div style={{ height: 56, border: '1px solid var(--line)', borderRadius: 6, gridColumn: '1 / 3' }} />
        </div>
      </div>

      {/* Click to call */}
      <div {...hov('call')} style={{ ...highlight('call'), padding: 4 }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '10px 12px', background: 'var(--ink)', color: 'white', borderRadius: 8, fontSize: 13 }}>
          <Icon.phone />
          Click to call
          <span style={{ marginLeft: 'auto' }} className="mono">0203 ··· ····</span>
        </div>
      </div>
    </div>
  );
}

/* ---------- SAMPLE LAYOUTS ---------- */
function SampleLayouts({ onCta }) {
  const samples = [
    {
      id: 'plumber',
      title: 'Sample: Local plumber, Kingston',
      category: 'Plumber',
      copy: 'A clean one-page layout for emergency plumbing, bathroom repairs, boiler support, and local call-outs.',
      tone: { hue: 28 }, // warm amber-leaning
      hero: 'Emergency plumbing, day or night.',
      services: ['Boilers', 'Bathrooms', 'Leaks', 'Call-outs'],
      elements: ['Hero preview', 'Services', 'Reviews placeholder', 'Click-to-call', 'Quote form'],
      ctaLabel: 'Call now',
      accentBlock: 'callout',
    },
    {
      id: 'roofer',
      title: 'Sample: Roofer, Epsom',
      category: 'Roofer',
      copy: 'A trust-focused layout for roof repairs, flat roofing, guttering, leak detection, and emergency call-outs.',
      tone: { hue: 50 }, // warm gold
      hero: 'Roof repairs done right, first time.',
      services: ['Repairs', 'Flat roofing', 'Guttering', 'Leak detection'],
      elements: ['Strong headline', 'Service cards', 'Gallery placeholder', 'Areas served', 'Call button'],
      ctaLabel: 'Book a survey',
      accentBlock: 'gallery',
    },
    {
      id: 'cleaning',
      title: 'Sample: Cleaning company, Surbiton',
      category: 'Cleaning company',
      copy: 'A bright, professional layout for domestic cleaning, end-of-tenancy cleans, deep cleaning, and commercial cleaning.',
      tone: { hue: 145 }, // fresh green
      hero: 'Sparkling homes & offices, on schedule.',
      services: ['Domestic', 'End-of-tenancy', 'Deep clean', 'Commercial'],
      elements: ['Clean hero', 'Service checklist', 'Trust badges', 'Contact form', 'Areas covered'],
      ctaLabel: 'Get a quote',
      accentBlock: 'checklist',
    },
    {
      id: 'painter',
      title: 'Sample: Painter & decorator, Sutton',
      category: 'Painter & decorator',
      copy: 'A premium visual layout for interior painting, exterior painting, wallpapering, rentals, and full home redecorating.',
      tone: { hue: 8 }, // muted clay
      hero: 'Brushwork that finishes a room properly.',
      services: ['Interior', 'Exterior', 'Wallpaper', 'Rentals'],
      elements: ['Elegant hero', 'Before / after', 'Services', 'Reputation', 'Free quote CTA'],
      ctaLabel: 'Free quote',
      accentBlock: 'beforeafter',
    },
    {
      id: 'removal',
      title: 'Sample: Removal company, Wimbledon',
      category: 'Removal company',
      copy: 'A practical lead-generation layout for man-and-van services, house moves, flat moves, student moves, and local removals.',
      tone: { hue: 70 }, // amber
      hero: 'Local moves. Fair price. Same week.',
      services: ['Man & van', 'House moves', 'Flat moves', 'Student moves'],
      elements: ['Fast quote CTA', 'WhatsApp / call', 'Service cards', 'Van gallery', 'Local areas'],
      ctaLabel: 'WhatsApp',
      accentBlock: 'fastquote',
    },
    {
      id: 'electrician',
      title: 'Sample: Electrician, Croydon',
      category: 'Electrician',
      copy: 'A trust-focused layout for emergency call-outs, rewires, fuse-box work, lighting, and EV charger installs.',
      tone: { hue: 50 },
      hero: 'Power back on, same day.',
      services: ['Rewires', 'Fuse box', 'Lighting', 'EV chargers'],
      elements: ['Emergency call-out', 'Service grid', 'NICEIC trust strip', 'Click-to-call', 'Quote form'],
      ctaLabel: 'Call electrician',
      accentBlock: 'callout',
    },
    {
      id: 'landscaper',
      title: 'Sample: Landscaper, Guildford',
      category: 'Landscaper',
      copy: 'A natural, editorial layout for garden design, lawn care, hedges, patios, and ongoing seasonal maintenance.',
      tone: { hue: 145 },
      hero: 'Gardens that grow with you.',
      services: ['Lawns', 'Hedges', 'Patios', 'Planting'],
      elements: ['Editorial hero', 'Service tiles', 'Seasonal pricing', 'Free quote CTA', 'Areas served'],
      ctaLabel: 'Get a quote',
      accentBlock: 'gallery',
    },
    {
      id: 'builder',
      title: 'Sample: Builder, Woking',
      category: 'Builder',
      copy: 'A confident layout for extensions, loft conversions, renovations, and ground-up builds with a project gallery and visit-booking CTA.',
      tone: { hue: 55 },
      hero: 'Built right. Built on time.',
      services: ['Extensions', 'Loft', 'Renovations', 'New builds'],
      elements: ['Blueprint hero', 'Project gallery', 'Service grid', 'Hi-vis CTA', 'Site-visit booking'],
      ctaLabel: 'Book site visit',
      accentBlock: 'gallery',
    },
    {
      id: 'treesurgeon',
      title: 'Sample: Tree surgeon, Richmond',
      category: 'Tree surgeon',
      copy: 'A natural, NPTC-credibility layout for crown reductions, fellings, stump removal, and emergency tree work.',
      tone: { hue: 140 },
      hero: 'Crown reductions. Stump removals. Safely.',
      services: ['Felling', 'Crown reduce', 'Stump remove', 'Hedge work'],
      elements: ['NPTC trust strip', 'Service tiles', 'Free quote CTA', 'Emergency line', 'Areas served'],
      ctaLabel: 'Free quote',
      accentBlock: 'callout',
    },
  ];

  return (
    <section id="samples" style={{ padding: '88px 28px' }}>
      <div style={{ maxWidth: 'var(--maxw)', margin: '0 auto' }}>
        <SectionHeader
          eyebrow="Sample layouts"
          title="Example Preview Layouts"
          intro="Below are fictional sample layouts showing the kind of private one-page website previews we can create for local service businesses. Real business previews stay private unless the business gives permission."
        />

        <p
          className="mono"
          style={{
            marginTop: 20,
            fontSize: 12,
            color: 'var(--muted)',
            background: 'var(--paper-2)',
            border: '1px solid var(--line)',
            borderRadius: 10,
            padding: '10px 14px',
            display: 'inline-block',
            maxWidth: 720,
          }}
        >
          These are sample preview layouts, not official client websites.
          We do not publish private business previews publicly unless the
          business gives permission.
        </p>

        <div
          style={{
            marginTop: 32,
            display: 'grid',
            gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 300px), 1fr))',
            gap: 16,
          }}
          className="reveal-stagger"
        >
          {samples.map((s) => (
            <SampleCard key={s.id} sample={s} />
          ))}
        </div>

        <div
          style={{
            marginTop: 28,
            display: 'flex',
            flexWrap: 'wrap',
            gap: 16,
            alignItems: 'center',
            justifyContent: 'space-between',
          }}
        >
          <p style={{ fontSize: 13.5, color: 'var(--muted)', maxWidth: 560 }}>
            Private previews are created for review only. They are not
            official business websites unless approved by the business owner.
          </p>
          <AccentBtn onClick={onCta}>Request a Free Preview</AccentBtn>
        </div>
      </div>
    </section>
  );
}

/* SampleCard + industry mocks live in sample-mocks.jsx */

/* ---------- TRUST STRIP ---------- */
function TrustStrip() {
  const items = [
    'Free preview, no signup',
    'You own your domain',
    'Fast launch after approval',
    'Cancel monthly support anytime',
  ];
  return (
    <section aria-label="What you can expect — and what we don’t promise" style={{ padding: '0 28px 88px' }}>
      <div
        style={{
          maxWidth: 'var(--maxw)',
          margin: '0 auto',
          background: 'var(--paper-2)',
          border: '1px solid var(--line)',
          borderRadius: 18,
          padding: '20px 22px',
          display: 'flex',
          flexWrap: 'wrap',
          alignItems: 'center',
          gap: '10px 18px',
        }}
      >
        <span
          className="mono"
          style={{
            fontSize: 11,
            letterSpacing: '0.1em',
            textTransform: 'uppercase',
            color: 'var(--accent-ink)',
            display: 'inline-flex',
            alignItems: 'center',
            gap: 8,
            paddingRight: 14,
            borderRight: '1px solid var(--line-strong)',
          }}
        >
          <span className="pulse-dot" style={{ width: 8, height: 8, borderRadius: 99, background: 'var(--accent)', display: 'inline-block' }} />
          Honest expectations
        </span>
        {items.map((t, i) => (
          <span
            key={t}
            style={{
              display: 'inline-flex',
              alignItems: 'center',
              gap: 8,
              fontSize: 13.5,
              color: 'var(--ink-2)',
              padding: '4px 0',
            }}
          >
            <span
              className="tick-pop"
              style={{
                color: 'var(--accent-ink)',
                display: 'inline-flex',
                '--tick-delay': (i * 90) + 'ms',
              }}
            >
              <Icon.check />
            </span>
            {t}
          </span>
        ))}
      </div>
    </section>
  );
}

/* ---------- FAQ ---------- */
function FAQ() {
  const items = [
    { q: 'Is the preview my official website?', a: 'No. The preview is a private mockup. It only becomes your official website if you approve it and ask us to get it live.' },
    { q: 'How much does it cost?', a: 'First websites start from £249. Professional 1–2 page websites are £349. Optional updates and support start from £79/month.' },
    { q: 'What is the difference between the £249 and £349 option?', a: 'The £249 option is a simple one-page entry website for businesses that need a basic online presence quickly. The £349 professional package covers 1 or 2 pages and includes a stronger layout with services, gallery or placeholder gallery, contact/quote form, Google Maps embed if available, basic local SEO title and description, one revision round, and launch support.' },
    { q: 'Is the domain included?', a: 'No. You pay for and own your domain separately. We can help you choose and connect it.' },
    { q: 'Do I get unlimited edits?', a: 'No. The £349 professional 1–2 page package includes one revision round. Extra changes can be quoted separately or handled through monthly support.' },
    { q: 'Is SEO included?', a: 'Basic local SEO title and description are included in the £349 professional 1–2 page package. A full SEO campaign is not included.' },
    { q: 'Can you build more than one page?', a: 'Yes. The £249 entry is one page. The £349 professional package covers 1 or 2 pages. Beyond that, extra pages can be added at fixed rates.' },
    { q: 'Do I have to pay monthly?', a: 'No. Monthly updates and support are optional from £79/month.' },
    { q: 'How fast can it go live?', a: 'Usually quickly once we have your business details, photos, preferred domain, and approval.' },
  ];
  const [open, setOpen] = React.useState(0);
  return (
    <section id="faq" style={{ padding: '88px 28px' }}>
      <div style={{ maxWidth: 'var(--maxw)', margin: '0 auto', display: 'grid', gridTemplateColumns: '0.85fr 1.15fr', gap: 48 }} className="faq-grid">
        <div>
          <SectionHeader
            eyebrow="FAQ"
            title="Plain answers to the questions we hear most."
          />
          <p style={{ marginTop: 18, fontSize: 14, color: 'var(--muted)' }}>
            Can’t find what you’re looking for? <a href="#contact" style={{ color: 'var(--accent-ink)', borderBottom: '1px solid currentColor', paddingBottom: 1 }}>Send us a message</a>.
          </p>
        </div>
        <div style={{ display: 'flex', flexDirection: 'column', gap: 0, borderTop: '1px solid var(--line)' }}>
          {items.map((it, i) => {
            const isOpen = open === i;
            return (
              <div key={it.q} style={{ borderBottom: '1px solid var(--line)' }}>
                <button
                  onClick={() => setOpen(isOpen ? -1 : i)}
                  style={{
                    width: '100%',
                    textAlign: 'left',
                    padding: '18px 4px',
                    background: 'transparent',
                    border: 'none',
                    display: 'flex',
                    alignItems: 'center',
                    justifyContent: 'space-between',
                    gap: 16,
                    cursor: 'pointer',
                    fontSize: 17,
                    color: 'var(--ink)',
                    letterSpacing: '-0.01em',
                  }}
                >
                  {it.q}
                  <span style={{
                    width: 26, height: 26, borderRadius: 8, border: '1px solid var(--line)',
                    display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
                    color: 'var(--ink-2)', flexShrink: 0,
                    background: isOpen ? 'var(--ink)' : 'white',
                    transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)',
                    transition: 'background 140ms ease, transform 280ms cubic-bezier(0.2,0.8,0.2,1)',
                  }}>
                    <span style={{ color: isOpen ? 'white' : 'var(--ink-2)' }}>
                      {isOpen ? <Icon.minus /> : <Icon.plus />}
                    </span>
                  </span>
                </button>
                <div style={{
                  maxHeight: isOpen ? 200 : 0,
                  overflow: 'hidden',
                  transition: 'max-height 240ms ease',
                }}>
                  <p style={{ padding: '0 4px 20px', fontSize: 15.5, color: 'var(--ink-2)', maxWidth: 640 }}>
                    {it.a}
                  </p>
                </div>
              </div>
            );
          })}
        </div>
      </div>
      <style>{`
        @media (max-width: 900px) {
          .faq-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
        }
      `}</style>
    </section>
  );
}

/* ---------- CONTACT ---------- */
function Contact() {
  const [form, setForm] = React.useState({
    name: '', business: '', phone: '', email: '', location: '', link: '', message: '', interest: '',
    companyWebsiteExtra: '',
  });
  const [consent, setConsent] = React.useState(false);
  const [view, setView] = React.useState('form'); // 'form' | 'success' | 'error'
  const [loading, setLoading] = React.useState(false);
  const [errors, setErrors] = React.useState({});

  const set = (k) => (e) => setForm((f) => ({ ...f, [k]: e.target.value }));

  const resetForm = () => {
    setForm({ name:'',business:'',phone:'',email:'',location:'',link:'',message:'',interest:'',companyWebsiteExtra:'' });
    setConsent(false);
    setErrors({});
    setView('form');
  };

  const onSubmit = async (e) => {
    e.preventDefault();
    if (loading) return;

    const errs = {};
    if (!form.name.trim()) errs.name = 'Your name helps us address you properly.';
    if (!form.business.trim()) errs.business = 'What’s the business called?';
    if (!form.email.trim()) errs.email = 'Add an email so we can send the preview.';
    else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.email.trim())) errs.email = 'That email doesn’t look right.';
    if (!consent) errs.consent = 'Please tick the box so we know we can contact you.';
    setErrors(errs);
    if (Object.keys(errs).length > 0) return;

    const payload = {
      leadName: form.name.trim(),
      businessName: form.business.trim(),
      phone: form.phone.trim(),
      email: form.email.trim(),
      location: form.location.trim(),
      currentWebsiteOrSocial: form.link.trim(),
      message: form.message.trim(),
      interestType: form.interest,
      consent: true,
      submittedAt: new Date().toISOString(),
      pageUrl: typeof window !== 'undefined' ? window.location.href : '',
      userAgent: typeof navigator !== 'undefined' ? navigator.userAgent : '',
      companyWebsiteExtra: form.companyWebsiteExtra,
    };

    setLoading(true);
    try {
      const res = await fetch('/api/contact', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' },
        body: JSON.stringify(payload),
      });
      let data = null;
      try { data = await res.json(); } catch (_) { data = null; }
      if (res.ok && data && data.ok === true) {
        setView('success');
      } else {
        setView('error');
      }
    } catch (_) {
      setView('error');
    } finally {
      setLoading(false);
    }
  };

  return (
    <section id="contact" style={{ padding: '88px 28px', background: 'var(--ink)', color: 'white' }}>
      <div style={{ maxWidth: 'var(--maxw)', margin: '0 auto', display: 'grid', gridTemplateColumns: '0.9fr 1.1fr', gap: 48 }} className="contact-grid">
        <div style={{ display: 'flex', flexDirection: 'column', gap: 18 }}>
          <Eyebrow style={{ color: '#A8B0C0' }}>Request a preview</Eyebrow>
          <h2 style={{ fontSize: 'clamp(30px, 4vw, 50px)', letterSpacing: '-0.03em', lineHeight: 1.05, fontWeight: 500 }}>
            Want to see your first<br />website preview?
          </h2>
          <p style={{ fontSize: 16.5, color: '#DDE3EE', maxWidth: 480 }}>
            Tell us about your business. We’ll put together a private one-page preview
            and send you the link — no obligation, no payment until you approve it.
          </p>
          <ul style={{ listStyle: 'none', padding: 0, margin: '8px 0 0', display: 'flex', flexDirection: 'column', gap: 8 }}>
            {[
              ['Private link', 'Only you see it.'],
              ['No upfront payment', 'You only pay if you approve and go live.'],
              ['Local response', 'Replies usually within one working day.'],
            ].map(([t, d]) => (
              <li key={t} style={{ display: 'flex', gap: 12, alignItems: 'flex-start' }}>
                <span style={{
                  width: 24, height: 24, borderRadius: 6,
                  background: '#232A3A', color: 'var(--accent)',
                  display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
                  flexShrink: 0,
                }}>
                  <Icon.check />
                </span>
                <span style={{ fontSize: 14.5 }}>
                  <strong style={{ fontWeight: 500 }}>{t}.</strong> <span style={{ color: '#C3CAD8' }}>{d}</span>
                </span>
              </li>
            ))}
          </ul>
        </div>

        {/* Form card */}
        <div style={{
          background: 'white',
          color: 'var(--ink)',
          borderRadius: 20,
          padding: 28,
          boxShadow: 'var(--shadow-pop)',
          position: 'relative',
        }}>
          {view === 'success' ? (
            <SubmittedState onReset={resetForm} />
          ) : view === 'error' ? (
            <ErrorState onReset={() => setView('form')} />
          ) : (
            <form
              onSubmit={onSubmit}
              name="ares-preview-request"
              method="POST"
              action="/api/contact"
              style={{ display: 'flex', flexDirection: 'column', gap: 14 }}
            >
              {/* Honeypot — real users never see or fill this. If filled, the
                  server silently treats the submission as spam. */}
              <div
                aria-hidden="true"
                style={{ position: 'absolute', left: '-10000px', top: 'auto', width: 1, height: 1, overflow: 'hidden' }}
              >
                <label>
                  Company website (leave blank)
                  <input
                    type="text"
                    name="companyWebsiteExtra"
                    tabIndex={-1}
                    autoComplete="off"
                    value={form.companyWebsiteExtra}
                    onChange={set('companyWebsiteExtra')}
                  />
                </label>
              </div>
              <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12 }} className="form-row">
                <Field label="Your name" name="name" autoComplete="name" required value={form.name} onChange={set('name')} error={errors.name} />
                <Field label="Business name" name="business" autoComplete="organization" required value={form.business} onChange={set('business')} error={errors.business} />
              </div>
              <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12 }} className="form-row">
                <Field label="Phone" name="phone" type="tel" autoComplete="tel" placeholder="0203 ..." value={form.phone} onChange={set('phone')} error={errors.phone} />
                <Field label="Email" name="email" type="email" autoComplete="email" required placeholder="you@yourbusiness.co.uk" value={form.email} onChange={set('email')} error={errors.email} />
              </div>
              <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12 }} className="form-row">
                <Field label="Business location" name="location" placeholder="Kingston, Surbiton, …" value={form.location} onChange={set('location')} />
                <Field label="Current website / social link" name="link" placeholder="Optional" value={form.link} onChange={set('link')} />
              </div>
              <Field label="Anything we should know?" name="message" multiline placeholder="Type of work, services, the area you cover…" value={form.message} onChange={set('message')} />

              <fieldset style={{
                border: '1px solid var(--line)',
                borderRadius: 10,
                padding: '12px 14px',
                margin: 0,
                display: 'flex',
                flexDirection: 'column',
                gap: 10,
                background: 'var(--paper)',
              }}>
                <legend className="mono" style={{
                  fontSize: 11,
                  color: 'var(--muted)',
                  letterSpacing: '0.06em',
                  textTransform: 'uppercase',
                  padding: '0 6px',
                }}>
                  What are you interested in?
                </legend>
                {[
                  { value: 'first_website_249',         label: 'First website from £249' },
                  { value: 'professional_one_page_349', label: 'Professional, one page — £349' },
                  { value: 'one_to_two_page',           label: '1–2 page site — £349' },
                  { value: 'one_to_three_page',         label: 'Up to 3 pages (£349 + 1 extra page from £99)' },
                  { value: 'support_79',                label: 'Updates / support from £79/month' },
                  { value: 'not_sure',                  label: 'Not sure yet' },
                ].map((opt) => {
                  const checked = form.interest === opt.value;
                  return (
                    <label key={opt.value} style={{
                      display: 'flex',
                      alignItems: 'center',
                      gap: 10,
                      cursor: 'pointer',
                      fontSize: 14,
                      color: 'var(--ink-2)',
                    }}>
                      <input
                        type="radio"
                        name="interest"
                        value={opt.value}
                        checked={checked}
                        onChange={set('interest')}
                        style={{ accentColor: 'var(--accent)', width: 16, height: 16 }}
                      />
                      <span style={{ color: checked ? 'var(--ink)' : 'var(--ink-2)' }}>{opt.label}</span>
                    </label>
                  );
                })}
              </fieldset>

              <label
                style={{
                  display: 'flex',
                  gap: 10,
                  alignItems: 'flex-start',
                  padding: '12px 14px',
                  border: '1px solid ' + (errors.consent ? '#C2342C' : 'var(--line)'),
                  borderRadius: 10,
                  background: 'var(--paper)',
                  cursor: 'pointer',
                  marginTop: 4,
                }}
              >
                <input
                  type="checkbox"
                  checked={consent}
                  onChange={(e) => setConsent(e.target.checked)}
                  style={{ marginTop: 3, width: 16, height: 16, accentColor: 'var(--accent)' }}
                />
                <span style={{ fontSize: 13.5, color: 'var(--ink-2)', lineHeight: 1.45 }}>
                  By submitting, you agree that ARES Technology can contact you
                  about your website preview. We will not sell your details.
                </span>
              </label>
              {errors.consent && (
                <span style={{ fontSize: 12, color: '#8F2A22', marginTop: -6 }}>
                  {errors.consent}
                </span>
              )}

              <div style={{
                display: 'flex', gap: 14, alignItems: 'center', flexWrap: 'wrap',
                marginTop: 6,
              }}>
                <AccentBtn
                  type="submit"
                  disabled={loading}
                  aria-busy={loading}
                  style={{
                    padding: '14px 20px',
                    opacity: loading ? 0.75 : 1,
                    cursor: loading ? 'wait' : 'pointer',
                  }}
                >
                  {loading ? 'Sending…' : 'Request My Preview'}
                </AccentBtn>
                <span className="mono" style={{ fontSize: 12, color: 'var(--muted)' }}>
                  Prefer email? Contact us at{' '}
                  <a
                    href="mailto:arestechnology.io@proton.me"
                    style={{ color: 'var(--cta)', borderBottom: '1px solid currentColor' }}
                  >
                    arestechnology.io@proton.me
                  </a>
                </span>
              </div>
            </form>
          )}
        </div>
      </div>
      <style>{`
        @media (max-width: 900px) {
          .contact-grid { grid-template-columns: 1fr !important; }
          .form-row { grid-template-columns: 1fr !important; }
        }
      `}</style>
    </section>
  );
}

function Field({ label, value, onChange, type = 'text', multiline = false, required = false, placeholder = '', error, name, autoComplete }) {
  const [focus, setFocus] = React.useState(false);
  const ringColor = error ? '#C2342C' : (focus ? 'var(--accent)' : 'var(--line-strong)');
  const commonStyle = {
    width: '100%',
    padding: multiline ? '14px 14px' : '12px 14px',
    border: '1px solid ' + ringColor,
    borderRadius: 10,
    fontSize: 15,
    background: 'white',
    color: 'var(--ink)',
    outline: 'none',
    transition: 'border-color 140ms ease, box-shadow 140ms ease',
    boxShadow: focus && !error ? '0 0 0 4px rgba(46,107,255,0.18)' : 'none',
    fontFamily: 'inherit',
  };
  return (
    <label style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
      <span className="mono" style={{ fontSize: 11, color: error ? '#8F2A22' : 'var(--muted)', letterSpacing: '0.06em', textTransform: 'uppercase' }}>
        {label}{required && <span style={{ color: 'var(--accent-ink)', marginLeft: 4 }}>*</span>}
      </span>
      {multiline ? (
        <textarea
          rows={4}
          name={name}
          value={value}
          onChange={onChange}
          placeholder={placeholder}
          required={required}
          autoComplete={autoComplete}
          onFocus={() => setFocus(true)}
          onBlur={() => setFocus(false)}
          style={{ ...commonStyle, resize: 'vertical', minHeight: 80 }}
        />
      ) : (
        <input
          type={type}
          name={name}
          value={value}
          onChange={onChange}
          placeholder={placeholder}
          required={required}
          autoComplete={autoComplete}
          onFocus={() => setFocus(true)}
          onBlur={() => setFocus(false)}
          style={commonStyle}
        />
      )}
      {error && (
        <span style={{ fontSize: 12, color: '#8F2A22' }}>{error}</span>
      )}
    </label>
  );
}

function SubmittedState({ onReset }) {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 16, padding: '12px 4px' }}>
      <span style={{
        width: 44, height: 44, borderRadius: 12,
        background: 'var(--accent-soft)', color: 'var(--accent-ink)',
        display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
      }}>
        <Icon.check />
      </span>
      <h3 style={{ fontSize: 24, letterSpacing: '-0.02em' }}>Thanks — we’ve got your request.</h3>
      <p style={{ fontSize: 15, color: 'var(--muted)', lineHeight: 1.5 }}>
        We’ll review your details and reply from{' '}
        <a
          href="mailto:arestechnology.io@proton.me"
          style={{ color: 'var(--cta)', borderBottom: '1px solid currentColor' }}
        >
          arestechnology.io@proton.me
        </a>{' '}
        as soon as possible. No payment, no obligation.
      </p>
      <p className="mono" style={{ fontSize: 12, color: 'var(--muted)' }}>
        Reply directly to that email if any details change.
      </p>
      <div style={{ display: 'flex', gap: 10, marginTop: 4 }}>
        <SecondaryBtn onClick={onReset}>Send another</SecondaryBtn>
      </div>
    </div>
  );
}

function ErrorState({ onReset }) {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 16, padding: '12px 4px' }}>
      <span style={{
        width: 44, height: 44, borderRadius: 12,
        background: '#FBE9E7', color: '#8F2A22',
        display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
      }}>
        <Icon.x />
      </span>
      <h3 style={{ fontSize: 24, letterSpacing: '-0.02em' }}>Couldn’t send your request right now.</h3>
      <p style={{ fontSize: 15, color: 'var(--muted)', lineHeight: 1.5 }}>
        Please email{' '}
        <a
          href="mailto:arestechnology.io@proton.me"
          style={{ color: 'var(--cta)', borderBottom: '1px solid currentColor' }}
        >
          arestechnology.io@proton.me
        </a>{' '}
        directly and we’ll pick it up from there.
      </p>
      <div style={{ display: 'flex', gap: 10, marginTop: 4 }}>
        <SecondaryBtn onClick={onReset}>Back to form</SecondaryBtn>
      </div>
    </div>
  );
}

/* ---------- FOOTER ---------- */
function Footer() {
  return (
    <footer style={{ padding: '40px 28px 56px', background: 'var(--ink)', color: '#DDE3EE', borderTop: '1px solid #232A3A' }}>
      <div style={{ maxWidth: 'var(--maxw)', margin: '0 auto', display: 'grid', gridTemplateColumns: '1.4fr 1fr 1fr 1fr', gap: 32 }} className="foot-grid">
        <div style={{ display: 'flex', flexDirection: 'column', gap: 12, maxWidth: 360 }}>
          <a href="#top" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
            <Logomark />
            <span style={{ color: 'white', fontWeight: 500 }}>ARES <span style={{ color: '#909AAD' }}>Technology</span></span>
          </a>
          <p style={{ fontSize: 14, color: '#A8B0C0', lineHeight: 1.5 }}>
            Private website previews for local businesses in the UK &amp; internationally —
            based in Surrey &amp; South West London.
            First websites from <span style={{ color: 'white' }}>£249</span>.
            Professional 1-2 page builds from <span style={{ color: 'white' }}>£349</span>.
            Client pays for and owns their own domain separately.
          </p>
        </div>
        <FootCol title="Offer" links={[['What’s included', '#pricing'], ['Monthly support', '#pricing'], ['Areas served', '#who']]} />
        <FootCol title="Info" links={[['FAQ', '#faq'], ['Privacy Policy — coming soon', null], ['Contact', '#contact']]} />
        <FootCol title="Contact" links={[['Request a preview', '#contact'], ['arestechnology.io@proton.me', 'mailto:arestechnology.io@proton.me']]} />
      </div>
      <div style={{
        maxWidth: 'var(--maxw)', margin: '32px auto 0',
        paddingTop: 22, borderTop: '1px solid #232A3A',
        display: 'flex', justifyContent: 'space-between', flexWrap: 'wrap', gap: 12,
        fontSize: 12, color: '#6A7388',
      }} className="mono">
        <span>© ARES Technology · Serving local businesses in the UK &amp; internationally</span>
        <span>v1.0 · Built for local trades</span>
      </div>
      <style>{`
        @media (max-width: 820px) {
          .foot-grid { grid-template-columns: 1fr 1fr !important; }
        }
        @media (max-width: 520px) {
          .foot-grid { grid-template-columns: 1fr !important; }
        }
      `}</style>
    </footer>
  );
}

function FootCol({ title, links }) {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
      <span className="mono" style={{ fontSize: 11, letterSpacing: '0.1em', textTransform: 'uppercase', color: '#6A7388' }}>
        {title}
      </span>
      <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 6 }}>
        {links.map(([l, href]) => (
          <li key={l}>
            {href ? (
              <a href={href} style={{ fontSize: 14, color: '#DDE3EE' }}>{l}</a>
            ) : (
              <span style={{ fontSize: 14, color: '#6A7388' }}>{l}</span>
            )}
          </li>
        ))}
      </ul>
    </div>
  );
}

Object.assign(window, {
  Nav, Hero, Problem, HowItWorks, Pricing, Monthly, WhoFor, WhyAres, HumanTrust,
  ExamplePreview, SampleLayouts, TrustStrip, FAQ, Contact, Footer,
});
