:root {
    --background-color: rgba(58, 26, 5, 1);
    --hub-image-size: 0.8;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    overflow-x: hidden;

    &.gradient {
        background: linear-gradient(to bottom, #003F2F, #001310, #003F2F);
        background-size: 100% var(--gradient-height);
    }
}

body:has(.startScreen) {
    overflow: hidden;
    height: 100vh;
}

/* Hub section styling */
.hub {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, z-index 0s ease 0s;
}

.hub.hub-visible {
    z-index: 9999;
    opacity: 1;
    pointer-events: auto;
}

/* Skip button styling */
#skip-button {
    font-family: "crayonize", sans-serif;
    font-weight: 400;
    font-style: normal;
    position: fixed;
    top: auto;
    bottom: 2vh;
    right: 1vw;
    padding: 12px 20px;
    color: white;
    cursor: pointer;
    font-size: 3.2em;
    border-radius: 5px;
    z-index: 10001;
    display: none;
}

#skip-button .skip-arrow {
    width: 48px;
    aspect-ratio: 1 / 1;
    margin-left: 8px;
    vertical-align: middle;
    display: inline-block;
    transform: rotate(270deg);
}

/* Completion video container styling */
#completion-video-container {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: 10000;
    background-color: #000;
    cursor: pointer;
    display: none;
}

#completion-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
}

/* Video container animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes scrollFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated-graphic {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

main>section>div.visible,
main>section>img.visible {
    animation: scrollFadeIn 0.8s ease-out forwards;
}

/* Only hide divs and images that will get the fade-in animation (not on index.html, not first section) */
main:not(.startScreen)>section:not(:first-of-type)>div,
main:not(.startScreen)>section:not(:first-of-type)>img {
    opacity: 0;
}

#video-container {
    animation: fadeIn 0.5s ease-in !important;
}

#video-container.fade-out {
    animation: fadeOut 0.5s ease-out !important;
}

img {
    display: block;
    margin: 5vw auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;

    &.full-width {
        width: 75vw;
        height: auto;
    }

    &.wider {
        width: 50vw;
        height: auto;
    }
}

main {
    width: 100vw;
    height: 100vh;

    >section {
        width: 100vw;
        height: 100vh;

        &.small {
            width: 100vw;
            height: 50vh;
        }

        &.medium {
            width: 100vw;
            height: 75vh;
        }

        &.tight {
            width: 100vw;
            height: auto;
        }

        &.bottom {
            display: flex;
            align-items: flex-end;
            justify-content: center;
        }

        display: flex;
        align-items: center;
        justify-content: center;

        &.audio-choice {
            min-height: 100vh;
            height: auto;
            flex-direction: column;

            >div {
                width: 80%;
            }
        }

        >div {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
            flex: 0 0 80%;

            &.left {
                display: grid;
                grid-template-columns: 1fr 1fr;
                grid-template-rows: auto auto;
            }

            &#video-container {
                position: fixed;
                width: 100vw;
                height: 100vh;
                top: 0;
                left: 0;
                z-index: 10000;
                background-color: #000;
                cursor: pointer;
                margin: 0;
                padding: 0;
                overflow: hidden;

                #intro-video-main {
                    width: 100%;
                    height: 100%;
                    position: relative;
                    margin: 0;
                    padding: 0;

                    #intro-poster {
                        position: absolute;
                        top: 0;
                        left: 0;
                        width: 100%;
                        height: 100%;
                        z-index: 1;
                        cursor: pointer;
                        margin: 0;
                        padding: 0;
                        border: none;
                        object-fit: cover;
                        max-width: 100vw;
                    }

                    .vimeo-wrapper {
                        width: 100%;
                        height: 100%;
                        position: relative;
                        margin: 0;
                        padding: 0;
                        object-fit: cover;

                        iframe {
                            position: absolute;
                            top: 0;
                            left: 0;
                            width: 120vw;
                            height: 120vh;
                            display: block;
                            margin: 0;
                            padding: 0;
                            border: none;
                            object-fit: cover;

                            #player {
                                width: 100% !important;
                                height: 100% !important;
                                margin: 0 !important;
                                padding: 0 !important;
                            }
                        }
                    }
                }
            }

            >div {
                display: flex;
                flex-direction: column;
                justify-content: center;
            }

            &.audio-files {
                display: grid;
                grid-template-columns: repeat(7, 1fr);
                grid-template-rows: repeat(2, auto);
                flex-direction: column;
                align-items: center;
                justify-content: center;

                >.file {
                    position: relative;

                    &#jos {
                        grid-column: 4 / span 2;
                        grid-row: 1;

                        >.audio {
                            top: 25%;
                            right: -10%;
                        }
                    }

                    &#marlies {
                        grid-column: 2 / span 2;
                        grid-row: 1;

                        >.audio {
                            top: 35%;
                            left: -25%;
                        }
                    }

                    &#sjeng {
                        grid-column: 3 / span 2;
                        grid-row: 2;

                        >.audio {
                            top: 25%;
                            left: 0%;
                        }

                        >.person {
                            width: 22vw;
                        }
                    }

                    &#wilma {
                        grid-column: 5 / span 2;
                        grid-row: 2;

                        >.audio {
                            top: 25%;
                            right: -30%;
                        }
                    }

                    >img.person {
                        width: 18vw;
                        height: auto;
                        object-fit: contain;
                    }

                    >img.audio {
                        cursor: pointer;
                        position: absolute;
                        width: 4vw;
                        height: auto;
                        object-fit: contain;
                    }
                }
            }

            h2 {
                width: fit-content;
            }

            h3 {
                color: white;
                font-size: 2.6em;
                font-family: "crayonize", sans-serif;
                font-weight: 800;
                font-style: bold;
                align-self: baseline;
                max-width: 35vw;
                margin-bottom: 2vh;
                margin-block-start: 1em;

                &.medium {
                    font-size: 6.4em;
                    font-weight: 400;
                }

                &.tall {
                    font-weight: 400;
                    font-size: 8em;
                }
            }

            p {
                color: white;
                font-size: 1.6em;
                font-family: "avenir-next-lt-pro", sans-serif;
                font-weight: 400;
                font-style: normal;
                line-height: 1.4;
                max-width: 31vw;

                &.short {
                    max-width: 35vw;
                }
            }

            img {
                width: 90%;
                max-width: 31vw;
                height: auto;
                margin: 2vh 5vw;
                object-fit: contain;
            }
        }

        >img {
            margin: 0 auto;
            width: 60vw;
            height: auto;
            object-fit: contain;
        }

        /* Nested divs stack their own children vertically */
        &.verdieping {
            display: flex;
            flex-direction: row;
            width: fit-content;

            div {
                width: 100vw;
                height: 100vh;
                flex-shrink: 0;
            }
        }

        &.hub {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;

            h1 {
                margin: 5vw auto;
                color: white;
                font-size: 4.8em;
                font-family: "crayonize", sans-serif;
                font-weight: 900;
                font-style: bold;
            }

            section {
                display: flex;
                flex-direction: row;
                justify-content: center;
                align-items: center;
                width: 90vw;
                height: 100vh;


                div {
                    display: flex;
                    justify-content: center;
                    align-items: flex-end;

                    >img {
                        cursor: pointer;
                        margin-bottom: 20vh;
                        object-fit: contain;

                        &#gezin {
                            width: calc(26vw * var(--hub-image-size));
                            height: auto;
                        }

                        &#vrije-tijd {
                            width: calc(28.2vw * var(--hub-image-size));
                            height: auto;
                        }

                        &#werk {
                            width: calc(20vw * var(--hub-image-size));
                            height: auto;
                        }
                    }
                }
            }
        }

        /* Visited page styling */
        .visited-page {
            opacity: 0.7;
            filter: brightness(0.7);
            transform: scale(0.95);
            transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
        }

        .visited-page:hover {
            opacity: 0.85;
            filter: brightness(0.85);
            transform: scale(0.96);
        }

        &.video-section {
            display: flex;
            justify-content: center;
            align-items: center;

            >div {
                height: 90vh;
                width: auto;
                aspect-ratio: 4 / 3;

                video {
                    width: 100%;
                    height: 100%;
                    object-fit: contain;
                }
            }
        }
    }



    h2 {
        font-family: "crayonize", sans-serif;
        font-weight: 800;
        font-style: bold;
        color: white;
        font-size: 3.2em;
        height: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        padding: 1.2em 1.5em;
        width: auto;
        margin: 5vh auto;
        margin-bottom: 5vh;
        white-space: normal;
    }


    &#gezin {
        h2:not(.clean) {
            background-image: url("../assets/uitknipsels/h2/Gezin.png");
        }

        h2.lang:not(.clean) {
            background-image: url("../assets/uitknipsels/h2/GezinLang.png");
        }
    }

    &#vrije-tijd {
        h2:not(.clean) {
            background-image: url("../assets/uitknipsels/h2/VrijeTijd.png");
        }
    }

    &#werk {
        h2:not(.clean) {
            background-image: url("../assets/uitknipsels/h2/Werk.png");
        }
    }
}

.animated-graphic {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;

    .anim-video {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        position: relative;
        align-items: center;
        justify-content: center;
    }
}

button {
    position: fixed;
    top: 50vh;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0);
    color: white;
    font-size: 2.4em;
    border: none;
    cursor: pointer;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;

    &#deep {
        right: 2vw;
    }

    &#back {
        left: 2vw;
    }

    &#down {
        right: 50vw;
        top: auto;
        bottom: 2vh;
        transform: translate(50%, 0);
    }

    &#up {
        right: 2vw;
        top: 8vh;
    }

    &#toHub {
        font-family: "crayonize", sans-serif;
        font-weight: 400;
        font-style: normal;
        font-size: 3.2em;
        left: 2vw;
        top: 2vh;
        transform: translate(0, 0);
    }

    &#heden-button {
        font-family: "crayonize", sans-serif;
        font-weight: 400;
        font-style: normal;
        font-size: 3.2em;
        left: 2vw;
        top: 2vh;
        transform: translate(0, 0);
        z-index: 10000;
    }

    &#reset-button {
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        bottom: 10%;
        font-family: crayonize;
        font-size: 4em;
        color: white;
        cursor: pointer;
        display: none;
        z-index: 10001;
    }

    &#end-button {
        position: initial;
        display: block;
        margin: 4vh auto 2vh;
        font-family: "crayonize", sans-serif;
        font-weight: 400;
        font-style: normal;
        font-size: 3.2em;
        color: white;
        cursor: pointer;
        padding-bottom: 5vh;
    }
}

.arrow-img {
    width: 2em;
    height: 2em;
    object-fit: contain;

    &.arrow-right {
        transform: rotate(270deg);
    }

    &.arrow-left {
        transform: rotate(90deg);
    }

    &.arrow-down {
        transform: rotate(0deg);
    }

    &.arrow-up {
        transform: rotate(180deg);
    }
}


div {
    width: 100%;
    height: 100%;

    >img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    >video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    &.start {
        width: 100vw;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5vh;

        background-image: url('../assets/StartScherm.png');
        background-size: cover;
        background-position: 10% 30%;
    }

    &.random-fact {
        width: 50vw;
        height: auto;
        margin: 0 auto;
        justify-content: center;
        align-items: center;
        text-align: center;

        h2 {
            font-size: 3.2em;
            font-family: "crayonize", sans-serif;
            font-weight: 100;
            font-style: normal;
        }
    }
}

h2 {
    color: white;
    font-size: 1.6em;
    font-weight: normal;
}

/* Scrolly page background colors */
body.gezin-page {
    background-color: rgba(33, 50, 61, 1);
}

body.vrije-tijd-page {
    background-color: rgba(147, 34, 85, 1);
}

@media (max-width: 1500px) {
    body {
        #skip-button {
            font-size: 2.4em;
        }

        main {
            section {
                h3 {
                    font-size: 2.1em;

                    &.medium {
                        font-size: 5em;
                    }

                    &.tall {
                        font-size: 6.2em;
                    }
                }

                p {
                    font-size: 1.3em;
                }
            }

            &.hub {
                h1 {
                    font-size: 3.8em;
                }
            }

            h2 {
                font-size: 2.5em;
            }
        }

        h2 {
            font-size: 1.2em;
        }

        .random-fact {
            h2 {
                font-size: 2.5em;
            }
        }

        button {
            font-size: 2.1em;

            &#toHub,
            &#heden-button,
            &#end-button {
                font-size: 2.5em;
            }

            &#reset-button {
                font-size: 3.2em;
            }
        }
    }
}

@media (max-width: 1100px) {
    body {
        #skip-button {
            font-size: 1.8em;
        }

        main {
            section {
                h3 {
                    font-size: 1.7em;

                    &.medium {
                        font-size: 3.8em;
                    }

                    &.tall {
                        font-size: 4.6em;
                    }
                }

                p {
                    font-size: 1.1em;
                }
            }

            &.hub {
                h1 {
                    font-size: 3em;
                }
            }

            h2 {
                font-size: 2em;
            }
        }

        h2 {
            font-size: 1em;
        }

        .random-fact {
            h2 {
                font-size: 2em;
            }
        }

        button {
            font-size: 1.7em;

            &#toHub,
            &#heden-button,
            &#end-button {
                font-size: 2em;
            }

            &#reset-button {
                font-size: 2.5em;
            }
        }
    }
}

@media (max-width: 768px) {
    body {
        #skip-button {
            font-size: 1.6em;
        }

        main {
            section {
                h3 {
                    font-size: 1.5em;

                    &.medium {
                        font-size: 3.2em;
                    }

                    &.tall {
                        font-size: 4em;
                    }
                }

                p {
                    font-size: 1em;
                }
            }

            &.hub {
                h1 {
                    font-size: 2.6em;
                }
            }

            h2 {
                font-size: 1.7em;
            }
        }

        h2 {
            font-size: 0.95em;
        }

        .random-fact {
            h2 {
                font-size: 1.7em;
            }
        }

        button {
            font-size: 1.5em;

            &#toHub,
            &#heden-button,
            &#end-button {
                font-size: 1.8em;
            }

            &#reset-button {
                font-size: 2.2em;
            }
        }
    }
}

/* Intro video styling */
.intro-video,
#intro-video {
    height: 90vh;
    position: relative;
}

/* Animated graphic styling */
.anim-video {
    position: relative;
}

/* Dark section styling */
.dark-section {
    background-color: #003F2F;
}

/* Wider image with translation */
.wider-dorpscafe {
    translate: -4vw 0;
}

/* Background video styling */
#background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}