@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --transition-theme-switch:
            color 0.5s ease,
            border 0.5s ease,
            border-top 0.5s ease,
            border-bottom 0.5s ease,
            fill 0.5s ease;
}

:root[data-theme="light"] {
    color-scheme: light;
    --color-white: #ffffff;
    --color-bg: #ffffff;
    --color-fg: #0d1229;
    --color-logo: #555969;
    --color-border: #ececec;
    --color-header-bg: rgba(255, 255, 255, 0.3);
    --color-headline: #0d1229;
    --color-code-bg: #e5e7ee;
    --color-social-icon: #898a90;
    --color-link: #555969;
    --color-md-alert: #f2f2f2;
    --color-toc-bg: #edecec;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --color-white: #ffffff;
    --color-bg: #131418;
    --color-fg: rgb(186, 189, 196);
    --color-logo: #e0e0e0;
    --color-border: #1b1d24;
    --color-header-bg: rgba(19, 20, 24 ,0.3);
    --color-headline: rgb(234, 234, 234);
    --color-code-bg: #1c222b;
    --color-social-icon: #ada8a8;
    --color-link: #eaeaea;
    --color-md-alert: #161b22;
    --color-toc-bg: #323232;
}

* {
    box-sizing: border-box;
    transition: var(--transition-theme-switch);
}

html {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    background: var(--color-bg);
    margin: 0;
    padding: 0;
    color: var(--color-fg);
    font-family: "Roboto", sans-serif;
    line-height: 1.85;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    box-sizing: border-box;
}

mark, ::selection {
    background: #9947ec;
    color: var(--color-bg);
}

a {
    color: var(--color-link);
    text-decoration: none;
    opacity: .7;
    transition: opacity 0.3s ease-in;

    &:hover {
        text-decoration: none;
        opacity: 1;
    }
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-headline);
}

h1, h2 {
    font-weight: 700;
}

h3, h4, h5, h6 {
    font-weight: 500;
}

code {
    background: var(--color-md-alert);
    white-space: nowrap;
    padding: 1px 5px;
    border-radius: 4px;
}

.hljs, .hljs-tag, .hljs-subst {
    border-radius: 5px;
}

.hljs-ln {
    padding: 0.5em !important;
    border-collapse: separate !important;
}

td.hljs-ln-numbers {
    padding-right: 5px !important;
    opacity: 0.3;
}

td.hljs-ln-code {
    padding-left: 10px !important;
}

.page-content p a {
    border-bottom: 1px dotted;
}

.md-alert {
    background: var(--color-md-alert);
    border-radius: 0 10px 10px 0;
}

.md-alert-title {
    margin-top: 0;
}

.md-alert-body {
    p {
        margin: 0;

        strong {
            font-size: 0.93rem;
        }

        code {
            background: var(--color-code-bg);
            padding: 1px 5px;
            border-radius: 4px;
        }
    }
}

.my-0 { margin-top: 0; margin-bottom: 0; }
.my-1 { margin-top: 1rem; margin-bottom: 1rem; }
.my-2 { margin-top: 2rem; margin-bottom: 2rem; }
.my-3 { margin-top: 3rem; margin-bottom: 3rem; }
.my-4 { margin-top: 4rem; margin-bottom: 4rem; }
.my-5 { margin-top: 5rem; margin-bottom: 5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mt-4 { margin-top: 4rem; }
.mt-5 { margin-top: 5rem; }
.mt-6 { margin-top: 6rem; }
.mt-7 { margin-top: 7rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mb-4 { margin-bottom: 4rem; }
.mb-5 { margin-bottom: 5rem; }

.theme-btn {
    background: var(--color-headline);
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-theme-switch);
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-toc {
    background: var(--color-toc-bg);
    margin: 1.1rem 0 1rem;
    padding: .5rem 1rem;
    border-radius: .3rem;

    summary {
        color: var(--color-headline);
        font-weight: 500;
        cursor: pointer;
    }

    a {
        color: #77a8fd;
    }
}

#container {
    margin-right: auto;
    margin-left: auto;
    padding: 0 .3rem .5rem;
}

.site-header {
    /*background: #131418;*/
    background: var(--color-header-bg);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);

    nav {
        display: flex;
        justify-content: space-between;
        width: 100%;

        ul {
            display: flex;
            justify-content: center;
            column-gap: 4px;
            list-style: none;
            margin: 0;
            padding: 0;

            a {
                margin: 0 0 0 1rem;

                &.active {
                    font-weight: bold;
                    opacity: 1;
                }

                &:hover {
                    text-decoration: none;
                }
            }
        }

        .logo {
            color: var(--color-logo);
            opacity: 1;

            &:hover {
                text-decoration: none;
                color: var(--color-headline);
            }
        }
    }
}

#content {
    margin-right: auto;
    margin-left: auto;
    padding-right: 30px;
    padding-left: 30px;

    .intro {
        text-align: center;
        padding: 0 1rem;
        margin-top: 6.3rem;
        margin-bottom: 7.2rem;

        .avatar {
            width: 80px;
            border-radius: 50%;
        }

        .bio {
            max-width: 393px;
            margin-right: auto;
            margin-left: auto;
            line-height: 1.688;
        }
    }

    .posts {
        ul {
            list-style: none;
            padding: 0;

            li {
                display: flex;
                justify-content: space-between;
                padding: 0.5rem 0;
                border-top: 1px solid var(--color-border);

                .date {
                    opacity: 0.6;
                }
            }
        }
    }
}

article {
    header {
        margin-top: 7.8em;

        h1 {
            font-size: 2em;
            line-height: 1.2;
            margin-top: 10px;
            margin-bottom: 20px;
        }
    }
}

footer {
    text-align: center;
    font-size: 0.8rem;
    margin-right: auto;
    margin-left: auto;
    margin-top: 8em;
    margin-bottom: 2em;
    padding-right: 30px;
    padding-left: 30px;

    .social-links {
        list-style: none;
        margin: 1rem 0 0.6rem 0;
        padding: 0;
        display: flex;
        justify-content: center;
        column-gap: 8px;

        a {
            svg {
                width: 20px;
                height: 20px;
                fill: var(--color-social-icon);
            }

            &:hover svg {
                fill: var(--color-white);
            }
        }
    }

    small {
        opacity: 0.5;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 2rem 0;
    padding: 0;
    gap: 0.5rem;

    li {
        display: inline-block;

        span {
            opacity: 0.5;
            cursor: default;
        }
    }

    a, span {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
        transition: all 0.2s ease-in-out;
        display: block;
    }

    a:hover {
        transform: scale(1.3);
    }

    .active {
    }

    .gap span {
        background: transparent;
        border: none;
        color: #aaa;
        padding: 0.5rem 0.6rem;
    }

    .prev, .next {
        a, span {
            font-size: 1.1rem;
        }
    }
}

.animation-wave {
    animation: wave-hand 0.25s infinite;
    display: inline-block;
}

@keyframes wave-hand {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(0eg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}