/* ============================================================
   BALEARIC GROOVE v3 — parts-v3.jsx
   Design System: Yellow #F1E850 · Red #E42322 · Deep Glass
   ============================================================ */
const { useState, useEffect, useContext, createContext } = React;

const LangContext = createContext({ lang: 'en', setLang: () => {} });
function useLang() { return useContext(LangContext); }

/* ── Translations ── */
const T = {
  en: {
    est: 'Est. 2026 · Ibiza · Balearic Islands',
    heroH1: 'Mediterranean soul,', heroH2: 'after midnight.',
    heroSub: 'An independent record label for Balearic Downtempo & Deep House. We sign feeling over formula — the warm, the patient, the deep.',
    heroCta1: 'Explore Releases', heroCta2: 'Submit Music',
    navReleases: 'Releases', navArtists: 'Artists', navSound: 'Sound', navDemo: 'Submit Music',
    maniEye: 'The Sound',
    maniH: ['Not just a label.','A character with','something to say.'],
    maniP1: "Balearic Groove was born in a rain-soaked alley with a vinyl in one hand and nothing to prove. We don't chase the charts — we chase the feeling of the last hour before sunrise, when the island goes quiet and the bass goes deep.",
    maniP2: 'Every release is curated, mastered and pressed with intention. Mediterranean warmth, underground edge, zero compromise.',
    statFounded:'Founded', statReleases:'Releases', statArtists:'Artists on roster',
    relEye:'Discography', relH:'Latest', relHem:'Releases', filterAll:'All',
    artEye:'The Roster', artH:'Our', artHem:'Artists', artJoin:'Join the roster',
    artView:'View Profile', artReleases:'releases',
    ctaEye:'Open Submissions', ctaH:'Is your music', ctaHem:'the right fit?',
    ctaSub:"We listen to every demo. If it fits our sound, we'll be in touch within 4–6 weeks.",
    ctaBtn:'Send Your Music',
    demoEye:'A&R · demos@balearicgroove.com', demoH:'Send us your', demoHem:'music',
    demoSub:"We listen to every demo. No connections needed — just the right feeling.",
    fName:'Your Name', fEmail:'Email', fArtist:'Artist / Project Name',
    fGenre:'Genre / Style', fGenreP:'Select a style…', fLink:'Demo Link',
    fLinkP:'SoundCloud private / Dropbox / WeTransfer URL',
    fMsg:'Message', fMsgP:'Tell us about your sound…', fMsgOpt:'(optional)',
    fGdpr:'I agree to Balearic Groove storing my submission to review it, in line with the',
    fPrivacy:'Privacy Policy', fSubmit:'Submit Demo', fSending:'Sending…', fReply:'Avg. reply · 4–6 weeks',
    r1t:'Every demo gets heard', r1s:'No gatekeeping. A human listens to all of it.',
    r2t:'Artist-first deals', r2s:'Fair splits, full credit, real promo behind every release.',
    r3t:'A real home', r3s:"Join a tight roster, not an algorithm's playlist.",
    soundTags:['Balearic','Downtempo','Deep House','Organic','Sunset','Dub','Analog warmth','120–122 BPM'],
    faq:[
      ['What do you listen for?','Feeling first. We want originality, warmth and a strong sense of mood over technical perfection. Mediterranean spirit always wins.'],
      ['How should I send my demo?','A private SoundCloud, Dropbox or WeTransfer link to 1–3 of your best tracks. No zip files, please.'],
      ["Do you reply to everyone?","We genuinely listen to every demo. If it fits we reach out within 4–6 weeks. Silence just means it wasn't the right moment."],
    ],
    successH:'Demo received.', successW:'4–6 weeks', successCta:'Back to the music',
    successP:"It's spinning on our deck right now. We'll get back to you within",
    footDesc:'Mediterranean Downtempo & Deep House. Pressed with intention in Ibiza, Balearic Islands.',
    footExplore:'Explore', footListen:'Listen', footNews:'Newsletter',
    footNewsSub:'Sunset sessions & new releases. No spam.',
    footCopy:'© 2026 Balearic Groove Records · Made with salt air in',
    streamSoon:'SoundCloud · streaming soon', featTag:'Featured', streamNow:'Stream Now',
    viewTracklist:'View tracklist', joinRoster:'Join the roster',
    errReq:'Required', errEmail:'Valid email required', errPick:'Pick one',
    errLink:'Add a full link (https://…)', errConsent:'Consent required',
  },
  es: {
    est: 'Est. 2026 · Ibiza · Islas Baleares',
    heroH1: 'Alma mediterránea,', heroH2: 'después de medianoche.',
    heroSub: 'Un sello discográfico independiente de Balearic Downtempo y Deep House. Firmamos sentimiento, no fórmula — lo cálido, lo paciente, lo profundo.',
    heroCta1: 'Explorar Lanzamientos', heroCta2: 'Mandar Música',
    navReleases:'Lanzamientos', navArtists:'Artistas', navSound:'Sonido', navDemo:'Mandar Música',
    maniEye:'El Sonido',
    maniH:['No solo un sello.','Un personaje con','algo que decir.'],
    maniP1:'Balearic Groove nació en un callejón bajo la lluvia, con un vinilo en la mano y nada que demostrar. No perseguimos las listas — perseguimos ese feeling de la última hora antes del amanecer, cuando la isla enmudece y el bajo se hace profundo.',
    maniP2:'Cada lanzamiento es curado, masterizado y prensado con intención. Calidez mediterránea, filo underground, cero compromiso.',
    statFounded:'Fundado', statReleases:'Lanzamientos', statArtists:'Artistas en roster',
    relEye:'Discografía', relH:'Últimos', relHem:'Lanzamientos', filterAll:'Todos',
    artEye:'El Roster', artH:'Nuestros', artHem:'Artistas', artJoin:'Únete al roster',
    artView:'Ver Perfil', artReleases:'lanzamientos',
    ctaEye:'Convocatoria Abierta', ctaH:'¿Tu música es', ctaHem:'lo que buscamos?',
    ctaSub:'Escuchamos cada demo. Si encaja con nuestro sonido, te contactamos en 4–6 semanas.',
    ctaBtn:'Mandar Música',
    demoEye:'A&R · demos@balearicgroove.com', demoH:'Mándanos tu', demoHem:'música',
    demoSub:'Escuchamos cada demo. Sin enchufes — solo el feeling correcto.',
    fName:'Tu Nombre', fEmail:'Correo Electrónico', fArtist:'Nombre Artístico / Proyecto',
    fGenre:'Género / Estilo', fGenreP:'Elige un estilo…', fLink:'Enlace al Demo',
    fLinkP:'SoundCloud privado / Dropbox / URL WeTransfer',
    fMsg:'Mensaje', fMsgP:'Cuéntanos sobre tu sonido…', fMsgOpt:'(opcional)',
    fGdpr:'Acepto que Balearic Groove guarde mi envío para revisarlo, conforme a la',
    fPrivacy:'Política de Privacidad', fSubmit:'Enviar Demo', fSending:'Enviando…', fReply:'Resp. media · 4–6 semanas',
    r1t:'Cada demo se escucha', r1s:'Sin filtros. Una persona real escucha todo.',
    r2t:'Contratos artista-primero', r2s:'Reparto justo, crédito completo, promo real.',
    r3t:'Un hogar de verdad', r3s:"Únete a un roster pequeño, no a la playlist de un algoritmo.",
    soundTags:['Balearic','Downtempo','Deep House','Orgánico','Atardecer','Dub','Calidez analógica','120–122 BPM'],
    faq:[
      ['¿Qué buscáis?','El feeling primero. Queremos originalidad, calidez y un fuerte sentido del mood por encima de la perfección técnica.'],
      ['¿Cómo envío mi demo?','Un enlace privado de SoundCloud, Dropbox o WeTransfer con 1–3 temas. Sin zips, por favor.'],
      ['¿Respondéis a todo el mundo?','Escuchamos cada demo. Si encaja, contactamos en 4–6 semanas. El silencio solo significa que no era el momento.'],
    ],
    successH:'Demo recibido.', successW:'4–6 semanas', successCta:'Volver a la música',
    successP:'Está girando en nuestra mesa. Te responderemos en',
    footDesc:'Downtempo Balear y Deep House. Prensado con intención en Ibiza, Islas Baleares.',
    footExplore:'Explorar', footListen:'Escuchar', footNews:'Newsletter',
    footNewsSub:'Sesiones de atardecer y nuevos lanzamientos. Sin spam.',
    footCopy:'© 2026 Balearic Groove Records · Hecho con aire salado en',
    streamSoon:'SoundCloud · próximamente', featTag:'Destacado', streamNow:'Escuchar Ahora',
    viewTracklist:'Ver tracklist', joinRoster:'Únete al roster',
    errReq:'Obligatorio', errEmail:'Email válido requerido', errPick:'Elige uno',
    errLink:'Añade un enlace completo (https://…)', errConsent:'Se requiere consentimiento',
  }
};

/* ── Icons ── */
const I = {
  insta: () => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7"><rect x="3" y="3" width="18" height="18" rx="5"/><circle cx="12" cy="12" r="4"/><circle cx="17.5" cy="6.5" r="1" fill="currentColor" stroke="none"/></svg>),
  soundcloud: () => (<svg viewBox="0 0 24 24" fill="currentColor"><path d="M1.2 14.3c0-.9.15-1.75.42-2.5.07-.18.3-.18.36 0 .26.74.4 1.58.4 2.5 0 .9-.14 1.74-.4 2.48-.07.18-.3.18-.36 0a7.4 7.4 0 0 1-.42-2.48zm2.1-1.3c0-.18.18-.3.34-.22.18.1.28.28.28.5l.06 1.02-.06 1.96c-.01.2-.16.34-.34.34s-.32-.15-.33-.34L3.3 14zm2-1.5c0-.2.16-.36.36-.36s.36.16.37.36l.1 2.5-.1 2.36a.37.37 0 0 1-.74 0l-.1-2.36.1-2.5zm2.05-.55c0-.22.18-.4.4-.4.21 0 .39.18.4.4l.08 3-.08 2.3a.4.4 0 0 1-.8 0l-.08-2.3.08-3zm2.1-.55c0-.24.2-.43.44-.43.23 0 .42.19.43.43l.07 3.6-.07 2.25a.44.44 0 0 1-.87 0l-.07-2.25.07-3.6zM12 9.5c.04-1.7.3-2.4.94-2.4.7 0 1.06 1 1.06 3v4.2c0 .27-.21.48-.48.48H12.5a.5.5 0 0 1-.5-.5V9.5zm2.6-1.7c.16-.1.34-.16.55-.16.66 0 1.2.55 1.2 1.23v5.2c0 .27-.22.48-.48.48h-.84a.48.48 0 0 1-.48-.48V7.9zm2.4 5.2c.3-.13.63-.2.98-.2 1.4 0 2.52 1.13 2.52 2.52S19.38 17.85 18 17.85h-1c-.27 0-.5-.22-.5-.5v-4c0-.05 0-.05.5-.35z"/></svg>),
  spotify: () => (<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2a10 10 0 1 0 0 20A10 10 0 0 0 12 2zm4.6 14.4a.62.62 0 0 1-.86.2c-2.34-1.43-5.28-1.75-8.75-.96a.62.62 0 1 1-.28-1.22c3.8-.87 7.06-.5 9.68 1.1.3.18.4.58.2.88zm1.23-2.74a.78.78 0 0 1-1.07.26c-2.68-1.65-6.76-2.13-9.93-1.17a.78.78 0 1 1-.45-1.5c3.62-1.08 8.12-.55 11.2 1.34.36.22.48.7.25 1.07zm.1-2.85C14.83 8.96 9.4 8.78 6.3 9.72a.94.94 0 1 1-.54-1.8c3.56-1.08 9.56-.87 13.13 1.25a.94.94 0 1 1-.96 1.62z"/></svg>),
  beatport: () => (<svg viewBox="0 0 24 24" fill="currentColor"><path d="M9.1 2v6.05c-.74-.5-1.63-.8-2.6-.8a4.65 4.65 0 1 0 4.65 4.65V6c.6 1.5 1.9 2.6 3.85 3v2.3c-2-.45-2.95-1.7-3-3.5 0 4.2 0 4 0 4a6.7 6.7 0 0 0 5.8 6.6V16c-2-.4-3.5-2.2-3.5-4.3 1 1.4 2.6 2.3 4.4 2.3v-2.1c-2 0-3.6-1.6-3.6-3.6V2H9.1zm-2.6 7.6a2.65 2.65 0 1 1 0 5.3 2.65 2.65 0 0 1 0-5.3z"/></svg>),
  play:    () => (<svg viewBox="0 0 24 24" fill="currentColor"><path d="M7 4.5v15l13-7.5z"/></svg>),
  pause:   () => (<svg viewBox="0 0 24 24" fill="currentColor"><rect x="6" y="4.5" width="4" height="15" rx="1"/><rect x="14" y="4.5" width="4" height="15" rx="1"/></svg>),
  prev:    () => (<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6 5v14h2.4V5zm12.5.5L9 12l9.5 6.5z"/></svg>),
  next:    () => (<svg viewBox="0 0 24 24" fill="currentColor"><path d="M18 5v14h-2.4V5zM5.5 5.5L15 12l-9.5 6.5z"/></svg>),
  vol:     () => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7"><path d="M4 9v6h3l4 4V5L7 9z" fill="currentColor" stroke="none"/><path d="M15.5 8.5a5 5 0 0 1 0 7M18 6a8.5 8.5 0 0 1 0 12"/></svg>),
  plus:    () => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M12 5v14M5 12h14"/></svg>),
  close:   () => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M6 6l12 12M18 6L6 18"/></svg>),
  arrow:   () => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M5 12h14M13 6l6 6-6 6"/></svg>),
  arrowUp: () => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M7 17L17 7M9 7h8v8"/></svg>),
  send:    () => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8"><path d="M21 3L3 10.5l6.5 2.5L12 21l9-18z"/><path d="M9.5 13L21 3"/></svg>),
  user:    () => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6"><circle cx="12" cy="8.5" r="3.5"/><path d="M5 20a7 7 0 0 1 14 0"/></svg>),
  music:   () => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>),
};

/* ── Data ── */
const SOCIAL = [
  { k:'insta',      label:'Instagram',  url:'https://instagram.com/balearicgroove'  },
  { k:'soundcloud', label:'SoundCloud', url:'https://soundcloud.com/balearicgroove' },
  { k:'spotify',    label:'Spotify',    url:'https://open.spotify.com/'             },
  { k:'beatport',   label:'Beatport',   url:'https://www.beatport.com/'             },
];
const RELEASES = [
  { id:'bg001', title:'Sunset Mirage',  artist:'Marina Solé', format:'EP',     date:'2026.05.18', c1:'#0f3340', c2:'#0a1b28', accent:'ep',
    cover:'https://images.unsplash.com/photo-1509233725247-49e657c54213?w=640&q=80&fit=crop' },
  { id:'bg002', title:'Salinas at 4AM', artist:'Dunes',        format:'Single', date:'2026.04.02', c1:'#3a2a1c', c2:'#1d130a', accent:'single',
    cover:'https://images.unsplash.com/photo-1519681393784-d120267933ba?w=640&q=80&fit=crop' },
  { id:'bg003', title:'Mediterráneo',  artist:'Niko Vega',    format:'LP',     date:'2026.02.21', c1:'#2c2a16', c2:'#161408', accent:'lp',
    cover:'https://images.unsplash.com/photo-1516483638261-f4dbaf036963?w=640&q=80&fit=crop' },
];
const FEATURED = { title:'Aurora', artist:'Marina Solé', format:'EP', date:'2026.06.01', track:'Aurora (Original Mix)', desc:'Our flagship release of the season. A journey through Mediterranean nights — deep, patient, and impossibly warm.', c1:'#0d3a44', c2:'#081a26',
  cover:'https://images.unsplash.com/photo-1604537466608-109fa2f16c3b?w=900&q=80&fit=crop' };
const ARTISTS = [
  { name:'Marina Solé', style:'Balearic Downtempo', releases:4, photo:'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=500&q=80&fit=crop&crop=faces' },
  { name:'Dunes',        style:'Deep House',         releases:2, photo:'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=500&q=80&fit=crop&crop=faces' },
  { name:'Niko Vega',   style:'Organic House',       releases:6, photo:'https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?w=500&q=80&fit=crop&crop=faces' },
  { name:'Lluna',        style:'Ambient · Dub',      releases:3, photo:'https://images.unsplash.com/photo-1531746020798-e6953c6e8e04?w=500&q=80&fit=crop&crop=faces' },
];

/* ── WALKING MASCOT — ping-pong canvas player ── */
function WalkingMascot() {
  const canvasRef = React.useRef(null);
  React.useEffect(() => {
    const canvas = canvasRef.current;
    if (!canvas) return;
    const ctx = canvas.getContext('2d');
    const video = document.createElement('video');
    video.src = 'assets/mascot-walk.mp4';
    video.muted = true; video.playsInline = true; video.preload = 'auto';
    let animId = null, reversing = false, revTime = 0;
    const STEP = 1 / 24;

    const draw = () => {
      ctx.clearRect(0, 0, canvas.width, canvas.height);
      if (video.readyState < 2) return;
      ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
      // Remove white background
      const id = ctx.getImageData(0, 0, canvas.width, canvas.height);
      const d = id.data;
      for (let i = 0; i < d.length; i += 4) {
        const r=d[i], g=d[i+1], b=d[i+2];
        if (r > 218 && g > 218 && b > 218) {
          const avg = (r + g + b) / 3;
          d[i+3] = Math.round(Math.max(0, (255 - avg) * 4));
        }
      }
      ctx.putImageData(id, 0, 0);
    };
    const rafLoop = () => { draw(); animId = requestAnimationFrame(rafLoop); };
    const doRevStep = () => {
      if (!reversing) return;
      revTime = Math.max(0, revTime - STEP);
      video.currentTime = revTime;
    };

    video.addEventListener('loadedmetadata', () => {
      canvas.width  = video.videoWidth  || 500;
      canvas.height = video.videoHeight || 500;
    });
    video.addEventListener('play', () => {
      cancelAnimationFrame(animId); animId = requestAnimationFrame(rafLoop);
    });
    video.addEventListener('ended', () => {
      reversing = true; revTime = video.duration;
      cancelAnimationFrame(animId); doRevStep();
    });
    video.addEventListener('seeked', () => {
      draw();
      if (!reversing) return;
      if (revTime <= 0) {
        reversing = false;
        video.play().catch(() => {});
      } else {
        setTimeout(doRevStep, STEP * 1000);
      }
    });
    video.load();
    video.play().catch(() => {});
    return () => { reversing = false; cancelAnimationFrame(animId); video.pause(); video.src = ''; };
  }, []);

  return (
    <canvas ref={canvasRef} style={{
      position:'relative', zIndex:4, display:'block',
      width:'88%', maxWidth:'460px', margin:'0 auto',
      filter:'drop-shadow(0 28px 46px rgba(0,0,0,.65))',
    }} />
  );
}

/* ── useReveal (scroll-based, bulletproof) ── */
function useReveal() {
  useEffect(() => {
    const reveal = () => {
      const h = window.innerHeight || document.documentElement.clientHeight;
      document.querySelectorAll('.reveal:not(.in)').forEach(el => {
        const r = el.getBoundingClientRect();
        if (r.top < h * .92 && r.bottom > -40) el.classList.add('in');
      });
    };
    reveal();
    window.addEventListener('scroll', reveal, { passive:true });
    window.addEventListener('resize', reveal);
    const t1 = setTimeout(reveal, 200), t2 = setTimeout(reveal, 800);
    return () => { window.removeEventListener('scroll', reveal); window.removeEventListener('resize', reveal); clearTimeout(t1); clearTimeout(t2); };
  }, []);
}

/* ── Blob light source component ── */
function Blob({ className, style }) {
  return <div aria-hidden="true" className={'blob ' + (className||'')} style={style}></div>;
}

/* ── NAV ── */
function Nav({ onOpenDemo }) {
  const { lang, setLang } = useLang();
  const t = T[lang];
  const [scrolled, setScrolled] = useState(false);
  const [menu, setMenu] = useState(false);

  useEffect(() => {
    const fn = () => setScrolled(window.scrollY > 60);
    window.addEventListener('scroll', fn, { passive:true }); fn();
    return () => window.removeEventListener('scroll', fn);
  }, []);
  useEffect(() => { document.body.style.overflow = menu ? 'hidden' : ''; }, [menu]);

  const go = (e, href) => {
    e.preventDefault(); setMenu(false);
    if (href === '#demo') { onOpenDemo(); return; }
    document.querySelector(href)?.scrollIntoView({ behavior:'smooth' });
  };
  const links = [[t.navReleases,'#releases'],[t.navArtists,'#artists'],[t.navSound,'#manifesto']];

  return (
    <React.Fragment>
      <nav className={'nav'+(scrolled?' scrolled':'')}>
        <a href="#top" className="brand" onClick={e=>go(e,'#top')}>
          <img src="assets/mascot.png" alt="Balearic Groove" />
          <span className="wordmark"><b>Balearic Groove</b><span>Mediterranean Label</span></span>
        </a>
        <div className="nav-links">
          {links.map(([label,href]) => <a key={href} href={href} onClick={e=>go(e,href)}>{label}</a>)}
        </div>
        <div className="nav-right">
          <div className="nav-social">
            {SOCIAL.map(s => <a key={s.k} href={s.url} target="_blank" rel="noopener" aria-label={s.label}>{I[s.k]()}</a>)}
          </div>
          <button className="lang-toggle" onClick={()=>setLang(l=>l==='en'?'es':'en')} aria-label="Switch language">
            <span className={lang==='en'?'active':''}>EN</span>
            <span className="sep">/</span>
            <span className={lang==='es'?'active':''}>ES</span>
          </button>
          <button className="btn btn-red" style={{padding:'9px 18px',fontSize:'12.5px'}} onClick={onOpenDemo}>
            {I.music()} {t.navDemo}
          </button>
          <button className={'hamburger'+(menu?' open':'')} aria-label="Menu" onClick={()=>setMenu(m=>!m)}>
            <span></span><span></span><span></span>
          </button>
        </div>
      </nav>

      <div className={'mobile-menu'+(menu?' open':'')}>
        <div className="mm-logo"><img src="assets/mascot.png" alt="Balearic Groove"/><b>Balearic Groove</b></div>
        {links.map(([label,href]) => <a key={href} className="mm-link" href={href} onClick={e=>go(e,href)}>{label}</a>)}
        <a className="mm-link red" href="#demo" onClick={e=>go(e,'#demo')}>{t.navDemo}</a>
        <div className="mm-bottom">
          <div className="mm-social">{SOCIAL.map(s=><a key={s.k} href={s.url} target="_blank" rel="noopener" aria-label={s.label}>{I[s.k]()}</a>)}</div>
          <div className="mm-lang">
            <button className={lang==='en'?'active':''} onClick={()=>setLang('en')}>EN</button>
            <span style={{color:'var(--text-3)',alignSelf:'center'}}>/</span>
            <button className={lang==='es'?'active':''} onClick={()=>setLang('es')}>ES</button>
          </div>
        </div>
      </div>
    </React.Fragment>
  );
}

/* ── HERO ── */
function Hero({ onOpenDemo }) {
  const { lang } = useLang();
  const t = T[lang];
  const rain  = Array.from({ length: 60 });
  const parts = Array.from({ length: 24 });

  return (
    <header className="hero" id="top" data-screen-label="Hero">
      <img className="hero-bg" src="assets/alley.jpg" alt="Balearic Groove — rainy alley" />
      <div className="hero-tint"></div>
      <div className="hero-scrim"></div>
      <div className="hero-vignette"></div>
      {/* Yellow glow orb behind the mascot */}
      <div className="hero-orb"></div>

      <div className="rain">
        {rain.map((_,i) => {
          const l=Math.random()*100, dur=.5+Math.random()*.7, delay=Math.random()*4, h=50+Math.random()*70;
          return <i key={i} style={{left:l+'%',animationDuration:dur+'s',animationDelay:delay+'s',height:h+'px'}}></i>;
        })}
      </div>
      <div className="particles">
        {parts.map((_,i) => {
          const l=Math.random()*100, top=35+Math.random()*55, sz=2+Math.random()*5, dur=6+Math.random()*7, delay=Math.random()*7;
          return <i key={i} style={{left:l+'%',top:top+'%',width:sz+'px',height:sz+'px',animationDuration:dur+'s',animationDelay:delay+'s'}}></i>;
        })}
      </div>

      <div className="social-bar">
        {SOCIAL.map(s=><a key={s.k} href={s.url} target="_blank" rel="noopener" aria-label={s.label}>{I[s.k]()}</a>)}
        <span className="vline"></span>
      </div>

      <div className="hero-content">
        <div className="wrap">
          <div className="eyebrow hero-eyebrow no-line">{t.est}</div>
          <h1 className="hero-tagline">{t.heroH1}<br/><em>{t.heroH2}</em></h1>
          <p className="hero-sub">{t.heroSub}</p>
          <div className="hero-wave" aria-hidden="true">
            {Array.from({length:44}).map((_,i)=>(
              <span key={i} style={{animationDelay:(i*.044)+'s',animationDuration:(.9+Math.random()*.85)+'s'}}></span>
            ))}
          </div>
          <div className="hero-cta">
            <a href="#releases" className="btn btn-yellow" onClick={e=>{e.preventDefault();document.querySelector('#releases')?.scrollIntoView({behavior:'smooth'});}}>
              {I.play()} {t.heroCta1}
            </a>
            <button className="btn btn-outline-yellow" onClick={onOpenDemo}>
              {t.heroCta2} {I.arrow()}
            </button>
          </div>
        </div>
      </div>
      <div className="scroll-cue"><div className="mouse"></div><span>Scroll</span></div>
    </header>
  );
}

/* ── MARQUEE ── */
function Marquee() {
  const items = ['Deep House','Balearic','Downtempo','Sunset Sessions','Organic House','Ibiza Nights','Analog Soul','After Hours'];
  const row = [...items, ...items];
  return (
    <div className="marquee" aria-hidden="true">
      <div className="marquee-track">
        {row.map((t,i)=><span key={i}>{t}</span>)}
      </div>
    </div>
  );
}

/* ── MANIFESTO ── */
function Manifesto() {
  const { lang } = useLang();
  const t = T[lang];
  return (
    <section className="section manifesto" id="manifesto" data-screen-label="Manifesto">
      {/* Atmospheric blobs for glass depth */}
      <Blob className="blob-y blob-pulse" style={{width:600,height:600,top:'-20%',right:'-8%',opacity:.9}} />
      <Blob className="blob-r blob-pulse-2" style={{width:380,height:380,bottom:'-10%',left:'-5%',opacity:.7}} />

      <div className="wrap">
        <div className="grid">
          <div className="manifesto-text reveal">
            <div className="eyebrow" style={{marginBottom:'22px'}}>{t.maniEye}</div>
            <h2 className="big">
              {t.maniH[0]}<br/>{t.maniH[1]}<br/><em>{t.maniH[2]}</em>
            </h2>
            <p>{t.maniP1}</p>
            <p>{t.maniP2}</p>
            <div className="manifesto-stats">
              <div className="stat reveal d1"><div className="n">2026</div><div className="l">{t.statFounded}</div></div>
              <div className="stat reveal d2"><div className="n">12</div><div className="l">{t.statReleases}</div></div>
              <div className="stat reveal d3"><div className="n">4</div><div className="l">{t.statArtists}</div></div>
            </div>
          </div>
          <div className="mascot-stage reveal d1">
            <div className="mascot-halo"></div>
            <WalkingMascot />
          </div>
        </div>
      </div>
    </section>
  );
}

Object.assign(window, {
  React, useState, useEffect, useContext, createContext,
  LangContext, useLang, T, I, SOCIAL, RELEASES, FEATURED, ARTISTS,
  useReveal, Blob, WalkingMascot, Nav, Hero, Marquee, Manifesto,
});
