@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Reem+Kufi:wght@400;700&family=Rakkas&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    background-color: #d4c5a0;
    font-family: 'Amiri', serif;
    color: #3e2b1d;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* Typography Defaults */
h2 {
    font-family: 'Rakkas', serif;
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: #8b0000;
    text-align: center;
}

h3 {
    font-family: 'Reem Kufi', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #5a4b3a;
}

p {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* HERO SECTION */
#hero {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Hero Animations & Text */
@keyframes floatUpReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    100% {
        opacity: 0.95;
        transform: translateY(0) scale(1);
    }
}

.central-title {
    position: relative;
    z-index: 2;
    font-family: 'Rakkas', serif;
    font-size: 5rem;
    color: #3e2b1d;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    max-width: 80%;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    animation: floatUpReveal 1.5s ease-out forwards 0.5s;
    line-height: 1.2;
}

.central-title em {
    font-style: normal;
    color: #8b0000;
    font-weight: 700;
    display: block;
}

.arabic-signature {
    position: absolute;
    bottom: 40px;
    right: 40px;
    font-family: 'Amiri', serif;
    font-size: 1.8rem;
    color: #4a3b2a;
    opacity: 0;
    pointer-events: none;
    direction: rtl;
    z-index: 2;
    animation: floatUpReveal 1.5s ease-out forwards 1.0s;
}

.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 2rem;
    color: #8b0000;
    animation: bounce 2s infinite;
    cursor: pointer;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* MAIN CONTENT */
main {
    position: relative;
    z-index: 2;
}

.content-section {
    position: relative;
    padding: 6rem 10%;
    background-color: #f4e9d5;
    z-index: 3;
    border-top: 1px solid #d4c5a0;
    border-bottom: 1px solid #d4c5a0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

/* STICKY GALLERY */
.gallery-section {
    position: relative;
    height: 300vh;
    /* Long scroll area */
    background-color: #2b2218;
    color: #f4e9d5;
    z-index: 3;
}

.sticky-container {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.gallery-text {
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    width: 30%;
    z-index: 5;
}

.text-block {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateY(20px);
}

.text-block.active {
    opacity: 1;
    position: relative;
    transform: translateY(0);
}

.text-block h3 {
    color: #dcb98a;
    margin-bottom: 0.5rem;
}

.text-block p {
    font-size: 1.1rem;
    color: #ccc;
}

.gallery-images {
    width: 50%;
    height: 80vh;
    position: absolute;
    right: 5%;
    top: 10vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-wrapper {
    position: absolute;
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
    transform: translateY(50px) scale(0.9) rotate(-2deg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 8px solid #dcb98a;
    border-radius: 4px;
    background: #000;
}

.image-wrapper.active {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
    z-index: 10;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 60vh;
    display: block;
}

.caption {
    display: block;
    text-align: center;
    padding: 10px;
    font-family: 'Reem Kufi', sans-serif;
    color: #3e2b1d;
    font-size: 0.9rem;
    background: #dcb98a;
    font-weight: bold;
}

/* INNOVATIONS CARDS */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    border: 1px solid #e0d0b0;
}

.card:hover {
    transform: translateY(-5px);
}

/* FOOTER */
footer {
    padding: 2rem;
    text-align: center;
    background: #3e2b1d;
    color: #dcb98a;
    z-index: 3;
    position: relative;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .central-title {
        font-size: 3rem;
    }

    .sticky-container {
        flex-direction: column;
    }

    .gallery-text {
        position: relative;
        width: 80%;
        left: 0;
        top: 0;
        transform: none;
        margin: 20px auto;
        height: auto;
        text-align: center;
    }

    .gallery-images {
        width: 90%;
        right: auto;
        position: relative;
        height: 50vh;
        top: 0;
    }

    .image-wrapper img {
        max-height: 40vh;
    }
}