* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Arial,
        "Segoe UI",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;

    background: #f5f5f5;
    color: #111;

    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

/* =========================
   Sidebar
   ========================= */

#sidebar {
    position: fixed;
    left: 0;
    top: 0;

    width: 230px;
    height: 100vh;

    padding: 20px;

    background: #e5e5e5;
    border-right: 1px solid #d0d0d0;

    transition:
        background-color 0.3s ease,
        border-color 0.3s ease;
}

#toggle {
    width: 40px;
    height: 40px;

    padding: 0;

    background: #333;
    color: white;

    border: none;
    border-radius: 8px;

    cursor: pointer;

    font-size: 18px;

    transition:
        background-color 0.2s ease,
        transform 0.15s ease;
}

#toggle:hover {
    background: #555;
    transform: scale(1.05);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;

    gap: 6px;

    margin-top: 25px;
}

.sidebar-nav a {
    padding: 10px 11px;

    color: #333;
    text-decoration: none;

    border-radius: 7px;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.sidebar-nav a:hover {
    background: #d5d5d5;
    color: #000;

    transform: translateX(3px);
}

/* =========================
   Main content
   ========================= */

main {
    margin-left: 230px;

    padding: 25px 40px 90px;

    max-width: 1100px;
}

.top-nav {
    display: flex;
    gap: 10px;

    margin-bottom: 35px;
}

.top-nav button {
    padding: 10px 20px;

    border: none;
    border-radius: 7px;

    background: #333;
    color: white;

    cursor: pointer;

    font-size: 14px;

    transition:
        background-color 0.2s ease,
        transform 0.15s ease;
}

.top-nav button:hover {
    background: #555;
    transform: translateY(-2px);
}

.top-nav button:active {
    transform: translateY(0);
}

header {
    margin-bottom: 50px;
}

h1 {
    margin: 0 0 10px;

    font-size: 42px;
    line-height: 1.15;

    color: #111;
}

.subtitle {
    margin: 0;

    color: #666;

    font-size: 18px;
    line-height: 1.6;
}

/* =========================
   Sections
   ========================= */

section {
    max-width: 850px;

    margin-bottom: 70px;

    scroll-margin-top: 30px;
}

h2 {
    margin: 0 0 15px;

    font-size: 30px;
    line-height: 1.2;
}

h3 {
    margin-top: 35px;
    margin-bottom: 10px;

    font-size: 22px;
    line-height: 1.3;
}

h4 {
    margin-top: 25px;
    margin-bottom: 10px;

    font-size: 17px;
}

p {
    margin-top: 10px;
    margin-bottom: 16px;

    line-height: 1.7;
}

strong {
    font-weight: 700;
}

/* =========================
   Code
   ========================= */

code {
    padding: 2px 5px;

    background: #e7e7e7;
    color: #222;

    border-radius: 4px;

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 0.95em;
}

pre {
    margin: 18px 0;

    padding: 18px;

    overflow-x: auto;

    background: #1e1e1e;
    color: #f5f5f5;

    border-radius: 8px;

    line-height: 1.6;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.12);
}

pre code {
    padding: 0;

    background: transparent;
    color: inherit;

    font-size: 14px;
}

/* =========================
   Operators
   ========================= */

.operator-list {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 15px;
}

.operator-list code {
    padding: 7px 11px;

    background: #e2e2e2;

    border-radius: 6px;

    transition:
        background-color 0.2s ease,
        transform 0.15s ease;
}

.operator-list code:hover {
    transform: translateY(-1px);
}

/* =========================
   Notes / Warnings / Versions
   ========================= */

.note,
.warning,
.version {
    margin: 20px 0;

    padding: 14px 16px;

    border-radius: 7px;

    line-height: 1.6;
}

.note {
    background: #e8e8e8;

    border-left: 4px solid #555;
}

.warning {
    background: #f1e6d4;

    border-left: 4px solid #a66a00;
}

.version {
    background: #e5e5e5;

    border-left: 4px solid #666;

    font-size: 14px;
}

/* =========================
   Version badge
   ========================= */

.version-badge {
    display: inline-block;

    margin-top: 5px;
    padding: 5px 9px;

    background: #e5e5e5;
    color: #444;

    border-radius: 6px;

    font-size: 13px;
    font-weight: 600;
}

/* =========================
   Footer
   ========================= */

footer {
    position: fixed;

    left: 0;
    bottom: 0;

    width: 100%;

    padding: 10px 15px;

    background: #003a00;
    color: white;

    text-align: center;

    font-size: 14px;

    cursor: pointer;

    z-index: 100;

    transition:
        background-color 0.2s ease,
        opacity 0.2s ease;
}

footer:hover {
    background: #005000;
}

/* =========================
   Dark mode
   ========================= */

body.dark {
    background: #1e1e1e;
    color: #f5f5f5;
}

body.dark #sidebar {
    background: #292929;

    border-right-color: #444;
}

body.dark #toggle {
    background: #fff;
    color: #111;
}

body.dark #toggle:hover {
    background: #ddd;
}

body.dark .sidebar-nav a {
    color: #ddd;
}

body.dark .sidebar-nav a:hover {
    background: #3a3a3a;
    color: white;
}

body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4 {
    color: #fff;
}

body.dark .subtitle {
    color: #aaa;
}

body.dark .top-nav button {
    background: #fff;
    color: #111;
}

body.dark .top-nav button:hover {
    background: #ddd;
}

body.dark code {
    background: #333;
    color: #fff;
}

body.dark pre {
    background: #111;
}

body.dark .operator-list code {
    background: #333;
}

body.dark .note {
    background: #2d2d2d;

    border-left-color: #aaa;
}

body.dark .warning {
    background: #3a3023;

    border-left-color: #c18a35;
}

body.dark .version {
    background: #2d2d2d;

    border-left-color: #aaa;
}

body.dark .version-badge {
    background: #333;
    color: #fff;
}

body.dark footer {
    background: #002600;
}

body.dark footer:hover {
    background: #003800;
}

/* =========================
   Mobile
   ========================= */

@media (max-width: 750px) {

    #sidebar {
        position: static;

        width: 100%;
        height: auto;

        padding: 12px;

        border-right: none;
        border-bottom: 1px solid #d0d0d0;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;

        gap: 5px;

        margin-top: 12px;
    }

    .sidebar-nav a {
        padding: 8px 9px;
    }

    main {
        margin-left: 0;

        padding: 20px 20px 80px;
    }

    .top-nav {
        flex-wrap: wrap;
    }

    header {
        margin-bottom: 35px;
    }

    h1 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 16px;
    }

    h2 {
        font-size: 27px;
    }

    h3 {
        font-size: 21px;
    }

    section {
        margin-bottom: 50px;
    }

    pre {
        padding: 14px;

        font-size: 13px;
    }

    footer {
        font-size: 13px;
    }
}

/* =========================
   Small phones
   ========================= */

@media (max-width: 450px) {

    main {
        padding-left: 15px;
        padding-right: 15px;
    }

    .top-nav {
        gap: 7px;
    }

    .top-nav button {
        padding: 9px 14px;
    }

    h1 {
        font-size: 29px;
    }

    h2 {
        font-size: 25px;
    }

    .operator-list {
        gap: 6px;
    }
}