:root {
    --primary-color: #00aaff; /* A vibrant, techy blue */
    --background-color: #0f172a; /* A deep, dark blue */
    --surface-color: #1e293b; /* A slightly lighter blue-grey for cards */
    --text-color: #e2e8f0; /* Lighter text for better contrast */
    --heading-color: #f8fafc; /* Near white for headings */
    --subtle-grey: #a0aec0; /* A lighter subtle grey */
    --glow-color: rgba(0, 170, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --border-color: #2c3a4f;
    --font-sans: 'Poppins', sans-serif;
    --font-serif: 'Lora', serif;

    /* Theme Colors */
    --color-edu: #F97316; /* Orange */
    --color-quant: #10B981; /* Green */
    --color-hardware: #8B5CF6; /* Purple */
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.8;
    font-size: 16.5px;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Animations --- */
@keyframes slide-in { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: var(--primary-color); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Header */
header { position: fixed; width: 100%; top: 0; left: 0; z-index: 100; transition: background-color 0.3s ease, box-shadow 0.3s ease; }
header.scrolled { background-color: rgba(15, 23, 42, 0.85); backdrop-filter: blur(10px); box-shadow: 0 2px 10px var(--shadow-color); }
nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; }
.logo-text { font-size: 1.8rem; font-weight: 700; color: var(--heading-color); text-decoration: none; letter-spacing: -1px; }
.logo-text:hover { color: var(--primary-color); }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a { text-decoration: none; color: var(--heading-color); font-weight: 600; transition: color 0.3s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--primary-color); }

/* Hamburger Menu & Mobile Nav */
.hamburger { display: none; }
.mobile-nav { display: none; }

/* Hero Section */
#hero { min-height: 100vh; background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.95)), url('assets/img/hero.png') no-repeat center center/cover; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 6rem 1rem 2rem 1rem; }
#hero h1 { font-size: 3.2rem; color: var(--heading-color); font-weight: 700; }
#hero .subtitle { font-size: 1.8rem; font-weight: 300; margin-bottom: 2.5rem; color: var(--text-color); opacity: 0; animation: slide-in 0.8s ease-out 2s forwards;}
.slogan-quote { border-left: 3px solid var(--primary-color); padding-left: 1.5rem; max-width: 600px; margin: 0 auto; text-align: left; font-size: 1.1rem; font-style: italic; color: var(--subtle-grey); opacity: 0; animation: slide-in 0.8s ease-out 2.5s forwards;}
.typing-effect { overflow: hidden; border-right: .15em solid var(--primary-color); white-space: nowrap; margin: 0 auto; letter-spacing: .1rem; animation: typing 2s steps(30, end), blink-caret .75s step-end infinite; }

/* General Section Styling */
.section { padding: 6rem 0; }
.section-title { font-size: 2.8rem; color: var(--heading-color); text-align: center; margin-bottom: 4rem; }

/* Philosophy/Manifesto Section */
#philosophy { background-color: var(--surface-color); }
.manifesto-box { max-width: 800px; margin: 0 auto; text-align: center; padding: 3rem; border: 1px solid var(--border-color); background-color: var(--background-color); border-radius: 8px; }
.manifesto-box .section-title { margin-bottom: 2.5rem; }
.manifesto-text { font-family: var(--font-serif); font-size: 1.5rem; line-height: 2.2; color: var(--text-color); font-style: italic; }
.manifesto-text strong { color: var(--primary-color); font-weight: 600; font-style: normal; }

/* Team Section */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.team-member { background-color: var(--surface-color); padding: 2rem; border-radius: 8px; border: 1px solid var(--border-color); text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.team-member:hover { transform: translateY(-8px); box-shadow: 0 12px 25px var(--shadow-color); }
.team-member-avatar { width: 80px; height: 80px; border-radius: 50%; background-color: var(--background-color); color: var(--primary-color); display: flex; justify-content: center; align-items: center; font-size: 2.5rem; margin: 0 auto 1.5rem auto; border: 2px solid var(--primary-color); }
.team-member h3 { color: var(--primary-color); margin-bottom: 0.5rem; font-size: 1.2rem; }
.team-member .contribution { font-size: 1rem; color: var(--text-color); }

/* Engine Diagram Section */
.engine-diagram { display: flex; flex-direction: column; align-items: center; gap: 3rem; }
.engine-core { background-color: var(--surface-color); border-radius: 50%; width: 180px; height: 180px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; border: 3px solid var(--primary-color); box-shadow: 0 0 25px var(--glow-color); position: relative; }
.engine-icon { font-size: 2.5rem; color: var(--primary-color); }
.engine-text h3 { font-size: 1.5rem; color: var(--heading-color); }
.engine-text p { font-size: 0.9rem; color: var(--subtle-grey); }
.flywheels-container { display: flex; justify-content: space-around; width: 100%; position: relative; padding-top: 50px; }
.flywheels-container::before { content: ''; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); width: 3px; height: 70px; background-color: var(--border-color); }
.flywheel-card { background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: 8px; padding: 2rem 1.5rem; width: 30%; text-align: center; position: relative; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.flywheel-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px var(--shadow-color); }
.flywheel-card::before, .flywheel-card::after { content: ''; position: absolute; background-color: var(--border-color); z-index: -1; }
.flywheel-card::before { top: -20px; left: 50%; transform: translateX(-50%); width: 3px; height: 20px; }
.flywheel-card:first-child::after, .flywheel-card:last-child::after { content: ''; position: absolute; top: -20px; height: 3px; width: 100%; }
.flywheel-card:first-child::after { left: 50%; }
.flywheel-card:last-child::after { right: 50%; }
.flywheel-icon { font-size: 2rem; margin-bottom: 1rem; animation: spin 20s linear infinite; }
.flywheel-card h4 { font-size: 1.2rem; color: var(--heading-color); margin-bottom: 0.5rem; }
.flywheel-card p { font-size: 0.95rem; }

/* Portfolio Section */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.project-card-detailed { background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: 8px; display: flex; flex-direction: column; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.project-card-detailed:hover { transform: translateY(-8px); box-shadow: 0 12px 25px var(--shadow-color); }
.project-header { background-color: #2c3a4f; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); border-radius: 8px 8px 0 0; }
.project-header h3 { font-size: 1.5rem; margin: 0; }
.project-category { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; opacity: 0.8; }
.project-body { padding: 1.5rem; flex-grow: 1; }
.project-section { margin-bottom: 1.5rem; }
.project-section:last-child { margin-bottom: 0; }
.project-section h4 { font-size: 1rem; color: var(--heading-color); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.project-section p, .project-section ul { color: var(--subtle-grey); }
.project-section ul { list-style: none; padding-left: 0; }
.project-section ul li { position: relative; padding-left: 1.5rem; margin-bottom: 0.5rem; }
.project-section ul li::before { content: '\25CF'; position: absolute; left: 0; font-size: 1.2rem; line-height: 1; }
.project-footer { background-color: #2c3a4f; padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); border-radius: 0 0 8px 8px; }
.status { font-weight: 600; }

/* --- Theme Overrides --- */
.theme-edu .flywheel-icon, .theme-edu .project-header h3, .theme-edu .project-section ul li::before, .theme-edu .status, .theme-edu .project-category { color: var(--color-edu); }
.theme-quant .flywheel-icon, .theme-quant .project-header h3, .theme-quant .project-section ul li::before, .theme-quant .status, .theme-quant .project-category { color: var(--color-quant); }
.theme-hardware .flywheel-icon, .theme-hardware .project-header h3, .theme-hardware .project-section ul li::before, .theme-hardware .status, .theme-hardware .project-category { color: var(--color-hardware); }

.theme-edu .project-card-detailed:hover { box-shadow: 0 0 25px rgba(249, 115, 22, 0.3); }
.theme-quant .project-card-detailed:hover { box-shadow: 0 0 25px rgba(16, 185, 129, 0.3); }
.theme-hardware .project-card-detailed:hover { box-shadow: 0 0 25px rgba(139, 92, 246, 0.3); }

/* "Ask" Section Optimization */
.ask-container {
    display: grid;
    grid-template-columns: 1fr; /* Single column layout */
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.ask-item {
    display: flex;
    align-items: flex-start; /* Align items to the top */
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ask-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.ask-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-right: 1.5rem;
    width: 40px; /* Fixed width for alignment */
    text-align: center;
}

.ask-content h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.ask-content p {
    color: var(--text-color);
    line-height: 1.7;
}

.ask-content strong {
    color: var(--heading-color);
    font-weight: 600;
}

/* Roadmap Section */
.roadmap-container { display: grid; grid-template-columns: 1fr; gap: 4rem; align-items: flex-start; }
.roadmap-funding h3, .roadmap-milestones h3 { text-align: center; font-size: 1.5rem; color: var(--heading-color); margin-bottom: 2rem; }
.chart-container { display: flex; align-items: center; justify-content: center; gap: 2rem; }
.donut-chart { position: relative; width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--color-hardware) 0% 10%, var(--color-quant) 10% 50%, var(--color-edu) 50% 100%); }
.chart-legend { list-style: none; padding-left: 0; }
.chart-legend li { margin-bottom: 0.8rem; display: flex; align-items: center; }
.chart-legend li::before { content: ''; width: 12px; height: 12px; border-radius: 50%; margin-right: 0.8rem; }
.chart-legend li[data-color="op"]::before { background-color: var(--color-edu); }
.chart-legend li[data-color="dev"]::before { background-color: var(--color-quant); }
.chart-legend li[data-color="res"]::before { background-color: var(--color-hardware); }

.timeline { list-style: none; padding-left: 0; position: relative; }
.timeline::before { content: ''; position: absolute; top: 0; left: 8px; transform: translateX(-50%); width: 4px; height: 100%; background-color: var(--surface-color); border-radius: 2px; }
.timeline-item { position: relative; padding-left: 3rem; margin-bottom: 2rem; }
.timeline-point { position: absolute; top: 5px; left: 8px; transform: translateX(-50%); width: 20px; height: 20px; background-color: var(--background-color); border: 4px solid var(--primary-color); border-radius: 50%; }
.timeline-content h4 { color: var(--primary-color); }
.timeline-content p { color: var(--subtle-grey); }

/* Footer */
footer { background-color: var(--background-color); text-align: center; padding: 5rem 1rem 2rem 1rem; }
.final-quote { border: none; text-align: center; font-size: 1.2rem; margin-bottom: 3rem; }
.contact-methods { margin: 2rem 0; }
.contact-info { font-size: 1.2rem; color: var(--text-color); margin-bottom: 0.5rem; }
.contact-info a { color: var(--primary-color); text-decoration: none; transition: color 0.3s ease; }
.contact-info a:hover { text-decoration: underline; }
.disclaimer { border-top: 1px solid var(--surface-color); padding-top: 2rem; margin-top: 2rem; }
.disclaimer p { font-size: 0.8rem; color: var(--subtle-grey); max-width: 800px; margin: 0 auto; }

/* Back to Top Button */
.back-to-top { position: fixed; bottom: 2rem; right: 2rem; background-color: var(--primary-color); color: var(--heading-color); width: 3rem; height: 3rem; border-radius: 50%; display: flex; justify-content: center; align-items: center; text-decoration: none; font-size: 1.5rem; opacity: 0; visibility: hidden; transform: translateY(100%); transition: opacity 0.3s, visibility 0.3s, transform 0.3s; }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* Responsive */
@media (min-width: 769px) { .roadmap-container { grid-template-columns: 1fr 1fr; } }
@media (max-width: 992px) {
    .flywheels-container { flex-direction: column; align-items: center; gap: 2rem; padding-top: 2rem; }
    .flywheel-card { width: 80%; max-width: 400px; }
    .flywheel-card::before, .flywheel-card::after { display: none; } 
    .flywheels-container::before { height: 40px; }
}

@media (max-width: 768px) {
    body { font-size: 16px; }
    .nav-links { display: none; }
    .hamburger { display: flex; flex-direction: column; justify-content: space-around; width: 2rem; height: 2rem; background: transparent; border: none; cursor: pointer; padding: 0; z-index: 101; }
    .hamburger-bar { width: 2rem; height: 0.25rem; background-color: var(--heading-color); border-radius: 10px; transition: all 0.3s linear; position: relative; transform-origin: 1px; }
    .hamburger.open .hamburger-bar:nth-child(1) { transform: rotate(45deg); }
    .hamburger.open .hamburger-bar:nth-child(2) { opacity: 0; transform: translateX(20px); }
    .hamburger.open .hamburger-bar:nth-child(3) { transform: rotate(-45deg); }
    .mobile-nav { display: flex; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--background-color); flex-direction: column; justify-content: center; align-items: center; z-index: 99; opacity: 0; transition: opacity 0.3s ease-in-out; pointer-events: none; }
    .mobile-nav.open { opacity: 1; pointer-events: auto; }
    .mobile-nav-link { color: var(--heading-color); text-decoration: none; font-size: 2rem; margin: 1.5rem 0; transition: color 0.3s ease; }
    .mobile-nav-link:hover { color: var(--primary-color); }

    #hero h1 { font-size: 2.5rem; }
    #hero .subtitle { font-size: 1.5rem; }
    .section-title { font-size: 2.2rem; }
    th, td { display: block; width: 100%; }
    th { font-weight: bold; padding-bottom: 0.5rem; }
    td { padding-top: 0; }
    .manifesto-text { font-size: 1.2rem; line-height: 2; }
    .chart-container { flex-direction: column; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Performance Metrics inside Project Card */
.performance-metrics-card {
    display: flex;
    justify-content: space-around;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

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

.metric-value-card {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-quant);
    display: block;
}

.metric-card p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
}
/* Final Quote Enhancement for "Transcendence" */
.final-quote p {
    font-family: var(--font-serif); /* Use elegant serif font */
    color: var(--heading-color);
    font-size: 1.4rem; /* Make it a bit more prominent */
    font-style: italic;
    line-height: 1.8;
}

.final-quote .highlight {
    color: var(--primary-color);
    font-weight: 600;
    text-shadow:
        0 0 5px rgba(0, 170, 255, 0.5),
        0 0 15px rgba(0, 170, 255, 0.3);
    animation: pulse-glow 3s infinite ease-in-out; /* Add a pulsing glow animation */
}

/* Keyframes for the pulsing glow */
@keyframes pulse-glow {
    0%, 100% {
        text-shadow:
            0 0 5px rgba(0, 170, 255, 0.5),
            0 0 15px rgba(0, 170, 255, 0.3);
    }
    50% {
        text-shadow:
            0 0 10px rgba(0, 170, 255, 0.7),
            0 0 25px rgba(0, 170, 255, 0.5);
    }
}


/* Scroll Animation for "Transcendence" */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.19, 1, 0.22, 1), transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
    transform: scale(0.95);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: scale(1);
}
