/* ===== tokens ===== */
:root {
    --bg: #06070d;
    --bg-2: #0a0d17;
    --panel: rgba(255, 255, 255, 0.038);
    --panel-2: rgba(255, 255, 255, 0.06);
    --solid: #0c101c;
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.16);
    --ink: #eef1f8;
    --ink-2: #a3adc2;
    --ink-3: #6d788e;
    --brand: #6366f1;
    --brand-2: #8b5cf6;
    --accent: #22d3ee;
    --hot: #f472b6;
    --ok: #34d399;
    --warn: #fbbf24;
    --radius: 14px;
    --radius-lg: 22px;
    --radius-sm: 10px;
    --shadow: 0 26px 60px -32px rgba(0, 0, 0, 0.95);
    --shadow-sm: 0 10px 26px -18px rgba(0, 0, 0, 0.9);
    --glow-1: rgba(99, 102, 241, 0.34);
    --glow-2: rgba(34, 211, 238, 0.2);
    --glow-3: rgba(244, 114, 182, 0.2);
    --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans', 'Microsoft YaHei', Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    /* iPhone home-indicator inset, used by fixed bottom UI */
    --safe-b: env(safe-area-inset-bottom, 0px);
}

[data-theme="light"] {
    --bg: #f4f5fb;
    --bg-2: #eceefa;
    --panel: rgba(255, 255, 255, 0.72);
    --panel-2: rgba(255, 255, 255, 0.9);
    --solid: #ffffff;
    --line: rgba(13, 18, 32, 0.10);
    --line-2: rgba(13, 18, 32, 0.18);
    --ink: #0d1220;
    --ink-2: #4a5468;
    --ink-3: #7b8598;
    --shadow: 0 26px 60px -34px rgba(13, 18, 32, 0.4);
    --shadow-sm: 0 10px 26px -20px rgba(13, 18, 32, 0.35);
    --glow-1: rgba(99, 102, 241, 0.24);
    --glow-2: rgba(34, 211, 238, 0.18);
    --glow-3: rgba(244, 114, 182, 0.18);
}

/* ===== reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.62;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.025em; font-weight: 700; }
ul, ol { margin-left: 20px; }

.shell {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 22px;
}

/* ===== backdrop ===== */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg);
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

.g1 { width: 60vw; height: 60vw; left: -18vw; top: -22vw; background: var(--glow-1); }
.g2 { width: 46vw; height: 46vw; right: -16vw; top: 4vh; background: var(--glow-2); }
.g3 { width: 44vw; height: 44vw; left: 24vw; bottom: -22vw; background: var(--glow-3); }

.backdrop .grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(130% 90% at 50% -10%, #000 0%, transparent 72%);
    mask-image: radial-gradient(130% 90% at 50% -10%, #000 0%, transparent 72%);
    opacity: 0.9;
}

@media (prefers-reduced-motion: no-preference) {
    .glow { animation: drift 30s ease-in-out infinite alternate; }
    .g2 { animation-duration: 38s; animation-delay: -8s; }
    .g3 { animation-duration: 44s; animation-delay: -16s; }
}

@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(5vw, 6vh, 0) scale(1.15); }
}

/* ===== topbar ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 66px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    flex: none;
}

.brand img { width: 30px; height: 30px; border-radius: 9px; }
.brand em { font-style: normal; color: var(--ink-3); font-weight: 600; }

.topnav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    overflow-x: auto;
    scrollbar-width: none;
}

.topnav::-webkit-scrollbar { display: none; }

.topnav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
    transition: 0.18s;
}

.topnav-link i { font-style: normal; font-size: 0.95rem; }
.topnav-link:hover { color: var(--ink); background: var(--panel-2); }

.topnav-link.is-active {
    color: var(--ink);
    background: var(--panel-2);
    box-shadow: inset 0 0 0 1px var(--line-2);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.iconbtn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 1rem;
    transition: 0.18s;
}

.iconbtn:hover { color: var(--ink); border-color: var(--line-2); background: var(--panel-2); }
.iconbtn[aria-expanded="true"] { color: var(--ink); border-color: var(--line-2); background: var(--panel-2); }
.iconbtn .moon { display: none; }

/* hamburger is mobile only */
.menubtn { display: none; }
[data-theme="light"] .iconbtn .sun { display: none; }
[data-theme="light"] .iconbtn .moon { display: block; }

/* ===== hero ===== */
.hero { padding: 66px 0 24px; }

/* home keeps the fold tight: input first, tools right below */
.home-hero { padding: 50px 0 16px; }
.home-hero .badge { margin-bottom: 16px; }
.home-hero .hero p { margin-bottom: 24px; }
.console { padding: 20px 0 6px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--ink-2);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 22px;
}

.badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent);
}

.hero h1 {
    font-size: clamp(2.3rem, 6vw, 4.05rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    margin-bottom: 14px;
    max-width: 20ch;
    background: linear-gradient(150deg, var(--ink) 32%, var(--brand) 78%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.06rem;
    color: var(--ink-2);
    max-width: 62ch;
    margin-bottom: 30px;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.pilllink {
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--ink-2);
    font-size: 0.95rem;
    transition: 0.18s;
}

.pilllink:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-1px); }

/* ===== page head ===== */
.pagehead { padding: 66px 0 20px; }

.pagehead-grid {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 26px;
}

.pagehead h1 {
    font-size: clamp(1.7rem, 4.2vw, 2.7rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 10px;
}

.pagehead p {
    color: var(--ink-2);
    font-size: 1rem;
    max-width: 68ch;
}

.pagehead-sample {
    font-size: 2rem;
    color: var(--ink-3);
    white-space: nowrap;
    opacity: 0.5;
    flex: none;
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.8rem;
    color: var(--ink-3);
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.crumbs a:hover { color: var(--ink); }

/* ===== sections ===== */
.section { padding: 30px 0; }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.section-head h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.section-head p { color: var(--ink-3); font-size: 0.88rem; }

/* ===== footer ===== */
.footer {
    margin-top: 46px;
    padding: 46px 0 34px;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 60%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 30px;
}

.footer-col { display: flex; flex-direction: column; gap: 9px; }

.footer-col h4 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 4px;
}

.footer-col a { font-size: 0.88rem; color: var(--ink-2); transition: 0.16s; }
.footer-col a:hover { color: var(--brand); }

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.footer-brand img { width: 26px; height: 26px; border-radius: 8px; }
.footer-col p { font-size: 0.88rem; color: var(--ink-3); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
    color: var(--ink-3);
}

.footer-disclosure {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    max-width: 920px;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--ink-3);
}

.footer-disclosure a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.footer-disclosure a:hover { color: var(--brand); }

/* ===== legal ===== */
.legal {
    max-width: 860px;
    margin: 0 auto;
    padding: 34px 36px;
}

.legal h2 { font-size: 1.2rem; margin: 28px 0 10px; }
.legal h2:first-child { margin-top: 0; }
.legal h3 { font-size: 1.02rem; margin: 20px 0 8px; }
.legal p { color: var(--ink-2); margin-bottom: 14px; font-size: 0.94rem; }
.legal ul { color: var(--ink-2); margin: 0 0 16px 22px; font-size: 0.94rem; }
.legal li { margin-bottom: 7px; }
.legal a { color: var(--brand); }
.legal strong { color: var(--ink); }
.legal code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--panel-2);
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* ===== notfound ===== */
.notfound { text-align: center; padding-top: 90px; }
.notfound .shell { max-width: 900px; }
.notfound h1 { font-size: 1.5rem; margin-bottom: 10px; }
.notfound p { margin: 0 auto 26px; }
.notfound .composer { text-align: left; }

.notfound-code {
    font-size: clamp(3.4rem, 13vw, 6.5rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 1;
    background: linear-gradient(140deg, var(--brand), var(--accent) 60%, var(--hot));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 14px;
}

/* ===== responsive ===== */
@media (max-width: 1080px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .topbar-inner { gap: 12px; }
    /* the docked nav leaves the flex flow, so push the action cluster to the edge */
    .topbar-actions { margin-left: auto; }
    .menubtn { display: inline-flex; }
    .topnav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 5;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin: 0;
        padding: 10px 16px calc(14px + var(--safe-b));
        max-height: calc(100vh - 90px);
        overflow-x: hidden;
        overflow-y: auto;
        background: var(--solid);
        border-top: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
    }
    .topnav.is-open { display: flex; }
    .topnav-link {
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 14px;
        font-size: 0.95rem;
        border-radius: var(--radius-sm);
        white-space: normal;
    }
    .topnav-link i { font-size: 1.05rem; }
    .footer { padding-bottom: calc(34px + var(--safe-b)); }
    body.has-cookiebar .footer { padding-bottom: calc(190px + var(--safe-b)); }
    .pagehead-grid { flex-direction: column; align-items: flex-start; }
    .pagehead-sample { display: none; }
    .hero { padding-top: 46px; }
}

@media (max-width: 640px) {
    .shell { padding: 0 16px; }
    .section { padding: 22px 0; }
    .legal { padding: 24px 20px; }

    /* footer: brand on its own row, link groups in two columns */
    .footer { padding: 32px 0 calc(24px + var(--safe-b)); }
    .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }
    .footer-col:first-child { grid-column: 1 / -1; }
    .footer-col { gap: 6px; }
    .footer-col h4 { margin-bottom: 2px; font-size: 0.62rem; letter-spacing: 0.08em; }
    .footer-col a { font-size: 0.8rem; line-height: 1.5; }
    .footer-disclosure { margin-top: 16px; padding-top: 14px; font-size: 0.74rem; }
    .footer-bottom { margin-top: 16px; padding-top: 14px; gap: 8px; }
}

@media (max-width: 420px) {
    .brand em { display: none; }
    .topbar-actions { gap: 6px; }
    .iconbtn { width: 34px; height: 34px; }
}