@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ---------- Theme tokens ----------
   Light by default; dark when the system asks for it (unless the visitor picked light),
   or when the visitor picked dark. Pages tint the accent with --accent-l / --accent-d. */
:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --surface-glass: rgba(255, 255, 255, 0.72);
    --text: #09090b;
    --text-2: #52525b;
    --text-3: #71717a;
    --border: rgba(9, 9, 11, 0.08);
    --border-strong: rgba(9, 9, 11, 0.14);
    --accent: var(--accent-l, #2563eb);
    --accent-ink: #ffffff;
    --glow: color-mix(in srgb, var(--accent) 16%, transparent);
    --shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.05);
    --shadow: 0 1px 2px rgba(9, 9, 11, 0.04), 0 12px 32px -12px rgba(9, 9, 11, 0.12);
    --shadow-lg: 0 2px 4px rgba(9, 9, 11, 0.04), 0 32px 64px -24px rgba(9, 9, 11, 0.24);
    --radius: 20px;
    --max: 1120px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #09090b;
        --surface: #111113;
        --surface-2: #1c1c1f;
        --surface-glass: rgba(17, 17, 19, 0.7);
        --text: #fafafa;
        --text-2: #a1a1aa;
        --text-3: #8b8b94;
        --border: rgba(255, 255, 255, 0.08);
        --border-strong: rgba(255, 255, 255, 0.16);
        --accent: var(--accent-d, #60a5fa);
        --accent-ink: #09090b;
        --glow: color-mix(in srgb, var(--accent) 22%, transparent);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
        --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 32px 64px -24px rgba(0, 0, 0, 0.8);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #09090b;
    --surface: #111113;
    --surface-2: #1c1c1f;
    --surface-glass: rgba(17, 17, 19, 0.7);
    --text: #fafafa;
    --text-2: #a1a1aa;
    --text-3: #8b8b94;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --accent: var(--accent-d, #60a5fa);
    --accent-ink: #09090b;
    --glow: color-mix(in srgb, var(--accent) 22%, transparent);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 32px 64px -24px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
}

/* Images that exist in a light and a dark variant. */
.only-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .only-light { display: none !important; }
    :root:not([data-theme="light"]) .only-dark { display: block !important; }
}
:root[data-theme="dark"] .only-light { display: none !important; }
:root[data-theme="dark"] .only-dark { display: block !important; }

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-feature-settings: "cv11", "ss01";
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body { position: relative; overflow-x: hidden; }

/* Soft accent glow and a faint grid behind the top of every page. */
body::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 720px;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(600px 320px at 20% 0%, var(--glow), transparent 70%),
        radial-gradient(520px 300px at 85% 10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
        linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 48px 48px,
        linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
}

/* Bilingual content: both languages live in the markup, one is hidden. */
html[data-lang="en"] [data-l="zh"],
html[data-lang="zh-CN"] [data-l="en"] { display: none !important; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
code { font-family: var(--mono); font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Navigation ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    background: var(--surface-glass);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--border);
}
.navbar .wrap {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.navbar-tabs { display: flex; align-items: center; gap: 4px; }
.navbar-tabs > a,
.nav-dropdown > button {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 14px;
    color: var(--text-2);
    font: inherit;
    font-weight: 500;
    font-size: 14px;
    background: none;
    border: none;
    border-radius: 999px;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
}
.navbar-tabs > a:hover,
.nav-dropdown > button:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.navbar-tabs > a.active,
.nav-dropdown > button.active { color: var(--text); background: var(--surface-2); font-weight: 600; }

.nav-dropdown { position: relative; display: flex; }
.nav-dropdown > button svg { width: 14px; height: 14px; opacity: 0.7; transition: transform 0.2s; }
.nav-dropdown.open > button svg { transform: rotate(180deg); }
.nav-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    min-width: 280px;
    margin-top: 10px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -6px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
/* Invisible bridge so the menu stays open while the pointer crosses the gap. */
.nav-menu::before { content: ""; position: absolute; inset: -12px 0 auto 0; height: 12px; }
.nav-dropdown.open .nav-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@media (hover: hover) {
    .nav-dropdown:hover .nav-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
    .nav-dropdown:hover > button svg { transform: rotate(180deg); }
}
.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    color: var(--text);
}
.nav-menu a:hover, .nav-menu a.current { background: var(--surface-2); text-decoration: none; }
.nav-menu img { width: 36px; height: 36px; flex: none; }
.nav-menu strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.nav-menu small { display: block; font-size: 12px; color: var(--text-3); line-height: 1.4; }

/* Language menu and theme button */
.nav-controls { display: flex; align-items: center; gap: 6px; }
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    min-width: 36px;
    padding: 0 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn .chev { width: 12px; height: 12px; opacity: 0.6; }
.theme-btn { padding: 0; width: 36px; }

.lang-menu { position: relative; }
.lang-menu .nav-menu { left: auto; right: 0; min-width: 200px; transform: translateY(-6px) scale(0.98); transform-origin: top right; }
.lang-menu.open .nav-menu { opacity: 1; visibility: visible; transform: none; }
.lang-menu .nav-menu button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    padding: 9px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    text-align: left;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}
.lang-menu .nav-menu button:hover { background: var(--surface-2); }
.lang-menu .nav-menu button small { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; white-space: nowrap; }
.lang-menu .nav-menu button .check { width: 16px; height: 16px; color: var(--accent); visibility: hidden; }
.lang-menu .nav-menu button[aria-checked="true"] { font-weight: 600; }
.lang-menu .nav-menu button[aria-checked="true"] .check { visibility: visible; }

@media (max-width: 640px) {
    .navbar .wrap { padding: 0 10px; }
    .navbar-tabs { gap: 0; }
    .navbar-tabs > a, .nav-dropdown > button { padding: 0 9px; font-size: 13.5px; }
    .nav-menu { left: -40px; transform: translateY(-6px); }
    .nav-dropdown.open .nav-menu { transform: none; }
    .nav-controls { gap: 4px; }
    .lang-btn .lang-label, .lang-btn .chev { display: none; }
    .lang-btn { padding: 0; width: 36px; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 28px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-note { font-size: 13px; color: var(--text-3); }
.btn-download { height: auto; min-height: 56px; padding: 10px 28px 10px 22px; gap: 12px; }
.btn-download svg { width: 22px; height: 22px; }
.btn-lines { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.btn-lines > span { font-size: 16px; }
.btn-lines small { font-size: 12px; font-weight: 500; opacity: 0.85; }

/* ---------- Sections ---------- */
section { padding: 80px 0; }
main { padding-bottom: 48px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 12px;
}
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
.section-title { font-size: clamp(28px, 4vw, 40px); font-weight: 700; margin-bottom: 14px; }
.section-lead { color: var(--text-2); font-size: 17px; max-width: 640px; margin: 0 0 44px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

.feature { padding: 26px; transition: border-color 0.2s, transform 0.2s; }
.feature:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.feature .icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 21px;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
    margin-bottom: 16px;
}
.feature h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--text-2); font-size: 15px; }

/* ---------- Home ---------- */
.home-hero { padding: 104px 0 56px; text-align: center; }
.home-hero h1 {
    font-size: clamp(40px, 7vw, 72px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 55%, transparent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.home-hero p { color: var(--text-2); font-size: clamp(17px, 2.2vw, 20px); margin: 20px auto 0; max-width: 560px; }

/* ---------- Product cards ---------- */
.product-card {
    --brand: var(--accent);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 32px;
    color: var(--text);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.product-card::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--brand) 28%, transparent), transparent 65%);
    pointer-events: none;
    transition: opacity 0.25s;
    opacity: 0.7;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.product-card:hover::before { opacity: 1; }
.product-card > * { position: relative; }
.product-card .head { display: flex; align-items: center; gap: 18px; color: inherit; }
.product-card .head:hover { text-decoration: none; }
.product-card .head img { width: 80px; height: 80px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18)); }
.product-card h3 { font-size: 24px; font-weight: 700; }
.product-card .tagline { color: var(--text-2); margin: 4px 0 0; font-size: 15px; }
.product-card .desc { color: var(--text-2); margin: 0; }
.product-card .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 500;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid var(--border);
}

/* ---------- Product landing ---------- */
.hero { padding: 96px 0 64px; text-align: center; }
.hero .app-icon { width: 136px; height: 136px; margin: 0 auto 28px; filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.22)); }
.hero h1 { font-size: clamp(44px, 8vw, 76px); font-weight: 800; letter-spacing: -0.04em; }
.hero .tagline { font-size: clamp(18px, 2.6vw, 22px); color: var(--text-2); margin: 16px auto 36px; max-width: 680px; }
.hero .btn-row { justify-content: center; }
.hero .btn-note { margin: 16px auto 0; max-width: 520px; }

/* Screenshots already include the macOS window frame and shadow on a transparent background. */
.shot img { width: 100%; height: auto; }
.shot-caption { text-align: center; color: var(--text-3); font-size: 14px; margin-top: 14px; }

.split { display: grid; gap: 48px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) {
    .split { grid-template-columns: 5fr 7fr; }
    .split.reverse > :first-child { order: 2; }
}
.split h3 { font-size: clamp(24px, 3vw, 30px); font-weight: 700; margin-bottom: 14px; }
.split p { color: var(--text-2); font-size: 16px; }
.split ul { color: var(--text-2); padding-left: 20px; margin: 0; }
.split li { margin: 8px 0; }

.install { padding: 30px; }
.install h2 { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.install ol { margin: 0 0 16px; padding-left: 20px; color: var(--text-2); }
.install li { margin: 6px 0; }
.requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}
.codebox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 8px 8px 16px;
    overflow-x: auto;
}
.codebox code { white-space: nowrap; }
.copy-btn {
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 12px;
    cursor: pointer;
    flex: none;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }

pre.tree {
    margin: 0;
    padding: 22px;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.65;
    overflow-x: auto;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}


@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
