:root {
    --bg: #0b0f14;
    --bg-2: #10161d;
    --panel: #141b24;
    --panel-2: #19222d;
    --line: #233041;
    --text: #e8eef5;
    --muted: #8a99ab;
    --accent: #31b0e9;
    --accent-2: #1b8fc4;
    --accent-glow: rgba(49, 176, 233, 0.35);
    --good: #3ddc97;
    --bad: #ff5c6c;
    --radius: 14px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--panel-2); padding: 2px 6px; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: 10px;
    padding: 10px 18px; font: 600 0.95rem var(--font); cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
    color: var(--text); background: var(--panel-2); white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #04121b; box-shadow: 0 8px 24px var(--accent-glow); }
.btn-primary:hover { background: #4cc0f2; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.icon-btn:hover { color: var(--text); }

/* ---------- top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 15, 20, 0.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; }
.brand-name { font-size: 1.2rem; }
.brand-name span { color: var(--accent); }
.brand-sm .brand-logo { width: 28px; height: 28px; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--text); text-decoration: none; }
.nav a.active { position: relative; }
.nav a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -23px; height: 2px; background: var(--accent); }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.basket-btn { position: relative; padding: 10px 14px; }
.basket-count {
    position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px; background: #fff; color: #04121b; font-size: 0.72rem; font-weight: 800;
    display: grid; place-items: center;
}
.menu-btn { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }

.demo-banner {
    background: linear-gradient(90deg, #1b8fc4, #31b0e9); color: #04121b; text-align: center;
    padding: 8px 16px; font-weight: 600; font-size: 0.9rem;
}
.demo-banner code { background: rgba(255, 255, 255, 0.35); }

/* ---------- hero ---------- */
.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero::before {
    content: ''; position: absolute; inset: -40% -20% auto; height: 120%;
    background: radial-gradient(closest-side, rgba(49, 176, 233, 0.22), transparent 70%);
    pointer-events: none;
}
.hero-banner { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .18; pointer-events: none; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; color: var(--accent); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: .12em; }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.7rem); line-height: 1.05; letter-spacing: -0.035em; margin: 16px 0 18px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 0 0 30px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.fw-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.fw-chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 13px; font-size: 0.82rem; color: var(--muted); font-weight: 600; }

.pulse-card {
    position: relative; background: linear-gradient(160deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow);
}
.pulse-card h4 { margin: 0 0 14px; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; }
.steps .num {
    width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    background: rgba(49, 176, 233, 0.12); color: var(--accent); font-weight: 800;
}
.steps strong { display: block; }
.steps span { color: var(--muted); font-size: 0.92rem; }
.pulse-line { margin-top: 18px; height: 42px; width: 100%; }
.pulse-line path { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-dasharray: 320; animation: pulse 3s linear infinite; filter: drop-shadow(0 0 6px var(--accent)); }
@keyframes pulse { from { stroke-dashoffset: 640; } to { stroke-dashoffset: 0; } }

/* ---------- sections ---------- */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { font-size: 2rem; letter-spacing: -0.03em; margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }

.perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.perk { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.perk .ico { width: 40px; height: 40px; border-radius: 10px; background: rgba(49, 176, 233, 0.12); display: grid; place-items: center; margin-bottom: 12px; }
.perk .ico svg { width: 20px; height: 20px; fill: var(--accent); }
.perk h3 { margin: 0 0 6px; font-size: 1.05rem; }
.perk p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* ---------- store ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.search {
    flex: 1 1 260px; display: flex; align-items: center; gap: 10px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 14px;
}
.search input { flex: 1; background: none; border: 0; color: var(--text); font: 500 0.95rem var(--font); padding: 11px 0; outline: none; }
.search svg { width: 18px; height: 18px; fill: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 7px 14px; font: 600 0.85rem var(--font); cursor: pointer; }
.chip.active, .chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: rgba(49, 176, 233, 0.12); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card {
    position: relative; display: flex; flex-direction: column;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(49, 176, 233, 0.55); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4); }
.card-media {
    aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0f2231, #0b141c);
    display: grid; place-items: center; position: relative; overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .placeholder { font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; color: rgba(232, 238, 245, 0.85); text-align: center; padding: 0 18px; }
.card-media .placeholder::after { content: ''; display: block; width: 46px; height: 3px; background: var(--accent); margin: 10px auto 0; border-radius: 2px; }
.card-tag { position: absolute; top: 12px; left: 12px; background: rgba(11, 15, 20, 0.75); border: 1px solid var(--line); border-radius: 999px; font-size: 0.75rem; font-weight: 700; padding: 3px 10px; color: var(--muted); }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.1rem; }
.card-body h3 a { color: var(--text); }
.card-body p { margin: 0; color: var(--muted); font-size: 0.92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.price { font-weight: 800; font-size: 1.15rem; }
.price s { color: var(--muted); font-weight: 500; font-size: 0.9rem; margin-right: 6px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- product page ---------- */
.product { display: grid; grid-template-columns: 1.35fr .65fr; gap: 32px; align-items: start; padding: 40px 0 64px; }
.crumbs { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.product h1 { font-size: 2.3rem; letter-spacing: -0.03em; margin: 0 0 10px; }
.product .lead { color: var(--muted); font-size: 1.08rem; margin: 0 0 24px; }
.product-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin-bottom: 24px; }
.buy-box { position: sticky; top: 92px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.buy-box .price { font-size: 2rem; display: block; margin-bottom: 4px; }
.buy-box ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; color: var(--muted); font-size: 0.9rem; }
.buy-box li::before { content: '\2713'; color: var(--good); margin-right: 8px; font-weight: 800; }
.buy-box .btn { margin-top: 18px; }
.feature-list { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; }
.feature-list li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 12px 40px; position: relative; }
.feature-list li::before { content: ''; position: absolute; left: 16px; top: 19px; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { background: none; border: 0; color: var(--muted); font: 600 0.95rem var(--font); padding: 12px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* markdown docs */
.md { color: #cfd8e3; }
.md h1 { display: none; }
.md h2 { color: var(--text); font-size: 1.35rem; margin: 30px 0 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.md h2:first-of-type { border-top: 0; padding-top: 0; }
.md h3 { color: var(--text); }
.md table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.92rem; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.md th { background: var(--panel-2); color: var(--text); }
.md pre { background: #0a0e13; border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md li { margin: 4px 0; }

.docs-layout { display: grid; grid-template-columns: 250px 1fr; gap: 32px; padding: 40px 0 64px; }
.docs-nav { position: sticky; top: 92px; align-self: start; display: grid; gap: 4px; }
.docs-nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.docs-nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.docs-nav a.active { background: rgba(49, 176, 233, 0.12); color: var(--accent); }
.docs-content { min-width: 0; }

.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; }
.faq summary::after { content: '+'; float: right; color: var(--accent); font-size: 1.2rem; }
.faq details[open] summary::after { content: '-'; }
.faq details p { color: var(--muted); margin: 0 0 16px; }

.notice { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 40px; text-align: center; max-width: 640px; margin: 60px auto; }
.notice h1 { margin-top: 0; }
.notice .big { font-size: 3rem; }

/* ---------- basket drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity .25s ease; }
.drawer-panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
    background: var(--bg-2); border-left: 1px solid var(--line); display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform .28s ease;
}
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; display: grid; gap: 12px; align-content: start; }
.drawer-foot { border-top: 1px solid var(--line); padding: 18px 20px; display: grid; gap: 12px; }
.line-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.line-item strong { font-size: 0.98rem; }
.line-item .remove { background: none; border: 0; color: var(--muted); cursor: pointer; font: 500 0.82rem var(--font); padding: 0; justify-self: start; }
.line-item .remove:hover { color: var(--bad); }
.total-row { display: flex; justify-content: space-between; font-size: 1.1rem; }
.coupon { display: flex; gap: 8px; }
.coupon input { flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: 500 0.92rem var(--font); }
.fineprint { margin: 0; color: var(--muted); font-size: 0.8rem; }
.user-pill { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 0.9rem; }

/* ---------- toasts ---------- */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 10px; }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); max-width: 340px; animation: toastIn .25s ease; }
.toast.error { border-left-color: var(--bad); }
.toast.success { border-left-color: var(--good); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: flex-end; align-items: start; }
.footer-links a { color: var(--muted); }
.footer .small { grid-column: 1 / -1; }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .hero-inner, .product, .docs-layout { grid-template-columns: 1fr; }
    .perks { grid-template-columns: repeat(2, 1fr); }
    .buy-box, .docs-nav { position: static; }
    .docs-nav { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 760px) {
    .nav {
        position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
        background: var(--bg-2); border-bottom: 1px solid var(--line); display: none;
    }
    .nav.open { display: flex; }
    .nav a { padding: 14px 16px; border-top: 1px solid var(--line); }
    .nav a.active::after { display: none; }
    .menu-btn { display: block; }
    #loginLabel { display: none; }
    .perks { grid-template-columns: 1fr; }
    .hero { padding: 56px 0 40px; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-links { justify-content: flex-start; }
    .topbar-inner { gap: 12px; }
}

/* logo PNGs have a black background - screen blending drops it into the page */
.brand-logo, .hero-logo { mix-blend-mode: screen; }
.brand-logo { width: 62px; height: 35px; object-fit: contain; }
.hero-logo { width: min(420px, 100%); height: auto; margin: -10px 0 8px -12px; }

/* ---------- maintenance screen ---------- */
body.maint { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, rgba(49, 176, 233, 0.16), transparent 60%), var(--bg); }
.maint-wrap { text-align: center; padding: 40px 16px; max-width: 620px; }
.maint-logo { width: min(460px, 90vw); margin: 0 auto 12px; mix-blend-mode: screen; }
.maint-wrap h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.03em; margin: 0 0 10px; }
.maint-wrap p { color: var(--muted); font-size: 1.1rem; margin: 0 0 26px; }
.maint-wrap .pulse-line { margin: 34px auto 0; max-width: 320px; }
