/* VSA Framework — site stylesheet. No build step: this file is served as it is. */

:root {
    color-scheme: light dark;

    --blue: #1d4ed8;
    --blue-soft: #5b9cff;
    --teal: #12b5a0;

    /* The gradient start has to be legible on the page behind it, so it follows the
       theme: the deep blue on white, the lighter one on near-black. */
    --grad-a: var(--blue);

    --bg: #ffffff;
    --bg-sunken: #f5f5fa;
    --bg-raised: #ffffff;
    --bg-code: #f2f2f8;
    --border: #e3e3ed;
    --border-strong: #cfcfdd;

    --text: #15151f;
    --text-soft: #52526b;
    --text-faint: #7c7c94;

    --accent: var(--blue);
    --accent-text: #ffffff;
    --btn-bg: var(--blue);
    --btn-fg: #ffffff;
    --accent-wash: rgba(29, 78, 216, 0.09);

    --shadow-sm: 0 1px 2px rgba(20, 20, 40, 0.06), 0 1px 3px rgba(20, 20, 40, 0.04);
    --shadow-md: 0 4px 12px rgba(20, 20, 40, 0.08), 0 2px 4px rgba(20, 20, 40, 0.04);
    --shadow-lg: 0 18px 50px rgba(20, 20, 40, 0.12);

    --radius: 10px;
    --radius-lg: 16px;

    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --page: 1180px;
    --prose: 780px;
    --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d0d14;
        --bg-sunken: #12121c;
        --bg-raised: #171722;
        --bg-code: #14141f;
        --border: #262635;
        --border-strong: #363648;

        --text: #eeeef6;
        --text-soft: #a8a8bf;
        --text-faint: #7e7e99;

        --accent: var(--blue-soft);
        --accent-text: #0a1020;
        --btn-bg: #2563eb;
        --btn-fg: #ffffff;
        --accent-wash: rgba(91, 156, 255, 0.15);
        --grad-a: var(--blue-soft);

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
        --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
    }
}

:root[data-theme="dark"] {
    --bg: #0d0d14;
    --bg-sunken: #12121c;
    --bg-raised: #171722;
    --bg-code: #14141f;
    --border: #262635;
    --border-strong: #363648;

    --text: #eeeef6;
    --text-soft: #a8a8bf;
    --text-faint: #7e7e99;

    --accent: var(--blue-soft);
    --accent-text: #0a1020;
    --btn-bg: #2563eb;
    --btn-fg: #ffffff;
    --accent-wash: rgba(91, 156, 255, 0.15);
    --grad-a: var(--blue-soft);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    line-height: 1.22;
    letter-spacing: -0.02em;
    margin: 0 0 0.5em;
    font-weight: 650;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code, kbd, pre, samp {
    font-family: var(--mono);
    font-size: 0.88em;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.wrap {
    width: 100%;
    max-width: var(--page);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip {
    position: absolute;
    left: -9999px;
}

.skip:focus {
    left: 12px;
    top: 12px;
    z-index: 100;
    background: var(--bg-raised);
    padding: 10px 14px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

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

.site-head {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-head .wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 680;
    letter-spacing: -0.02em;
    color: var(--text);
    font-size: 1.02rem;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 7px;
    background: linear-gradient(140deg, var(--blue), var(--teal));
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0;
}

.brand-tag {
    color: var(--text-faint);
    font-weight: 450;
    font-size: 0.82rem;
    border-left: 1px solid var(--border-strong);
    padding-left: 9px;
    margin-left: 2px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav a {
    color: var(--text-soft);
    padding: 7px 11px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 500;
}

.nav a:hover {
    color: var(--text);
    background: var(--bg-sunken);
    text-decoration: none;
}

.nav a[aria-current="page"] {
    color: var(--accent);
    background: var(--accent-wash);
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg-raised);
    color: var(--text-soft);
    cursor: pointer;
    padding: 0;
}

.icon-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.icon-btn svg {
    width: 17px;
    height: 17px;
}

:root[data-theme="dark"] .icon-sun,
:root[data-theme="light"] .icon-moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-sun {
        display: none;
    }
    :root:not([data-theme="light"]) .icon-moon {
        display: block;
    }
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .icon-moon {
        display: none;
    }
}

.nav-toggle {
    display: none;
}

@media (max-width: 800px) {
    .nav-toggle {
        display: grid;
    }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 10px var(--gutter) 14px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }

    .nav[hidden] {
        display: none;
    }

    .brand-tag {
        display: none;
    }
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 570;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--btn-bg);
    color: var(--btn-fg);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-ghost {
    background: var(--bg-raised);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-ghost:hover {
    background: var(--bg-sunken);
}

.btn svg {
    width: 17px;
    height: 17px;
    flex: none;
}

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

.hero {
    position: relative;
    padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 72px);
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -260px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 520px;
    background: radial-gradient(ellipse at center, var(--accent-wash), transparent 68%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    max-width: 840px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 560;
    letter-spacing: 0.02em;
    color: var(--text-soft);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    padding: 5px 12px 5px 8px;
    border-radius: 999px;
    margin-bottom: 20px;
}

.eyebrow .pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
}

.hero h1 {
    font-size: clamp(2.1rem, 6vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 18px;
}

.hero h1 .grad {
    background: linear-gradient(100deg, var(--grad-a), var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.lede {
    font-size: clamp(1.02rem, 2.2vw, 1.19rem);
    color: var(--text-soft);
    max-width: 66ch;
    margin: 0 0 30px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.hero-note {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-faint);
}

/* ---------- code block with copy ---------- */

.code {
    position: relative;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 18px 0;
}

.code-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 8px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-faint);
    font-weight: 550;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.code pre {
    margin: 0;
    padding: 14px;
    overflow-x: auto;
    font-size: 0.845rem;
    line-height: 1.6;
    color: var(--text);
}

.code pre code {
    font-size: inherit;
    white-space: pre;
}

.copy {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-strong);
    background: var(--bg-raised);
    color: var(--text-soft);
    border-radius: 7px;
    padding: 4px 9px;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 560;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    flex: none;
}

.copy:hover {
    color: var(--text);
}

.copy[data-copied="1"] {
    color: var(--teal);
    border-color: var(--teal);
}

.code.bare {
    background: transparent;
    border: 0;
    margin: 0;
}

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

.section {
    padding: clamp(48px, 7vw, 86px) 0;
}

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

.section-head {
    max-width: 62ch;
    margin-bottom: 38px;
}

.section-head h2 {
    font-size: clamp(1.5rem, 3.4vw, 2.05rem);
}

.section-head p {
    color: var(--text-soft);
    margin: 0;
}

.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}

.card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.card h3 {
    font-size: 1.04rem;
    margin-bottom: 7px;
}

.card p {
    color: var(--text-soft);
    margin: 0;
    font-size: 0.93rem;
}

.card p + p {
    margin-top: 10px;
}

.card .ico {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--accent-wash);
    color: var(--accent);
    margin-bottom: 14px;
}

.card .ico svg {
    width: 18px;
    height: 18px;
}

/* ---------- OS tabs ---------- */

.tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    flex-wrap: wrap;
}

.tabs button {
    appearance: none;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--text-soft);
    font: inherit;
    font-weight: 560;
    font-size: 0.94rem;
    padding: 10px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -1px;
}

.tabs button svg {
    width: 16px;
    height: 16px;
}

.tabs button:hover {
    color: var(--text);
}

.tabs button[aria-selected="true"] {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-panel {
    padding-top: 22px;
}

.tab-panel[hidden] {
    display: none;
}

/* ---------- download page ---------- */

.dl-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin: 26px 0 8px;
}

.dl-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dl-card.is-yours {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash), var(--shadow-sm);
}

.dl-card header {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 8px;
}

.dl-card header svg {
    width: 24px;
    height: 24px;
    flex: none;
    color: var(--text);
}

.dl-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.dl-card .yours {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 640;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-wash);
    padding: 3px 8px;
    border-radius: 999px;
    flex: none;
}

.dl-card .meta {
    color: var(--text-faint);
    font-size: 0.83rem;
    margin: 0 0 14px;
}

.dl-card .btn {
    width: 100%;
    margin-top: auto;
}

.steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0;
}

.steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 44px;
    padding-bottom: 26px;
    border-left: 1px solid var(--border);
    margin-left: 13px;
}

.steps > li:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.steps > li::before {
    content: counter(step);
    position: absolute;
    left: -14px;
    top: 0;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    color: var(--text-soft);
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 640;
    font-variant-numeric: tabular-nums;
}

.steps h3 {
    font-size: 1rem;
    margin: 2px 0 6px;
}

.steps p {
    color: var(--text-soft);
    margin: 0 0 10px;
    font-size: 0.94rem;
}

.note {
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: var(--bg-sunken);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 20px 0;
    font-size: 0.92rem;
    color: var(--text-soft);
}

.note strong {
    color: var(--text);
}

.note.warn {
    border-left-color: #d98324;
}

.note > :first-child {
    margin-top: 0;
}

.note > :last-child {
    margin-bottom: 0;
}

/* ---------- tables ---------- */

.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

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

th {
    background: var(--bg-sunken);
    font-weight: 620;
    white-space: nowrap;
}

tbody tr:last-child td {
    border-bottom: 0;
}

td code {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 5px;
    white-space: nowrap;
}

/* ---------- docs layout ---------- */

.docs {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    padding: 36px 0 80px;
}

.docs-nav {
    /* The markup carries `hidden` so the panel starts closed on a phone. An author
       display rule beats the UA's [hidden] rule, so this is what keeps it visible on
       a wide screen; the narrow breakpoint re-hides it with a more specific selector. */
    display: block;
    position: sticky;
    top: 84px;
    font-size: 0.92rem;
}

.docs-nav h4 {
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 8px;
    padding-left: 10px;
}

.docs-nav ul {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
}

.docs-nav a {
    display: block;
    padding: 6px 10px;
    border-radius: 7px;
    color: var(--text-soft);
    font-weight: 500;
}

.docs-nav a:hover {
    background: var(--bg-sunken);
    color: var(--text);
    text-decoration: none;
}

.docs-nav a[aria-current="page"] {
    background: var(--accent-wash);
    color: var(--accent);
    font-weight: 570;
}

.prose {
    min-width: 0;
    max-width: var(--prose);
}

.prose h1 {
    font-size: clamp(1.8rem, 4vw, 2.3rem);
    margin-bottom: 10px;
}

.prose .sub {
    color: var(--text-soft);
    font-size: 1.04rem;
    margin: 0 0 34px;
}

.prose h2 {
    font-size: 1.36rem;
    margin-top: 44px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.prose h3 {
    font-size: 1.06rem;
    margin-top: 28px;
}

.prose p, .prose li {
    color: var(--text-soft);
}

.prose strong {
    color: var(--text);
    font-weight: 620;
}

.prose li {
    margin-bottom: 7px;
}

.prose p code,
.prose li code {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 5px;
    color: var(--text);
}

.docs-foot {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 52px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    font-size: 0.93rem;
}

.docs-toggle {
    display: none;
}

@media (max-width: 900px) {
    .docs {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .docs-nav {
        position: static;
        background: var(--bg-sunken);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 12px;
    }

    .docs-nav[hidden] {
        display: none;
    }

    .docs-toggle {
        display: inline-flex;
        width: 100%;
        justify-content: space-between;
    }
}

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

.site-foot {
    border-top: 1px solid var(--border);
    background: var(--bg-sunken);
    padding: 34px 0;
    font-size: 0.9rem;
    color: var(--text-faint);
}

.site-foot .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 30px;
    align-items: center;
}

.site-foot nav {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-left: auto;
}

.site-foot a {
    color: var(--text-soft);
}
