---
/**
 * Site.astro — 官网整页布局（构建期单显一种语言）。
 * 两条路由复用：/ → lang="zh"，/en/ → lang="en"（铁律 6 单显不并排）。
 *
 * 样式来源顺序（全部自托管，无第三方 CDN）：
 *   @fontsource/*  → 自托管字体 @font-face（替代原型的 Google Fonts CDN）
 *   tokens.gen.css → 由 design/colors_and_type.css 生成（唯一令牌真相源）
 *   website.css    → 逐字迁自 ui_kits/website
 *   site-extra.css → 仅承载「原型内联 style= → class」的等价工具类
 */
import '@fontsource/sora/500.css';
import '@fontsource/sora/600.css';
import '@fontsource/sora/700.css';
import '@fontsource/manrope/400.css';
import '@fontsource/manrope/500.css';
import '@fontsource/manrope/600.css';
import '@fontsource/manrope/700.css';
import '@fontsource/noto-sans-sc/400.css';
import '@fontsource/noto-sans-sc/500.css';
import '@fontsource/noto-sans-sc/700.css';
import '@fontsource/jetbrains-mono/400.css';
import '@fontsource/jetbrains-mono/500.css';

import '../styles/tokens.gen.css';
import '../styles/website.css';
import '../styles/site-extra.css';

import { createT, type Lang } from '../i18n/strings';
import Header from '../components/Header.jsx';
import AnnouncementBar from '../components/AnnouncementBar.jsx';
import Hero from '../components/Hero.astro';
import Features from '../components/Features.astro';
import WhySignup from '../components/WhySignup.astro';
import Pricing from '../components/Pricing.astro';
import Download from '../components/Download.astro';
import Docs from '../components/Docs.astro';
import Blog from '../components/Blog.astro';
import CtaBand from '../components/CtaBand.astro';
import Footer from '../components/Footer.astro';

interface Props { lang: Lang }
const { lang } = Astro.props;
const t = createT(lang);

const headerT = {
  product: t('nav.product'),
  pricing: t('nav.pricing'),
  download: t('nav.download'),
  docs: t('nav.docs'),
  blog: t('nav.blog'),
  login: t('nav.login'),
  get: t('nav.get'),
  suBtn: t('su.btn'),
};
---
<!doctype html>
<html lang={lang === 'zh' ? 'zh-CN' : 'en'}>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>{t('meta.title')}</title>
  <meta name="description" content={t('meta.desc')} />
  <meta name="robots" content="index,follow" />
  <link rel="canonical" href={new URL(lang === 'zh' ? '/' : '/en/', Astro.site).href} />
  <link rel="alternate" hreflang="zh-CN" href={new URL('/', Astro.site).href} />
  <link rel="alternate" hreflang="en" href={new URL('/en/', Astro.site).href} />
  <link rel="alternate" hreflang="x-default" href={new URL('/', Astro.site).href} />
  <meta name="theme-color" content="#B96A3D" />
  <meta property="og:type" content="website" />
  <meta property="og:title" content={t('meta.title')} />
  <meta property="og:description" content={t('meta.desc')} />
  <meta property="og:locale" content={lang === 'zh' ? 'zh_CN' : 'en_US'} />
</head>
<body>
  <AnnouncementBar client:idle text={t('ann.txt')} cta={t('ann.cta')} />
  <Header client:load lang={lang} t={headerT} />

  <a id="top"></a>

  <Hero t={t} />
  <Features t={t} />
  <WhySignup t={t} />
  <Pricing t={t} />
  <Download t={t} />
  <Docs t={t} />
  <Blog t={t} />
  <CtaBand t={t} />
  <Footer t={t} />
</body>
</html>
