/* --- Variables & Theming --- */
:root {
    /* Brand Colors (Static) */
    --brand-blue: #243B6E;
    --brand-blue-dark: #1a2b52;
    --brand-highlight: #FDB035;
    
    /* Light Mode (Default) */
    --bg-body: #FDFDFB;       /* Cream */
    --bg-alt: #E9E9E9;        /* Light Grey */
    --bg-card: #FFFFFF;
    --bg-nav: rgba(255, 255, 255, 0.95);
    
    --text-main: #262626;     /* Dark Grey */
    --text-muted: #666666;
    --text-on-primary: #FFFFFF;
    
    --border-color: rgba(0,0,0,0.1);
    --shadow-color: rgba(0,0,0,0.05);
    
    --primary-blue: var(--brand-blue);
    
    --trans-speed: 0.3s;
    --font-main: 'Inter', sans-serif;
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-body: #121212;       /* Deep black/grey */
    --bg-alt: #1E1E1E;        /* Slightly lighter for sections */
    --bg-card: #262626;       /* Brand dark grey for cards */
    --bg-nav: rgba(30, 30, 30, 0.95);
    
    --text-main: #E0E0E0;     /* Off-white */
    --text-muted: #A0A0A0;
    
    --border-color: rgba(255,255,255,0.1);
    --shadow-color: rgba(0,0,0,0.3);
    
    /* Lighter blue for better contrast in dark mode */
    --primary-blue: #4A6FA5; 
}

/* --- Reset & Global --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--trans-speed);
}

ul {
    list-style: none;
}

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

.btn-primary {
    background-color: var(--brand-highlight);
    color: #262626;
    border: none;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 176, 53, 0.4);
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-nav);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-symbol {
    background-color: var(--primary-blue);
    color: #FFF;
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    font-style: italic;
    font-weight: 800;
    padding-right: 4px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary-blue);
}

.nav-links .nav-cta {
    color: var(--primary-blue);
    font-weight: 700;
}

/* Theme Toggle */
#theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    background-color: var(--bg-alt);
    transform: rotate(15deg);
}

.moon-icon { display: block; }
.sun-icon { display: none; }

[data-theme="dark"] .moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: block; color: var(--brand-highlight); }

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: linear-gradient(135deg, var(--brand-blue) 0%, #101E3C 100%);
    color: #FFF;
    overflow: hidden;
}

.hero h1, .hero p {
    color: #FFF; /* Always white in hero */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(36, 59, 110, 0.4) 0%, transparent 60%);
    animation: pulse 8s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 0.8; }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.hero .subheading {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 40px;
    max-width: 600px;
    font-weight: 300;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    color: #FFF;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);}
    40% {transform: translateX(-50%) translateY(-10px);}
    60% {transform: translateX(-50%) translateY(-5px);}
}

/* --- Content Sections (Sticky Logic) --- */
.sticky-section {
    padding: 100px 0;
    position: relative;
    background-color: var(--bg-body);
}

.alt-bg {
    background-color: var(--bg-alt);
}

.sticky-container {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.reverse-layout {
    flex-direction: row-reverse;
}

.text-content {
    flex: 1;
    padding-top: 20px;
}

.visual-content {
    flex: 1;
    position: sticky;
    top: 120px;
}

.section-title {
    font-size: 2.2rem;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

.text-content p {
    margin-bottom: 20px;
    color: var(--text-main);
    font-size: 1.1rem;
}

.feature-list {
    margin-top: 30px;
}

.feature-list li {
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
    font-weight: 500;
    color: var(--text-main);
}

.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--brand-highlight);
}

.tag {
    display: inline-block;
    background-color: var(--primary-blue);
    color: white;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    margin-right: 8px;
    margin-bottom: 8px;
}

/* --- Cards & Visuals --- */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card h3 {
    color: var(--text-main);
}

/* --- Gaussian Graph Animation --- */
.gaussian-container {
    padding: 20px 0;
    position: relative;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.gaussian-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* The Main Curve Stroke */
.curve-line {
    fill: none;
    stroke: var(--primary-blue);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawCurve 2s ease-out forwards;
}

/* The Highlighted Area (Fill) */
.curve-area {
    fill: var(--brand-highlight);
    opacity: 0;
    animation: fadeFill 1.5s ease-out forwards;
    animation-delay: 1.5s; /* Wait for curve to draw */
}

/* The Center Dotted Line */
.mean-line {
    stroke: var(--text-muted);
    stroke-width: 1;
    stroke-dasharray: 4;
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
    animation-delay: 2s;
}

/* Labels */
.graph-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    position: relative;
    padding: 0 40px; /* Align roughly with the curve shoulders */
}

.label-mean {
    font-weight: 700;
    color: var(--primary-blue);
}

/* --- Keyframes --- */
@keyframes drawCurve {
    to { stroke-dashoffset: 0; }
}

@keyframes fadeFill {
    to { opacity: 0.3; } /* Semi-transparent highlight */
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.caption {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

/* --- Community Grid Animation (Pyramid) --- */
.community-grid-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 250px;
    margin: 30px 0;
    position: relative;
    padding: 20px 0;
}

.community-grid-animation::before {
    content: '';
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 140px;
    /* Glow effect */
    background: radial-gradient(circle at top, rgba(36, 59, 110, 0.1) 0%, transparent 70%);
    z-index: 0;
}

.grid-source {
    z-index: 2;
    background: var(--bg-card);
    padding: 10px 20px;
    border: 2px solid var(--primary-blue);
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    color: var(--primary-blue);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.solar-panel-icon {
    font-size: 2rem;
    line-height: 1;
}

.grid-consumers {
    display: flex;
    justify-content: space-between;
    width: 100%;
    z-index: 2;
}

.consumer {
    text-align: center;
    background: var(--bg-card);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 30%;
    color: var(--text-main);
}

.house-icon { font-size: 1.8rem; }

.house-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

/* Moving Particles */
.energy-particle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--brand-highlight);
    border-radius: 50%;
    /* Start exactly centered on the SVG line start (y=60) */
    top: 54px; 
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    z-index: 1;
    box-shadow: 0 0 10px rgba(253, 176, 53, 0.6); /* Added glow for effect */
}

/* Animation Keyframes 
   Calculated to match SVG: Start Y=60, End Y=200
   Particle Center Compensation: -6px
*/

/* Path to Left House (Home A) */
.p1 { animation: flowLeft 3s infinite ease-in-out; }
@keyframes flowLeft {
    0%   { top: 54px;  left: 50%; opacity: 1; }
    80%  { top: 194px; left: 15%; opacity: 1; } /* Hit the roof */
    100% { top: 204px; left: 15%; opacity: 0; } /* Fade out inside */
}

/* Path to Center House (Home B) */
.p2 { animation: flowCenter 3s infinite ease-in-out; animation-delay: 1s; }
@keyframes flowCenter {
    0%   { top: 54px;  left: 50%; opacity: 1; }
    80%  { top: 194px; left: 50%; opacity: 1; }
    100% { top: 204px; left: 50%; opacity: 0; }
}

/* Path to Right House (Home C) */
.p3 { animation: flowRight 3s infinite ease-in-out; animation-delay: 0.5s; }
@keyframes flowRight {
    0%   { top: 54px;  left: 50%; opacity: 1; }
    80%  { top: 194px; left: 85%; opacity: 1; }
    100% { top: 204px; left: 85%; opacity: 0; }
}
/* --- Research & Innovation --- */
.innovation-section {
    padding: 100px 0;
    background-color: var(--bg-body);
}

.center-text { text-align: center; }

.section-desc {
    max-width: 600px;
    margin: 0 auto 50px auto;
    color: var(--text-muted);
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.partner-logo {
    height: 100px;
    background: var(--bg-alt);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 8px;
    transition: 0.3s;
}

.partner-logo:hover {
    background: #e0e0e0;
    color: var(--primary-blue);
}

.emergent-tech-banner {
    background: linear-gradient(90deg, #262626, #333);
    color: white;
    padding: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.badge {
    background: var(--brand-highlight);
    color: #262626;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- Footer --- */
footer {
    background-color: var(--brand-blue);
    color: #FDFDFB;
    padding: 80px 0 20px 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    margin-bottom: 20px;
    color: var(--brand-highlight);
}

.footer-col p, .footer-col a {
    color: #ccc;
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer-col a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.legal-links a { margin-left: 20px; }

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(36, 59, 110, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 450px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
}

.modal-content h2, .modal-content p {
    color: var(--text-main);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-header { margin-bottom: 20px; }

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-alt);
    color: var(--text-main);
    border-radius: 4px;
    font-family: inherit;
}

.error-msg {
    color: #d32f2f;
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

.full-width { width: 100%; }
.hidden { display: none; }

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

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

/* --- Mobile --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    
    .sticky-container { flex-direction: column; }
    .reverse-layout { flex-direction: column; }
    
    .visual-content { position: static; width: 100%; }
    
    .nav-links { display: none; } /* Hamburger logic not fully expanded for brevity */
    .nav-right { gap: 10px; }
    
    .footer-content { grid-template-columns: 1fr; }
}

/* --- Connector Lines (SVG) --- */
.grid-connector-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Behind the boxes (z-index 2) but with the particles */
    pointer-events: none;
}

.grid-connector-lines line {
    stroke: var(--primary-blue);
    stroke-width: 2;
    stroke-dasharray: 6; /* Makes the line dashed */
    opacity: 0.3; /* Subtle appearance */
}

/* --- Fixes for Light Mode Visibility --- */

/* 1. Fix Footer Logo & Symbol */
/* Force the logo text to be white when inside the footer */
footer .logo {
    color: #FFFFFF;
}

/* Force the V box to be white with blue text when inside the footer */
footer .logo-symbol {
    background-color: #FFFFFF;
    color: var(--brand-blue);
}

/* 2. Fix Emerging Technologies Banner */
/* Override global theme colors to force white text on this specific dark banner */
.emergent-tech-banner h3, 
.emergent-tech-banner p {
    color: #FFFFFF;
}