:root {
    --primary-color: hsl(242 69% 45%);
    --primary-color-hover: hsl(242 79% 55%);
    --secondary-color: hsl(190, 77%, 53%);
    --shadow-big: 0 8px 12px -4px rgba(0, 0, 0, 0.9), 0 0 32px rgba(0, 0, 0, 0.5);
    --shadow-small: 0 14px 6px -12px rgba(0, 0, 0, 0.75), 0 0 12px rgba(0, 0, 0, 0.25);
    --shadow-hard: 0 11px 4px -9px rgba(0, 0, 0, 0.95);
}

html {
    font-size: 16px;
    padding: 0;
    margin: 0;
    scroll-behavior: smooth;
}

body {
    background-color: hsl(253, 12%, 15%);
    color: hsl(0, 33%, 99%);
    font-family: system-ui, sans-serif;
    font-size: 1.15rem;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    padding-block-start: 3rem;
}


h2 {
    line-height: 1.25;
    font-size: 2rem;
    margin-block-end: 0.5rem;

    &:first-child {
        margin-block-start: 0.5rem;
    }
}

h4 {
    line-height: 1.25;
    font-size: 1.25rem;
    margin-block-start: 2rem;
    margin-block-end: 0;
}


ul {
    padding-left: 1rem;

    li {
        margin-bottom: .5rem;
    }
}

img {
    box-sizing: border-box;
    display: block;
    height: auto;
    max-width: 100%;
}

.anchor {
    display: block;
    height: 1rem;
    margin-top: -3rem;
    visibility: hidden;
}

.container {
    box-sizing: border-box;
    margin-block: 4rem;
    margin-inline: auto;
    max-width: 1300px;
}

.panel {
    border-radius: 1rem;
    color: hsl(180, 33%, 2%);
    box-shadow: var(--shadow-small);
    padding: 2rem 4rem;
}

.gradient-title {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-weight: 900;
    line-height: 1;
}

header {
    background-color: hsl(253, 12%, 7.5%);
    box-sizing: border-box;
    height: 3rem;
    padding: .25rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;

    nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-inline: auto;
        max-width: 1300px;

        h2 {
            margin: 0 !important;

            a {
                color: hsl(0, 0%, 100%);
                text-decoration: none;

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

        ul {
            display: flex;
            list-style: none;
            margin: 0;

            li {
                margin-block: 0;
                margin-inline-end: 1rem;
            }

            a {
                color: hsl(0, 0%, 100%);
                text-decoration: none;

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


.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;

    .hero__text {
        flex: 1;
        padding-right: 4rem;

        .logo {
            text-align: center;

            img {
                height: auto;
                margin-inline: auto;
                max-width: 200px;
            }
        }

        .gradient-title {
            font-size: 3.75rem;
            margin-block-end: 1rem;
            margin-block-start: 0;
            text-align: center;
        }

        .description {
            margin-bottom: 2rem;
            text-align: center;
        }

    }

    .hero__image {
        flex: 1;
        box-shadow: var(--shadow-big);
    }
}

.image-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(15, minmax(300px, 1fr));
    overflow-x: auto;
    scroll-snap-type: x mandatory;

    .image-block {
        position: relative;
        scroll-snap-align: start;
        text-align: center;

        &:hover {
            cursor: pointer;
        }

        img {
            background-clip: padding-box, border-box;
            background-origin: border-box;
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
            border-radius: 8px;
            border: 2px solid transparent;
            height: auto;
            padding: 2px;
            transition: transform 0.3s ease-in-out;
            width: 100%;
        }
    }

}

.screenshots {
    .large-image {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: auto;
        height: auto;
        max-width: none;
        max-height: none;
        z-index: 10;
        transform: scale(1.5); /* Adjust the scale value as needed */
    }
}

a {
    color: var(--secondary-color);
    text-decoration: none;

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

.download-button {
    background-color: var(--primary-color);
    border-radius: 5px;
    box-shadow: var(--shadow-hard);
    color: white;
    display: block;
    font-weight: bold;
    margin: 20px auto;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    width: fit-content;

    &:hover {
        background-color: var(--primary-color-hover);
        cursor: pointer;
        text-decoration: none;
    }
}


.features-panel {
    background-color: hsl(206, 61%, 90%);

    a {
        color: var(--primary-color-hover);
    }
}


.screenshots-panel {
    background-color: hsl(43, 91%, 82.5%);
    scrollbar-color: hsl(0, 0%, 0%, 20%) hsl(0, 0%, 0%, 10%);
}

.instructions-panel {
    background-color: hsl(84, 41%, 80%);
}

footer {
    text-align: center;

    h3 {
        margin-block-start: 3rem;
    }
}

.popover__container {
    align-items: center;
    background: hsl(0 0% 0% / 85%);
    display: none;
    height: 100%;
    justify-content: center;
    left: 0;
    overflow: hidden;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;

    &.open {
        display: flex;
    }

    .popover {
        display: contents;
        max-height: 80%;
        max-width: 1300px;
        position: relative;

        .popover__image {
            display: none;
            position: relative;
            max-width: 90%;
            max-height: 90%;

            &.open {
                display: block;
            }

            img {
                border-radius: 8px;
                height: auto;
                max-height: 90vh;
                max-width: 90vw;
                width: 100%;
            }

            .popover__caption {
                color: #fff;
            }
        }

        .close-popover {
            align-items: center;
            background: #fff;
            border-radius: 50%;
            border: none;
            color: #000;
            content: "\274c";
            cursor: pointer;
            display: flex;
            font-size: 1.5rem;
            font-weight: 900;
            height: 3rem;
            justify-content: center;
            opacity: .5;
            padding: .25rem;
            position: absolute;
            right: 1rem;
            top: 1rem;
            width: 3rem;

            &:hover {
                cursor: pointer;
                opacity: 1;
            }
        }
    }

}


@media (max-width: 600px) {
    h1 {
        font-size: 1.5em;
    }
    header {
        & nav {
            h2 {
                display: none;
            }
        }
    }

    .image-grid {
        grid-template-columns: 1fr;
    }


    .hero {
        flex-direction: column;
        justify-content: space-between;
        align-items: center;

        .hero__text {
            padding-right: 0;
        }
    }
    .panel {
        padding: 1rem;
        margin-inline: .5rem;
    }
    .popover__container {
        .popover {
            position: unset;

            .close-popover {
                font-size: .85rem;
                height: 2rem;
                opacity: 1;
                right: 1rem;
                top: 1rem;
                width: 2rem;
            }
        }
    }
}
