@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@200;300;400;500;600&display=swap");

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Raleway", sans-serif;
}

html,
body {
    height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #23232a;
    min-height: 100vh;
    position: relative;
}

main {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 20px;
    z-index: 10;
}

/* Slide-In/Slide-Out Animations */
@-webkit-keyframes slidein {
    0% {
        top: -100%;
        opacity: 0;
    }

    100% {
        top: 0;
        opacity: 1;
    }
}

@keyframes slidein {
    0% {
        top: -100%;
        opacity: 0;
    }

    100% {
        top: 0;
        opacity: 1;
    }
}

@-webkit-keyframes slideout {
    0% {
        top: 0;
        opacity: 1;
    }

    100% {
        top: -100%;
        opacity: 0;
    }
}

@keyframes slideout {
    0% {
        top: 0;
        opacity: 1;
    }

    100% {
        top: -100%;
        opacity: 0;
    }
}

.swiper {
    max-width: 750px;
    width: 100%;
    min-height: 300px; /* Set a minimum height to prevent collapse */
    aspect-ratio: 5/3;
    z-index: 10;
    margin: 0 auto;
    position: relative !important;
    transition: width 0.3s ease, max-width 0.3s ease; /* Smooth width changes */
    will-change: transform; /* Optimize rendering */
}

.swiper-wrapper {
    transition-timing-function: ease-out; /* Smooth slide transitions */
}

.swiper-slide {
    display: grid;
    grid-template-columns: 40% 60%;
    place-items: center;
    gap: 15px;
    padding: 20px 40px 20px 20px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: #23232a;
    box-shadow: inset 18px 18px 8px rgba(0, 0, 0, 0.2),
        inset -10px -18px 8px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.swiper-slide>img {
    width: 80%;
    height: 80%;
    border-radius: 30px;
    border: 2px solid #ffffff;
    filter: grayscale(40%);
}

.content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 25px;
    color: #ffffff;
    position: relative;
    top: -100%;
    opacity: 0;
    animation: slideout 0.75s ease-out;
}

.swiper-slide-active .content {
    animation: slidein 0.75s ease-out forwards;
}

.title>h1 {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
    letter-spacing: 0.2rem;
    font-size: 1.3rem;
}

.title>h3 {
    line-height: 1.5;
    letter-spacing: 0.05rem;
    color: #6b7280;
    font-size: 1.1rem;
}

.content>p {
    line-height: 1.5;
    color: #9ca3af;
    font-size: 1rem;
}

.white-point {
    display: inline-flex;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: #ffffff;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    z-index: 1;
    padding: 0 10px;
    margin: 0;
    list-style: none;
    overflow: hidden;
}

.particles span {
    position: relative;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 50%;
    background: #7edd90;
    box-shadow: 0 0 10px #7edd9044, 0 0 20px #7edd90;
    margin: 0 4px;
    animation: animate calc(190s / var(--i)) ease infinite;
    transform-origin: center center;
    will-change: transform;
}

.particles span:nth-child(2n) {
    background: #475c9a;
    box-shadow: 0 0 10px #475c9a44, 0 0 20px #475c9a;
}

.particles span:nth-child(3n) {
    background: #9a4772;
    box-shadow: 0 0 10px #9a477244, 0 0 20px #9a4772;
}

@keyframes animate {
    0% {
        transform: translateY(120vh) scale(0, 0) rotate(180deg);
    }

    20% {
        transform: translateY(100vh) scale(1, 1) rotate(0deg);
    }

    100% {
        transform: translateY(-120vh) scale(0.5, 0.5) rotate(360deg);
    }
}

/* Responsiveness */
@media (max-width: 900px) {
    main {
        padding: 0 10px;
    }

    .swiper {
        max-width: 95%;
        aspect-ratio: auto;
    }

    .swiper-slide {
        grid-template-columns: 1fr;
        padding: 10px;
        height: auto;
        gap: 10px;
    }

    .swiper-slide>img {
        width: 40%;
        height: 80%;
        max-height: 300px;
        border-radius: 30px;
        border: 2px solid #ffffff;
        filter: grayscale(40%);
    }

    .content {
        gap: 20px;
        animation-duration: 0.5s;
    }

    .swiper-slide-active .content {
        animation-duration: 0.5s;
    }

    .title>h1 {
        font-size: 1.2rem;
    }

    .title>h3 {
        font-size: 1rem;
    }

    .content>p {
        font-size: 0.9rem;
    }

    .white-point {
        width: 7px;
        height: 7px;
    }

    .swiper-pagination {
        transform: translateY(10px);
        margin-top: 15px;
    }
}

@media (max-width: 600px) {
    main {
        padding: 0 10px;
    }

    .swiper {
        max-width: 95%;
        aspect-ratio: auto;
    }

    .swiper-slide {
        grid-template-columns: 1fr;
        padding: 10px;
        height: auto;
        gap: 5px;
    }

    .swiper-slide>img {
        width: 50%;
        height: auto;
        max-height: 300px;
        border-radius: 30px;
        border: 2px solid #ffffff;
        filter: grayscale(40%);
        margin-top: 5px;
        margin-bottom: 10px;
    }

    .content {
        gap: 15px;
        animation-duration: 0.4s;
    }

    .swiper-slide-active .content {
        animation-duration: 0.4s;
    }

    .title>h1 {
        font-size: 1.2rem;
    }

    .title>h3 {
        font-size: 1rem;
    }

    .content>p {
        font-size: 0.9rem;
    }

    .white-point {
        width: 7px;
        height: 7px;
    }

    .swiper-pagination {
        transform: translateY(10px);
        margin-top: 15px;
    }
}