.background-container {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
    opacity: 1;
    transform: translateY(0);
}

.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: url("bg.png");
    background-size: cover;
    background-position: center;
}

.cont {
    margin-top: 70px;
    margin-left: 100px;
    width: 50%;
    color: white;
}

.con {
    width: 90%;
    margin-top: -5%;
}

.con p {
    text-align: justify;
    font-size: 16px;
    line-height: 30px;
}

.cont h1 {
    font-family: "Tektur", sans-serif;
    color: rgb(230, 217, 255);
    font-size: 88px;
    z-index: -1;
}

.learn-btn {
    margin-top: 10px;
    display: inline-block;
    background-color: #B480EE;
    color: black;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.3s ease-in-out;
}

.learn-btn:hover {
    background-color: #715fc0;
    color: white;
}

.image {
    margin-top: 80px;
    margin-right: 80px;
    align-items: center;
    justify-content: center;
    width: 50%;
    display: flex;
}

.image img {
    height: auto;
    width: 550px;
}

.box {
    display: flex;
    position: relative;
    justify-content: space-between;
}

.content {
    padding-top: 50px;
    background-color: #090712;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(100px);
    display: none;
    color: white;
    font-family: 'Fira Sans', sans-serif;
    line-height: 1.6;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
    padding-bottom: 100px;
}

.content.show-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.background-container.hidden {
    opacity: 0;
    transform: translateY(-100px);
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.description h2 {
    font-family: "Antonio", sans-serif;
    font-size: 64px;
    margin-bottom: 10px;
    margin-top: -10px;
    color: white;
}

.content-grid {
    margin-top: 100px;
    overflow: hidden;
    margin-left: 150px;
    margin-right: 150px;
}

.content-grid img {
    width: 40%;
    float: left;
    margin-right: 50px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-in-out 0.2s, transform 0.8s ease-in-out 0.2s;
}

.show-content .content-grid img {
    opacity: 1;
    transform: translateY(0);
}

.description p {
    font-size: 14px;
    margin-bottom: 25px;
    text-align: justify;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.show-content .description p:nth-child(2) {
    transition-delay: 0.3s;
    opacity: 1;
    transform: translateY(0);
}

.show-content .description p:nth-child(3) {
    transition-delay: 0.5s;
    opacity: 1;
    transform: translateY(0);
}

.show-content .description p:nth-child(4) {
    transition-delay: 0.7s;
    opacity: 1;
    transform: translateY(0);
}

.description h2 {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.show-content .description h2 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

main {
    flex: 1;
    position: relative;
}

/* Media queries for responsiveness */
@media (max-width: 1024px) {
    .box {
        flex-direction: column;
    }

    .cont, .image {
        width: 90%;
        margin: 20px auto;
    }

    .content-grid {
        margin: 50px 20px;
    }

    .content-grid img {
        width: 100%;
        float: none;
        margin-right: 0;
    }

    /* Adjust topic section layout for smaller screens */
    .topic-container {
        flex-direction: column !important; /* Force column layout, override row-reverse */
        align-items: center; /* Center items vertically in column */
        margin-left: 20px !important;
        margin-right: 20px !important;
    }

    .topic-image {
       margin-bottom: 30px; /* Add space below image */
       width: auto; /* Let image container size naturally */
    }

    .topic-content {
       width: 100%; /* Allow text to take full width */
       text-align: center; /* Center heading */
    }
    .topic-content p{
        text-align: justify; /* Justify paragraph text */
    }

    .topic-image img {
        height: 250px; /* Optionally adjust image size */
        width: auto;
    }

    .topic-section {
        padding: 30px 20px; /* Adjust padding */
    }
}

@media (max-width: 768px) {
    .cont h1 {
        font-size: 60px;
    }

     .description h2 {
        font-size: 48px; /* Adjust heading size */
    }

    .content-grid h1 {
        font-size: 60px; 
        margin-top: 100px;
    }

    .topic-section h2 {
        font-size: 36px; 
    }
}

.content-grid h1 {
    margin-top: 180px;
    font-size: 90px;
    font-family: "Antonio", sans-serif;
    text-align: center;
}

.topic-section {
    display: flex;
    justify-content: center; 
    padding: 50px 50px;
    background-color: #C9A0F8;
    margin-bottom: 50px;
    margin-left: 0px;
    margin-right: 0px;
    color: black;
    transition: all 0.3s ease-in-out;
}

.topic-container {
    margin-left: 100px;
    margin-right: 100px;
    display: flex;
    align-items: center; 
    gap: 50px;
    width: 100%;
    max-width: 1200px; 
    box-sizing: border-box; 
}

.topic-content {
    flex: 1;
    margin-top: -5%;
}

.topic-image {
    flex-shrink: 0;
    line-height: 0;
}

.topic-image img {
    height: 250px;
    width: auto;
    max-width: 100%;
    border-radius: 20px;
    display: block;
}

.topic-alternate {
    background-color: #B0A0F8;
}

.topic-alternate .topic-container {
    flex-direction: row-reverse; 
}


.topic-section h2 {
    font-family: "Antonio", sans-serif;
    font-size: 48px;
    margin-bottom: 20px;
    color: #181818;
    transform: none;
    transition: none; 
}

.topic-section p {
    font-family: 'Fira Sans', sans-serif;
    font-size: 13px;
    line-height: 1.7;
    text-align: justify;
    color: #181818;
    transform: none;
    transition: none; 
    margin-bottom: 0;
}

.topic_link {
    text-decoration: none;
}

.topic-section:hover {
    margin-left: 50px;
    margin-right: 50px;
    padding: 50px 0px;
    border-radius: 25px;
}