:root {
    --bg: #f5f7fa;
    --text: #1e2a36;
    --muted: #666666;
    --link: #1a5f91;
    --surface: #fafafa;
    --surface-strong: #ffffff;
    --surface-tint: #edf3f8;
    --code-bg: #f4f7f9;
    --line: #d8d8d8;
    --line-strong: #c4d3e1;
    --glow-a: radial-gradient(circle at top right, rgba(26, 95, 145, 0.08), transparent 34%);
    --glow-b: radial-gradient(circle at bottom left, rgba(158, 176, 192, 0.12), transparent 30%);
    --radius-md: 8px;
    --radius-lg: 12px;
    --max-width: 1040px;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #9eb0c0 #e8eef4;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    scrollbar-width: thin;
    scrollbar-color: #9eb0c0 #e8eef4;
}

html.theme-dark,
body.theme-dark {
    scrollbar-color: #5c7186 #1a2430;
}

body.theme-dark {
    --bg: #111820;
    --text: #d8e0e8;
    --muted: #9fb0c2;
    --link: #8ab9e8;
    --surface: #1b2530;
    --surface-strong: #121a23;
    --surface-tint: #1a2430;
    --code-bg: #121a23;
    --line: #394754;
    --line-strong: #3a4654;
    --glow-a: radial-gradient(circle at top right, rgba(138, 185, 232, 0.14), transparent 34%);
    --glow-b: radial-gradient(circle at bottom left, rgba(92, 113, 134, 0.18), transparent 30%);
}

* {
    box-sizing: border-box;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: var(--glow-a), var(--glow-b);
}

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

a:hover {
    text-decoration: underline;
}

img {
    display: block;
    max-width: 100%;
}

code,
pre.code {
    font-family: Consolas, "Courier New", monospace;
}

code {
    padding: 0.12rem 0.32rem;
    border-radius: 4px;
    background: var(--code-bg);
    border: 1px solid var(--line);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: #e8eef4;
}

*::-webkit-scrollbar-thumb {
    background: #9eb0c0;
    border-radius: 8px;
    border: 2px solid #e8eef4;
}

*::-webkit-scrollbar-thumb:hover {
    background: #879caf;
}

body.theme-dark *::-webkit-scrollbar-track,
body.theme-dark::-webkit-scrollbar-track,
html.theme-dark::-webkit-scrollbar-track {
    background: #1a2430;
}

body.theme-dark *::-webkit-scrollbar-thumb,
body.theme-dark::-webkit-scrollbar-thumb,
html.theme-dark::-webkit-scrollbar-thumb {
    background: #5c7186;
    border-color: #1a2430;
}

body.theme-dark *::-webkit-scrollbar-thumb:hover,
body.theme-dark::-webkit-scrollbar-thumb:hover,
html.theme-dark::-webkit-scrollbar-thumb:hover {
    background: #7891a9;
}

.page-shell {
    position: relative;
    z-index: 1;
    padding: 0 18px 96px;
}

.landing-main,
.docs-shell {
    width: min(100%, var(--max-width));
    margin: 0 auto;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    padding: 0;
    background: rgba(237, 243, 248, 0.96);
    border-bottom: 1px solid var(--line-strong);
    backdrop-filter: blur(16px);
}

body.theme-dark .site-header {
    background: rgba(18, 26, 35, 0.94);
}

.site-header-inner {
    width: 100%;
    padding: 12px 18px 14px;
}

.header-shell {
    position: relative;
    min-height: 156px;
    transition: min-height 1.5s ease;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    margin: 0;
}

.brand {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.8rem;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 600;
    min-height: 126px;
    text-decoration: none;
}

.brand img {
    width: 126px;
    height: 126px;
    transition: width 1.5s ease, height 1.5s ease, transform 1.5s ease;
}

.brand-short,
.brand-long {
    display: none;
}

.nav-cluster {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 12px;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-tools {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.language-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 2px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 82%, var(--surface-tint) 18%);
    isolation: isolate;
    min-width: 78px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.language-switch::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 50%;
    border-radius: 999px;
    background: linear-gradient(180deg, #2a7fbd, #1a5f91);
    box-shadow: 0 2px 8px rgba(17, 24, 32, 0.18);
    transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
    z-index: 0;
}

body.theme-dark .language-switch::after {
    background: linear-gradient(180deg, #8ab9e8, #5f95cb);
}

.language-switch[data-language-state="fr"]::after {
    transform: translateX(100%);
}

.lang-button {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    min-height: 30px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
    position: relative;
    z-index: 1;
    min-width: 38px;
    transition: color 180ms ease, transform 180ms ease;
}

.lang-button.is-active {
    color: #ffffff;
    transform: none;
}

.lang-button.is-active:hover {
    color: #ffffff;
}

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

.theme-toggle {
    appearance: none;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    border-radius: 6px;
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    padding: 0;
}

.theme-toggle:hover {
    background: var(--surface-strong);
}

.theme-icon {
    font-size: 16px;
    line-height: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.landing-main {
    display: grid;
    gap: 18px;
    padding-top: 220px;
}

.section {
    margin: 0;
    scroll-margin-top: 156px;
}

.box,
.docs-placeholder {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    padding: 18px;
}

.section-card {
    display: grid;
    gap: 14px;
}

.header-project-title {
    position: absolute;
    left: 50%;
    right: auto;
    top: 54px;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 36px);
    margin: 0;
    padding-bottom: 18px;
    text-align: left;
    line-height: 1.16;
    letter-spacing: -0.04em;
    font-size: clamp(2.15rem, 4.3vw, 3.4rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition:
        top 1.5s ease,
        left 1.5s ease,
        transform 1.5s ease,
        max-width 1.5s ease,
        padding-bottom 1.5s ease,
        font-size 1.5s ease,
        letter-spacing 1.5s ease,
        line-height 1.5s ease;
}

.section-title,
.docs-placeholder h1 {
    margin: 0;
    line-height: 1.08;
    letter-spacing: -0.03em;
    font-size: clamp(1.7rem, 3.2vw, 2.45rem);
}

.eyebrow {
    margin: 0;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    font-weight: 700;
}

.section-card p,
.docs-placeholder p,
.content-list {
    margin: 0;
    line-height: 1.75;
    font-size: 1rem;
}

.content-list {
    padding-left: 22px;
}

.content-list li + li {
    margin-top: 8px;
}

.section-image {
    margin: 6px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    width: min(50%, 420px);
    justify-self: center;
}

.section-image img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}

.cta-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.75rem 1.15rem;
    border-radius: 6px;
    border: 1px solid var(--line-strong);
    text-decoration: none;
    font-weight: 600;
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

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

.button-primary {
    background: var(--surface-tint);
    color: var(--link);
    min-width: 220px;
    letter-spacing: 0.12em;
}

.button-secondary {
    background: var(--surface);
    color: var(--text);
}

.muted,
.section-note {
    color: var(--muted);
}

.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    padding: 0;
    background: rgba(237, 243, 248, 0.96);
    border-top: 1px solid var(--line-strong);
    backdrop-filter: blur(16px);
}

.site-footer-inner {
    width: 100%;
    padding: 10px 18px;
}

body.theme-dark .site-footer {
    background: rgba(18, 26, 35, 0.94);
}

.site-footer p {
    margin: 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.footer-separator {
    padding: 0 0.45rem;
    color: var(--line-strong);
}

.site-footer a {
    color: var(--link);
}

.docs-body::before {
    background:
        radial-gradient(circle at top right, rgba(26, 95, 145, 0.06), transparent 28%),
        radial-gradient(circle at bottom left, rgba(158, 176, 192, 0.1), transparent 26%);
}

body.theme-dark.docs-body::before {
    background:
        radial-gradient(circle at top right, rgba(138, 185, 232, 0.12), transparent 28%),
        radial-gradient(circle at bottom left, rgba(92, 113, 134, 0.16), transparent 26%);
}

.docs-shell {
    min-height: calc(100vh - 42px);
}

.docs-placeholder {
    width: min(100%, 760px);
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

body.is-scrolled .brand {
    min-height: 42px;
}

body.is-scrolled .header-project-title {
    left: 64px;
    top: 8px;
    max-width: calc(100% - 184px);
    transform: none;
    padding-bottom: 0;
    font-size: clamp(1.05rem, 1.55vw, 1.45rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

body.is-scrolled .header-shell {
    min-height: 48px;
}

body.is-scrolled .brand img {
    width: 42px;
    height: 42px;
    transform: none;
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    animation: rise-in 520ms ease forwards;
}

.reveal-delay-1 {
    animation-delay: 90ms;
}

.reveal-delay-2 {
    animation-delay: 160ms;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 820px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-cluster {
        width: 100%;
        justify-content: space-between;
    }

    .nav-tools {
        width: 100%;
        justify-content: space-between;
    }

    .landing-main {
        padding-top: 244px;
    }

    body.is-scrolled .header-project-title {
        left: 156px;
        max-width: calc(100% - 174px);
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding: 0 10px 92px;
    }

    .site-header {
        padding: 0;
    }

    .site-header-inner {
        padding: 10px 10px 12px;
    }

    .header-shell {
        min-height: auto;
        transition: none;
    }

    .topbar {
        align-items: flex-start;
    }

    .brand img {
        width: 52px;
        height: 52px;
        transition: none;
    }

    .brand {
        align-items: center;
        min-height: auto;
        gap: 10px;
        width: 100%;
    }

    .nav-links {
        gap: 8px;
    }

    .nav-cluster {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 10px;
    }

    .nav-tools {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        width: auto;
        gap: 8px;
    }

    .language-switch,
    .theme-toggle {
        width: auto;
    }

    .theme-toggle {
        justify-content: center;
        min-height: 32px;
        width: 36px;
        min-width: 36px;
    }

    .section-title,
    .docs-placeholder h1 {
        font-size: 1.55rem;
    }

    .landing-main {
        padding-top: 258px;
    }

    .section-image {
        width: min(100%, 420px);
    }

    .header-project-title {
        position: static;
        left: auto;
        right: auto;
        top: auto;
        width: auto;
        max-width: none;
        transform: none;
        text-align: left;
        padding-bottom: 0;
        margin: 0;
        font-size: clamp(1.8rem, 7vw, 2.2rem);
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        transition: none;
    }

    body.is-scrolled .brand img {
        width: 52px;
        height: 52px;
    }

    .language-switch {
        min-width: 70px;
        padding: 1px;
    }

    .lang-button {
        min-height: 28px;
        min-width: 34px;
        padding: 0 7px;
        font-size: 10px;
    }

    .language-switch::after {
        top: 0;
        bottom: 0;
    }
}
