@font-face {
    font-family: "M Plus Rounded 1c";
    src: url("/fonts/MPLUSRounded1c-Bold.woff2") format("truetype");
    font-weight: bold;
    font-style: normal;
}

:root {
    --bg: #f5f5f5;
    --bg-secondary: #e8e8e8;
    --fg: #1a1a1a;
    --fg-secondary: #4a4a4a;
    --bg-secondary-hover: #d8d8d8;
    --bg-button: #1793d1;
    --bg-button-hover: #0f7ab8;
    --bg-code: #ebebeb;
    --border-color: #d0d0d0;
    --link-color: #1793d1;
    --bg-nav: rgba(255, 255, 255, 0.8);
    --nav-border-color: rgba(0, 0, 0, 0.1);

    --border-radius-md: 0.375rem;
    --border-radius-lg: 0.5rem;
    --box-shadow-color: rgba(0, 0, 0, 0.15);
    --box-shadow: 0 3px 4px var(--box-shadow-color);

    font-family: system-ui, segoe ui, Roboto, Helvetica, Arial, sans-serif, apple color emoji, segoe ui emoji;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: rgb(24, 26, 27);
        --bg-secondary: rgb(47, 50, 52);
        --fg: rgb(232, 230, 227);
        --fg-secondary: rgb(120, 120, 120);
        --bg-secondary-hover: rgb(60, 65, 68);
        --bg-button: rgb(1, 97, 138);
        --bg-button-hover: rgb(2, 114, 163);
        --bg-code: rgb(38, 41, 43);
        --border-color: rgb(59, 64, 67);
        --link-color: rgb(75, 168, 248);
        --bg-nav: rgba(24, 26, 27, 0.8);
        --nav-border-color: rgba(255, 255, 255, 0.1);
    }
}

html body {
    padding: 0;
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    text-rendering: optimizeLegibility;
    font-kerning: normal;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: var(--link-color);
    font-weight: 500;

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

header {
    border-radius: var(--border-radius-lg);
    background: var(--bg-secondary);
    box-shadow: var(--box-shadow);
}

.title {
    font-family: "M Plus Rounded 1c", serif;
    font-size: 32px;

    & a {
        color: inherit;
        font-size: 20px;
    }
}

section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
}

h2 {
    font-family: "M Plus Rounded 1c", serif;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0.5rem 0;
}

h3 {
    font-family: "M Plus Rounded 1c", serif;
    font-size: 1rem;
    font-weight: 500;
    margin: 0.5rem 0;
}

.btn-group {
    display: flex;
    justify-content: center;
    margin: 0.5rem;
}

.btn {
    background: var(--bg-button);
    border-radius: var(--border-radius-md);
    color: white;
    padding: 10px 25px;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--box-shadow);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    white-space: nowrap;
    font-weight: 600;

    &:hover {
        background: var(--bg-button-hover);
        text-decoration: none;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px var(--box-shadow-color);
    }
}

nav.page-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 4rem;
    background: var(--bg-nav);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--nav-border-color);

    & ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: row;
        align-items: center;

        & li {
            margin: 0;
            border-radius: var(--border-radius-md);
            background: transparent;
            font-weight: 600;
            transition: background 0.2s ease;

            & a {
                display: flex;
                align-items: center;
                gap: 0.5rem;
                text-decoration: none;
                color: var(--fg);
                padding: 0.5rem 1rem;
                border-radius: inherit;
                font-weight: inherit;
                transition: background 0.2s ease;

                &:hover {
                    background: var(--bg-secondary-hover);
                    text-decoration: none;
                }
            }
        }
    }

    & i {
        font-size: 1.25rem;
        width: auto;
    }
}

main {
    display: flex;
    flex-direction: column;
    padding: 5rem 2rem 2rem 2rem;
    margin: 0 auto;
    max-width: 36em;
}

footer.page-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 4rem;
    color: var(--fg-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);

    & p {
        margin: 0;
    }
}

/* Mobile: bottom nav */
@media only screen and (max-width: 768px) {
    nav.page-nav {
        top: auto;
        bottom: 0;
        box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
        border-bottom: none;
        border-top: 1px solid var(--nav-border-color);

        & ul {
            gap: 0;
            width: 100%;
            justify-content: space-around;

            & li {
                flex: 1;
                display: flex;
                justify-content: center;

                & a {
                    padding: 0.5rem;
                    flex-direction: column;
                    gap: 0.25rem;
                    width: 100%;
                    justify-content: center;

                    & span {
                        font-size: 0.75rem;
                    }
                }
            }
        }

        & i {
            font-size: 1.5rem;
        }
    }

    main {
        padding: 2rem 2rem 5rem 2rem;
    }

    footer.page-footer {
        padding-bottom: 6rem;
    }
}

/* Medium screens and up: top nav.page-navigation */
@media only screen and (min-width: 769px) {
    :target {
      scroll-margin-top: 80px;
    }

    nav.page-nav ul {
        gap: 1rem;

        & li {
            border-radius: var(--border-radius-md);
        }
    }
}
