•⁠  ⁠{
    box-sizing: border-box;
}

:root {
  --color-orange: #EB5D35;
  --color-bg-darkblue: #292F6B;
  --color-bg-darkerblue: #141738;
  --color-text: #fff;
  --color-bg-darkerblue-rgba: 20, 23, 56;
}

body {
    /* background-color: rgb(21, 21, 39); */
    background-color: var(--color-bg-darkerblue);
    overflow-x: hidden;
    overflow-y: hidden;
}

main {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
}

.rocket {
    min-height: 100vh;
    width: 100%;
    padding: clamp(1rem, 3vw, 2rem);
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: clamp(1rem, 2vw, 1.5rem);
    position: relative;
    overflow: hidden;
}

.rocket model-viewer {
    transform: rotateZ(20deg);
    transform-origin: center;
    width: min(80%, 34rem);
    height: min(80vh, 42rem);

    grid-column: 1/3;
    grid-row: 1/4;
    align-self: center;
    justify-self: center;
}

.rocket {
    background: rgb(21, 21, 39);
    transition: background-color 0.3s ease;
}

/* p display none en weer block bij deg */
.rocket p {
    color: var(--color-text);
    width: min(100%, 22rem);
    height: fit-content;
    padding: 0.5rem;
    font-size: clamp(0.9rem, 1vw, 0.95rem);
    display: none;
    font-family: monospace;


    text-align: center;
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 1.5rem;
}

.rocket p.block {
    display: block;
    justify-self: inline-end;
}

.tekst-container {
    grid-column: 1;
    grid-row: 2;
    z-index: 10000;

    anchor-scope: --tekst-1;

    svg {
        anchor-name: --tekst-1;
        justify-self: end;
    }

    
    p {
        position: absolute;
        position-anchor: --tekst-1;
        position-area: inline-start;
    }
}

.tekst-container2 {
    grid-column: 2;
    grid-row: 2;
    align-self: flex-end;
    justify-self: start;

    anchor-scope: --tekst-2;

    svg {
        anchor-name: --tekst-2;
        transform: scaleX(-1);
        transform-origin: center;
    }

    p {
        position: absolute;
        position-anchor: --tekst-2;
        position-area: right center;
    }
}


.tekst-container3 {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    justify-self: start;

    anchor-scope: --tekst-3;

    svg {
        anchor-name: --tekst-3;
        transform: scaleX(-1);
        transform-origin: center;
    }

    p {
        position: absolute;
        position-anchor: --tekst-3;
        position-area: right center;
    }
}


.tekst-lijn {
    width: clamp(5rem, 10vw, 10rem);
    display: none;
}

.tekst-container:has(p.block) .tekst-lijn,
.tekst-container2:has(p.block) .tekst-lijn,
.tekst-container3:has(p.block) .tekst-lijn {
    display: block;
    width: fit-content;
}



/* glitch effect */


@media (max-width: 900px) {
    .rocket {
        grid-template-columns: 1fr;
        grid-template-rows: auto 8em;
        justify-items: center;
    }

    .rocket model-viewer {
        grid-column: 1;
        grid-row: 1;
        width: min(100%, 28rem);
        height: min(55vh, 28rem);
    }

    .tekst-container,
    .tekst-container2,
    .tekst-container3 {
        grid-column: 1;
        justify-self: center;
        align-self: auto;
        width: 100%;

        p {
            position: relative;
            position-area: unset;
            margin: 0 auto;
        }
    }

    .tekst-container {
        grid-row: 2;
    }

    .tekst-container2 {
        grid-row: 2;
    }

    .tekst-container3 {
        grid-row: 2;
    }

    .rocket p {
        width: min(100%, 28rem);
    }

    .tekst-container:has(p.block) .tekst-lijn,
    .tekst-container2:has(p.block) .tekst-lijn,
    .tekst-container3:has(p.block) .tekst-lijn {
    display: none;
}
}

/* vallende sterren */
/* bron: https://codepen.io/delroyprithvi/pen/LYyJROR?editors=1100 */
.sterren {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.sterren span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    background: var(--color-orange);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.1),0 0 0 8px rgba(255,255,255,0.1),0 0 20px rgba(255,255,255,0.1);
    animation: vallen 3s linear infinite;
}

.sterren span::before{
    content:'';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 1px;
    background: linear-gradient(90deg,var(--color-orange),transparent);
}

/* annimatie vallende sterren */
@keyframes vallen {
 0% {
    transform: rotate(-70deg) translate(1000px);
    opacity: 1;
 }

 70% {
    opacity: 1;
 }

 100% {
    transform: rotate(-70deg) translate(-1000px);
    opacity: 0;
 }
}

.sterren span:nth-child(1){
    top: 6%;
    left: 8%;
    animation-delay: -0s;
    animation-duration: 1s;
}
.sterren span:nth-child(2){
    top: 14%;
    left: 18%;
    animation-delay: -0.2s;
    animation-duration: 3s;
}
.sterren span:nth-child(3){
    top: 24%;
    left: 30%;
    animation-delay: -0.4s;
    animation-duration: 2s;
}
.sterren span:nth-child(4){
    top: 10%;
    left: 42%;
    animation-delay: -0.6s;
    animation-duration: 1.5s;
}
.sterren span:nth-child(5){
    top: 18%;
    left: 54%;
    animation-delay: -0.8s;
    animation-duration: 2.5s;
}
.sterren span:nth-child(6){
    top: 8%;
    left: 66%;
    animation-delay: -1s;
    animation-duration: 3s;
}
.sterren span:nth-child(7){
    top: 36%;
    left: 74%;
    animation-delay: -1.2s;
    animation-duration: 1.75s;
}
.sterren span:nth-child(8){
    top: 16%;
    left: 82%;
    animation-delay: -1.4s;
    animation-duration: 1.25s;
}
.sterren span:nth-child(9){
    top: 12%;
    left: 92%;
    animation-delay: -0.75s;
    animation-duration: 2.25s;
}
.sterren span:nth-child(10){
    top: 28%;
    left: 60%;
    animation-delay: -2.75s;
    animation-duration: 2.75s;
}

.click-spot {
    padding: 5px 5px;
    color: rgba(20, 23, 56, 0.4);
    background: transparent;
    border: 1px solid transparent;
    font-family: monospace, Courier;
    
    transform: scale(1) rotate(0deg);
    box-shadow: none;
    text-shadow: none;
    animation: none; 
    color: var(--color-orange);
    text-decoration: none;

    &:hover {
        color: white;
        padding: 10px 10px;
        background: rgba(235, 93, 53, 0.2);
        border: 2px solid var(--color-orange);
        transform: scale(1.1) rotate(-2deg);

        box-shadow:
        0 0 15px rgba(235, 93, 53, 0.5),
        0 0 30px rgba(235, 93, 53, 0.3),
        inset 0 0 15px rgba(235, 93, 53, 0.2);

        text-shadow: 
            0 0 5px var(--color-text), 
            0 0 10px var(--color-orange);

        animation: pulseLaunchGlow 1.5s infinite alternate;
    }
    

}

/* Annimatie naar de Satellite scherm */
@view-transition {
    navigation: auto;
}

::view-transition-group(root) {
    animation-duration: .3s;
}

body.pagina-verlaten {
    model-viewer {
        animation: vliegen 3s linear;
    }
}

@keyframes vliegen {
    0% {
        transform: translate3d(0, 0, 0) rotate(20deg);
        opacity: 1;
    }

    50% {
        transform: translate3d(0, 2.5rem, 0) rotate(16deg);
        opacity: 1;
    }

    100% {
        transform: translate3d(16rem, -30rem, 0) rotate(34deg) scale(0.92);
        opacity: 0;
    }
}
