html,
body {
    color: var(--color-fg-default);
    background-color: var(--color-canvas-default);
    line-height: 1.5;
    min-height: 100vh;
    min-width: 300px;

    overflow-x: hidden;
}

/* Utility classes */

.flex {
    display: flex;
    gap: var(--gap, 1rem);
}

.uppercase {
    text-transform: uppercase;
}

b,
strong,
.bold {
    font-weight: var(--base-text-weight-semibold);
}

em {
    font-style: italic;
}

/* Navigation bar */

.logo {
    margin: 1rem;
    padding: 1rem;
    width: 3rem;
    aspect-ratio: 1/1;
}

.primary-header {
    align-items: center;
    justify-content: space-between;
}

.primary-navigation {
    background-color: var(--color-header-bg-default);
}

@supports (backdrop-filter: blur(2rem)) {
    .primary-navigation {
        background-color: var(--color-header-bg-transparent);
        backdrop-filter: blur(2rem);
    }
}

.primary-navigation a {
    color: var(--color-header-text);
    font-size: 1.5rem;
    text-decoration: none;
    padding: 1rem 0;
    margin: -1rem 0;
    border-radius: 0.5rem;
}

.primary-navigation a > [aria-hidden="true"] {
    font-weight: 700;
    margin-inline-end: 0.75rem;
}

.color-mode-toggle {
    color: var(--color-header-text);
    border: 2px solid currentColor;
    margin: auto;
    padding: 4px;
    background: transparent;
    cursor: pointer;
    border-radius: 5px;
    width: 2.5rem;
    height: 2.5rem;
}

@media (max-width: 35em) {
    .primary-navigation {
        --gap: 3rem;

        position: fixed;
        z-index: 1000;
        inset: 0 0 0 40%;

        flex-direction: column;
        padding: min(30vh, 10rem) 2rem;

        transform: translateX(100%);
        transition: transform 350ms ease-out;
    }

    .primary-navigation a {
        padding: 1rem;
        text-align: right;
        transition: background-color 350ms;
    }

    .primary-navigation a:hover {
        background-color: var(--color-btn-hover-bg);
        transition-duration: 0.1s;
    }

    .primary-navigation[data-visible="true"] {
        transform: translateX(0%);
    }

    .mobile-nav-toggle {
        display: flex;
    }
    [data-color-mode="light"] {
        --color-header-text: var(--color-fg-default);
        --color-header-bg-default: var(--color-scale-gray-0);
    }

    .color-mode-toggle {
        margin: 0 1rem 0 auto;
        width: 3rem;
        height: 3rem;
    }
}

@media (min-width: 35em) {
    .primary-navigation {
        --gap: clamp(1.5rem, 5vw, 3rem);
        padding-block: 1rem;
        padding-inline: clamp(3rem, 8vw, 10rem);
        background-color: var(--color-header-bg-default);
    }

    .primary-navigation *:hover {
        color: var(--color-header-text-hover);
        transition-duration: 0.1s;
    }
}
