// ─── Bolivia Joven — All Components ──────────────────────────────────────────
const { useState, useEffect, useRef } = React;

// ═══════════════════════════════════════════════════════════════════
// ICONS
// ═══════════════════════════════════════════════════════════════════
const Svg = ({ size=24, className='', strokeWidth=2, fill=false, children }) => (
  <svg width={size} height={size} viewBox="0 0 24 24"
    fill={fill?'currentColor':'none'} stroke={fill?'none':'currentColor'}
    strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"
    className={className} style={{display:'inline-block',flexShrink:0}}>
    {children}
  </svg>
);
const MenuIcon = p => <Svg {...p}><line x1="4" y1="6" x2="20" y2="6"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/></Svg>;
const XIcon = p => <Svg {...p}><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></Svg>;
const ChevronLeftIcon = p => <Svg {...p}><polyline points="15 18 9 12 15 6"/></Svg>;
const ChevronRightIcon = p => <Svg {...p}><polyline points="9 18 15 12 9 6"/></Svg>;
const ChevronDownIcon = p => <Svg {...p}><polyline points="6 9 12 15 18 9"/></Svg>;
const UsersIcon = p => <Svg {...p}><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></Svg>;

// Bolivia map silhouette icon — color via `color` prop (defaults to site red)
const BoliviaIcon = ({ size = 32, color = '#a20032', className = '', style = {} }) => (
  <img
    src="assets/bol.png"
    alt="Bolivia"
    width={size}
    height={size}
    className={className}
    style={{
      width: size,
      height: size,
      objectFit: 'contain',
      filter: color === '#a20032'
        ? 'brightness(0) saturate(100%) invert(8%) sepia(89%) saturate(4000%) hue-rotate(330deg) brightness(80%)'
        : color === '#e9d36c'
          ? 'brightness(0) saturate(100%) invert(85%) sepia(40%) saturate(600%) hue-rotate(5deg)'
          : color === '#ffffff'
            ? 'brightness(0) invert(1)'
            : 'brightness(0)',
      ...style,
    }}
  />
);
const SparklesIcon = p => <Svg {...p}><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/><path d="M20 3v4"/><path d="M22 5h-4"/><path d="M4 17v2"/><path d="M5 18H3"/></Svg>;
const LayersIcon = p => <Svg {...p}><polygon points="12 2 2 7 12 12 22 7 12 2"/><polyline points="2 17 12 22 22 17"/><polyline points="2 12 12 17 22 12"/></Svg>;
const ArrowRightIcon = p => <Svg {...p}><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></Svg>;
const PhoneIcon = p => <Svg {...p}><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12 19.79 19.79 0 0 1 1.61 3.4 2 2 0 0 1 3.6 1.22h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L7.91 8.9a16 16 0 0 0 6 6l.89-.89a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 21.73 16.92Z"/></Svg>;
const MailIcon = p => <Svg {...p}><rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/></Svg>;
const PlusIcon = p => <Svg {...p}><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></Svg>;
const FacebookIcon = ({size=24,className=''}) => <svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor" className={className}><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"/></svg>;
const InstagramIcon = ({size=24,className=''}) => <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}><rect width="20" height="20" x="2" y="2" 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" x2="17.51" y1="6.5" y2="6.5"/></svg>;
const LinkedInIcon = ({size=24,className=''}) => <svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor" className={className}><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"/><rect width="4" height="12" x="2" y="9"/><circle cx="4" cy="4" r="2"/></svg>;
const TikTokIcon = ({size=24,className=''}) => <svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor" className={className}><path d="M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.27 6.27 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.33-6.34V8.69a8.27 8.27 0 0 0 4.83 1.54V6.77a4.85 4.85 0 0 1-1.06-.08z"/></svg>;
const SproutIcon = p => <Svg {...p}><path d="M7 20h10"/><path d="M10 20c5.5-2.5.8-6.4 3-10"/><path d="M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z"/><path d="M14.1 6a7 7 0 0 1 1.5 9.4c-1.3-1.2-2.2-2.8-2.2-4.6-.1-2.4.6-4.1.7-4.8z"/></Svg>;
const ZapIcon = p => <Svg {...p}><path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"/></Svg>;
const MapPinIcon = p => <Svg {...p}><path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"/><circle cx="12" cy="10" r="3"/></Svg>;
const AwardIcon = p => <Svg {...p}><path d="m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526"/><circle cx="12" cy="8" r="6"/></Svg>;
const TrendingUpIcon = p => <Svg {...p}><polyline points="22 7 13.5 15.5 8.5 10.5 2 17"/><polyline points="16 7 22 7 22 13"/></Svg>;
const HandshakeIcon = p => <Svg {...p}><path d="m11 17 2 2a1 1 0 1 0 3-3"/><path d="m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4"/><path d="m21 3 1 11h-2"/><path d="M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3"/><path d="M3 4h8"/></Svg>;
const GraduationIcon = p => <Svg {...p}><path d="M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z"/><path d="M22 10v6"/><path d="M6 12.5V16a6 3 0 0 0 12 0v-3.5"/></Svg>;
const BookOpenIcon = p => <Svg {...p}><path d="M12 7v14"/><path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"/></Svg>;
const CoinsIcon = p => <Svg {...p}><circle cx="8" cy="8" r="6"/><path d="M18.09 10.37A6 6 0 1 1 10.34 18"/><path d="M7 6h1v4"/><path d="m16.71 13.88.7.71-2.82 2.82"/></Svg>;
const CheckCircleIcon = p => <Svg {...p}><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/></Svg>;
const InfoIcon = p => <Svg {...p}><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></Svg>;
const RocketIcon = p => <Svg {...p}><path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"/><path d="m3.29 15 1.41-1.41a1 1 0 0 0 0-1.41l-2.12-2.13A5 5 0 0 1 12 4a5 5 0 0 1 5 5 5 5 0 0 1-5 5 5 5 0 0 1-3.54-1.46L7.05 13.9a1 1 0 0 0-1.41 0L4.23 15.32"/><path d="m12 8-2 2 2 2 2-2z"/></Svg>;
const BellIcon = p => <Svg {...p}><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></Svg>;
const ClockIcon = p => <Svg {...p}><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></Svg>;
const HeartIcon = p => <Svg {...p}><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/></Svg>;
const StethoscopeIcon = p => <Svg {...p}><path d="M11 2v2"/><path d="M5 2v2"/><path d="M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1"/><path d="M8 15a6 6 0 0 0 12 0v-3"/><circle cx="20" cy="10" r="2"/></Svg>;
const ClipboardIcon = p => <Svg {...p}><rect width="8" height="4" x="8" y="2" rx="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/></Svg>;
const CalendarIcon = p => <Svg {...p}><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></Svg>;
const BuildingIcon = p => <Svg {...p}><rect width="16" height="20" x="4" y="2" rx="2"/><path d="M9 22v-4h6v4"/><path d="M8 6h.01"/><path d="M16 6h.01"/><path d="M12 6h.01"/><path d="M12 10h.01"/><path d="M12 14h.01"/><path d="M16 10h.01"/><path d="M16 14h.01"/><path d="M8 10h.01"/><path d="M8 14h.01"/></Svg>;
const CheckIcon = p => <Svg {...p}><path d="M20 6 9 17l-5-5"/></Svg>;
const MicroscopeIcon = p => <Svg {...p}><path d="M6 18h8"/><path d="M3 22h18"/><path d="M14 22a7 7 0 1 0 0-14h-1"/><path d="M9 14h2"/><path d="M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z"/><path d="M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3"/></Svg>;
const MapIcon = p => <Svg {...p}><path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/></Svg>;

// ═══════════════════════════════════════════════════════════════════
// HELPERS
// ═══════════════════════════════════════════════════════════════════
const useReveal = (ref) => {
  useEffect(() => {
    const observer = new IntersectionObserver(entries => {
      entries.forEach(entry => {
        if (entry.isIntersecting) {
          entry.target.querySelectorAll('.reveal').forEach((el, i) =>
            setTimeout(() => el.classList.add('in'), i * 130)
          );
          observer.unobserve(entry.target);
        }
      });
    }, { threshold: 0.1 });
    if (ref.current) observer.observe(ref.current);
    return () => observer.disconnect();
  }, []);
};

const useCountUp = (target, duration, shouldStart) => {
  const [count, setCount] = useState(0);
  useEffect(() => {
    if (!shouldStart) return;
    let startTime = null;
    const easeOut = t => 1 - Math.pow(1-t, 3);
    const step = ts => {
      if (!startTime) startTime = ts;
      const p = Math.min((ts - startTime) / duration, 1);
      setCount(Math.round(easeOut(p) * target));
      if (p < 1) requestAnimationFrame(step);
    };
    requestAnimationFrame(step);
  }, [shouldStart]);
  return count;
};

// ═══════════════════════════════════════════════════════════════════
// NAVBAR
// ═══════════════════════════════════════════════════════════════════
const Navbar = ({ page = 'home' }) => {
  const [scrolled, setScrolled] = useState(false);
  const [menuOpen, setMenuOpen] = useState(false);
  useEffect(() => {
    const fn = () => setScrolled(window.scrollY > 60);
    window.addEventListener('scroll', fn, {passive:true});
    return () => window.removeEventListener('scroll', fn);
  }, []);

  const links = [
    { label:'Inicio',         href: page==='home' ? '#inicio' : '/', active: page==='home',    scrollId: page==='home' ? '#inicio' : null },
    { label:'Proyectos',      href: '/proyectos',  active: page==='projects'  },
    { label:'Nuestro Equipo', href: '/equipo',     active: page==='team'      },
    { label:'Contacto',       href: '/contacto',   active: page==='contact'   },
  ];

  const logoHref = page === 'home' ? '#inicio' : '/';

  const go = (e, link) => {
    if (link.scrollId) {
      e.preventDefault(); setMenuOpen(false);
      document.querySelector(link.scrollId)?.scrollIntoView({behavior:'smooth'});
      return;
    }
    setMenuOpen(false);
  };

  return (
    <>
    <style>{`.bj-nav{padding-top:env(safe-area-inset-top,0px)}.bj-nav-cover{position:absolute;top:0;left:0;right:0;height:env(safe-area-inset-top,0px);background:#0e0e0e;pointer-events:none}`}</style>
    <nav className="bj-nav" style={{position:'fixed',top:0,left:0,right:0,zIndex:1000,
      background:scrolled?'rgba(14,14,14,0.96)':'rgba(20,20,20,0.45)',
      backdropFilter:'blur(18px)',WebkitBackdropFilter:'blur(18px)',
      borderBottom:scrolled?'1px solid rgba(255,255,255,0.06)':'1px solid transparent',
      transition:'background 0.4s, border-color 0.4s'}}>
      <div className="bj-nav-cover"/>
      <div style={{maxWidth:1152,margin:'0 auto',padding:'0 24px'}}>
        <div style={{display:'flex',alignItems:'center',justifyContent:'space-between',height:72}}>
          <a href={logoHref} style={{display:'flex',alignItems:'center',gap:12,textDecoration:'none'}}>
            <img src="/assets/logo.png" alt="Bolivia Joven" style={{height:60,width:'auto',display:'block',flexShrink:0}}/>
            <span className="font-anton" style={{color:'#fff',fontSize:19,letterSpacing:'0.06em'}}>
            </span>
          </a>
          <div className="desktop-only" style={{gap:36,alignItems:'center'}}>
            {links.map(l=>(
              <a key={l.label} href={l.href}
                className={`nav-link${l.active?' active':''}`}
                onClick={e=>go(e,l)}>{l.label}</a>
            ))}
          </div>
          <div style={{display:'flex',alignItems:'center',gap:16}}>
            <a href="/unete" className={`btn-primary desktop-only${page==='join'?' active':''}`} style={{padding:'9px 22px',fontSize:13}}>Únete</a>
            <button onClick={()=>setMenuOpen(o=>!o)} className="mobile-only"
              style={{background:'none',border:'none',cursor:'pointer',color:'#fff',padding:4,lineHeight:0}} aria-label="Menú">
              {menuOpen?<XIcon size={24}/>:<MenuIcon size={24}/>}
            </button>
          </div>
        </div>
        {menuOpen && (
          <div style={{borderTop:'1px solid var(--border)',padding:'16px 0 24px',background:'rgba(14,14,14,0.98)'}}>
            {links.map(l=>(
              <a key={l.label} href={l.href}
                className={`mobile-nav-link${l.active?' active':''}`}
                onClick={e=>go(e,l)}>{l.label}</a>
            ))}
            <a href="/unete" className="btn-primary" style={{marginTop:20,width:'100%',justifyContent:'center'}}>Únete</a>
          </div>
        )}
      </div>
    </nav>
    </>
  );
};

// ═══════════════════════════════════════════════════════════════════
// HERO
// ═══════════════════════════════════════════════════════════════════
const dismissLoader = () => {
  const fill = document.getElementById('loader-bar-fill');
  const loader = document.getElementById('page-loader');
  if (!loader) return;
  if (fill) { fill.style.animation = 'none'; fill.style.width = '100%'; fill.style.transition = 'width 0.25s ease'; }
  setTimeout(() => {
    loader.classList.add('hide');
    setTimeout(() => loader.remove(), 600);
  }, 250);
};

const Hero = () => {
  const videoRef = useRef(null);
  useEffect(() => {
    const video = videoRef.current;
    if (!video) { dismissLoader(); return; }
    if (video.readyState >= 3) { dismissLoader(); return; }
    video.addEventListener('canplay', dismissLoader, { once: true });
    const fallback = setTimeout(dismissLoader, 5000);
    return () => { video.removeEventListener('canplay', dismissLoader); clearTimeout(fallback); };
  }, []);
  return (
  <section id="inicio" style={{position:'relative',minHeight:'100vh',display:'flex',alignItems:'center',justifyContent:'center',overflow:'hidden',background:'#0e0e0e'}}>
    <div style={{position:'absolute',inset:0,overflow:'hidden'}}>
      <video ref={videoRef} autoPlay muted loop playsInline style={{position:'absolute',inset:0,width:'100%',height:'100%',objectFit:'cover'}}>
        <source src="assets/hero2.mp4" type="video/mp4"/>
      </video>
      <div style={{position:'absolute',inset:0,backgroundImage:'linear-gradient(rgba(255,255,255,0.02) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,0.02) 1px,transparent 1px)',backgroundSize:'80px 80px'}}/>
      <div style={{position:'absolute',inset:0,background:'linear-gradient(180deg,rgba(10,10,10,0.3) 0%,rgba(10,10,10,0.55) 60%,rgba(10,10,10,0.85) 100%)'}}/>
    </div>
    <div style={{position:'relative',zIndex:2,textAlign:'center',padding:'120px 24px 80px',maxWidth:900,margin:'0 auto'}}>
      <div className="hero-t1" style={{display:'inline-flex',alignItems:'center',gap:10,marginBottom:32}}>
        <div style={{width:32,height:2,background:'var(--red)',borderRadius:2}}/>
        <span style={{fontSize:11,fontWeight:600,letterSpacing:'0.2em',textTransform:'uppercase',color:'var(--gold)'}}>Asociación Bolivia Joven</span>
        <div style={{width:32,height:2,background:'var(--red)',borderRadius:2}}/>
      </div>
      <h1 className="font-anton hero-t2" style={{fontSize:'clamp(2.8rem,8vw,6.5rem)',lineHeight:1,letterSpacing:'0.02em',textTransform:'uppercase',color:'#fff',marginBottom:28}}>
        Jóvenes que{' '}
        <span style={{color:'var(--gold)',position:'relative',display:'inline-block'}}>
          transforman
        </span>
        <br/>el futuro de Bolivia
      </h1>
      <p className="hero-t3" style={{fontSize:'clamp(1rem,2.5vw,1.2rem)',color:'rgba(255, 255, 255, 1)',lineHeight:1.75,maxWidth:580,margin:'0 auto 44px',fontWeight:400}}>
        Conectamos jóvenes con proyectos de impacto social, oportunidades de liderazgo y una red que trasciende fronteras.
      </p>
      <div className="hero-t4" style={{display:'flex',gap:16,justifyContent:'center',flexWrap:'wrap'}}>
        <a href="#unirse" className="btn-primary" style={{fontSize:15,padding:'14px 36px'}}>Únete <ArrowRightIcon size={16}/></a>
        <a href="#proyectos" className="btn-outline" style={{fontSize:15,padding:'14px 36px'}}>Ver Proyectos</a>
      </div>
      <div style={{marginTop:72,opacity:0.35,animation:'blob2 2.5s ease-in-out infinite'}}>
        <ChevronDownIcon size={22} style={{display:'inline-block'}}/>
      </div>
    </div>
  </section>
  );
};

// ═══════════════════════════════════════════════════════════════════
// MISSION & VISION
// ═══════════════════════════════════════════════════════════════════
const Mission = () => {
  const ref = useRef(null);
  useReveal(ref);
  return (
    <section id="equipo" ref={ref} className="section-base" style={{background:'var(--bg)',borderTop:'1px solid var(--border)'}}>
      <div className="section-inner">
        <div style={{maxWidth:680,marginBottom:64}}>
          <div className="reveal gold-line"/>
          <h2 className="reveal reveal-d1 font-anton" style={{fontSize:'clamp(2rem,5vw,3.5rem)',lineHeight:1.1,textTransform:'uppercase',color:'#fff',marginBottom:24}}>
            Una organización construida<br/><span style={{color:'var(--gold)'}}>por y para</span> jóvenes bolivianos
          </h2>
          <p className="reveal reveal-d2" style={{fontSize:'1.05rem',lineHeight:1.8,color:'rgba(255,255,255,0.65)',maxWidth:580}}>
            Bolivia Joven es una red de estudiantes comprometidos con el desarrollo social del país. A través de proyectos colaborativos, formación en liderazgo y alianzas estratégicas, creamos oportunidades reales de impacto.
          </p>
        </div>
        <div style={{display:'grid',gridTemplateColumns:'repeat(auto-fit,minmax(280px,1fr))',gap:24}}>
          {[
            {letter:'M',label:'Misión',accent:'var(--red)',bg:'rgba(162,0,50,0.15)',borderAccent:'rgba(162,0,50,0.1)',text:'Construir, fortalecer y conectar a jóvenes líderes, impulsando su desarrollo personal y social a través de espacios de participación, aprendizaje y acción.',delay:'reveal-d2',hoverClass:'card-red-hover'},
            {letter:'V',label:'Visión',accent:'var(--gold)',bg:'rgba(233,211,108,0.12)',borderAccent:'rgba(233,211,108,0.08)',text:'Establecernos como la principal asociación referente en liderazgo juvenil en Bolivia, conocida por su profesionalismo, inclusión y cohesión.',delay:'reveal-d3',hoverClass:'card-gold-hover'},
          ].map(c=>(
            <div key={c.label} className={`reveal ${c.delay} card-lift ${c.hoverClass}`}
              style={{background:'var(--card)',borderRadius:16,border:'1px solid var(--border)',padding:'40px 36px',position:'relative',overflow:'hidden'}}>
              <div style={{position:'absolute',top:0,left:0,right:0,height:3,background:c.accent}}/>
              <div style={{width:44,height:44,borderRadius:10,background:c.bg,display:'flex',alignItems:'center',justifyContent:'center',marginBottom:24}}>
                <span className="font-anton" style={{color:c.accent,fontSize:18}}>{c.letter}</span>
              </div>
              <h3 className="font-anton" style={{fontSize:'1.6rem',letterSpacing:'0.04em',color:'#fff',marginBottom:16,textTransform:'uppercase'}}>{c.label}</h3>
              <p style={{fontSize:'0.95rem',lineHeight:1.8,color:'rgba(255,255,255,0.65)'}}>{c.text}</p>
              <div style={{position:'absolute',bottom:-40,right:-40,width:120,height:120,borderRadius:'50%',border:`1px solid ${c.borderAccent}`}}/>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
};

// ═══════════════════════════════════════════════════════════════════
// STATS
// ═══════════════════════════════════════════════════════════════════
const StatCard = ({icon:Icon,value,suffix,label,accent,bg}) => {
  const [started,setStarted] = useState(false);
  const ref = useRef(null);
  const count = useCountUp(value,2200,started);
  useEffect(()=>{
    const obs = new IntersectionObserver(([e])=>{if(e.isIntersecting){setStarted(true);obs.disconnect();}},{threshold:0.4});
    if(ref.current) obs.observe(ref.current);
    return ()=>obs.disconnect();
  },[]);
  return (
    <div ref={ref} className="card-lift" style={{background:'var(--card)',borderRadius:16,border:'1px solid var(--border)',padding:'44px 36px',textAlign:'center',position:'relative',overflow:'hidden',transition:'transform 0.35s ease,box-shadow 0.35s ease,border-color 0.35s ease'}}>
      <div style={{position:'absolute',top:0,left:'20%',right:'20%',height:2,background:accent,borderRadius:'0 0 4px 4px',opacity:0.8}}/>
      <div style={{width:56,height:56,borderRadius:14,background:`${accent}18`,display:'flex',alignItems:'center',justifyContent:'center',margin:'0 auto 24px',border:`1px solid ${accent}30`}}>
        <Icon size={26} style={{color:accent}}/>
      </div>
      <div className="font-anton" style={{fontSize:'clamp(3rem,6vw,4.5rem)',lineHeight:1,color:'#fff',marginBottom:8,letterSpacing:'-0.01em'}}>
        <span>{count.toLocaleString()}</span><span style={{color:accent}}>{suffix}</span>
      </div>
      <p style={{fontSize:'0.9rem',fontWeight:500,letterSpacing:'0.08em',textTransform:'uppercase',color:'rgba(255,255,255,0.45)'}}>{label}</p>
      <div className="font-anton" style={{position:'absolute',bottom:-20,right:16,fontSize:'7rem',color:'rgba(255,255,255,0.05)',lineHeight:1,userSelect:'none',pointerEvents:'none'}}>{bg}</div>
    </div>
  );
};

const Stats = () => {
  const ref = useRef(null);
  useReveal(ref);
  return (
    <section ref={ref} className="section-base" style={{background:'var(--bg2)',borderTop:'1px solid var(--border)',borderBottom:'1px solid var(--border)'}}>
      <div className="section-inner">
        <div style={{textAlign:'center',marginBottom:64}}>
          <div className="reveal" style={{display:'flex',justifyContent:'center',marginBottom:12}}><div className="gold-line"/></div>
          <h2 className="reveal reveal-d1 font-anton" style={{fontSize:'clamp(1.8rem,4vw,3rem)',textTransform:'uppercase',color:'#fff'}}>El impacto que generamos</h2>
        </div>
        <div style={{display:'grid',gridTemplateColumns:'repeat(auto-fit,minmax(260px,1fr))',gap:24}}>
          <StatCard icon={UsersIcon} value={500} suffix="+" label="Miembros Activos" accent="var(--red)" bg="B"/>
          <StatCard icon={SparklesIcon} value={15000} suffix="+" label="Personas Impactadas" accent="var(--gold)" bg="J"/>
          <StatCard icon={LayersIcon} value={35} suffix="+" label="Proyectos Realizados" accent="var(--green)" bg="⁠♡"/>
        </div>
      </div>
    </section>
  );
};

// ═══════════════════════════════════════════════════════════════════
// PROJECTS CAROUSEL
// ═══════════════════════════════════════════════════════════════════
const PROJECTS = [
  {id:1,title:'Cumbre Nacional de Liderazgo',desc:'Tres días de conferencias, talleres y networking que reúnen a 500 jóvenes líderes de los nueve departamentos de Bolivia para construir el futuro del país.',image:'https://images.unsplash.com/photo-1529156069898-49953e39b3ac?w=900&q=80',tag:'Liderazgo',tagColor:'var(--gold)',year:'2024'},
  {id:2,title:'Bolivia Digital 2025',desc:'Programa de alfabetización digital y emprendimiento tecnológico para jóvenes de comunidades rurales en Potosí, Oruro y Beni.',image:'https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=900&q=80',tag:'Tecnología',tagColor:'var(--green)',year:'2025'},
  {id:3,title:'Red de Mentores Bolivianos',desc:'Conectamos a profesionales establecidos a nivel nacional e internacional con jóvenes emprendedores que buscan orientación y acompañamiento personalizado.',image:'https://images.unsplash.com/photo-1488190211105-8b0e65b80b4e?w=900&q=80',tag:'Mentorship',tagColor:'var(--red)',year:'2025'},
  {id:4,title:'Voluntariado Comunitario',desc:'Iniciativas de impacto local en La Paz, Cochabamba y Santa Cruz donde nuestros miembros trabajan directamente con comunidades para generar cambio tangible.',image:'https://images.unsplash.com/photo-1523050854058-8df90110c9f1?w=900&q=80',tag:'Comunidad',tagColor:'var(--green)',year:'2024'},
  {id:5,title:'Círculo de Médicos Bolivia Joven',desc:'Consultas médicas gratuitas para jóvenes en situación de vulnerabilidad y jornadas laborales de inmersión clínica para estudiantes de medicina en alianza con especialistas comprometidos.',image:'https://images.unsplash.com/photo-1576091160550-2173dba999ef?w=900&q=80',tag:'Salud',tagColor:'var(--green)',year:'2026',href:'/proyectos/circulomedicos'},
];

const Projects = () => {
  const [cur,setCur] = useState(0);
  const [fading,setFading] = useState(false);
  const ref = useRef(null);
  useReveal(ref);
  const total = PROJECTS.length;
  const go = dir => {
    if(fading) return;
    setFading(true);
    setTimeout(()=>{ setCur(c=>(c+dir+total)%total); setFading(false); },280);
  };
  const proj = PROJECTS[cur];
  return (
    <section id="proyectos" ref={ref} className="section-base" style={{background:'var(--bg)'}}>
      <div className="section-inner">
        <div style={{display:'flex',alignItems:'flex-end',justifyContent:'space-between',marginBottom:52,flexWrap:'wrap',gap:24}}>
          <div>
            <div className="reveal gold-line" style={{background:'var(--green)'}}/>
            <h2 className="reveal reveal-d1 font-anton" style={{fontSize:'clamp(2rem,5vw,3.2rem)',textTransform:'uppercase',color:'#fff',lineHeight:1.1}}>
              Proyectos <span style={{color:'var(--green)'}}>destacados</span>
            </h2>
          </div>
          <div className="reveal reveal-d2" style={{display:'flex',gap:12}}>
            {[-1,1].map((d,i)=>(
              <button key={i} onClick={()=>go(d)} aria-label={d<0?'Anterior':'Siguiente'}
                style={{width:48,height:48,borderRadius:'50%',border:'1px solid var(--border2)',background:'var(--card)',display:'flex',alignItems:'center',justifyContent:'center',cursor:'pointer',color:'#fff',transition:'border-color 0.3s,background 0.3s'}}
                onMouseEnter={e=>{e.currentTarget.style.borderColor='var(--red)';e.currentTarget.style.background='rgba(162,0,50,0.15)';}}
                onMouseLeave={e=>{e.currentTarget.style.borderColor='var(--border2)';e.currentTarget.style.background='var(--card)';}}>
                {d<0?<ChevronLeftIcon size={20}/>:<ChevronRightIcon size={20}/>}
              </button>
            ))}
          </div>
        </div>
        <div className="reveal reveal-d2" style={{borderRadius:20,overflow:'hidden',border:'1px solid var(--border)',background:'var(--card)',display:'grid',gridTemplateColumns:'repeat(auto-fit,minmax(280px,1fr))',opacity:fading?0:1,transition:'opacity 0.28s ease'}}>
          <div style={{position:'relative',overflow:'hidden',minHeight:300}}>
            <img src={proj.image} alt={proj.title} style={{width:'100%',height:'100%',minHeight:300,objectFit:'cover',display:'block',transition:'transform 0.6s ease'}} onError={e=>{e.target.style.background='#222';}} className="proj-img"/>
            <div style={{position:'absolute',inset:0,background:'linear-gradient(135deg,rgba(14,14,14,0.2) 0%,rgba(14,14,14,0.6) 100%)'}}/>
            <div style={{position:'absolute',top:20,left:20,background:'rgba(14,14,14,0.8)',backdropFilter:'blur(8px)',border:'1px solid var(--border2)',padding:'4px 12px',borderRadius:20,fontSize:12,fontWeight:600,color:'rgba(255,255,255,0.7)',letterSpacing:'0.06em'}}>{proj.year}</div>
          </div>
          <div style={{padding:'48px 44px',display:'flex',flexDirection:'column',justifyContent:'center'}}>
            <div style={{display:'inline-flex',alignItems:'center',gap:8,marginBottom:20,width:'fit-content'}}>
              <div style={{width:8,height:8,borderRadius:'50%',background:proj.tagColor}}/>
              <span style={{fontSize:11,fontWeight:600,letterSpacing:'0.15em',textTransform:'uppercase',color:proj.tagColor}}>{proj.tag}</span>
            </div>
            <h3 className="font-anton" style={{fontSize:'clamp(1.8rem,3.5vw,2.6rem)',textTransform:'uppercase',color:'#fff',lineHeight:1.1,marginBottom:20}}>{proj.title}</h3>
            <p style={{fontSize:'0.97rem',lineHeight:1.8,color:'rgba(255,255,255,0.6)',marginBottom:36}}>{proj.desc}</p>
            <a href={proj.href||'#'} className="btn-primary" style={{width:'fit-content'}}>Ver más <ArrowRightIcon size={15}/></a>
          </div>
        </div>
        <div style={{display:'flex',justifyContent:'center',gap:10,marginTop:32}}>
          {PROJECTS.map((_,i)=>(
            <button key={i} onClick={()=>{if(!fading){setFading(true);setTimeout(()=>{setCur(i);setFading(false);},280);}}}
              style={{width:i===cur?28:8,height:8,borderRadius:4,background:i===cur?'var(--red)':'var(--border2)',border:'none',cursor:'pointer',padding:0,transition:'width 0.3s,background 0.3s'}}
              aria-label={`Proyecto ${i+1}`}/>
          ))}
        </div>
      </div>
    </section>
  );
};

// ═══════════════════════════════════════════════════════════════════
// PARTNERS TICKER
// ═══════════════════════════════════════════════════════════════════
const PARTNERS = [
  {name:'Soluciones Inteligentes',src:'assets/solucionesinteligentes.png'},
  {name:'Federación Jóvenes Bolivia',src:'assets/fedjovenesbol.png'},
  {name:'WBW',src:'assets/WBW.png'},
  {name:'OP Sonrisa',src:'assets/OPsonrisa.png'},
  {name:'Cuida tu Voto',src:'assets/cuidemosvoto.png'},
  {name:'Compass',src:'assets/compass.png'},
  {name:'Aspade',src:'assets/aspade.webp'},
  {name:'Casa Sergio',src:'assets/casasergio.png'},
  {name:'Jubileo',src:'assets/jubileo.png'},
  {name:'Aspire',src:'assets/aspire.png'},
  {name:'Presente',src:'assets/presente.jfif'},
  {name:'Peace Jam',src:'assets/peacejam.png'},
];

const Partners = () => {
  const ref = useRef(null);
  useReveal(ref);
  const doubled = [...PARTNERS,...PARTNERS];
  return (
    <section ref={ref} style={{background:'var(--bg2)',borderTop:'1px solid var(--border)',borderBottom:'1px solid var(--border)',padding:'72px 0'}}>
      <div style={{textAlign:'center',marginBottom:52,padding:'0 24px'}}>
        <div className="reveal" style={{display:'flex',justifyContent:'center',marginBottom:12}}><div className="gold-line"/></div>
        <h2 className="reveal reveal-d1 font-anton" style={{fontSize:'clamp(1.8rem,4vw,3rem)',textTransform:'uppercase',color:'#fff'}}>
          Nuestros <span style={{color:'var(--gold)'}}>Aliados</span>
        </h2>
        <p className="reveal reveal-d2" style={{fontSize:'0.95rem',color:'rgba(255,255,255,0.5)',marginTop:12,maxWidth:480,margin:'12px auto 0'}}>
          Organizaciones que creen en el potencial de la juventud boliviana
        </p>
      </div>
      <div style={{overflow:'hidden',position:'relative'}}>
        <div style={{position:'absolute',top:0,left:0,bottom:0,width:140,zIndex:2,background:'linear-gradient(90deg,var(--bg2) 0%,transparent 100%)',pointerEvents:'none'}}/>
        <div style={{position:'absolute',top:0,right:0,bottom:0,width:140,zIndex:2,background:'linear-gradient(270deg,var(--bg2) 0%,transparent 100%)',pointerEvents:'none'}}/>
        <div className="ticker-track" style={{display:'flex',alignItems:'center',height:96}}>
          {doubled.map((p,i)=>(
            <div key={i} style={{flexShrink:0,display:'flex',alignItems:'center',padding:'0 48px',opacity:0.6,transition:'opacity 0.3s',cursor:'default'}}
              onMouseEnter={e=>e.currentTarget.style.opacity='1'}
              onMouseLeave={e=>e.currentTarget.style.opacity='0.6'}>
              <img src={p.src} alt={p.name} style={{height:100,width:'auto',maxWidth:130,objectFit:'contain',display:'block'}}/>
            </div>
          ))}
        </div>
      </div>
      <div style={{display:'flex',justifyContent:'center',gap:8,marginTop:52,padding:'0 24px'}}>
        <div style={{flex:1,maxWidth:120,height:1,background:'var(--border)',alignSelf:'center'}}/>
        <div style={{width:6,height:6,background:'var(--red)',borderRadius:'50%',alignSelf:'center'}}/>
        <div style={{width:6,height:6,background:'var(--gold)',borderRadius:'50%',alignSelf:'center'}}/>
        <div style={{width:6,height:6,background:'var(--green)',borderRadius:'50%',alignSelf:'center'}}/>
        <div style={{flex:1,maxWidth:120,height:1,background:'var(--border)',alignSelf:'center'}}/>
      </div>
    </section>
  );
};

// ═══════════════════════════════════════════════════════════════════
// FAQ
// ═══════════════════════════════════════════════════════════════════
const FAQS = [
  {q:'¿Qué es Bolivia Joven?',a:'Bolivia Joven es una asociación sin fines de lucro dedicada a fomentar la participación activa de los jóvenes en el país. Fue fundada el 10 de diciembre de 2023 por cinco personas con el objetivo de crear un movimiento referente que impulse a la juventud a convertirse en agentes de cambio.'},
  {q:'¿Qué significa ser miembro y qué implica?',a:'Bolivia Joven es una asociación sin fines de lucro dedicada a fomentar la participación activa de los jóvenes en el país. Fue fundada el 10 de diciembre de 2023 por cinco personas con el objetivo de crear un movimiento referente que impulse a la juventud a convertirse en agentes de cambio.Ser miembro de Bolivia Joven significa formar parte de un movimiento de liderazgo juvenil que busca transformar el talento de los jóvenes bolivianos en un impacto positivo para la sociedad. Implica un compromiso con el desarrollo del país, actuando como un agente de cambio bajo principios democráticos y de responsabilidad ciudadana.'},
  {q:'¿Qué beneficios tiene convertirte en miembro?',a:'Te ofrecemos la oportunidad de formarte como un agente de cambio mediante el acceso a programas de liderazgo, mentorías con expertos y talleres de capacitación técnica. Los afiliados se integran a una red nacional de networking con jóvenes líderes y organizaciones aliadas, participando activamente en proyectos de impacto social en áreas de medio ambiente, cultura y emprendimiento. Aunque es una labor voluntaria sin remuneración económica, los beneficios se centran en el crecimiento profesional, el reconocimiento formal de su trayectoria y el sentido de pertenencia a un movimiento democrático e independiente que busca transformar el futuro de Bolivia.'},
  {q:'¿Cómo es el proceso de postulación?',a:'Las inscripciones a la asociación se abren cada cierto tiempo, durante el periodo de convocatoria puedes enviar tu postulación. Si cumples con el perfil que buscamos, podrás ingresar sin problema. Dentro del sitio web, puedes enviarnos tu información y te notificaremos cuando se realicen las próximas convocatorias.'},
];

const AccItem = ({item,index,openIdx,setOpen}) => {
  const isOpen = openIdx===index;
  return (
    <div style={{borderBottom:'1px solid var(--border)'}}>
      <button onClick={()=>setOpen(isOpen?-1:index)}
        style={{width:'100%',background:'none',border:'none',cursor:'pointer',padding:'28px 0',display:'flex',alignItems:'center',justifyContent:'space-between',gap:20,textAlign:'left'}}>
        <span style={{fontSize:'1.05rem',fontWeight:600,color:isOpen?'#fff':'rgba(255,255,255,0.8)',lineHeight:1.4,transition:'color 0.3s',fontFamily:"'Poppins',sans-serif"}}>{item.q}</span>
        <div style={{width:36,height:36,borderRadius:8,flexShrink:0,background:isOpen?'var(--red)':'var(--card)',border:`1px solid ${isOpen?'var(--red)':'var(--border2)'}`,display:'flex',alignItems:'center',justifyContent:'center',transition:'background 0.3s,border-color 0.3s,transform 0.3s',transform:isOpen?'rotate(45deg)':'rotate(0deg)',color:'#fff'}}>
          <PlusIcon size={16}/>
        </div>
      </button>
      <div className={`acc-content ${isOpen?'open':''}`}>
        <p style={{fontSize:'0.95rem',lineHeight:1.85,color:'rgba(255,255,255,0.6)',paddingBottom:28,fontFamily:"'Poppins',sans-serif"}}>{item.a}</p>
      </div>
    </div>
  );
};

const FAQ = () => {
  const [openIdx,setOpen] = useState(-1);
  const ref = useRef(null);
  useReveal(ref);
  return (
    <section ref={ref} className="section-base" style={{background:'var(--bg)'}}>
      <div className="section-inner">
        <div style={{display:'grid',gridTemplateColumns:'repeat(auto-fit,minmax(280px,1fr))',gap:64,alignItems:'start'}}>
          <div>
            <div className="reveal gold-line" style={{background:'var(--red)'}}/>
            <h2 className="reveal reveal-d1 font-anton" style={{fontSize:'clamp(2rem,4.5vw,3.2rem)',textTransform:'uppercase',color:'#fff',lineHeight:1.1,marginBottom:20}}>
              Preguntas<br/><span style={{color:'var(--red)'}}>frecuentes</span>
            </h2>
            <p className="reveal reveal-d2" style={{fontSize:'0.95rem',color:'rgba(255,255,255,0.5)',lineHeight:1.75,marginBottom:32}}>
              Todo lo que necesitas saber antes de dar el paso. Si tienes más dudas, escríbenos.
            </p>
          </div>
          <div className="reveal reveal-d2">
            {FAQS.map((item,i)=><AccItem key={i} item={item} index={i} openIdx={openIdx} setOpen={setOpen}/>)}
          </div>
        </div>
      </div>
    </section>
  );
};

// ═══════════════════════════════════════════════════════════════════
// CTA
// ═══════════════════════════════════════════════════════════════════
const CTA = () => {
  const ref = useRef(null);
  useReveal(ref);
  return (
    <section id="unirse" ref={ref} style={{position:'relative',overflow:'hidden'}}>
      <div style={{position:'absolute',inset:0,background:'#0e0e0e'}}>
        <div style={{position:'absolute',inset:0,background:'linear-gradient(135deg,rgba(162,0,50,0.85) 0%,rgba(180,14,40,0.7) 35%,rgba(20,20,20,0.0) 70%)'}}/>
        <div style={{position:'absolute',top:'-30%',right:'-10%',width:'55vw',height:'55vw',background:'radial-gradient(circle,rgba(233,211,108,0.12) 0%,transparent 65%)'}}/>
        <div style={{position:'absolute',inset:0,backgroundImage:'repeating-linear-gradient(-55deg,transparent,transparent 40px,rgba(255,255,255,0.015) 40px,rgba(255,255,255,0.015) 41px)'}}/>
        <div style={{position:'absolute',right:-80,bottom:-80,width:400,height:400,border:'1px solid rgba(233,211,108,0.08)',transform:'rotate(45deg)'}}/>
        <div style={{position:'absolute',right:40,bottom:40,width:250,height:250,border:'1px solid rgba(233,211,108,0.05)',transform:'rotate(45deg)'}}/>
        <div style={{position:'absolute',inset:0,background:'linear-gradient(180deg,transparent 0%,rgba(10,10,10,0.35) 100%)'}}/>
      </div>
      <div className="section-base" style={{position:'relative',zIndex:2}}>
        <div className="section-inner" style={{textAlign:'center'}}>
          <div className="reveal" style={{display:'inline-flex',alignItems:'center',gap:10,marginBottom:28}}>
          </div>
          <h2 className="reveal reveal-d1 font-anton" style={{fontSize:'clamp(2.5rem,7vw,5.5rem)',textTransform:'uppercase',color:'#fff',lineHeight:1,marginBottom:24,textShadow:'0 4px 40px rgba(0,0,0,0.5)'}}>
            Postúlate hoy y<br/><span style={{color:'var(--gold)'}}>forma parte</span><br/>del cambio
          </h2>
          <p className="reveal reveal-d2" style={{fontSize:'1.1rem',color:'rgba(255,255,255,0.75)',lineHeight:1.75,maxWidth:480,margin:'0 auto 48px'}}>
            Te notificaremos cuando abran las inscripciones. Sé el primero en saber.
          </p>
          <a href="/unete" className="reveal reveal-d3 btn-primary"
            style={{fontSize:'1rem',padding:'14px 36px',background:'var(--gold)',color:'#141414',fontWeight:700,letterSpacing:'0.04em',boxShadow:'0 0 40px rgba(233,211,108,0.35)'}}
            onMouseEnter={e=>{e.currentTarget.style.background='#f5e07a';e.currentTarget.style.boxShadow='0 8px 40px rgba(233,211,108,0.55)';}}
            onMouseLeave={e=>{e.currentTarget.style.background='var(--gold)';e.currentTarget.style.boxShadow='0 0 40px rgba(233,211,108,0.35)';}}>
            Únete <ArrowRightIcon size={17}/>
          </a>
        </div>
      </div>
    </section>
  );
};

// ═══════════════════════════════════════════════════════════════════
// FOOTER
// ═══════════════════════════════════════════════════════════════════
const Footer = ({ page }) => {
  const yr = new Date().getFullYear();
  const links = [
    {label:'Inicio',         href:'/'},
    {label:'Proyectos',      href:'/proyectos'},
    {label:'Nuestro Equipo', href:'/equipo'},
    {label:'Contacto',       href:'/contacto'},
    {label:'Únete',          href:'/unete'},
  ];
  const socials = [
    {Icon:FacebookIcon, href:'https://www.facebook.com/p/Asociación-Bolivia-Joven-61555223188163/', label:'Facebook'},
    {Icon:InstagramIcon,href:'https://www.instagram.com/bolivia_joven/', label:'Instagram'},
    {Icon:TikTokIcon,   href:'https://www.tiktok.com/@bolivia.joven', label:'TikTok'},
    {Icon:LinkedInIcon, href:'https://www.linkedin.com/company/asociación-bolivia-joven', label:'LinkedIn'},
  ];
  const SBtn = ({Icon,href,label}) => (
    <a href={href} aria-label={label} target="_blank" rel="noopener noreferrer"
      style={{width:40,height:40,borderRadius:8,border:'1px solid var(--border2)',display:'flex',alignItems:'center',justifyContent:'center',color:'rgba(255,255,255,0.5)',textDecoration:'none',transition:'border-color 0.3s,color 0.3s,background 0.3s'}}
      onMouseEnter={e=>{e.currentTarget.style.borderColor='var(--red)';e.currentTarget.style.color='#fff';e.currentTarget.style.background='rgba(162,0,50,0.15)';}}
      onMouseLeave={e=>{e.currentTarget.style.borderColor='var(--border2)';e.currentTarget.style.color='rgba(255,255,255,0.5)';e.currentTarget.style.background='transparent';}}>
      <Icon size={17}/>
    </a>
  );
  return (
    <footer id="contacto" style={{background:'#0e0e0e',borderTop:'1px solid var(--border)'}}>
      <div style={{maxWidth:1152,margin:'0 auto',padding:'72px 24px 48px'}}>
        <div style={{display:'grid',gridTemplateColumns:'repeat(auto-fit,minmax(220px,1fr))',gap:48,marginBottom:56}}>
          {/* Brand */}
          <div>
            <a href="/" style={{display:'inline-flex',alignItems:'center',gap:12,textDecoration:'none',marginBottom:20}}>
              <img src="/assets/logo.png" alt="Bolivia Joven" style={{height:100,width:'auto',display:'block',flexShrink:0}}/>
            </a>
            <p style={{fontSize:'0.9rem',lineHeight:1.75,color:'rgba(255,255,255,0.45)',marginBottom:24,maxWidth:240}}>Inspirando liderazgo,<br/>impulsando el cambio.</p>
            <div style={{display:'flex',gap:10,flexWrap:'wrap'}}>
              {socials.map(s=><SBtn key={s.label} {...s}/>)}
            </div>
          </div>
          {/* Nav */}
          <div>
            <h4 className="font-anton" style={{fontSize:'0.85rem',letterSpacing:'0.15em',textTransform:'uppercase',color:'rgba(255,255,255,0.35)',marginBottom:20}}>Navegación</h4>
            <nav style={{display:'flex',flexDirection:'column',gap:12}}>
              {links.map(l=>(
                <a key={l.label} href={l.href} style={{fontSize:'0.95rem',fontWeight:500,color:'rgba(255,255,255,0.6)',textDecoration:'none',transition:'color 0.3s'}}
                  onMouseEnter={e=>e.currentTarget.style.color='var(--gold)'} onMouseLeave={e=>e.currentTarget.style.color='rgba(255,255,255,0.6)'}>{l.label}</a>
              ))}
            </nav>
          </div>
          {/* Contact */}
          <div>
            <h4 className="font-anton" style={{fontSize:'0.85rem',letterSpacing:'0.15em',textTransform:'uppercase',color:'rgba(255,255,255,0.35)',marginBottom:20}}>Contacto</h4>
            <div style={{display:'flex',flexDirection:'column',gap:16}}>
              {[
                {href:'https://wa.me/59161013020',Icon:PhoneIcon,accent:'var(--red)',bg:'rgba(162,0,50,0.12)',border:'rgba(162,0,50,0.2)',label:'WHATSAPP',val:'+591 61013020'},
                {href:'mailto:boliviajnacional@gmail.com',Icon:MailIcon,accent:'var(--gold)',bg:'rgba(233,211,108,0.08)',border:'rgba(233,211,108,0.15)',label:'EMAIL',val:'boliviajnacional@gmail.com'},
              ].map(c=>(
                <a key={c.label} href={c.href} style={{display:'flex',alignItems:'center',gap:12,textDecoration:'none',transition:'color 0.3s',color:'rgba(255,255,255,0.6)'}}
                  onMouseEnter={e=>e.currentTarget.style.color='#fff'} onMouseLeave={e=>e.currentTarget.style.color='rgba(255,255,255,0.6)'}>
                  <div style={{width:36,height:36,borderRadius:8,background:c.bg,border:`1px solid ${c.border}`,display:'flex',alignItems:'center',justifyContent:'center',flexShrink:0}}>
                    <c.Icon size={16} style={{color:c.accent}}/>
                  </div>
                  <div>
                    <div style={{fontSize:11,color:'rgba(255,255,255,0.35)',marginBottom:2,letterSpacing:'0.06em'}}>{c.label}</div>
                    <div style={{fontSize:'0.9rem',fontWeight:500}}>{c.val}</div>
                  </div>
                </a>
              ))}
            </div>
          </div>
        </div>
        <div style={{borderTop:'1px solid var(--border)',paddingTop:28,display:'flex',alignItems:'center',justifyContent:'space-between',flexWrap:'wrap',gap:16}}>
          <p style={{fontSize:'0.82rem',color:'rgba(255,255,255,0.3)'}}>© {yr} Bolivia Joven. Todos los derechos reservados.</p>
          <p style={{fontSize:'0.82rem',color:'rgba(255,255,255,0.25)'}}>Hecho con pasión desde Bolivia 🇧🇴</p>
        </div>
      </div>
    </footer>
  );
};

// Export all to window
Object.assign(window, {
  Navbar, Hero, Mission, Stats, Projects, Partners, FAQ, CTA, Footer,
  useReveal,
  // icons — general
  UsersIcon, SparklesIcon, ArrowRightIcon, ChevronDownIcon,
  PhoneIcon, MailIcon, MapPinIcon,
  FacebookIcon, InstagramIcon, LinkedInIcon, TikTokIcon,
  // icons — projects page
  SproutIcon, ZapIcon, AwardIcon, TrendingUpIcon, HandshakeIcon, GraduationIcon,
  // icons — join funnel
  BookOpenIcon, CoinsIcon, CheckCircleIcon, InfoIcon, RocketIcon, BellIcon, ClockIcon,
  // icons — medicos page
  HeartIcon, StethoscopeIcon, ClipboardIcon, CalendarIcon, BuildingIcon, CheckIcon, MicroscopeIcon, MapIcon,
});
