@import "shared/mixins-and-vars";

main {
    color: @dark-grey;
    width: 100%;
}

a {
    color: @orange;
}

.homepage {
    &__sponsor-logo {
        display: block;
        margin: 20px auto;
        width: 200px;
    }

    &__slogan {
        margin-bottom: 40px;
    }

    &__hero {
        color: @color0;
        min-height: 30vh;
        padding: 20px;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        font-size: (19.2 / @px);

        &--heading {
            font-family: @font-default-brand;
            font-size: (64 / @px);
            margin: 30px auto 10px;
            font-weight: normal;
            color: @pink;

            img {
                width: 12rem;

                @media @tablet-up {
                    width: 18rem;
                }
            }
        }

        &--copy {
            margin-bottom: 10px;
            display: flex;
            flex-direction: column;
            align-items: center;

            @media @tablet-up {
                margin-bottom: 40px;
            }
        }

        p {
            max-width: 50rem;
        }
    }

    &__hero-link {
        @button-height: (50 / @px);
        text-decoration: none;

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

        &--main {
            display: inline-block;
            height: @button-height;
            line-height: @button-height;
            background: @color1;
            color: white;
            padding: 0 20px;
            margin-right: 20px;
        }

        &--secondary {
            display: inline-block;
            white-space: nowrap;
            color: @color0;

            height: @button-height;
            line-height: @button-height;

            @media @mobile {
                margin-top: 20px;
            }

            &:after {
                .icon-mixin("../images/chevron-up.svg");
                filter: none;
                transform: rotate(90deg);
                top: (4.5 / @px);
            }
        }
    }

    &__intro {
        display: flex;
        justify-content: center;
        flex-direction: column;

        @media @tablet-up {
            flex-direction: row;
        }

        &--section {
            font-size: (16 / @px);
            border-radius: 25px;
            background-color: #f4f7f5;
            margin-bottom: 40px;
            padding: 20px;
            flex-grow: 1;
            width: 100%;

            p {
                text-align: center;
                a {
                    color: @orange;
                }
            }

            @media @tablet-up {
                width: 33%;
                p {
                    text-align: center;
                }
            }
        }

        &--section + &--section {
            // margin-left: 2%;
            // background-color: #b8d5b8;
            background-color: #f4f7f5;
            margin-top: 20px;

            @media @tablet-up {
                margin-left: 2%;
                margin-top: 0;
            }
        }

        &--section-icon {
            width: 100px;
            height: 100px;
        }

        &--header {
            font-weight: bold;
            font-size: (20 / @px);
            border: none;
            margin-top: 10px;
            margin-bottom: 20px;
            color: @dark-grey;
            text-align: center;
            display: block;
            align-items: center;

            @media @desktop {
                margin-top: 20px;
                margin-bottom: 30px;
            }

            &::before {
                content: "";
                //display: inline-flex;
                display: block;
                width: 20px;
                height: 20px;
                border-radius: 50%;
                margin: 0 auto 30px auto;
                //margin-right: 20px;
                padding: 20px;
                background-size: 40px;
                background-repeat: no-repeat;
                background-position: 50% 50%;
                background-color: #fff;
                flex-shrink: 0;

                @media @desktop {
                    width: 50px;
                    height: 50px;
                }

                @media (forced-colors: active) {
                    & {
                        filter: invert() brightness(61%) contrast(434%);
                    }
                }

                .enable__is-dark-mode & {
                    background-color: #999;
                }
            }

            &--code::before {
                background-image: data-uri("../images/icons/code.svg");
                // background-color: @color-scratch;
            }

            &--existing::before {
                background-image: data-uri("../images/icons/integrate.svg");
                // background-color: @color-integrate;
            }

            &--npm::before {
                background-image: data-uri("../images/icons/npm.svg");
                // background-color: @color-npm;

                @media (forced-colors: active) {
                    & {
                        background-color: #fff;
                        filter: grayscale() invert() contrast(434%);
                    }
                }
            }

            &--question::before {
                background-image: data-uri("../images/icons/question.svg");
            }

            &--donate:before {
                background-image: data-uri("../images/icons/donate.svg");
            }

            &--bug:before {
                background-image: data-uri("../images/icons/bug.svg");
            }
        }

        a {
            color: @pink;
            border-bottom: 3px solid;
            text-decoration: none;
        }
    }

    &__bottom-copy {
        background: @pink;
        color: #fff;
        line-height: 1.5;
        padding: 20px;
        //padding-bottom: -10px;
        text-align: center;

        @media @desktop {
            padding: 20px calc(~"(100% - 1024px) / 2 + 20px");
            padding-bottom: 60px;
        }

        &--heading {
            font-weight: bold;
            color: #fff;
            display: inline-flex;
            align-items: stretch;
            margin-bottom: 0px;

            @media @tablet-up {
                font-size: (38 / @px);
            }
        }

        &--heading::before {
            width: 20px;
            height: 20px;
            margin-right: 10px;
        }

        &.background-secondary {
            background: #f4f7f5;
            p {
                color: @blue;
            }
        }

        &.background-tertiary {
            background: @blue;
            a {
                color: @light-orange;
            }
        }

        .background-secondary &--heading {
            color: @blue;
        }

        ul {
            margin: 0;
            padding: 0;

            @media @tablet-up {
                column-count: 2;
                column-gap: 13px;
            }

            li {
                margin-bottom: 20px;
                background-color: #fff;
                border-radius: 25px;
                padding: 20px;
                list-style-type: none;
                color: @dark-grey;
            }
        }
    }
}

.enable__is-dark-mode {
    main {
        color: @dark-mode-white;
    }
    
    .homepage {
        &__hero {
            color: @pink-darkmode;

            &--heading {
                color: @pink-darkmode;
            }
        }

        &__intro {
            &--section {
                background-color: #222;
                color: white;
                
                p {
                    a {
                        color: @light-orange;
                    }
                }
            }

            &--section + &--section {
                background-color: #222;
            }

            &--header {
                color: white;
            }
        }

        &__bottom-copy {
            ul {
                li {
                    background-color: #222;
                    color: white;
                }
            }

            &--heading {
                color: white;
            }

            &.background-secondary {
                background-color: #111;
                p {
                    color: white;
                }

                .homepage__bottom-copy--heading {
                    color: white;
                }
            }
        }
    }

    a {
        color: @light-orange;
    }
}