/* Dark Theme Variables */
body.dark-theme {
    --bg-color: #0d1117;
    --text-color: #c9d1d9;
    --header-bg: rgba(13, 17, 23, 0.9);
    --logo-color: #58a6ff;
    --link-color: #c9d1d9;
    --link-hover-color: #58a6ff;
    --btn-outline-border: #58a6ff;
    --btn-outline-text: #58a6ff;
    --btn-outline-hover-bg: #58a6ff;
    --btn-outline-hover-text: #0d1117;
    --section-bg: #161b22;
    --card-bg: #0d1117;
    --card-shadow: rgba(0,0,0,0.2);
    --heading-color: #e6edf3;
    --footer-bg: #010409;
}

/* --- General Setup --- */
body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color, #fff);
    color: var(--text-color, #333);
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Header & Navigation --- */
.sticky-header {
    position: fixed;
    top: 18px;
    left: 50%; /* center horizontally */
    transform: translateX(-50%);
    width: 79%;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(6px);
    border-radius: 37px;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color );
    transition: background-color 0.3s, width 0.3s, padding 0.3s;
    box-sizing: border-box;
    padding: 0 .65rem; /* a little horizontal breathing room so content doesn't touch edges */
}

.sticky-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    gap: 1rem;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--logo-color, #58a6ff);
    text-decoration: none;
}


.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #ee9b00;
    color: white;
}

.btn-primary:hover {
    background-color: #ca6702;
    transform: translateY(-2px);
}

.btn-outline {
    border: 2px solid var(--btn-outline-border, #0a9396);
    color: var(--btn-outline-text, #0a9396);
}

.btn-outline:hover {
    background-color: var(--btn-outline-hover-bg, #0a9396);
    color: var(--btn-outline-hover-text, white);
}

.theme-toggle-btn {
    background: none;
    border: 2px solid var(--btn-outline-border, #0a9396);
    color: var(--btn-outline-text, #0a9396);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.theme-toggle-btn:hover {
    background-color: var(--btn-outline-hover-bg, #0a9396);
    color: var(--btn-outline-hover-text, white);
    transform: rotate(15deg);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.video-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5);
}
body.dark-theme .video-background img {
    filter: brightness(0.4);
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

/* --- Sections General --- */
section {
    padding: 6rem 0;
}


/* --- Ecosystems Section --- */
.ecosystems-section {
    background-color: var(--bg-color, #fff);
}

.ecosystems-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--heading-color, #003f5c);
}

.ecosystem-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.card {
    background: var(--card-bg, white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--card-shadow, rgba(0,0,0,0.08));
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px var(--card-shadow, rgba(0,0,0,0.12));
}

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

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    margin-top: 0;
    color: var(--logo-color, #005f73);
}

/* --- Impact Section --- */
.impact-section {
    background-color: var(--heading-color, #003f5c);
    color: var(--bg-color, white);
    text-align: center;
}
body.dark-theme .impact-section {
    background-color: #010409;
    color: #e6edf3;
}

.impact-section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.stats-container {
    display: flex;
    justify-content: space-around;
}

.stat {
    font-size: 1.2rem;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #ee9b00;
}

/* --- CTA Section --- */
.cta-section {
    background: linear-gradient(rgba(0, 95, 115, 0.8), rgba(0, 95, 115, 0.8)), url('/frontend/assets/images/underwater-seagrass-cta.jpg') no-repeat center center/cover;
    text-align: center;
    color: white;
}

.cta-section h2 {
    font-size: 2.5rem;
}

.cta-section p {
    max-width: 600px;
    margin: 1rem auto 2rem auto;
}

.cta-section .btn-primary {
    transform: scale(1.1);
}


/* --- Animations --- */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .nav-actions { display: flex; align-items: center; }
    .ecosystem-cards { grid-template-columns: 1fr; }
    .stats-container { flex-direction: column; gap: 3rem; }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    section {
        padding: 4rem 0;
    }

    .intro-text h2, .ecosystems-section h2, .impact-section h2, .cta-section h2 {
        font-size: 2rem;
    }
}

/* Ultra-mobile / narrow phones: show only logo */
@media (max-width: 780px) {
    .sticky-header {
        width: 94%;
        top: 12px;
        padding: .5rem .85rem;
        border-radius: 28px;
    }
    .sticky-header nav {
        justify-content: center;
        height: 56px;
        gap: 0;
    }
    .logo {
        text-align: center;
        width: auto;
        flex: 0 1 auto;
    }
    .nav-actions { /* hide all nav action buttons on mobile */
        display: none !important;
    }
}



