/*
 * The site's whole stylesheet. No framework, no build step.
 *
 * Colours and radius match the app (src/renderer/src/index.css): change the
 * tokens below and both read as one product. Dark mode follows the visitor's
 * system until they use the toggle (site.js).
 */

:root {
    --bg: #ffffff;
    --bg-soft: #f6f7f9;
    --fg: #16181d;
    --muted: #5d6470;
    --border: #e4e6eb;
    --card: #ffffff;
    --primary: #2f5fd0;
    --primary-fg: #ffffff;
    --primary-soft: rgba(47, 95, 208, 0.1);
    --success: #1f8a4c;
    --warning: #a86a00;
    --danger: #c43c3c;
    --code-bg: #f1f3f6;
    --radius: 0.75rem;
    --shadow-sm:
        0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
    --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
    --max: 1120px;
    --font:
        ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color-scheme: light;
}

.dark {
    --bg: #0b0c0f;
    --bg-soft: #121419;
    --fg: #eef0f4;
    --muted: #9aa1ad;
    --border: #262a33;
    --card: #14161b;
    --primary: #5b86ec;
    --primary-fg: #ffffff;
    --primary-soft: rgba(91, 134, 236, 0.14);
    --success: #4cc584;
    --warning: #f0b84a;
    --danger: #ef6b6b;
    --code-bg: #1b1e25;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary);
    text-underline-offset: 2px;
}

h1,
h2,
h3 {
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    margin: 0 0 1rem;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin: 0 0 0.75rem;
}

h3 {
    font-size: 1.1rem;
    margin: 0 0 0.4rem;
}

code,
kbd {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--code-bg);
    border-radius: 0.3rem;
    padding: 0.1em 0.35em;
}

kbd {
    border: 1px solid var(--border);
    border-bottom-width: 2px;
}

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.center {
    text-align: center;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 0.5rem;
}

.lede {
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 40rem;
    margin: 0 auto 1.75rem;
}

/* ------------------------------------------------------------- header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--fg);
    text-decoration: none;
}

.brand img {
    width: 28px;
    height: 28px;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--fg);
    background: var(--bg-soft);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--fg);
    cursor: pointer;
}

.nav-toggle {
    display: none;
}

@media (max-width: 760px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 1.25rem 1rem;
    }
    body.nav-open .nav-links {
        display: flex;
    }
    .nav-toggle {
        display: inline-flex;
    }
    .header-actions .btn-primary {
        display: none;
    }
}

/* ------------------------------------------------------------ buttons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    border-radius: 0.6rem;
    font-weight: 600;
    font-size: 0.98rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-fg);
}

.btn-primary:hover {
    background: color-mix(in srgb, var(--primary) 88%, black);
}

.btn-outline {
    border-color: var(--border);
    color: var(--fg);
    background: var(--card);
}

.btn-outline:hover {
    border-color: var(--muted);
}

.btn-lg {
    padding: 0.85rem 1.6rem;
    font-size: 1.05rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.88rem;
}

.btn[disabled] {
    opacity: 0.6;
    cursor: default;
}

/* ----------------------------------------------------------- sections */

main section {
    padding: 4.5rem 0;
}

.band {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-head {
    max-width: 44rem;
    margin: 0 auto 2.5rem;
    text-align: center;
}

.section-head p {
    color: var(--muted);
}

.hero {
    padding: 5rem 0 3rem;
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-meta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.hero-shot {
    margin: 3rem auto 0;
    max-width: 1000px;
}

.page-head {
    padding: 3.5rem 0 1rem;
}

.page-head p {
    color: var(--muted);
    max-width: 44rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--primary-soft);
    color: var(--primary);
}

/* -------------------------------------------------------------- cards */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.grid {
    display: grid;
    gap: 1.25rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.feature .icon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    background: var(--primary-soft);
    color: var(--primary);
    margin-bottom: 0.9rem;
}

.feature .icon svg {
    width: 20px;
    height: 20px;
}

.feature p {
    color: var(--muted);
    margin: 0;
}

.steps {
    counter-reset: step;
}

.steps .card::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-fg);
    font-weight: 700;
    margin-bottom: 0.8rem;
}

/* --------------------------------------------------------- screenshots */

/* A screenshot in a window-ish frame. <picture> swaps in the dark one. */
.shot {
    margin: 1.5rem 0;
}

.shot img {
    display: block;
    border-radius: 0.6rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    background: var(--card);
}

.shot figcaption {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.6rem;
}

/* ---------------------------------------------------------- downloads */

.download-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.download-card[data-featured="true"] {
    box-shadow:
        inset 0 0 0 2px var(--primary),
        var(--shadow-md);
}

.download-card h2 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-card ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: 0.6rem;
}

.download-card li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.download-card li span {
    color: var(--muted);
    font-size: 0.9rem;
}

.release-line {
    color: var(--muted);
}

/* -------------------------------------------------------------- guide */

.doc-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 3rem;
    padding-bottom: 4rem;
}

.toc {
    position: sticky;
    top: 88px;
    align-self: start;
    font-size: 0.92rem;
}

.toc a {
    display: block;
    color: var(--muted);
    text-decoration: none;
    padding: 0.25rem 0;
}

.toc a:hover {
    color: var(--fg);
}

.doc h2 {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.doc h2:first-child {
    margin-top: 0;
    border-top: 0;
}

/* Narrow screenshots side by side. */
.shots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    align-items: start;
    margin: 1.5rem 0;
}

.shots .shot {
    margin: 0;
}

.callout {
    border-left: 3px solid var(--primary);
    background: var(--primary-soft);
    padding: 0.8rem 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1.25rem 0;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: 0.95rem;
}

th,
td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

@media (max-width: 860px) {
    .doc-layout {
        grid-template-columns: 1fr;
    }
    .toc {
        position: static;
    }
}

/* ---------------------------------------------------------- changelog */

.release {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.release h2 {
    font-size: 1.35rem;
    margin: 0;
}

.release .meta {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0.25rem 0 0.75rem;
}

.release .notes h3 {
    font-size: 1rem;
    margin-top: 1rem;
}

/* -------------------------------------------------------------- forms */

.form {
    display: grid;
    gap: 1rem;
    max-width: 40rem;
}

.form label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.form input,
.form select,
.form textarea {
    font: inherit;
    font-weight: 400;
    color: var(--fg);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
}

.form textarea {
    min-height: 9rem;
    resize: vertical;
}

.form .hint {
    color: var(--muted);
    font-weight: 400;
    font-size: 0.85rem;
}

/* A field for bots only: off-screen, not display:none (bots skip those). */
.form .trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.status {
    min-height: 1.5em;
    color: var(--muted);
}

.status.error {
    color: var(--danger);
}

/* ------------------------------------------------------------- footer */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    justify-content: space-between;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--fg);
}

[hidden] {
    display: none !important;
}
