/* #region Global Styles */
:root {
    /* Border radius */
    --rounded-sm: 4px;
    --rounded-md: 18px;
    --rounded-full: 9999px;

    /* Colors */
    --background: #f5f5f9;
    --background-1: #ffffff;
    --background-2: #eeeeee;
    --background-dark: #333333;
    --background-dark-hover: #555555;

    /* Hero Colours */
    --gradient-start: #f5f5f9;
    --gradient-end: #f5f5f900;
    --text-shadow: rgba(255, 255, 255, 0.5);
    --opposite-shadow: rgba(0, 0, 0, 0.5);

    /* Text colors */
    --text-primary: #111111;
    --text-secondary: #444444;
    --text-light: #ffffff;

    /* Accent colors */
    --primary: #415de8;
    --primary-hover: #3449c4;
    --warning: #f5a623;
    --danger: #d0021b;

    /* Border colors */
    --border: #dddddd;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;

    /* Callout colors */
    --callout-note-bg: #e8f4fd;
    --callout-note-border: #3498db;
    --callout-note-text: #2980b9;

    --callout-important-bg: #fdf3e8;
    --callout-important-border: #f39c12;
    --callout-important-text: #d35400;

    --callout-warning-bg: #fde8e8;
    --callout-warning-border: #e74c3c;
    --callout-warning-text: #c0392b;
}

body.dark {
    --background: #121212;
    --background-1: #1e1e1e;
    --background-2: #333333;
    --background-dark: #333333;
    --background-dark-hover: #555555;

    --gradient-start: #121212;
    --gradient-end: #12121200;
    --text-shadow: rgba(0, 0, 0, 0.5);
    --opposite-shadow: rgba(255, 255, 255, 0.5);

    --text-primary: #ffffff;
    --text-secondary: #d4d4d4;
    --text-light: #ffffff;

    --primary: #198fe9;
    --primary-hover: #0361cc;
    --warning: #f5a623;
    --danger: #d0021b;

    --border: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* #region Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--background-2);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--rounded-full);
    border: 3px solid var(--background-2);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* #endregion */

body {
    font-family: "Roboto", Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--background);
    overflow-x: hidden;

    &.dark {
        .nav-logo {
            filter: invert(1);
        }

        .shader-switch button {
            border: 2px solid white;
            border-bottom-color: #0000;
            background: var(--background-1);

            &&::after {
                background-color: white;
            }

            &.active {
                background: var(--background-2);
            }
        }

        .shader-settings > div {
            border-color: white;
            background: var(--background-2);
        }
    }
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
li {
    color: var(--text-primary);
}

a {
    color: var(--primary);
    text-decoration: none;

    &:hover {
        color: var(--primary-hover);
    }
}

/* #endregion */

/* #region Navigation */
nav {
    background-color: var(--text-shadow);
    padding: calc(var(--space-md) / 2) var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;

    /* margin-bottom: -55px; */
    z-index: 1;
    backdrop-filter: blur(10px);

    .nav-logo {
        height: 30px;
        margin-right: 1rem;
    }

    .nav-logo-link {
        text-decoration: none;
        display: flex;
        align-items: center;
    }

    ul {
        list-style: none;
        display: flex;
        justify-content: center;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);

        li {
            margin: 0 1rem;

            a {
                color: var(--text-primary);
                text-decoration: none;
                padding: var(--space-sm) var(--space-md);

                &.active {
                    color: var(--primary);
                    border-bottom: 2px solid var(--primary);
                    font-weight: bold;
                }

                &:hover {
                    color: var(--primary);
                    font-weight: bold;
                }
            }
        }
    }

    .socials {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: var(--space-sm);
        margin-left: auto;

        a {
            color: var(--text-primary);
            text-decoration: none;

            &:hover {
                color: var(--primary);
            }

            svg {
                fill: currentColor;
                width: 24px;
                height: 24px;
            }
        }
    }
}

.mobile-nav {
    display: none;
}

@media (max-width: 768px) {
    nav:not(.mobile-nav) {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    .nav-logo {
        height: 24px;
    }
}
/* #endregion */

/* #region Footer */
footer {
    background-color: var(--background-1);
    color: var(--text-light);
    padding: var(--space-md) var(--space-sm) var(--space-md) var(--space-md);
    position: relative;

    p,
    span {
        color: var(--text-secondary);
    }

    .footer-content {
        display: flex;
        justify-content: flex-end;
        gap: var(--space-lg);
        max-width: min(1200px, 90%);
        margin: 0 auto var(--space-lg);
    }

    .footer-section {
        max-width: 120px;
        /* width: 100%; */

        flex: 1;

        &:first-child {
            max-width: 300px;
            flex: 2;

            display: flex;
            flex-direction: column;

            .toggles {
                margin-top: auto;
                display: flex;
                flex-direction: column;
                gap: var(--space-md);

                .toggle {
                    display: flex;
                    gap: var(--space-md);
                }
            }
        }

        img {
            width: 100%;
            height: auto;
        }

        h4 {
            color: var(--text-primary);
            margin-bottom: var(--space-md);
            font-size: 1.2rem;
        }

        ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        li {
            margin-bottom: var(--space-sm);
        }

        a {
            color: var(--text-secondary);
            text-decoration: none;
            font-weight: normal;
            transition: color 0.2s ease;

            &:hover {
                color: var(--primary);
            }

            &.disabled {
                opacity: 0.5;
                cursor: not-allowed;

                &:hover {
                    color: var (--text-secondary);
                }
            }
        }

        box-icon {
            fill: currentColor;
            stroke: currentColor;
            width: 12px;
            height: 12px;
        }
    }

    .footer-bottom {
        border-top: 1px solid var(--border);
        padding-top: var(--space-md);
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        flex-wrap: wrap;
        gap: var(--space-md);
        max-width: min(1200px, 90%);
        margin: 0 auto;

        p {
            margin: 0;
        }

        .footer-info {
            display: flex;
            flex-direction: column;
            gap: var(--space-md);
            text-align: left;
        }

        .disclaimers {
            font-size: 0.8rem;
            color: var(--text-secondary);
            max-width: 600px;
            line-height: 1.4;
        }

        .credits {
            text-align: right;
        }
    }

    @media (max-width: 768px) {
        .footer-bottom {
            justify-content: center;
            text-align: center;

            .theme-toggle {
                margin-top: var(--space-sm);
            }

            .footer-info {
                text-align: center;
            }
        }
    }
}
/* #endregion */

/* #region Layout */
main {
    /* max-width: 1200px; */
    /* margin: 2rem auto; */
    /* padding: 0 1rem; */
}

.hero-content,
#content {
    max-width: min(1200px, 90vw);
    margin: 2rem auto;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
}
/* #endregion */

/* #region Hero Section */
main:has(.hero:only-child) {
    margin-bottom: 0 !important;
}

.hero {
    position: relative;
    min-height: 69vh;
    max-height: 69vh;
    color: var(--text-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;

    &.small {
        min-height: 29vh;
        max-height: 29vh;
        margin-bottom: 0;

        + div {
            margin-top: 0 !important;
        }

        .hero-content {
            padding: 0;
        }
    }

    h1 {
        color: var(--text-light);
    }

    &:only-child {
        --gradient-start: var(--background-1);
    }

    .hero-logo {
        position: absolute;
        z-index: 1;
        max-width: 400px;
        width: 100%;
        top: 15%;
        left: 50%;
        transform: translate(-50%, -50%);

        img {
            width: 100%;
            height: auto;
            filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
        }
    }

    .hero-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 0;

        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        &::after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                to top,
                var(--gradient-start) 30px,
                var(--gradient-end) 350px
            );
        }
    }

    &:hover .hero-image img {
        transform: scale(1.1);
    }

    .hero-content {
        position: relative;
        z-index: 1;
        padding: var(--space-lg);
        padding-bottom: 5rem;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        min-height: inherit;
        width: 100%;
        margin-top: auto;

        h1 {
            text-align: left;
            margin-bottom: var(--space-sm);
            color: var(--text-primary);

            text-shadow: 0 2px 4px var(--text-shadow);
        }

        p {
            margin-bottom: var(--space-md);
            color: var(--text-primary);

            text-shadow: 0 2px 4px var(--text-shadow);
        }
    }

    .skip {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-md);

        a {
            padding: var(--space-sm) var(--space-md);
            background-color: var(--background);
            color: var(--text-primary);
            text-decoration: none;
            border-radius: var(--rounded-md);
            box-shadow: 0px 0px 2px 0px var(--opposite-shadow);

            &:hover {
                background-color: var(--background-dark-hover);
                color: var(--text-light);
            }

            &.primary {
                background-color: var(--primary);

                &:hover {
                    background-color: var(--primary-hover);
                }
            }
        }
    }

    &.video-hero {
        &::after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                to top,
                var(--gradient-start) 30px,
                var(--gradient-end) 350px
            );
            z-index: 0;
        }

        &:hover .hero-image img {
            transform: none;
        }

        .hero-video {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 100vw;
            height: 100vh;
            z-index: 0;

            iframe {
                width: 100vw;
                height: 56.25vw;
                min-height: 100vh;
                min-width: 177.77vh;
                position: absolute;
                top: 50%;
                left: 50%;
                pointer-events: none;
                transform: translate(-50%, -50%) scale(1.6);
            }
        }
    }
}
/* #endregion */

/* #region Features Section */
.features-section {
    margin: 3em 1em;
}

.feature {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: var(--space-md);
    background-color: var(--background-1);
    border-radius: var(--rounded-md);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: min(90%, 900px);
    width: 100%;

    &.shifted {
        flex-direction: row-reverse;
        margin-left: auto;
    }

    .feature-media {
        flex: 1;
        max-width: 33%;
        width: 33%;
        border-radius: var(--rounded-md);

        overflow: hidden;

        img {
            width: 100%;
            height: 100%;
            object-fit: cover;

            transition: transform 500ms ease;
        }

        &:hover img {
            transform: scale(1.1);
        }
    }

    .feature-details {
        flex: 2;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        height: fit-content;

        h3 {
            margin: 0;
            font-size: 1.75rem;
            color: var(--text-primary);
        }

        .creators {
            display: flex;
            flex-direction: row;
            gap: 3rem;
            align-items: center;
            color: var(--text-secondary);
        }

        .creator {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 1rem;
            color: var(--text-secondary);

            .image {
                width: 48px;
                height: 48px;
                border-radius: 50%;
                overflow: hidden;

                .creator-logo {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }
            }

            .creator-details {
                display: flex;
                flex-direction: column;

                span:first-child {
                    font-size: 0.9rem;
                    color: var(--text-secondary);
                }

                .creator-name {
                    font-weight: bold;
                    color: var(--text-primary);
                }
            }
        }

        .description {
            line-height: 1.4;
            font-size: 0.9rem;
            color: var (--text-secondary);
            border-left: 3px solid var(--border);
            padding-left: var(--space-md);
        }

        .requirements {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            border-radius: var(--rounded-md);
            padding: var(--space-sm);
            outline: 3px solid var(--border);

            span,
            ul {
                font-weight: bold;
                color: var(--text-primary);
                width: 100%;
                border-bottom: 1px solid var(--border);
            }

            ul {
                list-style: none;
                display: flex;
                flex-direction: column;
                gap: 0.5rem;
            }

            li {
                padding: var(--space-xs) var(--space-sm);
                background-color: var(--background-2);
                border-radius: var(--rounded-full);
                font-size: 0.9rem;
                width: fit-content;
                border: 2px solid var(--border);

                display: flex;
                align-items: center;
                gap: 0.5rem;

                /* &.no::before {
                    content: "✗";
                    margin-right: 0.5rem;
                }

                &.yes::before {
                    content: "✓";
                    margin-right: 0.5rem;
                } */

                box-icon {
                    width: 20px;
                    height: 20px;
                    fill: var(--text-primary);
                }
            }
        }

        .further-actions {
            display: flex;
            flex-direction: row;
            gap: 1rem;
            margin-top: 1rem;

            a {
                padding: var(--space-sm) var(--space-md);
                background-color: var(--background-dark);
                color: var(--text-light);
                text-decoration: none;
                border-radius: var(--rounded-md);

                display: flex;
                align-items: center;
                gap: 5px;

                &.primary {
                    background-color: var(--primary);

                    &:hover {
                        background-color: var(--primary-hover);
                    }
                }

                box-icon {
                    fill: currentColor;
                    width: 24px;
                    height: 24px;
                    margin-right: -10px;
                }
            }
        }
    }
}
/* #endregion */

/* #region Content Section */
.instructions-content {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.instructions-section {
    background-color: var(--background-1);
    padding: var(--space-md);
    border-radius: var(--rounded-md);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

    .subsection {
        margin-top: 1rem;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    h3:not(:first-child) {
        margin-top: 1rem;
    }

    ol {
        margin-left: 1rem;
    }

    .setting-keys {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;

        .setting-key {
            display: flex;
            gap: 0.5rem;
            align-items: center;

            .colour {
                width: 1.5rem;
                height: 1.5rem;
                border-radius: 50%;
                background-color: var(--key-color);
            }

            span {
                font-weight: bold;
                color: var(--key-color);
            }
        }
    }

    .important {
        --key-color: #ed3965;
    }

    .recommended {
        --key-color: #f4c11b;
    }

    .settings-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1rem;

        .setting {
            padding: var(--space-md);
            background-color: var(--background-2);
            border-radius: var(--rounded-md);
            display: flex;
            flex-direction: column;
            gap: 1rem;
            cursor: pointer;
            transition: transform 0.2s ease;

            img {
                width: 100%;
                height: 100%;
                border-radius: var(--rounded-md);
            }

            span {
                font-weight: bold;
                color: var(--text-primary);
            }

            &:hover {
                transform: scale(1.02);
            }
        }
    }

    .shader-switch {
        display: flex;
        gap: var(--space-sm);
        width: 100%;
        margin-bottom: -1rem;

        button {
            padding: var(--space-sm) var(--space-md);
            border: 2px solid black;
            border-radius: var(--rounded-md);
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
            background: none;
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.2s ease;
            background: var(--background-2);
            width: 100%;
            position: relative;

            &:first-child::after {
                content: "";
                display: block;
                width: var(--space-sm);
                height: 1px;
                background-color: black;
                position: absolute;
                bottom: -1px;
                right: -1px;
                transform: translateX(100%);
            }

            &.active {
                background: var(--background-1);
                border-bottom-color: #0000;
            }
        }
    }

    .shader-settings > div {
        display: none;
        padding: var(--space-md);
        background: var(--background-1);
        border: 2px solid;
        border-top: none;
        border-radius: var(--rounded-md);
        border-top-left-radius: 0;
        border-top-right-radius: 0;

        &.active {
            display: block;
        }

        > div {
            margin-left: 0rem;
        }

        > div > ol > li {
            list-style: none !important;
            font-weight: bold !important;
            margin-left: 10px !important;
        }

        > div > ol > li > ol,
        > div > ol li {
            font-weight: normal;
            list-style: disc;
            margin-left: 2rem;
        }

        h3:not(:first-child) {
            margin-top: 1rem;
        }

        .downArrow {
            list-style: none;

            &::before {
                content: "▼";
                margin-right: 0.5rem;
                transform: scaleY(0.5);
            }

            ol {
                margin-left: 2rem;
            }
        }
    }
}
/* #endregion */

/* #region Download Tiers */
.download-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-lg);
    width: 100%;
}

.download-tier {
    background-color: var(--background-1);
    border-radius: var(--rounded-md);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    width: 100%;
    display: flex;
    flex-direction: column;

    &:hover {
        transform: translateY(-4px);
    }

    &.most-popular {
        /* add a before element with the text "Most Popular Choice */
        position: relative;

        &::before {
            content: "Most Popular Choice";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            padding: var(--space-xs) var(--space-md);
            transform: translateY(-100%);
            background-color: var(--primary);
            color: var(--text-light);
            font-weight: bold;
            text-align: center;

            border-top-left-radius: var(--rounded-md);
            border-top-right-radius: var(--rounded-md);
        }

        .download-tier-header {
            border-radius: 0;
        }
    }

    .download-tier-header {
        position: relative;
        border-radius: var(--rounded-md) var(--rounded-md) 0 0;
        overflow: hidden;

        img {
            width: 100%;
            height: 150px;
            object-fit: cover;

            transition: transform 0.5s ease;
        }

        &:hover {
            img {
                transform: scale(1.1);
            }
        }
    }

    .download-tier-details {
        padding: var(--space-md);
        display: flex;
        flex-direction: column;
        padding-top: 0;
        /* height: 100%; */
        flex-grow: 1;
        gap: var(--space-md);

        h3 {
            font-size: 1.5rem;
            margin-bottom: var(--space-xs);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .tier-price {
            font-size: 2rem;
            font-weight: bold;
            color: var(--primary);
            display: flex;
            align-items: center;

            .currency {
                font-size: 1.25rem;
                margin-right: var(--space-xs);
            }
        }

        .tier-description {
            color: var(--text-secondary);
            /* margin-bottom: var(--space-md); */
            font-size: 1.2rem;
            padding-left: 0.5rem;
            margin-left: -0.25rem;
            border-left: 3px solid var(--border);
            border-radius: var(--rounded-sm);
        }

        .tier-features {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: var(--space-sm);

            li {
                display: flex;
                align-items: center;
                gap: var(--space-sm);
                color: var(--text-primary);
                font-size: 1rem;

                box-icon {
                    width: 20px;
                    height: 20px;
                    fill: var(--text-primary);
                }
            }
        }

        .tier-download {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: auto;

            a {
                padding: var(--space-sm) var(--space-md);
                background-color: var(--primary);
                color: var(--text-light);
                text-decoration: none;
                border-radius: var(--rounded-md);
                width: 100%;
                text-align: center;
                /* font-weight: bold; */
                font-size: 1.3rem;

                &:hover {
                    background-color: var(--primary-hover);
                }
            }
        }
    }
}

.demo-section {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background-color: var(--background-1);
    border-radius: var(--rounded-md);
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

    h2 {
        color: var(--text-primary);
        margin-bottom: var(--space-sm);
    }

    p {
        color: var(--text-secondary);
        font-size: 1.2rem;

        a {
            color: var(--primary);
            text-decoration: none;
            font-weight: bold;

            &:hover {
                color: var(--primary-hover);
            }
        }
    }
}

@media (max-width: 768px) {
    .download-section {
        grid-template-columns: 1fr;
    }
}
/* #endregion */

/* #region Section Headers */
.section-header {
    width: 100%;
    margin: var(--space-lg) 0;
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;

    img {
        width: 100%;
        max-width: 400px;
        height: 100px;
        object-fit: contain;
    }
}

body.dark .section-header {
    img {
        filter: invert(1);
    }
}

@media (max-width: 768px) {
    .section-header {
        margin: var(--space-md) 0;

        img {
            height: 150px;
        }
    }
}
/* #endregion */

/* #region Components */
.button {
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    background-color: var(--background-dark);
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--rounded-md);
    align-self: flex-start;

    &:hover {
        background-color: var(--background-dark-hover);
    }

    &.primary {
        background-color: var(--primary);

        &:hover {
            background-color: var(--primary-hover);
        }
    }
}

.discord {
    display: inline-flex;
    padding: var(--space-xs) var(--space-sm);
    padding-left: var(--space-xs);
    background-color: #5865f1;
    color: var(--text-light);
    border-radius: var(--rounded-full);
    font-size: 0.9rem;
    text-decoration: none;
    position: relative;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);

    &::before {
        content: "";
        display: inline-block;
        height: 1.5rem;
        width: 1.5rem;
        background-image: url("../images/logos/alextestria.webp");
        background-size: cover;
        margin-right: 0.5rem;
    }
}

.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;

    &.active {
        display: flex;
    }

    img {
        max-width: 90%;
        max-height: 90vh;
        object-fit: contain;
        border-radius: var(--rounded-md);
        width: auto;
        height: auto;
    }
}

.switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;

    input {
        display: none;
    }

    .slider {
        width: 50px;
        height: 25px;
        background-color: var(--text-primary);
        border-radius: var(--rounded-full);
        position: relative;
        transition: background-color 0.3s;

        &::before {
            content: "";
            position: absolute;
            width: 21px;
            height: 21px;
            background-color: var(--text-light);
            border-radius: 50%;
            top: 2px;
            left: 2px;
            transition: transform 0.3s;
        }
    }

    input:checked + .slider {
        background-color: var(--primary);

        &::before {
            transform: translateX(25px);
        }
    }
}
/* #endregion */

/* #region Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 250px;
    grid-auto-flow: dense;
    gap: var(--space-md);
    padding: var(--space-md);
    max-width: min(1400px, 100vw);
    margin: 0 auto;
    width: 100%;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--rounded-md);
    overflow: hidden;
    background-color: var(--background-2);

    outline: var(--space-md) solid var(--background);
    filter: grayscale(0.5) saturate(1.2);

    &:nth-child(4n + 1) {
        grid-column: span 2;
        grid-row: span 2;
    }

    &:nth-child(6n + 3) {
        grid-column: span 1;
        grid-row: span 2;
    }

    &:nth-child(8n + 2) {
        grid-column: span 2;
    }

    &:nth-child(9n - 2) {
        grid-column: span 2;
        grid-row: span 1;
    }

    &:nth-child(12n + 8) {
        grid-row: span 2;
    }

    &:hover {
        transform: scale(1.1);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        z-index: 1;

        filter: grayscale(0) saturate(1) brightness(1);

        border-radius: 1px;

        &:nth-child(4n + 1),
        &:nth-child(8n + 2),
        &:nth-child(9n - 2) {
            transform: scale(1.05);
        }

        img {
            transform: scale(1.1);
        }

        &::after {
            opacity: 0.2;
        }
    }

    &::after {
        content: "";
        position: absolute;
        inset: 0;
        /* background: var(--primary); */
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }
}
/* #endregion */

/* #region Legal Content */
.loaded-content {
    max-width: min(800px, 90%);
    margin: 0 auto;
    padding: var(--space-lg);
    line-height: 1.6;
    background-color: var(--background-1);
    border-radius: var(--rounded-md);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

    h2 {
        color: var(--text-primary);
        margin: var(--space-lg) 0 var(--space-md);
        margin-top: 0;
        font-size: 1.8rem;
    }

    h3 {
        color: var(--text-primary);
        margin: var(--space-md) 0 var(--space-sm);
        font-size: 1.4rem;
    }

    p {
        margin-bottom: var(--space-md);
        color: var(--text-secondary);
    }

    ul {
        margin: var(--space-md) var(--space-lg) var(--space-lg);

        li {
            margin-bottom: var(--space-sm);
            color: var(--text-secondary);
        }
    }

    em {
        display: block;
        margin: var(--space-sm) 0;
        padding: var(--space-sm);
        background: var(--background-2);
        border-left: 3px solid var(--primary);
        font-style: normal;
        color: var(--text-primary);
    }

    br {
        margin-bottom: var(--space-sm);
    }
}

/* #endregion */

/* Markdown callouts */
.callout {
    border: 2px solid;
    padding: var(--space-md);
    padding-left: calc(var(--space-lg) * 1.25);
    margin: var(--space-lg) 0;
    border-radius: var(--rounded-md);
    font-weight: 500;
    overflow: hidden;
    position: relative;
    text-align: center;
    font-size: 1.2rem;

    --bg-color: var(--background-2);
    --bd-color: var(--border);
    --tx-color: var(--text-primary);
    --call-ico: "i";

    &.note {
        --bg-color: var(--callout-note-bg);
        --bd-color: var(--callout-note-border);
        --tx-color: var(--callout-note-text);
        --call-ico: "i";
    }
    &.important {
        --bg-color: var(--callout-important-bg);
        --bd-color: var(--callout-important-border);
        --tx-color: var(--callout-important-text);
        --call-ico: "!";
    }
    &.warning {
        --bg-color: var(--callout-warning-bg);
        --bd-color: var(--callout-warning-border);
        --tx-color: var(--callout-warning-text);
        --call-ico: "!";
    }

    background: var(--bg-color);
    border-color: var(--bd-color);
    color: var(--tx-color);

    &:before {
        content: var(--call-ico);
        background: var(--bd-color);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-light);

        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 2rem;
    }
}

/* Add to your existing CSS */
.foldout {
    background: var(--background-1);
    border: 1px solid var(--border);
    border-radius: var(--rounded-md);
    margin: var(--space-sm) 0;
    overflow: hidden;

    color: var(--text-primary);

    summary {
        padding: var(--space-md);
        cursor: pointer;
        font-weight: 500;
        background: var(--background-2);
        transition: background-color 0.2s ease;

        &:hover {
            background: var(--background);
            color: var(--text-primary);
        }
    }

    &[open] {
        summary {
            border-bottom: 1px solid var(--border);
        }
    }
}

.foldout-content {
    padding: var(--space-md);
    overflow-x: auto;

    ol,
    ul {
        margin: var(--space-sm) 0;
        padding-left: var(--space-lg);

        li {
            margin-bottom: var(--space-xs);
        }
    }

    > *:first-child {
        margin-top: 0;
    }

    > *:last-child {
        margin-bottom: 0;
    }

    code {
        background: var(--background-1);
        border: 2px solid var(--border);
        padding: 0.5rem 1rem;
        border-radius: var(--rounded-sm);
    }

    table {
        width: 100%;
        border-collapse: collapse;
        margin: var(--space-md) 0;
        border: 1px solid var(--border);

        th,
        td {
            border: 1px solid var(--border);
            padding: var(--space-sm);
        }

        th {
            background: var(--background-1);
        }

        tr:nth-child(2n) {
            background: var(--background-2);
        }
    }
}

/* #region Credits Styles */
.credits-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg);

    color: var(--text-primary);
}

.credits-header {
    text-align: center;
    margin-bottom: var(--space-lg);

    h2 {
        color: var(--text);
        font-size: 2.5rem;
        margin-bottom: var(--space-md);
        font-weight: 700;
    }

    .credits-description {
        color: var(--text-muted);
        font-size: 1.1rem;
        line-height: 1.6;
        max-width: 800px;
        margin: 0 auto;
    }
}

.credits-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: var(--space-xl) 0;
}

.contributors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.contributor-card {
    background: var(--background-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease,
        border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: var(--space-md);

    &:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        border-color: var(--accent);
    }

    .contributor-info {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .contributor-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: var(--space-md);
        width: 100%;

        .contributor-image {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            overflow: hidden;
            border: 3px solid var(--accent);
            transition: transform 0.2s ease;
            flex-shrink: 0;

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                transition: transform 0.2s ease;
            }

            &:hover img {
                transform: scale(1.1);
            }
        }

        .contributor-title {
            flex: 1;

            .contributor-name {
                color: var(--text);
                font-size: 1.5rem;
                font-weight: 600;
                margin: 0;
            }

            .contributor-role {
                color: var(--accent);
                font-size: 1rem;
                font-weight: 500;
                text-transform: uppercase;
                letter-spacing: 0.5px;
                margin: 0;
            }
        }
    }

    .contributor-body {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);

        .contributor-description {
            color: var(--text-muted);
            line-height: 1.6;
            margin: 0;
        }

        .contributor-links {
            display: flex;
            flex-wrap: wrap;
            gap: var(--space-xs);
        }

        .contributor-link {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.25rem 0.6rem;
            border: 1.5px solid var(--border);
            background: var(--background-2);
            color: var(--text-primary);
            text-decoration: none;
            border-radius: var(--rounded-full);
            line-height: 1;
            font-size: 0.85rem;
            font-weight: 600;
            transition: all 0.2s ease;

            &:hover {
                background: var(--primary);
                border-color: var(--primary-hover);
                color: var(--text-light);
                transform: translateY(-1px);
            }

            &:focus-visible {
                outline: 2px solid var(--primary);
                outline-offset: 2px;
            }

            /* ensure the external icon sits after text and matches current color */
            .external-icon,
            box-icon {
                width: 14px;
                height: 14px;
                fill: currentColor;
                stroke: none;
            }
        }
    }
}

@media (max-width: 768px) {
    .contributors-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .credits-header h2 {
        font-size: 2rem;
    }

    .contributor-card {
        padding: var(--space-md);
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--space-sm);

        .contributor-header {
            flex-direction: column;
            align-items: center;
            text-align: center;
            align-items: center;

            .contributor-image {
                width: 60px;
                height: 60px;
            }
        }

        .contributor-links {
            margin-left: 0;
            justify-content: center;
        }
    }
}
/* #endregion */
