/* --- Global Styles & Variables --- */
:root {
    --teal: #117a65; /* Verified 5.26:1 contrast against white, 4.78:1 against light grey (WCAG AA Compliant) */
    --purple: #6d3d8b; /* Verified 7.81:1 contrast against white (WCAG AA Compliant) */
    --accent-blue: #2874a6; /* Verified 5.07:1 contrast against white (WCAG AA Compliant) */
    --dark-grey: #222222; /* Verified 15.9:1 contrast against white */
    --slate-grey: #555566; /* Financial Harmony secondary grey - Verified 7.30:1 contrast */
    --light-grey: #f4f4f4;
    --white: #ffffff;
    --brand-light-teal: #9bdbdc;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--dark-grey);
    background-color: var(--white);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2rem; color: var(--purple); }
h3 { font-size: 1.5rem; color: var(--teal); }
p { margin-bottom: 1rem; }
a { color: var(--teal); text-decoration: none; }

/* --- Header & Navigation --- */
header {
    background: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
header nav { display: flex; justify-content: space-between; align-items: center; }
.logo { 
    height: 72px; 
    width: auto;
    display: block;
    vertical-align: middle;
}
.nav-links { list-style: none; display: flex; }
.nav-links li { margin-left: 2rem; }
.nav-links a { font-family: var(--font-heading); font-weight: 600; color: #222222; transition: color 0.3s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--teal); }
.hamburger { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--dark-grey); }

/* --- Buttons --- */
.btn { display: inline-block; padding: 12px 28px; border-radius: 50px; font-family: var(--font-heading); font-weight: 600; text-align: center; border: none; cursor: pointer; transition: background-color 0.3s, transform 0.2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background-color: var(--teal); color: #ffffff; }
.btn-primary:hover { background-color: #0e6655; color: #ffffff; } /* Darkened hover for 6.88:1 contrast */
.btn-secondary { background-color: transparent; color: #5a4bb1; border: 2px solid var(--purple); }
.btn-secondary:hover { background-color: var(--purple); color: var(--white); }

/* --- Hero Section --- */
.hero { background: linear-gradient(135deg, var(--purple), var(--teal)); color: var(--white); text-align: center; padding: 6rem 0; }
.hero h1 { font-size: 3.5rem; }
.hero .subtitle { font-size: 1.2rem; max-width: 600px; margin: 1rem auto 2rem; }

/* --- Features Section --- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; padding: 4rem 0; text-align: center; }
.feature-card { padding: 2rem; background: var(--light-grey); border-radius: 10px; }
.feature-icon { font-size: 3rem; color: var(--accent-blue); margin-bottom: 1rem; }

/* --- Page Headers --- */
.page-header { text-align: center; padding: 3rem 0; border-bottom: 1px solid var(--light-grey); }
.page-header-gradient { background: linear-gradient(135deg, var(--purple), var(--teal)); color: var(--white); padding: 4rem 20px; border-bottom: none; }
.page-header-gradient h1, .page-header-gradient .subtitle { color: var(--white) !important; }
.page-header-gradient .container { background: transparent; text-align: center; }
.full-width-gradient { background: linear-gradient(135deg, var(--purple), var(--teal)); padding: 3rem 20px; border-radius: 10px; margin: 3rem 0; }
.full-width-gradient h2, .full-width-gradient p { color: var(--white); text-align: center; }

/* --- Homepage: Us In Action Horizontal Gallery --- */
.action-gallery-section { padding: 3rem 0; }
.action-gallery-section h2 { text-align: center; margin-bottom: 2rem; }
.gallery-grid { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 1.5rem; padding-bottom: 1.5rem; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--teal) var(--light-grey); }
.gallery-grid::-webkit-scrollbar { height: 8px; }
.gallery-grid::-webkit-scrollbar-track { background: var(--light-grey); border-radius: 10px; }
.gallery-grid::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 10px; }
.gallery-grid::-webkit-scrollbar-thumb:hover { background: var(--purple); }
.gallery-item { flex-shrink: 0; width: 450px; height: 300px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); scroll-snap-align: start; background-color: var(--light-grey); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item iframe,
.gallery-item video {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Impact Page: Stats Section --- */
.stats-section { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding: 3rem 0; text-align: center; }
.stat-item { background-color: #f9f9f9; padding: 2rem 1rem; border-radius: 10px; border-left: 5px solid var(--purple); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); display: flex; flex-direction: column; justify-content: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.stat-item:hover { transform: translateY(-5px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); }
.stat-item .stat-number { display: block; font-family: var(--font-heading); font-size: 3.5rem; font-weight: 700; color: var(--teal); line-height: 1; margin-bottom: 0.5rem; }
.stat-item .stat-label { display: block; font-size: 1rem; font-weight: 600; color: var(--dark-grey); }

/* --- About Page --- */
.about-content { padding: 3rem 0; }
.about-text-wrapper { position: relative; max-width: 800px; margin: 0 auto; }
.about-text-wrapper::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 300px; height: 300px; background-image: url('images/logo.svg'); background-repeat: no-repeat; background-size: contain; opacity: 0.08; z-index: -1; }
.framework-graphic-placeholder { border: none; background-color: var(--white); padding: 2rem; border-radius: 10px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07); margin-top: 1rem; }
.framework-graphic-placeholder h3 { text-align: center; color: var(--purple); font-size: 1.8rem; margin-bottom: 2rem; }
.framework-graphic-placeholder ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; padding: 0; list-style: none; }
.framework-graphic-placeholder li { background: #f9f9f9; padding: 1.5rem; border-radius: 8px; text-align: center; font-weight: 600; border-bottom: 4px solid var(--accent-blue); transition: transform 0.3s ease; }
.framework-graphic-placeholder li:hover { transform: translateY(-5px); }
.framework-graphic-placeholder li i { font-size: 2.5rem; color: var(--accent-blue); margin-bottom: 1rem; display: block; }

/* --- Products Page --- */
.product-filters { text-align: center; margin-bottom: 3rem; }
.filter-btn { background: transparent; border: 2px solid var(--light-grey); color: var(--dark-grey); padding: 10px 20px; margin: 0 5px; border-radius: 50px; cursor: pointer; font-family: var(--font-heading); font-weight: 600; transition: all 0.3s ease; }
.filter-btn.active, .filter-btn:hover { background: var(--teal); color: var(--white); border-color: var(--teal); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.product-card { background: var(--white); border-radius: 10px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12); }
.product-thumbnail { width: 100%; height: 200px; object-fit: cover; }
.product-info { padding: 1.5rem; flex-grow: 1; }
.product-info h3 { color: var(--purple); margin-top: 0; }
.product-price { display: block; font-weight: 700; font-size: 1.2rem; color: var(--dark-grey); margin-bottom: 1rem; }

/* --- Learning Page (Games) --- */
.game-section { padding: 3rem 0; border-bottom: 1px solid var(--light-grey); }
.game-board, .game-board-risk { background: var(--light-grey); padding: 2rem; border-radius: 10px; margin-top: 1.5rem; }
.game-info { display: flex; justify-content: space-between; font-family: var(--font-heading); font-size: 1.2rem; margin-bottom: 1rem; }
.tile-bank { display: flex; flex-wrap: wrap; gap: 10px; padding: 1rem; border-top: 1px solid #ccc; margin-bottom: 1.5rem; }
.game-tile { padding: 10px 15px; background: var(--white); border: 1px solid #ccc; border-radius: 5px; cursor: grab; font-weight: 600; user-select: none; }
.game-tile:active { cursor: grabbing; }
.game-tile.correct { background-color: #d4edda; border-color: #c3e6cb; }
.game-tile.incorrect { background-color: #f8d7da; border-color: #f5c6cb; }
.game-feedback { margin-top: 1rem; font-weight: 600; text-align: center; min-height: 24px; }
#investment-risk-game .risk-game-area { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1.5rem; }
.risk-ladder-container h3, #investment-bank-container h3 { text-align: center; }

.risk-label-top, .risk-label-bottom {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--slate-grey);
    padding: 0 5px;
}

.risk-label-top {
    display: block;
    margin-bottom: 0.5rem;
}

.risk-label-bottom {
    display: block;
    text-align: right;
    margin-top: 0.5rem;
}

#risk-ladder { background-image: repeating-linear-gradient(to bottom, #ccc, #ccc 1px, transparent 1px, transparent 50px); border: 2px solid #ccc; border-radius: 5px; padding: 10px; list-style: none; min-height: 480px; background-color: white; }
#investment-bank { background-color: white; border: 2px dashed var(--accent-blue); border-radius: 5px; padding: 10px; min-height: 200px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.investment-tile { padding: 8px 12px; text-align: center; transition: background-color 0.3s, border-color 0.3s; }
.investment-tile.rank-correct { border-left: 5px solid var(--teal); }
.investment-tile.rank-close { border-left: 5px solid #f0ad4e; }
.investment-tile.rank-wrong { border-left: 5px solid #d9534f; }
#definitions-container { margin-top: 2rem; }
#definitions-bank { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; margin-top: 1rem; }
.definition-tile { background-color: var(--white); border: 1px solid #ccc; padding: 10px; border-radius: 5px; cursor: pointer; transition: all 0.3s; font-size: 0.9rem; }
.definition-tile:hover, .investment-tile.selectable:hover { background-color: #eaf5ff; }
.investment-tile.selected, .definition-tile.selected { background-color: var(--accent-blue); color: var(--white); border-color: var(--accent-blue); }
.definition-tile.matched, .investment-tile.matched { background-color: var(--teal); color: var(--white); cursor: default; opacity: 0.7; }
.hidden { display: none !important; }

/* --- Contact Page --- */
.contact-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; padding: 3rem 0; }
.contact-form .form-group { margin-bottom: 1.5rem; }
.contact-form label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-family: var(--font-body); }
.contact-details h3 { margin-bottom: 1.5rem; }
.contact-details p { font-size: 1.1rem; margin-bottom: 1.5rem; }
.contact-details i { color: var(--teal); margin-right: 10px; width: 20px; }

/* --- Footer --- */
footer { background: #2a2a2a; color: #ffffff; padding: 2.5rem 0; margin-top: 3rem; }
.footer-content { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 2rem; }
.footer-legal { max-width: 800px; }
.disclaimer-text { font-size: 0.85rem; line-height: 1.5; color: #d0d0d0; margin-top: 1rem; }
.disclaimer-text p { margin-bottom: 0.75rem; }
.social-links a { color: var(--white); font-size: 1.5rem; margin-left: 1rem; transition: color 0.3s; }
.social-links a:hover { color: var(--brand-light-teal); } /* High contrast against dark footer background */

/* =================================================================== */
/* ---                     Responsive Design                       --- */
/* =================================================================== */

@media (max-width: 900px) {
    .stats-section { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .hero h1 { font-size: 2.8rem; }
    
    .nav-links {
        position: fixed;
        top: 90px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 81px);
        background: var(--white);
        flex-direction: column;
        align-items: center;
        padding-top: 2rem;
        transition: left 0.3s ease-in-out;
    }
    .nav-links.active { left: 0; }
    .nav-links li { margin: 1rem 0; }
    .hamburger { display: block; }
    
    .features { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    #investment-risk-game .risk-game-area { grid-template-columns: 1fr; }

    .gallery-item { width: 350px; height: 233px; }
}

@media (max-width: 480px) {
    .stats-section { grid-template-columns: 1fr; }
    .gallery-item { width: 280px; height: 187px; }
}

/* --- About Page: Video Section --- */
.video-section { padding: 3rem 0; text-align: center; }
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; 
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin-top: 2rem;
}
.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- About Page: Pillar Cards --- */
.framework-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    padding: 0;
    list-style: none;
}

.pillar-card {
    background: #f9f9f9;
    font-weight: 600;
    border-bottom: 4px solid var(--accent-blue);
    color: var(--dark-grey);
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pillar-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.pillar-card i {
    font-size: 2.5rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

/* --- Pillar Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--white);
    color: var(--dark-grey);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal-hidden .modal-content {
    transform: scale(0.9);
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--slate-grey); /* Replaced #aaa with #555566 to hit 7.3:1 contrast */
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--dark-grey);
}

#modal-title {
    font-size: 1.8rem;
    color: var(--purple);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--teal);
}

#modal-text {
    font-size: 1rem;
    line-height: 1.7;
}

/* --- Impact Page: Research Section --- */
.research-section { padding-top: 3rem; padding-bottom: 3rem; }
.research-section .subtitle { margin-bottom: 3rem; }
.research-item {
    background-color: var(--light-grey);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--purple);
}
.research-item h3 { color: var(--teal); margin-bottom: 0.5rem; }
.research-item p { margin-bottom: 1rem; }
.source-link {
    font-weight: 600;
    display: inline-block;
    font-size: 0.9rem;
    color: var(--teal);
}
.source-link i { margin-right: 6px; }

/* --- Us In Action Page: Logo Scroller --- */
.logo-scroll-section {
    padding: 3rem 0;
    background-color: var(--light-grey);
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}
.logo-scroll-section h2 { text-align: center; margin-bottom: 2rem; }
.logo-scroll-container {
    overflow: hidden;
    position: relative;
    width: 100%;
}
.logo-scroll-container::before,
.logo-scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 100px;
    z-index: 2;
}
.logo-scroll-container::before {
    left: 0;
    background: linear-gradient(to right, var(--light-grey) 0%, rgba(244, 244, 244, 0) 100%);
}
.logo-scroll-container::after {
    right: 0;
    background: linear-gradient(to left, var(--light-grey) 0%, rgba(244, 244, 244, 0) 100%);
}
.logo-scroll-track {
    display: flex;
    align-items: center;
    width: calc(150px * 10);
    animation: scrollAnimation 30s linear infinite;
}
.logo-scroll-container:hover .logo-scroll-track { animation-play-state: paused; }
.logo-item { width: 150px; padding: 0 20px; }
.logo-item img {
    max-width: 100%;
    height: auto;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
}
.logo-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}
@keyframes scrollAnimation {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-150px * 5)); }
}
