const { useState, useEffect, useRef } = React;

const CHROME_STORE_URL =
  'https://chromewebstore.google.com/detail/song-finder/jfcgghdcppnkehglmddcoeknbamleaan';

// ===== shared icons =====
const HistoryIcon = ({ size = 18 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l3 2"/></svg>
);
const BackIcon = ({ size = 18 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M19 12H5"/><path d="m12 19-7-7 7-7"/></svg>
);
const TrashIcon = ({ size = 14 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M3 6h18"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>
);
const ExternalIcon = ({ size = 12 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round"><path d="M7 17 17 7"/><path d="M7 7h10v10"/></svg>
);
const SpotifyMark = ({ size = 16 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24"><circle cx="12" cy="12" r="11" fill="#1DB954"/><path d="M6.5 9.5c3.5-1.2 8-1 11.2.8M7 13c3-.9 6.7-.7 9.3.8M7.5 16.2c2.4-.7 5.3-.5 7.4.7" stroke="#0a2814" strokeWidth="1.6" strokeLinecap="round" fill="none"/></svg>
);
const AppleMark = ({ size = 16 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24"><defs><linearGradient id={`am${size}`} x1="0" y1="0" x2="0" y2="1"><stop offset="0" stopColor="#FB5C74"/><stop offset="1" stopColor="#FA233B"/></linearGradient></defs><circle cx="12" cy="12" r="11" fill={`url(#am${size})`}/><path d="M14.6 7.4c-.6.1-2.5.5-3.5.7-.4.1-.6.3-.6.7v6.6c0 .8-.5 1.4-1.4 1.5-.9.1-1.6-.4-1.6-1.2 0-.7.5-1.3 1.4-1.4.5-.1.9-.1 1.1.1V9.2c0-.6.3-.9.9-1l3.7-.8c.5-.1.9.2.9.7v5.5c0 .8-.5 1.4-1.4 1.5-.9.1-1.6-.4-1.6-1.2 0-.7.5-1.3 1.4-1.4.4-.1.8 0 1.1.1V8.1c0-.5-.2-.8-.4-.7Z" fill="#fff"/></svg>
);
const YouTubeMark = ({ size = 16 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24"><circle cx="12" cy="12" r="11" fill="#ff2a2a"/><path d="M10 8.7v6.6l5.5-3.3-5.5-3.3Z" fill="#fff"/></svg>
);

const ACCENT = {
  bgTop: '#1a1142',
  bgBot: '#0f0826',
  glow: 'rgba(120, 80, 220, 0.35)',
  ring: 'rgba(180, 150, 255, 0.08)',
  orb1: '#a855f7',
  orb2: '#ec4899',
  orb3: '#f97316',
};

const POPUP_W = 360;
const POPUP_H = 540;

const SAMPLE_RESULT = { title: "Not Afraid", artist: "Eminem", album: "Recovery", year: "2010", match: 98 };
const SAMPLE_HISTORY = [
  { title: "Raindance", artist: "Dave", time: "2m", hue: 280 },
  { title: "No Brainer", artist: "DJ Khaled", time: "14m", hue: 320 },
  { title: "South of the Border", artist: "Ed Sheeran", time: "1h", hue: 250 },
];

function Logo({ size = 26, radius = 8 }) {
  return (
    <div style={{
      width: size, height: size, borderRadius: radius,
      background: `linear-gradient(135deg, ${ACCENT.orb1} 0%, ${ACCENT.orb2} 100%)`,
      display: 'flex', alignItems: 'center', justifyContent: 'center',
      boxShadow: `0 4px 14px -4px ${ACCENT.orb2}aa`,
      flexShrink: 0,
    }}>
      <svg width={size * 0.55} height={size * 0.55} viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round">
        <path d="M4 12c2-3 4-3 6 0s4 3 6 0 4-3 4 0"/>
      </svg>
    </div>
  );
}

function PopupShell({ children, screen, onToggleHistory, showHistory }) {
  return (
    <div data-screen-label={`Popup · ${screen}`} style={{
      width: POPUP_W, height: POPUP_H,
      position: 'relative', overflow: 'hidden',
      borderRadius: 16,
      background: `radial-gradient(120% 80% at 50% -10%, ${ACCENT.glow} 0%, transparent 55%), linear-gradient(180deg, ${ACCENT.bgTop} 0%, ${ACCENT.bgBot} 100%)`,
      color: '#EDE7FF',
      fontFamily: 'Geist, ui-sans-serif, system-ui, sans-serif',
      boxShadow: '0 40px 80px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06) inset',
      display: 'flex', flexDirection: 'column',
      isolation: 'isolate',
    }}>
      <div style={{
        position: 'absolute', inset: 0, pointerEvents: 'none', opacity: 0.5, mixBlendMode: 'overlay',
        backgroundImage: 'url("data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%22120%22 height=%22120%22><filter id=%22n%22><feTurbulence baseFrequency=%220.9%22 numOctaves=%222%22 stitchTiles=%22stitch%22/><feColorMatrix values=%220 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.18 0%22/></filter><rect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23n)%22/></svg>")'
      }} />
      <div aria-hidden style={{
        position: 'absolute', left: '50%', top: '50%', width: 900, height: 900, transform: 'translate(-50%,-50%)',
        backgroundImage: `radial-gradient(circle, transparent 38%, ${ACCENT.ring} 38.2%, transparent 38.5%), radial-gradient(circle, transparent 48%, ${ACCENT.ring} 48.2%, transparent 48.5%), radial-gradient(circle, transparent 60%, ${ACCENT.ring} 60.2%, transparent 60.5%)`,
        opacity: 0.35, pointerEvents: 'none',
      }} />

      <div style={{ position: 'relative', zIndex: 2, padding: '14px 16px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: 9 }}>
          <Logo size={24} radius={7} />
          <span style={{ fontWeight: 600, fontSize: 13, letterSpacing: -0.1 }}>Song Finder</span>
        </div>
        <button onClick={onToggleHistory} style={{
          width: 32, height: 32, borderRadius: 999,
          display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
          background: 'rgba(255,255,255,0.06)',
          border: '1px solid rgba(255,255,255,0.10)',
          color: '#EDE7FF', cursor: 'pointer',
          backdropFilter: 'blur(8px)',
        }}>
          {showHistory ? <BackIcon size={16} /> : <HistoryIcon size={16} />}
        </button>
      </div>

      <div style={{ flex: 1, position: 'relative', zIndex: 2, display: 'flex', flexDirection: 'column', minHeight: 0, paddingBottom: 14 }}>
        {children}
      </div>
    </div>
  );
}

function IdleView() {
  return (
    <div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', padding: '0 28px', textAlign: 'center' }}>
      <div style={{ fontFamily: 'Geist Mono, ui-monospace, monospace', fontSize: 10, letterSpacing: 1.6, textTransform: 'uppercase', color: 'rgba(237,231,255,0.5)', marginBottom: 22 }}>
        Tap to identify
      </div>
      <div style={{
        position: 'relative', width: 180, height: 180, borderRadius: '50%',
        background: `conic-gradient(from 200deg, ${ACCENT.orb1}, ${ACCENT.orb2}, ${ACCENT.orb3}, ${ACCENT.orb1})`,
        boxShadow: `0 30px 60px -20px ${ACCENT.orb2}88, 0 0 0 1px rgba(255,255,255,0.08) inset, 0 0 60px ${ACCENT.orb2}40`,
      }}>
        <div style={{
          position: 'absolute', inset: 6, borderRadius: '50%',
          background: `linear-gradient(155deg, ${ACCENT.orb1} 0%, ${ACCENT.orb2} 50%, ${ACCENT.orb3} 100%)`,
          display: 'flex', alignItems: 'center', justifyContent: 'center', flexDirection: 'column', gap: 8,
        }}>
          <svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
            <path d="M3 14a9 9 0 0 1 18 0"/>
            <rect x="3" y="14" width="4" height="6" rx="1.4" fill="rgba(255,255,255,0.15)"/>
            <rect x="17" y="14" width="4" height="6" rx="1.4" fill="rgba(255,255,255,0.15)"/>
          </svg>
          <div style={{ fontWeight: 600, fontSize: 17, color: '#fff' }}>Listen</div>
        </div>
      </div>
      <div style={{ marginTop: 24, fontSize: 12, color: 'rgba(237,231,255,0.65)', maxWidth: 220, lineHeight: 1.5 }}>
        Make sure music is playing in your current tab.
      </div>
    </div>
  );
}

function ListeningView() {
  const [bars, setBars] = useState(() => Array.from({ length: 13 }, () => Math.random()));
  useEffect(() => {
    const id = setInterval(() => setBars(Array.from({ length: 13 }, () => 0.25 + Math.random() * 0.75)), 170);
    return () => clearInterval(id);
  }, []);
  return (
    <div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', padding: '0 28px', textAlign: 'center' }}>
      <div style={{ position: 'relative', width: 200, height: 200, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
        {[0, 1, 2].map(i => (
          <div key={i} style={{
            position: 'absolute', inset: 0, borderRadius: '50%',
            border: `1.5px solid ${ACCENT.orb2}`,
            animation: `pulse 3s cubic-bezier(0.2,0.8,0.2,1) ${i * 1}s infinite`,
          }} />
        ))}
        <div style={{
          width: 135, height: 135, borderRadius: '50%',
          background: `linear-gradient(155deg, ${ACCENT.orb1} 0%, ${ACCENT.orb2} 50%, ${ACCENT.orb3} 100%)`,
          display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 3,
          boxShadow: `0 20px 50px -15px ${ACCENT.orb2}aa, 0 0 0 1px rgba(255,255,255,0.08) inset`,
        }}>
          {bars.map((h, i) => (
            <div key={i} style={{ width: 3, height: `${28 + h * 44}px`, borderRadius: 2, background: '#fff', opacity: 0.85, transition: 'height 170ms ease' }} />
          ))}
        </div>
      </div>
      <div style={{ fontWeight: 600, fontSize: 18, letterSpacing: -0.2, marginTop: 28 }}>Listening<span className="dots" /></div>
      <div style={{ fontFamily: 'Geist Mono, ui-monospace, monospace', fontSize: 10, letterSpacing: 1.4, textTransform: 'uppercase', color: 'rgba(237,231,255,0.5)', marginTop: 8 }}>
        Analyzing audio sample
      </div>
    </div>
  );
}

function ResultView() {
  const r = SAMPLE_RESULT;
  return (
    <div style={{ flex: 1, display: 'flex', flexDirection: 'column', padding: '6px 18px 14px' }}>
      <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center', marginTop: 8 }}>
        <div style={{
          width: 110, height: 110, borderRadius: 16,
          background: `linear-gradient(155deg, ${ACCENT.orb1} 0%, ${ACCENT.orb2} 50%, ${ACCENT.orb3} 100%)`,
          boxShadow: `0 18px 36px -10px ${ACCENT.orb2}66, 0 0 0 1px rgba(255,255,255,0.08) inset`,
          display: 'flex', alignItems: 'center', justifyContent: 'center', position: 'relative',
          marginBottom: 16,
        }}>
          <svg width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" style={{ opacity: 0.95 }}>
            <path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/>
          </svg>
          <div style={{
            position: 'absolute', bottom: -7, right: -7,
            background: '#10b981', color: '#fff',
            fontFamily: 'Geist Mono, ui-monospace, monospace',
            fontSize: 9, fontWeight: 600,
            padding: '3px 7px', borderRadius: 999,
            border: '2px solid #1a1142', letterSpacing: 0.4,
          }}>{r.match}%</div>
        </div>
        <div style={{ fontSize: 20, fontWeight: 600, letterSpacing: -0.4, lineHeight: 1.1 }}>{r.title}</div>
        <div style={{ fontSize: 13, color: 'rgba(237,231,255,0.7)', marginTop: 4 }}>{r.artist}</div>
        <div style={{ fontFamily: 'Geist Mono, ui-monospace, monospace', fontSize: 9, letterSpacing: 1.2, textTransform: 'uppercase', color: 'rgba(237,231,255,0.4)', marginTop: 6 }}>
          {r.album} · {r.year}
        </div>
      </div>
      <div style={{ marginTop: 18, display: 'flex', flexDirection: 'column', gap: 7 }}>
        {[
          { label: 'Open in Spotify', mark: <SpotifyMark size={18} /> },
          { label: 'Open in Apple Music', mark: <AppleMark size={18} /> },
          { label: 'Open in YouTube', mark: <YouTubeMark size={18} /> },
        ].map(s => (
          <div key={s.label} style={{
            padding: '10px 12px', borderRadius: 10,
            border: '1px solid rgba(255,255,255,0.08)',
            background: 'rgba(255,255,255,0.04)',
            display: 'flex', alignItems: 'center', gap: 11,
            fontSize: 12, fontWeight: 500,
          }}>
            {s.mark}
            <span style={{ flex: 1 }}>{s.label}</span>
            <span style={{ color: 'rgba(237,231,255,0.45)' }}><ExternalIcon /></span>
          </div>
        ))}
      </div>
    </div>
  );
}

function HistoryView() {
  return (
    <div style={{ flex: 1, display: 'flex', flexDirection: 'column', padding: '4px 16px 12px' }}>
      <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '4px 4px 10px' }}>
        <div style={{ fontSize: 17, fontWeight: 600, letterSpacing: -0.2 }}>History</div>
        <div style={{
          fontSize: 11, fontWeight: 500,
          color: 'rgba(255,180,180,0.85)',
          background: 'rgba(255,90,90,0.08)',
          border: '1px solid rgba(255,90,90,0.18)',
          borderRadius: 8, padding: '5px 9px',
          display: 'inline-flex', alignItems: 'center', gap: 5,
        }}>
          <TrashIcon size={12} /> Clear
        </div>
      </div>
      <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
        {SAMPLE_HISTORY.map((item, i) => (
          <div key={i} style={{
            display: 'flex', alignItems: 'center', gap: 11,
            padding: '9px 10px', borderRadius: 10,
            background: 'rgba(255,255,255,0.03)',
            border: '1px solid rgba(255,255,255,0.05)',
          }}>
            <div style={{
              width: 38, height: 38, borderRadius: 8,
              background: `linear-gradient(155deg, oklch(0.72 0.18 ${item.hue}), oklch(0.62 0.20 ${item.hue + 40}))`,
              flexShrink: 0, display: 'flex', alignItems: 'center', justifyContent: 'center',
            }}>
              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" style={{ opacity: 0.9 }}>
                <path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/>
              </svg>
            </div>
            <div style={{ flex: 1, minWidth: 0 }}>
              <div style={{ fontSize: 12, fontWeight: 500, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{item.title}</div>
              <div style={{ fontSize: 10.5, color: 'rgba(237,231,255,0.55)' }}>{item.artist}</div>
            </div>
            <div style={{ display: 'flex', gap: 4 }}>
              <SpotifyMark size={18} />
              <AppleMark size={18} />
              <YouTubeMark size={18} />
            </div>
          </div>
        ))}
      </div>
    </div>
  );
}

function AutoCyclingPopup() {
  const SEQ = [
    { name: 'idle', dur: 3800 },
    { name: 'listening', dur: 3300 },
    { name: 'result', dur: 5600 },
    { name: 'history', dur: 4400 },
  ];
  const [idx, setIdx] = useState(0);

  useEffect(() => {
    const id = setTimeout(() => setIdx(i => (i + 1) % SEQ.length), SEQ[idx].dur);
    return () => clearTimeout(id);
  }, [idx]);

  const screen = SEQ[idx].name;

  return (
    <div style={{ position: 'relative' }}>
      <PopupShell screen={screen} onToggleHistory={() => setIdx(screen === 'history' ? 0 : 3)} showHistory={screen === 'history'}>
        <div key={screen} className="screen-fade" style={{ flex: 1, display: 'flex', flexDirection: 'column', minHeight: 0 }}>
          {screen === 'idle' && <IdleView />}
          {screen === 'listening' && <ListeningView />}
          {screen === 'result' && <ResultView />}
          {screen === 'history' && <HistoryView />}
        </div>
      </PopupShell>

      <div style={{
        marginTop: 18, display: 'flex', gap: 6, justifyContent: 'center',
        fontFamily: 'Geist Mono, ui-monospace, monospace',
        fontSize: 9, letterSpacing: 1.2, textTransform: 'uppercase',
      }}>
        {SEQ.map((s, i) => (
          <button key={s.name} onClick={() => setIdx(i)} style={{
            padding: '6px 10px', borderRadius: 6,
            border: '1px solid ' + (i === idx ? 'rgba(168,85,247,0.4)' : 'rgba(255,255,255,0.06)'),
            background: i === idx ? 'rgba(168,85,247,0.14)' : 'rgba(255,255,255,0.02)',
            color: i === idx ? '#e9d5ff' : 'rgba(237,231,255,0.45)',
            cursor: 'pointer',
            fontFamily: 'inherit', fontSize: 'inherit', letterSpacing: 'inherit', textTransform: 'inherit',
          }}>{s.name}</button>
        ))}
      </div>
    </div>
  );
}

function ChromeIcon({ size = 18 }) {
  return (
    <svg width={size} height={size} viewBox="0 0 48 48" aria-hidden="true">
      <circle cx="24" cy="24" r="22" fill="#fff"/>
      <circle cx="24" cy="24" r="9" fill="#1a73e8"/>
      <path d="M24 4a20 20 0 0 1 17.3 10H24a10 10 0 0 0-9.4 6.6L8.3 9.7A20 20 0 0 1 24 4z" fill="#ea4335"/>
      <path d="M6.6 35A20 20 0 0 1 5 14l8.3 8.5A10 10 0 0 0 18.2 33L13 44A20 20 0 0 1 6.6 35z" fill="#fbbc04"/>
      <path d="M24 44a20 20 0 0 1-11-3.5L19 31a10 10 0 0 0 13.5-5l8.3 4.3A20 20 0 0 1 24 44z" fill="#34a853"/>
    </svg>
  );
}

function Landing() {
  return (
    <div data-screen-label="Landing" style={{
      minHeight: '100vh',
      color: '#EDE7FF',
      fontFamily: 'Geist, ui-sans-serif, system-ui, sans-serif',
      display: 'flex', flexDirection: 'column',
      position: 'relative', overflow: 'hidden',
    }}>
      <nav style={{
        padding: '24px 40px', display: 'flex', justifyContent: 'flex-start', alignItems: 'center',
        position: 'relative', zIndex: 2,
      }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
          <Logo size={32} radius={9} />
          <span style={{ fontWeight: 600, fontSize: 16, letterSpacing: -0.2 }}>Song Finder</span>
        </div>
      </nav>

      <main style={{
        flex: 1,
        display: 'grid',
        gridTemplateColumns: '1fr auto',
        gap: 80,
        alignItems: 'center',
        padding: '0 80px 60px',
        maxWidth: 1200,
        margin: '0 auto',
        width: '100%',
        boxSizing: 'border-box',
      }}>
        <div style={{ maxWidth: 480 }}>
          <div style={{
            fontFamily: 'Geist Mono, ui-monospace, monospace',
            fontSize: 11, letterSpacing: 2, textTransform: 'uppercase',
            color: 'rgba(237,231,255,0.5)',
            marginBottom: 22,
            display: 'inline-flex', alignItems: 'center', gap: 8,
            padding: '6px 12px',
            border: '1px solid rgba(255,255,255,0.08)',
            borderRadius: 999,
            background: 'rgba(255,255,255,0.02)',
          }}>
            <span style={{ width: 6, height: 6, borderRadius: 999, background: '#10b981', display: 'inline-block', boxShadow: '0 0 8px #10b981' }} />
            Chrome extension
          </div>

          <h1 style={{
            fontSize: 56, fontWeight: 600, letterSpacing: -1.5, lineHeight: 1.02,
            margin: '0 0 22px',
          }}>
            Name any song<br/>
            <span style={{
              background: `linear-gradient(110deg, ${ACCENT.orb1} 0%, ${ACCENT.orb2} 50%, ${ACCENT.orb3} 100%)`,
              WebkitBackgroundClip: 'text', backgroundClip: 'text', color: 'transparent',
            }}>playing in your tab.</span>
          </h1>

          <p style={{
            fontSize: 17, lineHeight: 1.55,
            color: 'rgba(237,231,255,0.7)',
            margin: '0 0 36px',
            maxWidth: 440,
          }}>
            Song Finder listens to the audio in your current tab and identifies the track in seconds — then opens it in Spotify, Apple Music, or YouTube.
          </p>

          <div style={{ display: 'flex', gap: 12, alignItems: 'center', flexWrap: 'wrap' }}>
            <a href={CHROME_STORE_URL} target="_blank" rel="noopener noreferrer" style={{
              display: 'inline-flex', alignItems: 'center', gap: 10,
              padding: '14px 22px',
              borderRadius: 12,
              background: '#fff',
              color: '#0f0826',
              fontWeight: 600, fontSize: 15,
              textDecoration: 'none',
              boxShadow: '0 12px 28px -10px rgba(168,85,247,0.4), 0 0 0 1px rgba(255,255,255,0.1)',
              transition: 'transform 160ms ease',
            }}
            onMouseEnter={e => e.currentTarget.style.transform = 'translateY(-1px)'}
            onMouseLeave={e => e.currentTarget.style.transform = 'translateY(0)'}
            >
              <ChromeIcon size={20} />
              Add to Chrome
            </a>
          </div>
        </div>

        <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
          <AutoCyclingPopup />
        </div>
      </main>

      <footer style={{
        padding: '20px 40px',
        display: 'flex', justifyContent: 'space-between', alignItems: 'center',
        fontSize: 12,
        color: 'rgba(237,231,255,0.4)',
        fontFamily: 'Geist Mono, ui-monospace, monospace',
        letterSpacing: 0.4,
        borderTop: '1px solid rgba(255,255,255,0.05)',
        position: 'relative', zIndex: 2,
      }}>
        <span>© 2026 Song Finder</span>
        <div style={{ display: 'flex', gap: 20 }}>
          <a href="privacy.html" style={{ color: 'rgba(237,231,255,0.55)', textDecoration: 'none' }}>Privacy policy</a>
          <a href="mailto:antoninacodes@gmail.com" style={{ color: 'rgba(237,231,255,0.55)', textDecoration: 'none' }}>Contact</a>
        </div>
      </footer>
    </div>
  );
}

ReactDOM.createRoot(document.getElementById('root')).render(<Landing />);
