:root {
    --header-height: 3.5rem;
    --bg-color: #f8fafc;
    --fg-color: #1f2937;
    --muted-fg-color: #64748b;
    --neutral-color: #d5deea;
    --link-color: #2563eb;
    --code-bg-color: #eef2f7;
    --code-block-bg-color: #0f172a;
    --code-block-fg-color: #e2e8f0;
    --code-block-border-color: #1e293b;
    --tab-bg-color: #eff3ff;
    --tab-border-color: #cdd9ee;
    --tab-hover-border-color: #9fb3d9;
    --tab-active-bg-color: #2563eb;
    --tab-active-fg-color: #ffffff;
}

* {
    font-weight: 400;
}

body {
    color: var(--fg-color) !important;
    background-color: var(--bg-color) !important;
    background-image: radial-gradient(circle at top, #ffffff, var(--bg-color) 55%) !important;
}

main,
nav.left,
nav.right {
    color: var(--fg-color) !important;
    background-color: transparent;
}

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 20;
    height: var(--header-height);
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--neutral-color);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-brand {
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--fg-color);
}

.site-brand:hover {
    text-decoration: none;
    color: var(--link-color);
}

.site-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: var(--muted-fg-color);
    font-size: 0.9rem;
}

.site-repo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.34rem 0.58rem;
    border: 1px solid #c7d6f0;
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 560;
    line-height: 1;
}

.site-repo-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.site-repo-label {
    letter-spacing: 0.01em;
}

.site-repo:hover {
    border-color: #93b0e3;
    background: #e2ecff;
    text-decoration: none;
}

nav.left,
nav.right {
    top: var(--header-height);
    height: calc(100% - var(--header-height));
    background: rgba(248, 250, 252, 0.96);
}

nav.left {
    border-right: 1px solid var(--neutral-color);
    padding-top: 1.25rem;
}

nav.right {
    border-left: 1px solid var(--neutral-color);
    padding-top: 1.25rem;
}

nav.left ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

nav.left > ul > li {
    margin: 0 0 0.95rem;
}

nav.left li > a {
    display: block;
    padding: 0.34rem 0.2rem;
    border-radius: 0.55rem;
    color: var(--fg-color);
    text-decoration: none;
}

nav.left > ul > li > a {
    font-weight: 640;
    letter-spacing: 0.01em;
}

nav.left li > ul {
    margin-top: 0.3rem;
    margin-left: 0.45rem;
    padding-left: 0.85rem;
    border-left: 1px solid #d7e3f3;
}

nav.left li > ul > li {
    margin: 0.12rem 0;
}

nav.left li > ul > li > a {
    color: #44566c;
    font-size: 0.95rem;
}

nav.left li > a:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--link-color);
}

nav.left li > a.active {
    background: linear-gradient(180deg, #eef4ff 0%, #e3eeff 100%);
    color: #1d4ed8;
    font-weight: 650;
}

nav.left > ul > li:has(> ul > li > a.active) > a {
    color: #102a43;
}

main {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding: 2rem 2.25rem;
}

h1 {
    margin-top: 0.5rem;
}

h2 {
    margin-top: 2.5rem;
}

a.toclink:hover::after {
    content: none !important;
}

h1 .headerlink,
h2 .headerlink,
h3 .headerlink,
h4 .headerlink,
h5 .headerlink,
h6 .headerlink {
    margin-left: 0.35rem;
    color: var(--muted-fg-color);
    text-decoration: none;
    font-size: 0;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

h1 .headerlink::before,
h2 .headerlink::before,
h3 .headerlink::before,
h4 .headerlink::before,
h5 .headerlink::before,
h6 .headerlink::before {
    content: "#";
    font-size: 0.9rem;
    font-weight: 600;
}

h1:hover .headerlink,
h2:hover .headerlink,
h3:hover .headerlink,
h4:hover .headerlink,
h5:hover .headerlink,
h6:hover .headerlink {
    opacity: 0.6;
}

h1 .headerlink:hover,
h2 .headerlink:hover,
h3 .headerlink:hover,
h4 .headerlink:hover,
h5 .headerlink:hover,
h6 .headerlink:hover {
    opacity: 1;
    color: var(--link-color);
}

code,
pre {
    border-radius: 0.5rem;
}

code:not(pre code) {
    background: var(--code-bg-color);
    color: var(--fg-color);
}

pre {
    background: var(--code-block-bg-color) !important;
    border: 1px solid var(--code-block-border-color);
}

div.highlight pre code,
pre code {
    color: var(--code-block-fg-color) !important;
    background: transparent !important;
}

div.highlight pre code .normal,
div.highlight pre code a {
    color: inherit;
}

div.highlight {
    margin: 1.1rem 0 1.2rem;
}

table {
    width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    display: block;
    margin: 1rem 0 1.25rem;
}

th {
    background: rgba(125, 211, 252, 0.08);
    font-weight: 600;
}

table + .highlight,
table + pre {
    margin-top: 1.35rem;
}

.tabbed-set {
    margin: 1.15rem 0 1.45rem;
}

.tabbed-set > input {
    display: none;
}

.tabbed-set .tabbed-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.tabbed-set .tabbed-labels > label {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.72rem;
    border: 1px solid var(--tab-border-color);
    border-radius: 999px;
    background: var(--tab-bg-color);
    color: var(--fg-color);
    font-size: 0.92rem;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tabbed-set .tabbed-labels > label:hover {
    border-color: var(--tab-hover-border-color);
}

.tabbed-set .tabbed-content > .tabbed-block {
    display: none;
}

.tabbed-set .tabbed-content > .tabbed-block > :first-child {
    margin-top: 0;
}

.tabbed-set > input:nth-of-type(1):checked ~ .tabbed-content > .tabbed-block:nth-of-type(1),
.tabbed-set > input:nth-of-type(2):checked ~ .tabbed-content > .tabbed-block:nth-of-type(2),
.tabbed-set > input:nth-of-type(3):checked ~ .tabbed-content > .tabbed-block:nth-of-type(3),
.tabbed-set > input:nth-of-type(4):checked ~ .tabbed-content > .tabbed-block:nth-of-type(4),
.tabbed-set > input:nth-of-type(5):checked ~ .tabbed-content > .tabbed-block:nth-of-type(5),
.tabbed-set > input:nth-of-type(6):checked ~ .tabbed-content > .tabbed-block:nth-of-type(6),
.tabbed-set > input:nth-of-type(7):checked ~ .tabbed-content > .tabbed-block:nth-of-type(7),
.tabbed-set > input:nth-of-type(8):checked ~ .tabbed-content > .tabbed-block:nth-of-type(8) {
    display: block;
}

.tabbed-set > input:nth-of-type(1):checked ~ .tabbed-labels > label:nth-of-type(1),
.tabbed-set > input:nth-of-type(2):checked ~ .tabbed-labels > label:nth-of-type(2),
.tabbed-set > input:nth-of-type(3):checked ~ .tabbed-labels > label:nth-of-type(3),
.tabbed-set > input:nth-of-type(4):checked ~ .tabbed-labels > label:nth-of-type(4),
.tabbed-set > input:nth-of-type(5):checked ~ .tabbed-labels > label:nth-of-type(5),
.tabbed-set > input:nth-of-type(6):checked ~ .tabbed-labels > label:nth-of-type(6),
.tabbed-set > input:nth-of-type(7):checked ~ .tabbed-labels > label:nth-of-type(7),
.tabbed-set > input:nth-of-type(8):checked ~ .tabbed-labels > label:nth-of-type(8) {
    background: var(--tab-active-bg-color);
    border-color: var(--tab-active-bg-color);
    color: var(--tab-active-fg-color);
}

.admonition {
    margin: 1.25rem 0;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}

.admonition .admonition-title {
    margin-bottom: 0.6rem;
}

.admonition p,
.admonition ul,
.admonition ol {
    margin: 0.7rem 0;
}

.highlight + .admonition,
pre + .admonition,
table + .admonition {
    margin-top: 1.35rem;
}

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

.pagination {
    margin-top: 2.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--neutral-color);
    display: flex;
    gap: 0.85rem;
    align-items: stretch;
}

.pagination a {
    float: none !important;
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    max-width: calc(50% - 0.425rem);
    min-height: 2.65rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid #c8d5eb;
    border-radius: 0.72rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    color: var(--fg-color) !important;
    text-decoration: none;
    font-weight: 520;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.pagination a.previous {
    justify-content: flex-start;
}

.pagination a.next {
    justify-content: flex-end;
    text-align: right;
    margin-left: auto;
}

.pagination a:hover {
    border-color: #9ab3de;
    background: #edf3ff;
    transform: translateY(-1px);
    text-decoration: none;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 1fr);
    gap: 1.4rem;
    margin: 0.35rem 0 2rem;
    padding: 1.6rem;
    border: 1px solid #cfe0f7;
    border-radius: 1.4rem;
    background:
        radial-gradient(circle at top right, rgba(14, 165, 164, 0.12), transparent 30%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 247, 255, 0.98) 100%);
    box-shadow: 0 22px 50px rgba(148, 163, 184, 0.16);
}

.landing-hero-copy,
.landing-hero-panel {
    min-width: 0;
}

.landing-eyebrow,
.feature-kicker {
    margin: 0 0 0.65rem;
    color: #0f766e;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.landing-hero h1 {
    margin: 0;
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.landing-lede {
    max-width: 42rem;
    margin: 1rem 0 0;
    color: #102a43;
    font-size: 1.24rem;
    line-height: 1.45;
}

.landing-body {
    max-width: 42rem;
    margin: 1rem 0 0;
    color: var(--muted-fg-color);
    font-size: 1rem;
    line-height: 1.7;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.35rem;
}

.landing-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.85rem;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 630;
    text-decoration: none;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.landing-button:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.landing-button-primary {
    background: linear-gradient(135deg, #0f4c81 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.landing-button-primary:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #0d436f 0%, #1d4ed8 100%);
}

.landing-button-secondary {
    border-color: #c9d9ef;
    background: rgba(255, 255, 255, 0.9);
    color: #16324f;
}

.landing-button-secondary:hover {
    border-color: #9bb7dc;
    background: #eef5ff;
}

.landing-hero-panel {
    padding: 1rem;
    border: 1px solid rgba(160, 186, 219, 0.65);
    border-radius: 1.1rem;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.96) 0%, rgba(236, 244, 255, 0.96) 100%);
}

.landing-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.62rem;
    border: 1px solid #c7dbf7;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #1d4f91;
    font-size: 0.84rem;
    font-weight: 600;
}

.landing-stats,
.feature-grid,
.workflow-grid,
.entry-grid,
.principles-grid {
    display: grid;
    gap: 1rem;
}

.landing-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.landing-stat-card,
.feature-card,
.workflow-step,
.entry-card,
.principle-card {
    border: 1px solid #d8e3f2;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 30px rgba(148, 163, 184, 0.08);
}

.landing-stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
}

.landing-stat-card strong {
    color: #102a43;
    font-size: 1.03rem;
}

.landing-stat-label {
    color: #5c6f85;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.landing-stat-meta {
    color: #516173;
    font-size: 0.92rem;
    line-height: 1.5;
}

.landing-stat-meta code {
    background: rgba(220, 231, 244, 0.8);
}

.feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 1.15rem 0 0.25rem;
}

.feature-card,
.entry-card,
.principle-card {
    padding: 1.15rem;
}

.feature-card h3,
.workflow-step h3,
.entry-card h3,
.principle-card h3 {
    margin: 0;
    color: #102a43;
}

.feature-card p:last-child,
.workflow-step p:last-child,
.entry-card p:last-child,
.principle-card p:last-child {
    margin-bottom: 0;
}

.workflow-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 1.15rem 0 0.25rem;
}

.workflow-step {
    position: relative;
    padding: 1.1rem;
    overflow: hidden;
}

.workflow-step::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 0.3rem;
    background: linear-gradient(90deg, #0ea5a4 0%, #2563eb 100%);
}

.workflow-step-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    margin-bottom: 0.75rem;
    border-radius: 999px;
    background: #e9f4ff;
    color: #0f4c81;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.entry-grid,
.principles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 1.15rem 0 0.25rem;
}

.entry-card a {
    color: inherit;
    text-decoration-color: #9db8dd;
}

.entry-card a:hover {
    color: #1d4ed8;
}

.principle-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 251, 255, 0.95) 100%);
}

@media (max-width: 1000px) {
    .site-tagline {
        display: none;
    }

    nav.left {
        top: var(--header-height);
    }

    main {
        margin-top: var(--header-height);
    }

    .landing-hero {
        grid-template-columns: 1fr;
    }

    .workflow-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .pagination {
        flex-direction: column;
    }

    .pagination a {
        max-width: none;
    }

    .pagination a.next {
        margin-left: 0;
    }

    main {
        padding: 1.35rem 1rem 1.8rem;
    }

    .landing-hero {
        padding: 1.1rem;
        border-radius: 1rem;
    }

    .landing-actions {
        flex-direction: column;
    }

    .landing-button {
        width: 100%;
    }

    .landing-stats,
    .feature-grid,
    .workflow-grid,
    .entry-grid,
    .principles-grid {
        grid-template-columns: 1fr;
    }
}
