/* global React, ReactDOM */
const { useState, useEffect, useRef } = React;
const { motion: _fm, MotionConfig: _MC } = window.Motion || {};
const _MD = (_fm && _fm.div)    || 'div';
const _MA = (_fm && _fm.a)      || 'a';
const _MB = (_fm && _fm.button) || 'button';
const _prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;

const useWindowWidth = () => {
  const [w, setW] = useState(window.innerWidth);
  useEffect(() => {
    const onResize = () => setW(window.innerWidth);
    window.addEventListener('resize', onResize, { passive: true });
    return () => window.removeEventListener('resize', onResize);
  }, []);
  return w;
};

/* ============================================================
   Tiny scroll-reveal hook + utility
   ============================================================ */
const useReveal = () => {
  const ref = useRef(null);
  useEffect(() => {
    const el = ref.current;
    if (!el) return;
    const io = new IntersectionObserver(
      (entries) => {
        entries.forEach((e) => {
          if (e.isIntersecting) {
            el.classList.add('is-in');
            io.unobserve(el);
          }
        });
      },
      { threshold: 0.15 }
    );
    io.observe(el);
    return () => io.disconnect();
  }, []);
  return ref;
};

const Reveal = ({ children, delay = 0, as = 'div', ...rest }) => {
  const ref = useReveal();
  const Tag = as;
  return (
    <Tag
      ref={ref}
      className={`reveal ${rest.className || ''}`}
      style={{ transitionDelay: `${delay}ms`, ...rest.style }}
    >
      {children}
    </Tag>
  );
};

/* ============================================================
   Logo lockup
   ============================================================ */
const Logo = ({ size = 22, href = 'index.html' }) => (
  <a href={href} style={{
    display: 'flex', alignItems: 'center', gap: 10,
    textDecoration: 'none', color: 'var(--fg)',
  }}>
    <img src="assets/logo-mark.png" alt="Recall"
      style={{ width: size, height: size, objectFit: 'contain' }} />
    <span style={{
      fontFamily: 'var(--font-display)', fontWeight: 800,
      fontSize: size * 0.78, letterSpacing: '-0.03em', color: 'var(--fg)',
    }}>Recall</span>
  </a>
);

/* ============================================================
   Sticky Nav
   ============================================================ */
const Nav = ({ active }) => {
  const [scrolled, setScrolled] = useState(false);
  const [menuOpen, setMenuOpen] = useState(false);
  const width = useWindowWidth();
  const isMobile = width < 768;

  useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 8);
    window.addEventListener('scroll', onScroll, { passive: true });
    onScroll();
    return () => window.removeEventListener('scroll', onScroll);
  }, []);

  useEffect(() => { if (!isMobile) setMenuOpen(false); }, [isMobile]);

  useEffect(() => {
    document.body.style.overflow = menuOpen ? 'hidden' : '';
    return () => { document.body.style.overflow = ''; };
  }, [menuOpen]);

  const navLinks = [
    ['Features', 'features.html', 'features'],
    ['Pricing', 'pricing.html', 'pricing'],
    ['Support', 'support.html', 'support'],
  ];

  const desktopLink = (label, href, key) => {
    const isActive = key === active;
    return (
      <a key={key} href={href} style={{
        fontFamily: 'var(--font-body)', fontSize: 14,
        color: isActive ? 'var(--fg)' : 'var(--fg-2)',
        textDecoration: 'none', letterSpacing: '-0.011em',
        transition: 'color var(--dur-2) var(--ease-out)',
      }}
      onMouseEnter={(e) => (e.currentTarget.style.color = 'var(--fg)')}
      onMouseLeave={(e) => (e.currentTarget.style.color = isActive ? 'var(--fg)' : 'var(--fg-2)')}
      >{label}</a>
    );
  };

  const bar = (transform) => (
    <span style={{
      width: 18, height: 1.5, background: 'var(--fg)', display: 'block',
      transition: 'transform 220ms var(--ease-out), opacity 220ms var(--ease-out)',
      transform,
    }} />
  );

  return (
    <>
      <nav style={{
        position: 'fixed', top: 12, left: '50%', transform: 'translateX(-50%)',
        width: 'calc(100% - 48px)', maxWidth: 860, zIndex: 200,
        height: 52, padding: '0 16px',
        display: 'flex', alignItems: 'center', justifyContent: 'space-between',
        background: scrolled ? 'rgba(8,8,8,0.92)' : 'rgba(8,8,8,0.60)',
        backdropFilter: 'blur(16px) saturate(140%)',
        WebkitBackdropFilter: 'blur(16px) saturate(140%)',
        border: `1px solid ${scrolled ? 'rgba(255,255,255,0.09)' : 'rgba(255,255,255,0.05)'}`,
        borderRadius: 14,
        transition: 'background var(--dur-3) var(--ease-out), border-color var(--dur-3) var(--ease-out)',
      }}>
        <Logo size={20} />
        {isMobile ? (
          <button onClick={() => setMenuOpen((o) => !o)} style={{
            width: 36, height: 36, borderRadius: 8,
            background: 'var(--surface)', border: '1px solid var(--border)',
            display: 'flex', flexDirection: 'column', alignItems: 'center',
            justifyContent: 'center', gap: 4, cursor: 'pointer', padding: 0,
          }}>
            {bar(menuOpen ? 'rotate(45deg) translate(4px, 4.5px)' : 'none')}
            {bar(menuOpen ? 'scaleX(0)' : 'none')}
            {bar(menuOpen ? 'rotate(-45deg) translate(4px, -4.5px)' : 'none')}
          </button>
        ) : (
          <div style={{ display: 'flex', alignItems: 'center', gap: 24 }}>
            {navLinks.map(([label, href, key]) => desktopLink(label, href, key))}
            <_MA href="waitlist.html" style={{
              height: 34, padding: '0 16px', display: 'inline-flex', alignItems: 'center',
              background: 'var(--accent-gradient)', color: '#fff', borderRadius: 999,
              fontFamily: 'var(--font-body)', fontSize: 13, fontWeight: 600,
              textDecoration: 'none', letterSpacing: '-0.011em',
              transition: 'box-shadow var(--dur-2) var(--ease-out)',
            }}
            onMouseEnter={(e) => { e.currentTarget.style.boxShadow = '0 0 20px rgba(255,107,107,0.25)'; }}
            onMouseLeave={(e) => { e.currentTarget.style.boxShadow = 'none'; }}
            {...(!_prefersReduced && _fm ? { whileHover: { scale: 1.03 }, whileTap: { scale: 0.97 }, transition: { type: 'spring', stiffness: 400, damping: 25 } } : {})}
            >Join waitlist</_MA>
          </div>
        )}
      </nav>
      {menuOpen && (
        <div style={{
          position: 'fixed', inset: 0, zIndex: 150,
          background: 'rgba(0,0,0,0.97)',
          backdropFilter: 'blur(20px)', WebkitBackdropFilter: 'blur(20px)',
          display: 'flex', flexDirection: 'column', justifyContent: 'center',
          padding: '0 32px 48px',
          gap: 8,
        }}>
          {navLinks.map(([label, href, key]) => {
            const isActive = key === active;
            return (
              <a key={key} href={href} onClick={() => setMenuOpen(false)} style={{
                fontFamily: 'var(--font-display)', fontWeight: 800,
                fontSize: 'clamp(32px, 10vw, 56px)', letterSpacing: '-0.04em',
                color: isActive ? 'var(--fg)' : 'var(--fg-3)',
                textDecoration: 'none', lineHeight: 1.15,
                transition: 'color 150ms',
              }}>{label}</a>
            );
          })}
          <_MA href="waitlist.html" onClick={() => setMenuOpen(false)} style={{
            marginTop: 28, height: 56,
            display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
            background: 'var(--accent-gradient)', color: '#fff', borderRadius: 12,
            fontFamily: 'var(--font-body)', fontSize: 16, fontWeight: 600,
            textDecoration: 'none', letterSpacing: '-0.011em',
          }}
          {...(!_prefersReduced && _fm ? { whileTap: { scale: 0.97 }, transition: { type: 'spring', stiffness: 400, damping: 25 } } : {})}
          >Join waitlist</_MA>
        </div>
      )}
    </>
  );
};

/* ============================================================
   Waitlist input + countdown
   ============================================================ */
const TARGET = new Date('2026-07-01T00:00:00+10:00').getTime();

const WaitlistInput = ({ variant = 'pill', size = 'md' }) => {
  const [submitted, setSubmitted] = useState(false);
  const [email, setEmail] = useState('');
  const [firstName, setFirstName] = useState('');
  const [loading, setLoading] = useState(false);
  const [error, setError] = useState(null);
  const h = size === 'lg' ? 52 : 44;
  const fontSize = size === 'lg' ? 15 : 14;

  const handleSubmit = async (e) => {
    e.preventDefault();
    if (!firstName.trim() || !email) return;
    setLoading(true);
    setError(null);
    try {
      const res = await fetch('https://recall-backend-chi.vercel.app/waitlist', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ firstName: firstName.trim(), email }),
      });
      if (res.ok) {
        setSubmitted(true);
      } else {
        const data = await res.json().catch(() => ({}));
        setError(data.error || 'Something went wrong. Please try again.');
      }
    } catch (_) {
      setError('Network error. Please try again.');
    } finally {
      setLoading(false);
    }
  };

  if (submitted) {
    return (
      <div style={{
        padding: '16px 24px', background: 'var(--surface)',
        border: '1px solid var(--border)', borderRadius: 12,
        maxWidth: 440, width: '100%', textAlign: 'center',
      }}>
        <p style={{ margin: 0, color: 'var(--fg)', fontWeight: 600, fontSize }}>
          You&rsquo;re on the list. We&rsquo;ll see you 1 July. 🎉
        </p>
      </div>
    );
  }

  const inputBase = {
    height: h, border: '1px solid var(--border)', borderRadius: 999,
    background: 'var(--surface)', color: 'var(--fg)',
    fontFamily: 'var(--font-body)', fontSize, padding: '0 18px',
    outline: 'none', letterSpacing: '-0.011em',
    width: '100%', boxSizing: 'border-box',
    transition: 'box-shadow var(--dur-2) var(--ease-out)',
  };

  return (
    <form onSubmit={handleSubmit}
      style={{ maxWidth: 440, width: '100%', display: 'flex', flexDirection: 'column', gap: 8 }}>
      <input
        type="text" required placeholder="First name"
        value={firstName} onChange={(e) => setFirstName(e.target.value)}
        style={inputBase}
        onFocus={(e) => (e.currentTarget.style.boxShadow = '0 0 0 1.5px var(--accent)')}
        onBlur={(e) => (e.currentTarget.style.boxShadow = 'none')}
      />
      <div
        style={{
          display: 'flex', alignItems: 'center', gap: 4, padding: 4,
          background: 'var(--surface)', border: '1px solid var(--border)',
          borderRadius: 999,
          transition: 'border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out)',
        }}
        onMouseEnter={(e) => (e.currentTarget.style.borderColor = 'var(--border-strong)')}
        onMouseLeave={(e) => (e.currentTarget.style.borderColor = 'var(--border)')}
        onFocus={(e) => (e.currentTarget.style.boxShadow = '0 0 0 1.5px var(--accent)')}
        onBlur={(e) => { if (!e.currentTarget.contains(e.relatedTarget)) e.currentTarget.style.boxShadow = 'none'; }}
      >
        <input type="email" required value={email}
          placeholder="you@example.com"
          onChange={(e) => setEmail(e.target.value)}
          style={{
            flex: 1, height: h, border: 'none', outline: 'none',
            background: 'transparent', color: 'var(--fg)',
            fontFamily: 'var(--font-body)', fontSize, padding: '0 18px',
            letterSpacing: '-0.011em',
          }} />
        <_MB type="submit" disabled={loading}
          style={{
            height: h, padding: '0 22px', borderRadius: 999,
            background: 'var(--accent-gradient)', color: '#fff', border: 'none',
            cursor: loading ? 'default' : 'pointer',
            fontFamily: 'var(--font-body)', fontWeight: 600, fontSize: 13,
            letterSpacing: '-0.011em', whiteSpace: 'nowrap',
            opacity: loading ? 0.7 : 1,
            transition: 'box-shadow var(--dur-2) var(--ease-out)',
          }}
          onMouseEnter={(e) => { if (!loading) { e.currentTarget.style.boxShadow = '0 0 20px rgba(255,107,107,0.25)'; } }}
          onMouseLeave={(e) => { if (!loading) { e.currentTarget.style.boxShadow = 'none'; } }}
          {...(!_prefersReduced && _fm && !loading ? { whileHover: { scale: 1.03 }, whileTap: { scale: 0.97 }, transition: { type: 'spring', stiffness: 400, damping: 25 } } : {})}
        >
          {loading ? 'Joining…' : 'Join waitlist'}
        </_MB>
      </div>
      {error && (
        <p style={{ margin: 0, fontSize: 13, color: 'var(--accent)' }}>{error}</p>
      )}
    </form>
  );
};

const Countdown = ({ variant = 'cards' }) => {
  const [now, setNow] = useState(Date.now());
  useEffect(() => {
    const id = setInterval(() => setNow(Date.now()), 1000);
    return () => clearInterval(id);
  }, []);
  const diff = Math.max(0, TARGET - now);
  const days = Math.floor(diff / 86400000);
  const hours = Math.floor(diff / 3600000) % 24;
  const mins = Math.floor(diff / 60000) % 60;
  const secs = Math.floor(diff / 1000) % 60;

  if (diff === 0) {
    return (
      <div style={{
        fontFamily: 'var(--font-mono)', fontSize: 14, color: 'var(--fg)',
        letterSpacing: '0.08em', textTransform: 'uppercase',
      }}>Available now</div>
    );
  }

  if (variant === 'inline') {
    return (
      <div style={{
        display: 'inline-flex', alignItems: 'baseline', gap: 6,
        fontFamily: 'var(--font-mono)', fontSize: 13,
        color: 'var(--fg-2)', letterSpacing: '0.02em',
      }}>
        <span style={{ color: 'var(--fg)', fontVariantNumeric: 'tabular-nums' }}>
          {String(days).padStart(3, '0')}d : {String(hours).padStart(2, '0')}h : {String(mins).padStart(2, '0')}m : {String(secs).padStart(2, '0')}s
        </span>
        <span style={{ color: 'var(--fg-3)' }}>until launch</span>
      </div>
    );
  }

  const cell = (n, label, idx) => {
    const motionProps = (!_prefersReduced && _fm) ? {
      initial: { opacity: 0, y: 8 },
      animate: { opacity: 1, y: 0 },
      transition: { duration: 0.3, ease: 'easeOut', delay: idx * 0.08 },
    } : {};
    return (
      <_MD key={label} {...motionProps} style={{
        display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4,
        padding: '14px 18px', minWidth: 84,
        background: 'var(--surface)', border: '1px solid var(--border)',
        borderRadius: 12,
      }}>
        <span style={{
          fontFamily: 'var(--font-mono)', fontSize: 32, fontWeight: 500,
          letterSpacing: '-0.02em', color: 'var(--fg)',
          fontVariantNumeric: 'tabular-nums',
        }}>{String(n).padStart(2, '0')}</span>
        <span style={{
          fontFamily: 'var(--font-mono)', fontSize: 10, color: 'var(--fg-3)',
          letterSpacing: '0.12em', textTransform: 'uppercase',
        }}>{label}</span>
      </_MD>
    );
  };
  return (
    <div className="countdown-row" style={{ display: 'flex', gap: 10 }}>
      {cell(days, 'Days', 0)}{cell(hours, 'Hours', 1)}{cell(mins, 'Mins', 2)}{cell(secs, 'Secs', 3)}
    </div>
  );
};

/* ============================================================
   CTA band — bottom of every page
   ============================================================ */
const CTABand = () => (
  <section id="waitlist" style={{
    padding: 'var(--section-y, 120px) 32px',
    textAlign: 'center', position: 'relative', overflow: 'hidden',
    display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 28,
    borderTop: '1px solid var(--border)',
  }}>
    {/* Abstract coral glow shapes */}
    <div aria-hidden style={{ position: 'absolute', inset: 0, overflow: 'hidden', pointerEvents: 'none' }}>
      <div style={{
        position: 'absolute', top: '-30%', left: '15%',
        width: 600, height: 500,
        background: 'var(--accent-gradient)',
        borderRadius: '40% 60% 55% 45% / 50% 45% 55% 50%',
        filter: 'blur(90px)', opacity: 0.12,
        animation: 'heroShape1 60s ease-in-out infinite',
      }} />
      <div style={{
        position: 'absolute', top: '-20%', right: '10%',
        width: 380, height: 320,
        background: 'var(--accent)',
        borderRadius: '55% 45% 35% 65% / 45% 55% 45% 55%',
        filter: 'blur(70px)', opacity: 0.10,
        animation: 'heroShape3 70s ease-in-out infinite',
      }} />
      <div style={{
        position: 'absolute', bottom: 0, left: 0, right: 0, height: '50%',
        background: 'linear-gradient(to bottom, transparent, var(--bg))',
      }} />
    </div>
    <Reveal>
      <span className="eyebrow">Try free for 14 days · Windows, Mac &amp; Linux · Early access 1 July 2026</span>
    </Reveal>
    <Reveal delay={80}>
      <h2 style={{
        margin: 0, fontFamily: 'var(--font-display)',
        fontWeight: 700,
        fontSize: 'clamp(36px, 5.5vw, 64px)', lineHeight: 1.06,
        letterSpacing: '-0.03em', color: 'var(--fg)',
        textWrap: 'balance', maxWidth: 600, position: 'relative',
      }}>
        Start learning today.
      </h2>
    </Reveal>
    <Reveal delay={140}>
      <p style={{
        margin: 0, maxWidth: 420,
        fontFamily: 'var(--font-mono)', fontSize: 13, lineHeight: 1.7,
        color: 'var(--fg-3)', letterSpacing: '-0.005em', position: 'relative',
      }}>
        Join the waitlist and get 50% off as one of the first 100 users.
      </p>
    </Reveal>
    <Reveal delay={200}>
      <div style={{ position: 'relative' }}><WaitlistInput size="lg" /></div>
    </Reveal>
    <Reveal delay={260}>
      <p style={{ margin: 0, fontSize: 12, color: 'var(--fg-3)', fontFamily: 'var(--font-mono)' }}>
        No spam, ever.
      </p>
    </Reveal>
    <Reveal delay={320}>
      <Countdown />
    </Reveal>
  </section>
);

/* ============================================================
   Footer — minimal 3-col: logo+copy · nav links · social icons
   ============================================================ */
const Footer = () => (
  <footer style={{
    borderTop: '1px solid var(--border)',
    padding: '28px 32px',
  }}>
    <div className="footer-inner" style={{
      maxWidth: 1200, margin: '0 auto',
      display: 'flex', alignItems: 'center', justifyContent: 'space-between',
      gap: 24,
    }}>
      {/* Left: logo + copyright */}
      <div style={{ display: 'flex', alignItems: 'center', gap: 14 }}>
        <Logo size={18} />
        <span style={{
          fontFamily: 'var(--font-mono)', fontSize: 11,
          color: 'var(--fg-3)', letterSpacing: '0.04em',
        }}>© 2026 Recall Labs</span>
      </div>

      {/* Centre: nav links */}
      <nav style={{ display: 'flex', alignItems: 'center', gap: 20, flexWrap: 'wrap', justifyContent: 'center' }}>
        {[
          ['Features', 'features.html'],
          ['Pricing', 'pricing.html'],
          ['Support', 'support.html'],
          ['Privacy', 'privacy.html'],
          ['Terms', 'terms.html'],
        ].map(([label, href]) => (
          <a key={label} href={href} style={{
            fontFamily: 'var(--font-body)', fontSize: 13, color: 'var(--fg-3)',
            textDecoration: 'none', letterSpacing: '-0.011em',
            transition: 'color var(--dur-2) var(--ease-out)',
          }}
          onMouseEnter={(e) => (e.currentTarget.style.color = 'var(--fg)')}
          onMouseLeave={(e) => (e.currentTarget.style.color = 'var(--fg-3)')}
          >{label}</a>
        ))}
      </nav>

      {/* Right: social icons */}
      <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
        {/* Discord */}
        <a href="https://discord.gg/cet27uRc" target="_blank" rel="noopener noreferrer"
          title="Discord"
          style={{
            width: 34, height: 34, borderRadius: 8,
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            background: 'var(--surface)', border: '1px solid var(--border)',
            color: 'var(--fg-3)', textDecoration: 'none',
            transition: 'color var(--dur-2), border-color var(--dur-2)',
          }}
          onMouseEnter={(e) => { e.currentTarget.style.color = 'var(--fg)'; e.currentTarget.style.borderColor = 'var(--border-strong)'; }}
          onMouseLeave={(e) => { e.currentTarget.style.color = 'var(--fg-3)'; e.currentTarget.style.borderColor = 'var(--border)'; }}
        >
          <svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor">
            <path d="M20.317 4.37a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057c.002.022.015.043.032.054a19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.11 13.11 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"/>
          </svg>
        </a>
        {/* Instagram */}
        <a href="https://www.instagram.com/recall.labs/" target="_blank" rel="noopener noreferrer"
          title="Instagram"
          style={{
            width: 34, height: 34, borderRadius: 8,
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            background: 'var(--surface)', border: '1px solid var(--border)',
            color: 'var(--fg-3)', textDecoration: 'none',
            transition: 'color var(--dur-2), border-color var(--dur-2)',
          }}
          onMouseEnter={(e) => { e.currentTarget.style.color = 'var(--fg)'; e.currentTarget.style.borderColor = 'var(--border-strong)'; }}
          onMouseLeave={(e) => { e.currentTarget.style.color = 'var(--fg-3)'; e.currentTarget.style.borderColor = 'var(--border)'; }}
        >
          <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
            <rect x="2" y="2" width="20" height="20" rx="5" ry="5"/>
            <path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"/>
            <line x1="17.5" y1="6.5" x2="17.51" y2="6.5"/>
          </svg>
        </a>
      </div>
    </div>
  </footer>
);

/* FooterCol kept for sub-pages that still use it */
const FooterCol = ({ heading, links }) => (
  <div>
    <h4 style={{
      margin: '0 0 14px', fontFamily: 'var(--font-mono)', fontSize: 11,
      color: 'var(--fg-3)', letterSpacing: '0.12em',
      textTransform: 'uppercase', fontWeight: 500,
    }}>{heading}</h4>
    <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 8 }}>
      {links.map(([label, href, target, hoverColor]) => (
        <li key={label}>
          <a href={href} target={target} rel={target === '_blank' ? 'noopener noreferrer' : undefined} style={{
            fontFamily: 'var(--font-body)', fontSize: 14, color: 'var(--fg-2)',
            textDecoration: 'none', transition: 'color var(--dur-2) var(--ease-out)',
          }}
          onMouseEnter={(e) => (e.currentTarget.style.color = hoverColor || 'var(--fg)')}
          onMouseLeave={(e) => (e.currentTarget.style.color = 'var(--fg-2)')}
          >{label}</a>
        </li>
      ))}
    </ul>
  </div>
);

Object.assign(window, {
  useWindowWidth, useReveal, Reveal, Logo, Nav,
  WaitlistInput, Countdown, CTABand, Footer, FooterCol,
  MotionConfig: _MC,
});
