:root {
    --ifm-color-primary: #6c5ce7;
    --ifm-color-primary-dark: #5a48e0;
    --ifm-color-primary-darker: #5140dc;
    --ifm-color-primary-darkest: #3a2ac5;
    --ifm-color-primary-light: #7e70ee;
    --ifm-color-primary-lighter: #877af0;
    --ifm-color-primary-lightest: #a49af5;
    --ifm-code-font-size: 95%;
    --docusaurus-highlighted-code-line-bg: rgba(108, 92, 231, 0.1);
}

[data-theme='dark'] {
    --ifm-color-primary: #a29bfe;
    --ifm-color-primary-dark: #8b82fe;
    --ifm-color-primary-darker: #7d73fd;
    --ifm-color-primary-darkest: #524bfd;
    --ifm-color-primary-light: #b9b4fe;
    --ifm-color-primary-lighter: #c7c3fe;
    --ifm-color-primary-lightest: #eeedff;
    --ifm-background-color: #1a1a2e;
    --ifm-background-surface-color: #16213e;
    --ifm-navbar-background-color: #0f3460;
    --ifm-footer-background-color: #0a1628;
    --docusaurus-highlighted-code-line-bg: rgba(162, 155, 254, 0.15);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* GitHub icon in navbar */
.header-github-link::before {
    content: '';
    width: 24px;
    height: 24px;
    display: flex;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12' fill='%23333'/%3E%3C/svg%3E") no-repeat;
}

[data-theme='dark'] .header-github-link::before {
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12' fill='%23fff'/%3E%3C/svg%3E") no-repeat;
}

.header-github-link:hover {
    opacity: 0.7;
}

/* Logo grids in doc pages (funding & institutions) */
.funding-logo-grid,
.institution-logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    margin: 1.5rem 0 2rem;
}

.funding-logo-grid a,
.institution-logo-grid a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.funding-logo-grid img,
.institution-logo-grid img {
    height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    opacity: 0.55;
    filter: grayscale(100%);
    transition: all 0.25s ease;
}

[data-theme='dark'] .funding-logo-grid img,
[data-theme='dark'] .institution-logo-grid img {
    filter: grayscale(100%) invert(1);
}

.funding-logo-grid a:hover img,
.institution-logo-grid a:hover img {
    opacity: 1;
    filter: none;
}

/* Version badge in navbar */
.navbar-version-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.15rem 0.55rem;
    border-radius: 12px;
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.25);
    color: var(--ifm-color-primary);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

[data-theme='dark'] .navbar-version-badge {
    background: rgba(162, 155, 254, 0.12);
    border-color: rgba(162, 155, 254, 0.25);
    color: var(--ifm-color-primary-light);
}

/* ═══════════════════════════════════════
 *  Download Page
 * ═══════════════════════════════════════ */

/* Hero */
.dl-hero {
    background: var(--ifm-color-primary);
    color: #fff;
    padding: 3rem 0 2rem;
    text-align: center;
}

.dl-hero h1 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.dl-hero__sub {
    font-size: 1rem;
    opacity: 0.85;
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Card sections */
.dl-card {
    background: var(--ifm-background-surface-color);
    border: 1px solid var(--ifm-color-emphasis-200);
    border-radius: 8px;
    padding: 1.75rem 2rem;
    margin-bottom: 1rem;
}

.dl-card--full {
    height: 100%;
}

.dl-row-gap {
    margin-bottom: 1rem;
}

.dl-row-gap>[class*='col'] {
    margin-bottom: 0;
}

.dl-card>h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.dl-card__desc {
    color: var(--ifm-color-emphasis-700);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1rem;
    max-width: 680px;
}

.dl-sub-heading {
    margin-top: 1.25rem !important;
    margin-bottom: 0.15rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
}

/* Release metadata line */
.dl-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    color: var(--ifm-color-emphasis-600);
}

.dl-meta__tag {
    font-weight: 600;
    color: var(--ifm-color-primary);
}

[data-theme='dark'] .dl-meta__tag {
    color: var(--ifm-color-primary-light);
}

.dl-meta__sep {
    color: var(--ifm-color-emphasis-300);
    user-select: none;
}

.dl-meta__date {
    font-weight: 400;
}

.dl-meta__sha {
    font-family: var(--ifm-font-family-monospace);
    font-size: 0.78rem;
    color: var(--ifm-color-emphasis-600);
    text-decoration: none !important;
}

.dl-meta__sha:hover {
    color: var(--ifm-color-primary);
}

/* Tables */
.dl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.dl-table thead {
    border-bottom: 2px solid var(--ifm-color-emphasis-200);
}

.dl-table th {
    padding: 0.5rem 0.65rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ifm-color-emphasis-500);
    text-align: left;
}

.dl-table td {
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid var(--ifm-color-emphasis-100);
    vertical-align: middle;
}

.dl-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.015);
}

[data-theme='dark'] .dl-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.dl-table a {
    font-weight: 500;
    word-break: break-all;
}

.dl-table__right {
    text-align: right !important;
}

.dl-table__mono {
    font-family: var(--ifm-font-family-monospace);
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Privacy notice */
.dl-privacy {
    padding: 0.85rem 1rem;
    background: var(--ifm-background-color);
    border-left: 3px solid var(--ifm-color-primary);
    font-size: 0.88rem;
    line-height: 1.55;
    margin: 0.75rem 0 1rem;
    color: var(--ifm-color-emphasis-700);
}

[data-theme='dark'] .dl-privacy {
    background: rgba(255, 255, 255, 0.03);
}

/* Links row */
.dl-links {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.dl-links__sep {
    margin: 0 0.35rem;
    color: var(--ifm-color-emphasis-300);
}

/* Sub cards (Getting Started) */
.dl-sub-card {
    background: var(--ifm-background-color);
    border: 1px solid var(--ifm-color-emphasis-200);
    border-radius: 6px;
    padding: 1.25rem;
    height: 100%;
}

.dl-sub-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.dl-steps {
    margin-bottom: 0.85rem;
    padding-left: 1.15rem;
    font-size: 0.88rem;
    line-height: 1.6;
}

/* Code blocks */
.dl-code {
    background: var(--ifm-background-color);
    border: 1px solid var(--ifm-color-emphasis-200);
    border-radius: 6px;
    padding: 0.75rem 0.85rem;
    font-size: 0.8rem;
    overflow-x: auto;
    margin: 0.5rem 0 0.85rem;
}

[data-theme='dark'] .dl-code {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Hint text */
.dl-hint {
    font-size: 0.82rem;
    color: var(--ifm-color-emphasis-600);
    line-height: 1.5;
    margin-top: 0.35rem;
}

/* License footer */
.dl-license {
    text-align: center;
    font-size: 0.82rem;
    color: var(--ifm-color-emphasis-500);
    margin: 0.5rem 0 0;
}

/* Compact asset list (for side-by-side columns) */
.dl-asset-group {
    margin-bottom: 0.75rem;
}

.dl-asset-group__heading {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ifm-color-emphasis-500);
    margin-bottom: 0.3rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid var(--ifm-color-emphasis-100);
}

.dl-asset-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dl-asset-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--ifm-color-emphasis-100);
    font-size: 0.84rem;
}

.dl-asset-list li:last-child {
    border-bottom: none;
}

.dl-asset-list a {
    font-weight: 500;
}

.dl-asset-list__size {
    font-family: var(--ifm-font-family-monospace);
    font-size: 0.76rem;
    color: var(--ifm-color-emphasis-500);
    white-space: nowrap;
    margin-left: 0.75rem;
}

.dl-variant-note {
    font-size: 0.78rem;
    color: var(--ifm-color-emphasis-500);
    margin: -0.15rem 0 0.6rem;
    line-height: 1.35;
}

/* Badge labels */
.dl-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    vertical-align: middle;
    line-height: 1.4;
}

.dl-badge--experimental {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

[data-theme='dark'] .dl-badge--experimental {
    background: rgba(255, 193, 7, 0.15);
    color: #ffd54f;
    border-color: rgba(255, 193, 7, 0.4);
}

/* Experimental note block */
.dl-experimental-note {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--ifm-color-emphasis-700);
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
}

[data-theme='dark'] .dl-experimental-note {
    background: rgba(255, 193, 7, 0.08);
    color: var(--ifm-color-emphasis-600);
}

/* Right-side table of contents */
.dl-toc {
    position: sticky;
    top: calc(var(--ifm-navbar-height) + 1rem);
    max-height: calc(100vh - var(--ifm-navbar-height) - 2rem);
    overflow-y: auto;
    padding-left: 1rem;
    border-left: 1px solid var(--ifm-color-emphasis-200);
}

.dl-toc__title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ifm-color-emphasis-500);
    margin-bottom: 0.5rem;
}

.dl-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dl-toc__list li {
    margin-bottom: 0.15rem;
}

.dl-toc__link {
    display: block;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    color: var(--ifm-color-emphasis-600);
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.dl-toc__link:hover {
    color: var(--ifm-color-primary);
    background: rgba(108, 92, 231, 0.05);
    text-decoration: none;
}

.dl-toc__link--active {
    color: var(--ifm-color-primary);
    font-weight: 600;
    border-left: 2px solid var(--ifm-color-primary);
    padding-left: calc(0.5rem - 2px);
}

[data-theme='dark'] .dl-toc__link:hover {
    background: rgba(162, 155, 254, 0.08);
}

/* Skeleton loader */
.dl-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.75rem 0;
}

.dl-skeleton__bar {
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg,
            var(--ifm-color-emphasis-100) 25%,
            var(--ifm-color-emphasis-200) 50%,
            var(--ifm-color-emphasis-100) 75%);
    background-size: 200% 100%;
    animation: dl-shimmer 1.5s ease-in-out infinite;
}

@keyframes dl-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Hide version badge and GitHub icon from the hamburger sidebar menu
   (they are only relevant on the desktop top bar) */
.navbar-sidebar .navbar-version-item,
.navbar-sidebar .header-github-link {
    display: none !important;
}

/* Responsive */
@media (max-width: 996px) {
    .dl-toc-col {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .dl-card {
        padding: 1.15rem 1rem;
    }

    .dl-hero {
        padding: 2rem 1rem 1.5rem;
    }

    .dl-hero h1 {
        font-size: 1.6rem;
    }

    .dl-sub-card {
        margin-bottom: 0.75rem;
    }

    .dl-row-gap>[class*='col'] {
        margin-bottom: 1rem;
    }
}