div#page-2 {
    overflow: hidden;
}

.svg-element {
    transition: filter 0.3s ease-in-out;
    z-index: 2;
}

.dark-theme .svg-element {
    filter: invert(1) grayscale(100%);
}

.containerastrohome {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 15%;
    height: 100%;
}

.astro {
    width: 331px;
    height: 508px;
    position: relative;
    animation: floatAndSwayAnimation 9s infinite ease-in-out alternate, astroFloat 11s infinite ease-in-out;
}

.rocket {
    width: 397px;
    height: 223px;
    position: absolute;
    left: 60px;
    top: 70px;
    animation: floatAndSwayAnimation 11s infinite ease-in-out alternate, astroFloat 11s infinite ease-in-out;
}

.planet {
    width: 157px;
    height: auto;
    position: absolute;
    right: 40px;
    top: 40px;
    transform: rotate(-45deg);
}

.typewriter {
    width: 123px;
    height: 131px;
    position: absolute;
    right: calc(50% - 289px);
    top: calc(50% - 188px);
    animation: floatAndSwayAnimation 4s infinite ease-in-out alternate, astroFloat 9s infinite ease-in-out;
}

.camera {
    width: 130px;
    height: 125px;
    position: absolute;
    right: calc(50% - 380px);
    bottom: calc(50% - 130px);
    animation: floatAndSwayAnimation 4s infinite ease-in-out alternate, astroFloat 7s infinite ease-in-out;
}

.phone {
    width: 120px;
    height: 120px;
    position: absolute;
    right: calc(50% - 280px);
    bottom: calc(50% - 290px);
    animation: floatAndSwayAnimation 6s infinite ease-in-out alternate, astroFloat 11s infinite ease-in-out;
}

.abacus {
    width: 109px;
    height: 123px;
    position: absolute;
    left: calc(50% - 220px);
    bottom: calc(50% - 270px);
    animation: floatAndSwayAnimation 7s infinite ease-in-out alternate, astroFloat 8s infinite ease-in-out;
}

@keyframes floatAndSwayAnimation {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        transform: translateY(-30px) rotate(0deg);
    }
}

@keyframes astroFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-50px) rotate(-4deg);
    }
}


/* Styl dla efektu pulsowania beacon */
@keyframes beacon {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.typewriter,
.abacus,
.camera,
.phone {
    transition: transform 1s ease-in-out; 
}

.typewriter:hover,
.abacus:hover,
.camera:hover,
.phone:hover {
    animation: floatAndSwayAnimation 4s infinite ease-in-out alternate, astroFloat 6s infinite ease-in-out, beacon 2s infinite;
}


/* stars */

#stars-container {
    position: relative;
    overflow: hidden;
}

.star {
    position: absolute;
    width: var(--size, 2px);
    height: var(--size, 2px);
    background-color: var(--text-color);
    border-radius: 50%;
    opacity: 0.6;
    animation: blink 3s alternate infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}


/* ---- subpages ---- */

.ckontaktsub {
    margin: 40px 0 0 30px;
}

.cwycenasub {
    margin: 90px 0 0 90px;
}


.typewriter-sub {
    width: 140px;
    height: 136px;
    position: relative;
    left: 0;
    top: 50px;
    animation: floatAndSwayAnimation 7s infinite ease-in-out alternate, astroFloat 8s infinite ease-in-out;
}


.wycena-sub {
    width: 230px;
    height: auto;
    left: 250px;
    top: 200px;
    animation: floatAndSwayAnimation 3s infinite ease-in-out alternate, astroFloat 8s infinite ease-in-out;
}


/* ---- responsive ---- */

@media (max-width: 1399px) { 
    .rocket {
        width: 297px;
        height: 123px;
        left: 40px;
        top: 50px;
    }

    .planet {
        width: 97px;
        right: 20px;
        top: 20px;
    }
}

@media (max-width: 1280px) { 
    .containerastrohome {
        padding-top: 11%;
    }
}    

@media (max-width: 989px) {
    .rocket {
        display: none;
    }

    .planet {
        display: none;
    }
}

@media (max-width: 768px) { 

    .containerastro {
        padding-top: 40px;
    }

    #stars-container {
        height: 520px;
    }

    .astro {
        width: 220px;
        height: auto;
    }
    
    .typewriter {
        width: 78px;
        height: auto;
        right: calc(50% - 160px);
        top: calc(50% - 194px);
    }
    
    .camera {
        width: 90px;
        height: auto;
        left: calc(50% - 160px);
        bottom: calc(50% - 130px);
    }
    
    .phone {
        width: 90px;
        height: auto;
        right: calc(50% - 150px);
        bottom: calc(50% - 240px);
    }
    
    .abacus {
        width: 65px;
        height: auto;
        left: calc(50% - 110px);
        bottom: calc(50% - 240px);
    }

}    