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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    max-width: 100vw;
    overflow-x: hidden;
}

#about, #programs, #contact {
    scroll-margin-top: 100px;
}

body {
    font-family: 'Poppins', sans-serif;
    color: #1e293b;
    background-color: #f1f5f9;
    position: relative;
    overflow-x: hidden;
}

/* TYPOGRAPHY PAIRING */
h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    letter-spacing: -1px;
}

h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.btn,
nav ul li a,
.logo {
    font-family: 'Montserrat', sans-serif;
}

.btn {
    font-weight: 700;
}

nav ul li a {
    font-weight: 600;
}

body::before {
    content: '';
    position: fixed;
    top: -30%;
    left: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

/* NAVBAR */
nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 60px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    transition: 0.3s;
}

/* Scroll shrink effect (like your old one but cleaner) */
nav.scrolled {
    padding: 10px 60px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav a {
    text-decoration: none;
    color: #1e293b;
    font-weight: 500;
}

/* HERO */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 80px 60px;
    min-height: 80vh;
    background: transparent;
    color: #1e293b;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-left {
    flex: 1;
}

.hero-left h1 {
    font-size: 120px;
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
    line-height: 1.1;
}

.hero-left p {
    color: #475569;
    font-size: 18px;
    max-width: 500px;
}

.hero-buttons {
    margin: 25px 0;
}

.hero-impact {
    display: flex;
    gap: 40px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.hero-impact h3 {
    color: #10b981;
}

.hero-impact span {
    color: #aaa;
    font-size: 14px;
}

/* IMAGE SIDE */
/* IMAGE SIDE - FLOATING COLLAGE */
.hero-right.floating-collage {
    flex: 1;
    position: relative;
    height: 500px;
    margin-left: 40px;
}

.floating-collage .gallery-item {
    position: absolute;
    border-radius: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 5px solid #ffffff;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.floating-collage .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.collage-img-1 {
    width: 60%;
    height: 350px;
    top: 0;
    right: 0;
    z-index: 2;
    animation: float 6s ease-in-out infinite;
}

.collage-img-2 {
    width: 50%;
    height: 250px;
    bottom: 20px;
    left: 20px;
    z-index: 3;
    animation: float 7s ease-in-out infinite reverse;
}

.collage-img-3 {
    width: 45%;
    height: 200px;
    top: 50px;
    left: 0;
    z-index: 1;
    opacity: 0.9;
    animation: float 8s ease-in-out infinite 1s;
}

.floating-collage .gallery-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.hero h1 {
    font-size: 52px;
    font-weight: 600;
    letter-spacing: 1px;
}

.hero p {
    font-size: 20px;
    color: #475569;
}

.proof {
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #64748b;
    text-align: center;
    padding: 15px;
    font-size: 14px;
}

@media(max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 100px 20px;
    }

    .hero-left h1 {
        font-size: 48px;
        min-height: 220px;
    }

    .hero-left p {
        margin: 0 auto 20px;
    }

    .hero-impact {
        justify-content: center;
        gap: 20px;
    }

    .hero-right.floating-collage {
        margin-top: 50px;
        width: 100%;
        margin-left: 0;
        height: 350px;
        display: flex;
        flex-direction: row !important;
        align-items: stretch !important;
        gap: 8px;
    }

    .floating-collage .gallery-item {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        height: auto !important;
        /* Let flex stretch handle height */
        flex-grow: 1;
        flex-basis: 0;
        min-width: 0 !important;
        /* Critical fix for flexbox intrinsic size bouncing */
        box-shadow: none !important;
        border-radius: 20px !important;
        border: 2px solid #fff !important;
        transition: none !important;
        /* Removed conflicting transition */
        overflow: hidden !important;
    }

    .gallery-item.collage-img-1 {
        animation: auto-accordion-1 9s ease-in-out infinite !important;
    }

    .gallery-item.collage-img-2 {
        animation: auto-accordion-2 9s ease-in-out infinite !important;
    }

    .gallery-item.collage-img-3 {
        animation: auto-accordion-3 9s ease-in-out infinite !important;
    }

    .hero-right.floating-collage:active .gallery-item {
        animation: none !important;
        transition: flex-grow 0.4s ease !important;
        /* Re-enable transition ONLY when tapped manually */
        flex-grow: 1 !important;
    }

    .hero-right.floating-collage .gallery-item:active {
        flex-grow: 5 !important;
    }
}

@keyframes auto-accordion-1 {

    0%,
    22.22%,
    100% {
        flex-grow: 5;
    }

    33.33%,
    88.88% {
        flex-grow: 1;
    }
}

@keyframes auto-accordion-2 {

    0%,
    22.22% {
        flex-grow: 1;
    }

    33.33%,
    55.55% {
        flex-grow: 5;
    }

    66.66%,
    100% {
        flex-grow: 1;
    }
}

@keyframes auto-accordion-3 {

    0%,
    55.55% {
        flex-grow: 1;
    }

    66.66%,
    88.88% {
        flex-grow: 5;
    }

    100% {
        flex-grow: 1;
    }
}

/* BUTTONS */
.btn {
    padding: 12px 25px;
    border-radius: 30px;
    text-decoration: none;
    margin: 10px;
    display: inline-block;
    transition: 0.3s;
}

.primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.secondary {
    border: 1px solid #10b981;
    color: #10b981;
    backdrop-filter: blur(6px);
}

.btn:hover {
    transform: translateY(-3px) scale(1.03);
}

/* SECTIONS */
.section {
    padding: 60px 40px;
    text-align: center;
}

.section h2 {
    font-size: 32px;
    margin-bottom: 50px;
    color: #1e293b;
}

.about-section {
    padding: 60px 40px;
    background: #ffffff;
    color: #1e293b;
    border-radius: 40px;
    margin: 40px auto;
    max-width: 1400px;
    width: calc(100% - 40px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
}

.about-container {
    display: flex;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
}

.about-text h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

.about-text p {
    color: #475569;
    line-height: 1.6;
}

.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: 0.3s;
}

.about-image img:hover {
    transform: scale(1.02);
}

/* IMPACT */
.impact-section {
    padding: 60px 40px;
    background: #0f0f0f;
    color: #f8fafc;
    border-radius: 40px;
    margin: 40px auto;
    max-width: 1400px;
    width: calc(100% - 40px);
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.impact-section h2 {
    color: #f8fafc;
}

.impact-section h2 {
    margin-bottom: 50px;
    font-size: 32px;
}

.impact-grid {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.impact-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 40px;
    border-radius: 16px;
    flex: 1;
    min-width: 130px;
    max-width: 350px;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.impact-card:hover {
    transform: translateY(-8px);
    border-color: rgba(16, 185, 129, 0.4);
}

.impact-card h1 {
    font-family: 'Montserrat', sans-serif;
    color: #10b981;
    font-size: 40px;
    margin-bottom: 10px;
}

.impact-card p {
    color: #cbd5e1;
}

/* GALLERY */
.gallery {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.gallery img {
    width: 33%;
    border-radius: 10px;
    transition: 0.3s;
}

.gallery img:hover {
    transform: scale(1.05);
}

@media(max-width: 900px) {
    .about-container {
        flex-direction: column;
        text-align: center;
    }
    .about-image {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
}

/* SPONSOR */
.sponsor {
    background: #0f0f0f;
    color: #f8fafc;
    border-radius: 40px;
    margin: 40px auto;
    max-width: 1400px;
    width: calc(100% - 40px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.sponsor h2 {
    color: #f8fafc;
}

.sponsor-section {
    padding: 60px 40px;
    background: #0f0f0f;
    color: #f8fafc;
    border-radius: 40px;
    margin: 40px auto;
    max-width: 1400px;
    width: calc(100% - 40px);
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.sponsor-section h2 {
    color: #f8fafc;
    margin-bottom: 50px;
}

/* SPONSOR FIX */
.sponsor-grid {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.sponsor-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: 0.3s;
}

.sponsor-card:hover {
    transform: translateY(-6px);
    border-color: rgba(16, 185, 129, 0.4);
}

.sponsor-card h3 {
    color: #10b981;
    margin-bottom: 10px;
}

.sponsor-card p {
    color: #cbd5e1;
}

.sponsor-cta {
    margin-top: 60px;
}

.sponsor-cta p {
    margin-bottom: 20px;
    color: #cbd5e1;
}

.program-section {
    padding: 60px 40px;
    background: #ffffff;
    color: #1e293b;
    border-radius: 40px;
    margin: 40px auto;
    max-width: 1400px;
    width: calc(100% - 40px);
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
}

.program-section h2 {
    font-size: 32px;
    margin-bottom: 50px;
}

.program-grid {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.program-card {
    background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
    border-radius: 20px;
    overflow: hidden;
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid #e2e8f0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
    cursor: pointer;
}

.program-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.program-card h3 {
    color: #10b981;
    margin: 15px 0 10px;
}

.program-card p {
    color: #475569;
    padding: 0 20px 20px;
    font-size: 14px;
}

@media (hover: hover) {
    .program-card.stagger-card.active:hover {
        transform: translateY(-15px) scale(1.15);
        border-color: #10b981;
        box-shadow: 0 30px 60px rgba(16, 185, 129, 0.2);
    }
}

@media(max-width: 768px) {

    .sponsor-section {
        padding: 80px 20px;
    }

    .sponsor-card {
        width: 100%;
    }

    .sponsor-cta {
        padding: 0 10px;
    }

    .impact-grid {
        gap: 15px;
        /* Smaller gap on mobile */
    }

    .impact-card {
        padding: 20px;
    }

    .impact-card h1 {
        font-size: 28px;
    }

    .impact-card p {
        font-size: 14px;
    }
}



/* CONTACT */
input,
textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ccc;
}

button {
    padding: 12px 25px;
    background: #10b981;
    color: white;
    border: none;
    cursor: pointer;
}

/* HAMBURGER */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 101;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background: #1e293b;
    margin: 4px 0;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    border-radius: 3px;
}

/* Hamburger to X Animation */
.hamburger.active div:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}
.hamburger.active div:nth-child(2) {
    opacity: 0;
}
.hamburger.active div:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

.contact-section {
    padding: 60px 40px;
    background: #ffffff;
    color: #1e293b;
    border-radius: 40px;
    margin: 40px auto;
    max-width: 1400px;
    width: calc(100% - 40px);
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
}

.contact-section h2 {
    margin-bottom: 50px;
    font-size: 32px;
}

/* LAYOUT */
.contact-container {
    display: flex;
    gap: 40px;
    align-items: stretch;
}

/* MAP */
.contact-map {
    flex: 1;
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
    border-radius: 16px;
}

/* FORM */
.contact-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 12px;
    color: #1e293b;
    border-radius: 8px;
}

.contact-form textarea {
    height: 150px;
}

.contact-form button {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    padding: 12px;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.contact-form button:hover {
    transform: translateY(-2px);
}

.footer {
    background: #0f0f0f;
    border-radius: 40px 40px 0 0;
    color: white;
    padding: 80px 60px 30px;
    margin-top: 40px;
}

.footer-container {
    display: flex;
    gap: 40px;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

/* COLUMNS */
.footer-col {
    flex: 1;
}

.footer-col h3 {
    margin-bottom: 15px;
    color: #10b981;
}

/* TEXT */
.footer-text {
    color: #aaa;
    font-size: 14px;
    line-height: 1.6;
}

/* ICONS */
.footer-icons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.footer-icons a {
    font-size: 22px;
    color: #aaa;
    transition: 0.3s;
}

.footer-icons a:hover {
    color: #10b981;
    transform: translateY(-3px);
}

/* BOTTOM */
.footer-bottom {
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    font-size: 13px;
    color: #777;
}

/* MOBILE */
@media(max-width: 768px) {

    .hamburger {
        display: flex;
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        width: 100%;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        display: flex;
        padding: 0;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        margin: 0;
    }

    nav ul.active {
        right: 0;
    }

    nav ul li {
        margin: 20px 0;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

    nav ul.active li {
        opacity: 1;
        transform: translateY(0);
    }

    nav ul.active li:nth-child(1) { transition-delay: 0.1s; }
    nav ul.active li:nth-child(2) { transition-delay: 0.15s; }
    nav ul.active li:nth-child(3) { transition-delay: 0.2s; }
    nav ul.active li:nth-child(4) { transition-delay: 0.25s; }
    nav ul.active li:nth-child(5) { transition-delay: 0.3s; }

    nav ul li a {
        font-size: 24px;
        font-weight: 700;
        color: #1e293b;
    }
}

/* RESPONSIVE */
@media(max-width: 900px) {

    .cards,
    .gallery {
        flex-direction: column;
    }

    .about-container.reverse-mobile {
        flex-direction: column-reverse;
    }

    .gallery img {
        width: 100%;
    }

    .program-section {
        padding: 60px 0; /* Remove horizontal padding so carousel can bleed to edge */
    }

    .program-section h2 {
        padding: 0 20px; /* Put padding back on heading */
    }

    .program-grid {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        justify-content: flex-start;
        gap: 20px;
        padding: 10px 20px 40px; /* Space for shadow */
        scroll-padding-left: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .program-grid::-webkit-scrollbar {
        display: none;
    }

    .program-card {
        flex: 0 0 auto;
        scroll-snap-align: center;
        width: 85vw;
        max-width: 350px;
    }

    .contact-section {
        padding: 40px 15px;
        width: calc(100% - 20px);
        margin: 20px auto;
    }

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

    .contact-map iframe {
        min-height: 300px;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-icons {
        justify-content: center;
    }
}

/* SCROLL REVEAL ANIMATIONS */
.reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    filter: blur(10px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
}

/* HERO STAGGER ANIMATIONS (PAGE LOAD) */
.hero-stagger {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-stagger.active {
    opacity: 1;
    transform: translateY(0);
}

/* TYPEWRITER CURSOR */
.typewriter-cursor {
    font-weight: 300;
    animation: blink 1s step-end infinite;
    color: #10b981;
    margin-left: 5px;
}

.typewriter-cursor.fade-out {
    animation: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* WATERFALL STAGGER CARDS */
.stagger-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-card.active {
    opacity: 1;
    transform: translateY(0);
}

/* SCROLL SCRUBBING TEXT */
.scroll-scrub span {
    transition: opacity 0.5s ease;
}
/* NEW SCROLL EFFECTS */
body {
    background-color: #ffffff;
    transition: background-color 1s ease;
}

#scroll-thread {
    position: fixed;
    top: 0;
    left: 0;
    width: 4px;
    height: 0%;
    background: #10b981;
    z-index: 9999;
    border-radius: 0 0 4px 0;
    transition: height 0.1s linear;
}

.curtain-container {
    position: relative;
    overflow: hidden;
}

.curtain-container img {
    display: block;
    transform: scale(1.2);
    transition: transform 2.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.curtain {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #10b981;
    z-index: 2;
    transform-origin: right;
    transition: transform 2.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.curtain-container.reverse-curtain .curtain {
    transform-origin: left;
}

.curtain-container.active .curtain,
.active .curtain-container .curtain,
.active > .curtain-container .curtain {
    transform: scaleX(0);
}

.curtain-container.active img,
.active .curtain-container img,
.active > .curtain-container img {
    transform: scale(1);
}
