:root {
    color-scheme: light dark;
    --bg: #f0f7ff;
    --bubble: #ffffffee;
    --bubble-soft: rgba(255, 255, 255, 0.6);
    --accent: #6bc1ff;
    --accent-dark: #4387ff;
    --text: #1f2a44;
    --muted: #5c6f8c;
    --chip-bg: rgba(107, 193, 255, 0.2);
    --chip-text: #1b4a7a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        "Inter",
        "SF Pro Display",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(
        circle at top,
        #d8f1ff 0%,
        #e8f5ff 45%,
        var(--bg) 100%
    );
    color: var(--text);
    padding: 1.5rem;
}

body.page-list {
    align-items: flex-start;
    padding-top: 3rem;
}

body.page-docs {
    align-items: flex-start;
    padding-top: 2.5rem;
}

main {
    background: var(--bubble);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    box-shadow: 0 25px 60px rgba(94, 16, 78, 0.1);
    width: 100%;
    max-width: 850px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

body.page-list main {
    max-width: 1100px;
    text-align: left;
}

main::before,
main::after {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    background: rgba(107, 193, 255, 0.18);
    border-radius: 50%;
    z-index: 0;
}

main::before {
    top: -60px;
    right: -40px;
}

main::after {
    bottom: -70px;
    left: -50px;
}

main > * {
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
}

p {
    color: var(--muted);
    margin-top: 0;
    margin-bottom: 1.6rem;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.page-actions {
    margin-top: 1.5rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(120deg, var(--accent), var(--accent-dark));
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.85rem 1.8rem;
    border-radius: 999px;
    box-shadow: 0 15px 35px rgba(67, 135, 255, 0.25);
    transition:
        transform 150ms ease,
        box-shadow 150ms ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 45px rgba(67, 135, 255, 0.35);
}

.stats {
    margin-top: 2.4rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    gap: 1rem;
    text-align: left;
}

.stat-card {
    padding: 0.9rem 1rem;
    background: var(--bubble-soft);
    border-radius: 18px;
    border: 1px solid rgba(67, 135, 255, 0.15);
    backdrop-filter: blur(4px);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.stat-value {
    font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.95rem;
    margin-top: 0.35rem;
    color: var(--text);
    word-break: break-all;
}

.collection {
    margin-top: 2.25rem;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.6rem;
}

.section-count {
    font-size: 0.9rem;
    color: var(--muted);
}

.list-grid {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1rem;
    padding: 0;
    list-style: none;
}

.list-card {
    padding: 1.25rem;
    border-radius: 20px;
    border: 1px solid rgba(67, 135, 255, 0.15);
    background: var(--bubble-soft);
    backdrop-filter: blur(4px);
}

.list-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.list-card h3 a {
    color: inherit;
    text-decoration: none;
}

.list-card h3 a:hover {
    text-decoration: underline;
}

.version-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 0.45rem;
}

.version-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.version-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    background: var(--chip-bg);
    color: var(--chip-text);
    text-decoration: none;
}

.version-chip:hover {
    opacity: 0.7;
}

.empty-state {
    margin-top: 1rem;
    font-style: italic;
    color: var(--muted);
}

.back-link {
    margin-top: 2rem;
}

.doc-wrapper {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 1.5rem;
}

.doc-sidebar,
.doc-main {
    background: var(--bubble);
    border-radius: 32px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 60px rgba(94, 16, 78, 0.1);
}

.doc-sidebar {
    position: sticky;
    top: 1.5rem;
    align-self: start;
}

.doc-section + .doc-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(67, 135, 255, 0.15);
}

.doc-section h2 {
    margin: 0 0 0.4rem 0;
    font-size: 1rem;
}

.doc-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.doc-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.doc-link:hover {
    text-decoration: underline;
}

.doc-main .doc-back {
    margin-bottom: 1rem;
}

.doc-main .doc-back a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.doc-main .doc-back a:hover {
    text-decoration: underline;
}

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

.doc-content {
    line-height: 1.7;
    color: var(--text);
}

.doc-content h1,
.doc-content h2,
.doc-content h3 {
    margin-top: 1.5rem;
}

.doc-content h1:first-of-type {
    margin-top: 0;
}

.doc-content pre {
    background: rgba(99, 114, 255, 0.08);
    border-radius: 16px;
    padding: 1rem;
    overflow-x: auto;
}

.doc-content code {
    font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.95rem;
}

.doc-content a {
    color: var(--accent-dark);
}

.doc-alert {
    border-radius: 18px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--accent);
    background: rgba(107, 193, 255, 0.12);
}

.doc-alert-note {
    border-color: var(--accent);
    background: rgba(107, 193, 255, 0.12);
}

.doc-alert-title {
    margin: 0 0 0.4rem 0;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.doc-alert-body > :first-child {
    margin-top: 0;
}

.doc-alert-body > :last-child {
    margin-bottom: 0;
}

.doc-alert-tip {
    border-color: #3fb950;
    background: rgba(63, 185, 80, 0.15);
}

.doc-alert-important {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.18);
}

.doc-alert-warning {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.18);
}

.doc-alert-caution {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.18);
}

@media (max-width: 720px) {
    main {
        padding: 2.25rem;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    body {
        padding: 1rem;
    }
}

@media (max-width: 900px) {
    .doc-wrapper {
        grid-template-columns: 1fr;
    }

    .doc-sidebar {
        order: 2;
        position: static;
    }
}
