// Site header with sticky nav + mobile burger.
function Header({ page, go }) {
  const { Logo, Button } = window.B2B_4a97d9;
  const [open, setOpen] = React.useState(false);
  const links = [
    ['about', 'О нас'], ['events', 'Мероприятия'], ['speakers', 'Спикеры'],
    ['knowledge', 'База знаний'], ['blog', 'Блог'], ['formats', 'Форматы'], ['partner', 'Партнёрам'],
  ];
  const linkStyle = (id) => ({
    fontFamily: 'var(--tb-font-mono)', fontSize: '12px', letterSpacing: '0.04em',
    textTransform: 'uppercase', padding: '9px 12px', cursor: 'pointer',
    color: page === id ? 'var(--tb-ink)' : '#3a3f42', position: 'relative',
    borderBottom: page === id ? '2px solid var(--tb-signal)' : '2px solid transparent',
  });
  return (
    <header style={{ position: 'sticky', top: 0, zIndex: 60, background: 'var(--tb-header-bg)', backdropFilter: 'blur(8px)', WebkitBackdropFilter: 'blur(8px)', borderBottom: '1px solid var(--tb-line)' }}>
      <div style={{ maxWidth: '1240px', margin: '0 auto', padding: '0 32px', height: '64px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
        <div onClick={() => go('home')} style={{ cursor: 'pointer', display: 'flex', alignItems: 'center' }}>
          <Logo height={30} />
        </div>
        <nav style={{ display: 'flex', alignItems: 'center', gap: '2px' }} className="tb-menu">
          {links.map(([id, label]) => (
            <a key={id} onClick={() => go(id)} style={linkStyle(id)}>{label}</a>
          ))}
          <Button variant="signal" arrow={false} onClick={() => go('join')} style={{ marginLeft: '10px', padding: '10px 16px', fontSize: '12px' }}>Присоединиться</Button>
        </nav>
      </div>
    </header>
  );
}
window.Header = Header;
