/* ============================================================
   HOME PAGE — Fadar Kamshi / Incense Palace
   ============================================================ */
/* ── Video panel cycling hook ─────────────────────────────── */
function useVideoCycle(count, intervalMs) {
  const [active, setActive] = React.useState(0);
  const [pulsing, setPulsing] = React.useState(-1);
  const timer = React.useRef(null);
  const goTo = React.useCallback((idx) => {
    setActive((prev) => {if (prev === idx) return prev;setPulsing(idx);setTimeout(() => setPulsing(-1), 700);return idx;});
  }, []);
  const start = React.useCallback(() => {
    timer.current = setInterval(() => setActive((prev) => {const next = (prev + 1) % count;setPulsing(next);setTimeout(() => setPulsing(-1), 700);return next;}), intervalMs);
  }, [count, intervalMs]);
  const stop = React.useCallback(() => clearInterval(timer.current), []);
  React.useEffect(() => {start();return stop;}, [start, stop]);
  return { active, pulsing, goTo, start, stop };
}

function HomeHero() {
  const { nav } = useStore();
  /* One poster + one video per panel — nothing reused */
  const panels = IMG.hero.panels;
  const { active, pulsing, goTo, start, stop } = useVideoCycle(panels.length, 4500);


  /* Try to play all videos (needed on iOS) */
  const refs = React.useRef([]);
  React.useEffect(() => {
    refs.current.forEach((v) => v && v.play().catch(() => {}));
    const resume = () => refs.current.forEach((v) => v && v.play().catch(() => {}));
    document.addEventListener('pointerdown', resume, { once: true });
    return () => document.removeEventListener('pointerdown', resume);
  }, []);

  return (
    <section
      style={{ position: 'relative', width: '100%', height: '100svh', minHeight: 620, overflow: 'hidden', background: 'var(--ink)' }}
      onMouseEnter={stop}
      onMouseLeave={start}>
      
      {/* ── 4-panel grid ─────────────────────────────── */}
      <div style={{
        position: 'absolute', inset: 0,
        display: 'grid',
        gridTemplateColumns: `repeat(${panels.length}, 1fr)`,
        gridTemplateRows: '1fr',
        gap: 3,
        background: 'linear-gradient(135deg, rgba(0,0,0,.6), rgba(0,0,0,.4))'
      }}>
        {panels.map((p, i) =>
        <div
          key={i}
          data-panel={i}
          onClick={() => {stop();goTo(i);start();}}
          style={{
            position: 'relative',
            overflow: 'hidden',
            cursor: 'pointer',
            gridColumn: i + 1,
            gridRow: '1'
          }}>
          
            {/* Still image — paints instantly, sits behind the video */}
            <img
            src={p.poster}
            alt={p.label}
            loading={i === 0 ? 'eager' : 'lazy'}
            fetchPriority={i === 0 ? 'high' : 'low'}
            decoding="async"
            style={{
              position: 'absolute', inset: 0, width: '100%', height: '100%',
              objectFit: 'cover', zIndex: 0
            }} />

            {/* Video element */}
            <video
            ref={(el) => refs.current[i] = el}
            autoPlay muted loop playsInline
            preload={i === 0 ? 'auto' : 'metadata'}
            poster={p.poster}
            aria-hidden="true"
            style={{
              position: 'absolute', inset: 0, width: '100%', height: '100%',
              objectFit: 'cover', zIndex: 0,
              animation: active === i ? 'kenburnsActive 18s ease-in-out infinite alternate' : 'kenburns 18s ease-in-out infinite alternate',
              willChange: 'transform'
            }}>
            
              <source src={p.src} type="video/mp4" />
            </video>

            {/* Scrim — dims inactive panels */}
            <div style={{
            position: 'absolute', inset: 0,
            background: active === i ? 'rgba(0,0,0,.06)' : 'rgba(0,0,0,.44)',
            transition: 'background 1.1s ease',
            zIndex: 1
          }} />

            {/* Pulse flash on activation */}
            {pulsing === i &&
          <div style={{
            position: 'absolute', inset: 0, zIndex: 2,
            background: 'rgba(255,255,255,.12)',
            animation: 'panelPulse .7s ease forwards'
          }} />
          }
          </div>
        )}
      </div>

      {/* ── Gradient overlays for text legibility ───── */}
      <div style={{ position: 'absolute', inset: 0, zIndex: 11, pointerEvents: 'none',
        background: 'linear-gradient(to bottom, transparent 0%, transparent 55%, rgba(0,0,0,.35) 75%, rgba(0,0,0,.6) 100%)' }} />

      {/* ── Content ──────────────────────────────────── */}
      <div style={{
        position: 'absolute', inset: 0, zIndex: 20,
        display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'flex-end',
        padding: 'clamp(90px,10vh,120px) clamp(24px,6vw,80px) clamp(70px,9vh,100px)',
        textAlign: 'center',
        pointerEvents: 'none'
      }}>
        {/* Headline */}
        <h1 style={{
          fontFamily: 'var(--serif)', fontWeight: 400, lineHeight: .92,
          fontSize: 'clamp(56px,8vw,116px)',
          letterSpacing: '-.02em', color: '#fff',
          maxWidth: 980, marginBottom: 22,
          animation: 'fadeUpHero 1.1s .7s both'
        }}>
          Fragrance that<br />
          <em style={{
            fontStyle: 'italic',
            background: 'linear-gradient(135deg, #ffffff 10%, #E3BC63 90%)',
            WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent',
            backgroundClip: 'text'
          }}>lingers.</em>
        </h1>

        {/* CTAs */}
        <div style={{ display: 'flex', gap: 14, flexWrap: 'wrap', justifyContent: 'center', marginBottom: 50, animation: 'fadeUpHero 1.1s 1.2s both', pointerEvents: 'auto' }}>
          <button
            className="btn btn-primary btn-lg"
            onClick={() => nav('shop')}
            style={{ borderRadius: 100, background: 'linear-gradient(135deg,#3B1258,#8A5F14)', border: 'none', color: '#fff', boxShadow: '0 8px 32px rgba(0,0,0,.45)' }}>
            Shop all fragrance →</button>
          <button
            className="btn btn-lg"
            onClick={() => nav('brief')}
            style={{ borderRadius: 100, background: 'rgba(255,255,255,.12)', border: '1.5px solid rgba(255,255,255,.3)', color: '#fff', backdropFilter: 'blur(8px)', display: 'inline-flex', alignItems: 'center', gap: 8 }}>
            <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8"><path d="M12 5v14M5 12h14" strokeLinecap="round" /></svg>
            Wholesale Enquiry</button>
        </div>
      </div>

      {/* ── Scroll indicator ─────────────────────────── */}
      <div style={{ position: 'absolute', bottom: 26, right: 'clamp(20px,4vw,52px)', zIndex: 30,
        display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 8,
        animation: 'scrollBounce 2.4s ease-in-out infinite' }}>
        <span style={{ fontFamily: 'var(--sans)', fontSize: 9, letterSpacing: '.22em', textTransform: 'uppercase',
          color: 'rgba(255,255,255,.5)', writingMode: 'vertical-lr' }}>Scroll</span>
        <svg width="16" height="22" viewBox="0 0 16 22" fill="none" style={{ opacity: .5 }}>
          <rect x="5" y="0" width="6" height="13" rx="3" fill="none" stroke="white" strokeWidth="1.5" />
          <rect x="6.5" y="3" width="3" height="4" rx="1.5" fill="white">
            <animate attributeName="y" values="3;7;3" dur="2s" repeatCount="indefinite" />
            <animate attributeName="opacity" values="1;0;1" dur="2s" repeatCount="indefinite" />
          </rect>
          <path d="M2 18l6 4 6-4" stroke="white" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" opacity=".5" />
        </svg>
      </div>

      {/* ── Keyframes (injected once) ─────────────────── */}
      <style>{`
        @keyframes kenburns {
          0%   { transform: scale(1.00) translate(0%,0%); }
          50%  { transform: scale(1.06) translate(-1.2%,-1.5%); }
          100% { transform: scale(1.03) translate(1.2%,0.5%); }
        }
        @keyframes kenburnsActive {
          0%   { transform: scale(1.04) translate(0%,0%); }
          50%  { transform: scale(1.12) translate(-1.8%,-2%); }
          100% { transform: scale(1.07) translate(1.8%,0.8%); }
        }
        @keyframes panelPulse {
          0%   { opacity: .5; }
          100% { opacity: 0; }
        }
        @keyframes fadeUpHero {
          from { opacity: 0; transform: translateY(28px); }
          to   { opacity: 1; transform: translateY(0); }
        }
        @keyframes scrollBounce {
          0%,100% { transform: translateY(0); }
          55%      { transform: translateY(7px); }
        }
      `}</style>
    </section>);

}

function TrustStrip() {
  const items = [
  [I.truck, 'Nationwide delivery', 'Lagos · Abuja · Kano · and beyond'],
  [I.shield, 'Secure NGN & USD checkout', 'Multiple payment options'],
  [I.gift, 'Blended in-house', 'Our own turaren wuta recipes']];

  return (
    <section style={{ borderBottom: '1px solid var(--line)', background: 'var(--ivory)' }}>
      <div className="container wide" style={{ display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center', gap: 48, flexWrap: 'wrap', padding: '34px var(--gutter)' }}>
        {items.map(([Icon, t, s], i) =>
        <div key={i} style={{ display: 'flex', gap: 14, alignItems: 'center' }}>
            <span style={{ width: 46, height: 46, flexShrink: 0, borderRadius: 100, background: 'var(--cream-deep)', display: 'grid', placeItems: 'center', color: 'var(--gold-deep)' }}>{Icon({ width: 22, height: 22 })}</span>
            <div style={{ lineHeight: 1.25 }}><div style={{ fontWeight: 500, fontSize: 14.5 }}>{t}</div><div style={{ fontSize: 12.5, color: 'var(--ink-soft)' }}>{s}</div></div>
          </div>
        )}
      </div>
    </section>);

}

function FeaturedCategories() {
  const { nav } = useStore();
  const [showCustomModal, setShowCustomModal] = React.useState(false);
  return (
    <section className="container wide" style={{ padding: 'clamp(64px,9vw,120px) var(--gutter)' }}>
      {showCustomModal &&
      <div onClick={(e) => {if (e.target === e.currentTarget) setShowCustomModal(false);}} role="dialog" aria-modal="true" style={{ position: 'fixed', inset: 0, zIndex: 9999, background: 'rgba(0,0,0,.72)', backdropFilter: 'blur(7px)', display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 20, animation: 'bbFadeIn .4s forwards' }}>
          <div style={{ background: 'var(--ivory)', borderRadius: 24, maxWidth: 520, width: '100%', padding: 'clamp(28px,5vw,52px)', boxShadow: '0 32px 80px rgba(0,0,0,.35)', border: '1px solid var(--line)', animation: 'bbSlideIn .45s forwards', position: 'relative' }}>
            <button onClick={() => setShowCustomModal(false)} aria-label="Close" style={{ position: 'absolute', top: 20, right: 20, width: 36, height: 36, borderRadius: '100%', background: 'var(--cream-deep)', border: 'none', cursor: 'pointer', display: 'grid', placeItems: 'center', color: 'var(--ink-soft)' }} onMouseEnter={(e) => {e.currentTarget.style.background = 'var(--ink)';e.currentTarget.style.color = '#fff';}} onMouseLeave={(e) => {e.currentTarget.style.background = 'var(--cream-deep)';e.currentTarget.style.color = 'var(--ink-soft)';}}>
              <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M18 6 6 18M6 6l12 12" strokeLinecap="round" /></svg>
            </button>
            <p className="eyebrow" style={{ marginBottom: 12 }}>Wholesale &amp; bulk</p>
            <h2 style={{ fontFamily: 'var(--serif)', fontSize: 'clamp(26px,4vw,38px)', marginBottom: 14, lineHeight: 1.05 }}>Buying by the <em style={{ fontStyle: 'italic' }}>carton?</em></h2>
            <div style={{ height: 1, background: 'linear-gradient(90deg,var(--gold-soft),var(--blush-soft),transparent)', marginBottom: 20 }}></div>
            <div style={{ display: 'flex', flexDirection: 'column', gap: 12, marginBottom: 24 }}>
              {['Wholesale rates on incense, oils and charcoal by the carton.', 'Custom labelling and gift packaging for events and resale.', 'Send us your list and we quote the same day.'].map((t, i) =>
            <div key={i} style={{ display: 'flex', gap: 10, alignItems: 'flex-start' }}>
                  <span style={{ color: 'var(--gold)', fontSize: 10, marginTop: 5, flexShrink: 0 }}>✦</span>
                  <p style={{ fontSize: 14.5, color: 'var(--ink-soft)', lineHeight: 1.65 }}>{t}</p>
                </div>
            )}
            </div>
            <div style={{ background: 'linear-gradient(135deg,var(--gold-soft),var(--blush-soft))', borderRadius: 14, padding: '18px 22px', marginBottom: 28, borderLeft: '3px solid var(--gold)' }}>
              <p style={{ fontFamily: 'var(--serif)', fontStyle: 'italic', fontSize: 'clamp(15px,2vw,19px)', color: 'var(--ink)', lineHeight: 1.45 }}>“The scent should still be in the room long after you have left it.”</p>
            </div>
            <div style={{ display: 'flex', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
              <button className="btn btn-gold" onClick={() => {setShowCustomModal(false);nav('brief');}} style={{ flex: 1 }}>
                Send my list <I.arrow width={15} height={15} />
              </button>
              <button className="btn btn-outline" onClick={() => setShowCustomModal(false)} style={{ flexShrink: 0 }}>Maybe later</button>
            </div>
          </div>
        </div>
      }
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', flexWrap: 'wrap', gap: 16, marginBottom: 40 }}>
        <div>
          <p className="eyebrow">Shop by collection</p>
          <h2 style={{ fontSize: 'clamp(34px,5vw,60px)', marginTop: 12 }}>Blended, bottled, <em style={{ fontStyle: 'italic' }}>burned</em></h2>
        </div>
        <button className="link-u" style={{ fontSize: 14 }} onClick={() => nav('shop')}>View all →</button>
      </div>
      <div className="cat-grid">
        {BB.categories.slice(0, 4).map((c, i) =>
        <Reveal key={c.id} delay={i % 3 + 1} className={`cat-tile ${i === 0 ? 'cat-feature' : ''}`} onClick={() => nav('shop', { cat: c.id })} style={{ cursor: 'pointer' }}>
            <Ph label={c.name} src={c.img} style={{ height: '100%', minHeight: 200, borderRadius: 'var(--r-lg)' }} />
            <div style={{ position: 'absolute', inset: 0, borderRadius: 'var(--r-lg)', background: 'linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,.55) 45%, transparent 70%)', display: 'flex', flexDirection: 'column', justifyContent: 'flex-end', padding: 22, color: 'var(--cream)' }}>
              <h3 style={{ fontSize: i === 0 ? 34 : 25, color: 'var(--cream)' }}>{c.name}</h3>
              <span style={{ display: 'inline-flex', alignItems: 'center', gap: 7, fontSize: 12.5, letterSpacing: '.1em', textTransform: 'uppercase', marginTop: 12, color: 'var(--gold-soft)' }}>Shop now <I.arrow width={15} height={15} /></span>
            </div>
          </Reveal>
        )}

      </div>
    </section>);

}

function Bestsellers() {
  const { nav } = useStore();
  const [tab, setTab] = useState('best');
  const list = BB.products.filter((p) => tab === 'best' ? p.tags.includes('best') : p.tags.includes('new')).slice(0, 4);
  return (
    <section style={{ background: 'var(--cream-deep)' }}>
      <div className="container wide" style={{ padding: 'clamp(64px,9vw,120px) var(--gutter)' }}>
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', flexWrap: 'wrap', gap: 18, marginBottom: 42 }}>
          <h2 style={{ fontSize: 'clamp(34px,5vw,60px)' }}>Customers keep <em style={{ fontStyle: 'italic' }}>coming back</em></h2>
          <div style={{ display: 'flex', gap: 8 }}>
            <button className={`chip ${tab === 'best' ? 'active' : ''}`} onClick={() => setTab('best')}>Bestsellers</button>
            <button className={`chip ${tab === 'new' ? 'active' : ''}`} onClick={() => setTab('new')}>New in</button>
          </div>
        </div>
        <div className="prod-grid">
          {list.map((p, i) => <ProductCard key={p.id} p={p} delay={i % 4 + 1} />)}
        </div>
        <div style={{ textAlign: 'center', marginTop: 48 }}>
          <button className="btn btn-outline btn-lg" onClick={() => nav('shop')}>Shop everything</button>
        </div>
      </div>
    </section>);

}

function InspirationGallery() {
  const { nav } = useStore();
  const labels = ['White Humra oils', 'Majesty & Shuwa Secret', 'Chadian Humra range', 'Wardrobe balls', 'Palace Mixture & VIP Mix', 'Jars, fresh filled'];
  const photos = IMG.shelf.map((src, i) => ({ src, label: labels[i] }));

  return (
    <section style={{ background: 'var(--cream-deep)', padding: 'clamp(64px,9vw,110px) var(--gutter)' }}>
      <div className="container wide">
        <div style={{ textAlign: 'center', marginBottom: 48 }}>
          <p className="eyebrow">Straight off the shelf</p>
          <h2 style={{ fontSize: 'clamp(32px,4.5vw,56px)', marginTop: 14 }}>What is in the <em style={{ fontStyle: 'italic' }}>store</em></h2>
          <p style={{ fontSize: 16, color: 'var(--ink-soft)', maxWidth: 500, margin: '14px auto 0', lineHeight: 1.7 }}>Every photo here is our own stock, shot in our own stores in Surulere, Wuye and Kano — no stand-ins.</p>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 16 }}>
          {photos.map((p, i) =>
          <Reveal key={i} delay={i % 3 + 1} style={{ position: 'relative', borderRadius: 'var(--r-lg)', overflow: 'hidden', aspectRatio: i === 0 || i === 5 ? '4/5' : '1', cursor: 'pointer' }}
          onClick={() => nav('shop')}>
              <Ph src={p.src} label={p.label} style={{ height: '100%', borderRadius: 'var(--r-lg)' }} />
              <div style={{
              position: 'absolute', inset: 0,
              background: 'linear-gradient(to top, rgba(0,0,0,.80) 0%, transparent 55%)',
              borderRadius: 'var(--r-lg)',
              display: 'flex', alignItems: 'flex-end', padding: 20,
              opacity: 0, transition: 'opacity .35s'
            }}
            onMouseEnter={(e) => e.currentTarget.style.opacity = '1'}
            onMouseLeave={(e) => e.currentTarget.style.opacity = '0'}>
                <span style={{ fontFamily: 'var(--serif)', fontSize: 18, color: '#fff', fontStyle: 'italic' }}>{p.label}</span>
              </div>
            </Reveal>
          )}
        </div>
        <div style={{ textAlign: 'center', marginTop: 40 }}>
          <button className="btn btn-primary btn-lg" onClick={() => nav('shop')}>
            Shop <I.arrow width={16} height={16} />
          </button>
        </div>
      </div>
    </section>);

}

function EditorialSplit() {
  const { nav } = useStore();
  return (
    <section className="container wide" style={{ padding: 'clamp(64px,9vw,120px) var(--gutter)' }}>
      <div className="edit-split" style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 'clamp(28px,5vw,72px)', alignItems: 'center' }}>
        <Reveal style={{ position: 'relative' }}>
          <Ph label="Inside the Incense Palace store" src={IMG.about.founder} variant="ph-gold" style={{ aspectRatio: '5/6', borderRadius: 'var(--r-xl)' }} />
          <div style={{ position: 'absolute', bottom: 24, right: -20, background: 'var(--ivory)', padding: '18px 22px', borderRadius: 'var(--r-md)', boxShadow: 'var(--shadow-md)', maxWidth: 230 }}>
            <p style={{ fontFamily: 'var(--serif)', fontStyle: 'italic', fontSize: 19, lineHeight: 1.35 }}>"The scent should still be in the room long after you have left it."</p>
            <p style={{ fontSize: 11, color: 'var(--ink-soft)', marginTop: 12, letterSpacing: '.12em' }}>— FADAR KAMSHI</p>
          </div>
        </Reveal>
        <Reveal delay={2}>
          <p className="eyebrow">Fadar Kamshi</p>
          <h2 style={{ fontSize: 'clamp(32px,4.5vw,54px)', margin: '14px 0 20px' }}>Three stores, <em style={{ fontStyle: 'italic' }}>one house scent</em></h2>
          <p style={{ fontSize: 16.5, color: 'var(--ink-soft)', lineHeight: 1.7, marginBottom: 18 }}>
            Fadar Kamshi — the House of Fragrance — trades as Incense Palace across Surulere in Lagos, Wuye in Abuja and Kano. Turaren wuta, original incense, designer oil perfumes, burners and home fragrance, all under one roof.
          </p>
          <p style={{ fontSize: 16.5, color: 'var(--ink-soft)', lineHeight: 1.7, marginBottom: 18 }}>
            The blends are our own. <strong>Valley Mix</strong> for every day, <strong>Exclusive</strong> for guests, <strong>Clothes Signature</strong> for what you wear — milled and mixed in-house rather than bought in and relabelled, which is why the scent behaves the same jar after jar.
          </p>
          <ul style={{ listStyle: 'none', display: 'flex', flexDirection: 'column', gap: 12, marginBottom: 30 }}>
            {['Our own blends — milled and mixed in-house, not resold', 'Alcohol-free oil perfumes — concentrated, long-wearing', 'Walk in or order — three stores plus nationwide delivery'].map((t) =>
            <li key={t} style={{ display: 'flex', gap: 12, alignItems: 'center', fontSize: 15.5 }}>
                <span style={{ width: 26, height: 26, borderRadius: 100, background: 'var(--sage-soft)', color: 'var(--sage-deep)', display: 'grid', placeItems: 'center', flexShrink: 0 }}><I.check width={15} height={15} /></span>{t}
              </li>
            )}
          </ul>
          <button className="btn btn-primary" onClick={() => nav('about')}>Our story</button>
        </Reveal>
      </div>
    </section>);

}

function Testimonials() {
  const [i, setI] = useState(0);
  const t = BB.testimonials;
  useEffect(() => {const id = setInterval(() => setI((p) => (p + 1) % t.length), 5500);return () => clearInterval(id);}, []);
  return (
    <section style={{ background: 'linear-gradient(160deg, var(--sage-soft), var(--cream))' }}>
      <div className="container" style={{ padding: 'clamp(64px,9vw,120px) var(--gutter)', textAlign: 'center', maxWidth: 860 }}>
        <p className="eyebrow">What customers say</p>
        <div style={{ position: 'relative', minHeight: 220, marginTop: 24 }}>
          {t.map((item, idx) =>
          <blockquote key={idx} style={{ position: idx === i ? 'relative' : 'absolute', inset: 0, opacity: idx === i ? 1 : 0, transition: 'opacity .7s', pointerEvents: idx === i ? 'auto' : 'none' }}>
              <p style={{ fontFamily: 'var(--serif)', fontSize: 'clamp(22px,3.5vw,38px)', lineHeight: 1.35, fontStyle: 'italic' }}>"{item.quote}"</p>
              <div style={{ marginTop: 26, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 8 }}>
                <Stars value={5} size={16} />
                <div style={{ fontWeight: 600, fontSize: 15 }}>{item.name}</div>
                <div style={{ fontSize: 13, color: 'var(--ink-soft)' }}>{item.role}</div>
              </div>
            </blockquote>
          )}
        </div>
        <div style={{ display: 'flex', gap: 8, justifyContent: 'center', marginTop: 30 }}>
          {t.map((_, idx) => <button key={idx} onClick={() => setI(idx)} aria-label={`Testimonial ${idx + 1}`} style={{ width: idx === i ? 28 : 9, height: 9, borderRadius: 100, background: idx === i ? 'var(--gold)' : 'var(--line)', transition: 'all .4s' }} />)}
        </div>
      </div>
    </section>);

}

function InstagramSection() {
  const { nav } = useStore();
  return (
    <section className="container wide" style={{ padding: 'clamp(56px,8vw,100px) var(--gutter)' }}>
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 'clamp(32px,5vw,72px)', alignItems: 'center' }}>
        <div>
          <p className="eyebrow">@incensepalaceandperfumes</p>
          <h2 style={{ fontSize: 'clamp(30px,4.5vw,52px)', margin: '14px 0 16px' }}>New blends, <em style={{ fontStyle: 'italic' }}>as they land</em></h2>
          <p style={{ fontSize: 16, color: 'var(--ink-soft)', lineHeight: 1.7, marginBottom: 28 }}>
            Restocks, new mixes and what is on the shelf this week — posted first on Instagram. Message us there and we will hold your order.
          </p>
          <div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
            <a href="https://instagram.com/incensepalaceandperfumes" target="_blank" rel="noopener noreferrer" className="btn btn-primary">
              <I.ig width={17} height={17} /> Follow on Instagram
            </a>
            <a href="https://instagram.com/incensepalaceandperfumes" target="_blank" rel="noopener noreferrer" className="btn btn-outline"><I.ig width={17} height={17} /> Message us</a>
          </div>
        </div>
        <div className="social-grid">
          {IMG.social.slice(0, 6).map((src, i) =>
          <Reveal key={i} delay={i % 3 + 1} style={{ position: 'relative' }} className="social-tile">
              <Ph label="in store" src={src} style={{ aspectRatio: '1', borderRadius: 'var(--r-md)' }} />
              <div className="social-ov" style={{ position: 'absolute', inset: 0, background: 'rgba(0,0,0,.48)', borderRadius: 'var(--r-md)', display: 'grid', placeItems: 'center', opacity: 0, transition: 'opacity .35s' }}>
                <I.ig width={26} height={26} style={{ color: 'var(--cream)' }} />
              </div>
            </Reveal>
          )}
        </div>
      </div>
    </section>);

}


function HomePage() {
  return (
    <>
      <HomeHero />
      <TrustStrip />
      <FeaturedCategories />
      <Bestsellers />
      <EditorialSplit />
      <Testimonials />
      <InstagramSection />
      <Newsletter />
    </>);

}

Object.assign(window, { HomePage });