:root {
    --bs-blue: #3b7ddd;
    --bs-blue-dark: #2f64b3;
    --bs-success: #1cbb8c;
    --bs-body-color: #495057;
    --bs-body-bg: #f5f7fb;
    --card-bg: #ffffff;
    --card-border: #e9ecef;
    --muted: #6c757d;
    --heading: #212529;
    --code-bg: #f1f3f6;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-color: #cbd5e1;
        --bs-body-bg: #161d27;
        --card-bg: #1e2733;
        --card-border: #2a3646;
        --muted: #93a2b5;
        --heading: #f1f5f9;
        --code-bg: #10161f;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", "Helvetica Neue", Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    line-height: 1.6;
}

a { color: var(--bs-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- top nav ---------- */

nav.topnav {
    padding: 20px 0;
    border-bottom: 1px solid var(--card-border);
}

nav.topnav .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* ---------- brand wordmark (recreated in text, not the old raster logo.png) -----------
   Font/colors sampled from the original img/logo.png: a humanist sans with curled t/r
   terminals and a single-story looped g (Trebuchet MS's own letterforms) - kept as a plain
   font-family name rather than a self-hosted webfont, since Trebuchet MS is a licensed
   Microsoft font PonControl doesn't have distribution rights to; it's still genuinely present
   on most Windows/Office installs, with Verdana as a same-era fallback everywhere else.
   Colors are the exact pixels sampled from the original logo (#1795bd blue, #61747a slate) -
   kept fixed across light/dark rather than swapped like the rest of the palette, the same way
   a brand mark's own colors normally don't follow a UI theme toggle. */
.brand-word {
    font-family: "Trebuchet MS", Verdana, sans-serif;
    font-weight: 700;
    color: #61747a;
    white-space: nowrap;
}

.brand-word .accent { color: #1795bd; }

.brand-tag {
    font-family: "Trebuchet MS", Verdana, sans-serif;
    color: #9aa7a6;
    white-space: nowrap;
}

nav.topnav .brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

nav.topnav .brand .brand-word { font-size: 1.55rem; }

nav.topnav .brand .brand-tag {
    font-size: 0.58rem;
    letter-spacing: -0.02em;
    margin-top: -2px;
}

nav.topnav .links {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

nav.topnav .links a {
    color: var(--bs-body-color);
    font-size: 0.92rem;
    font-weight: 600;
}

nav.topnav .links a:hover { color: var(--bs-blue); text-decoration: none; }
nav.topnav .links a.active { color: var(--bs-blue); }

.lang-switch {
    display: flex;
    gap: 4px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 3px;
}

.lang-switch a {
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
}

.lang-switch a.active {
    background: var(--bs-blue);
    color: #fff;
}

.lang-switch a:hover { text-decoration: none; }

/* ---------- hero ---------- */

.hero {
    padding: 56px 0 48px;
    text-align: center;
}

.hero .brand-word {
    font-size: 4.2rem;
    display: block;
    letter-spacing: -0.01em;
    line-height: 1;
}

.hero .brand-tag {
    display: block;
    font-size: 1.15rem;
    letter-spacing: -0.04em;
    margin: -8px 0 22px;
}

@media (max-width: 560px) {
    .hero .brand-word { font-size: 2.6rem; }
    .hero .brand-tag { font-size: 0.9rem; }
}

.hero p.lede {
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.cta-buttons {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.btn-cta {
    display: inline-block;
    width: 220px;
    padding: 17px 0;
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-cta:hover { text-decoration: none; transform: translateY(-2px); }
.btn-cta:active { transform: translateY(0); }

.btn-cta-primary {
    background: linear-gradient(135deg, var(--bs-blue), var(--bs-blue-dark));
    color: #fff;
    box-shadow: 0 8px 24px rgba(59, 125, 221, 0.4);
}

.btn-cta-primary:hover { box-shadow: 0 10px 28px rgba(59, 125, 221, 0.5); }

.btn-cta-secondary {
    background: linear-gradient(135deg, var(--card-bg), var(--bs-body-bg));
    color: var(--heading);
    border: 2px solid var(--card-border);
}

.btn-cta-secondary:hover {
    border-color: var(--bs-blue);
    color: var(--bs-blue);
    box-shadow: 0 8px 24px rgba(59, 125, 221, 0.15);
}

@media (max-width: 560px) {
    .btn-cta { width: 180px; padding: 14px 0; font-size: 1rem; }
}

.badges {
    margin-top: 28px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.badge-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- feature grid ---------- */

section.features { padding: 8px 0 64px; }

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

@media (max-width: 800px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 24px;
}

.card .icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(59, 125, 221, 0.12);
    color: var(--bs-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 1.2rem;
}

.card h3 { margin: 0 0 8px; font-size: 1.02rem; color: var(--heading); }
.card p { margin: 0; font-size: 0.92rem; color: var(--muted); }

/* ---------- generic page/content ---------- */

main.page {
    padding: 48px 0 64px;
}

main.page h1.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--heading);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

main.page p.page-lede {
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 700px;
    margin: 0 0 36px;
}

.content-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 8px 32px;
}

.content-card h2 {
    font-size: 1.3rem;
    color: var(--heading);
    margin: 32px 0 12px;
}

.content-card h2:first-child { margin-top: 28px; }

.content-card h3 {
    font-size: 1.05rem;
    color: var(--heading);
    margin: 22px 0 8px;
}

.content-card p { margin: 0 0 14px; }
.content-card ul, .content-card ol { margin: 0 0 14px; padding-left: 22px; }
.content-card li { margin-bottom: 6px; }

.content-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 18px;
    font-size: 0.92rem;
}

.content-card table th, .content-card table td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--card-border);
}

.content-card table th { color: var(--heading); font-weight: 600; }

.content-card code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.content-card pre {
    background: var(--code-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

.content-card pre code { background: none; padding: 0; }

.content-card hr {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 28px 0;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 0;
}

/* ---------- documentation accordion ---------- */

details.doc-section {
    border-bottom: 1px solid var(--card-border);
    padding: 18px 0;
}

details.doc-section:last-of-type { border-bottom: none; }

details.doc-section summary {
    cursor: pointer;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--heading);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

details.doc-section summary::-webkit-details-marker { display: none; }

details.doc-section summary .chev {
    color: var(--muted);
    transition: transform 0.15s;
    font-size: 0.85rem;
}

details.doc-section[open] summary .chev { transform: rotate(180deg); }

details.doc-section .doc-body {
    padding-top: 14px;
    font-size: 0.95rem;
}

/* ---------- what's new ---------- */

.whatsnew-list { display: flex; flex-direction: column; }

.whatsnew-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--card-border);
}

.whatsnew-row:last-child { border-bottom: none; }

.whatsnew-row .date {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    padding-top: 2px;
}

.whatsnew-row .summary { font-size: 0.96rem; }

@media (max-width: 560px) {
    .whatsnew-row { grid-template-columns: 1fr; gap: 4px; }
}

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

footer.site-footer {
    border-top: 1px solid var(--card-border);
    padding: 28px 0 40px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}
