/* 
======================================================
    CSS VARIABLES & THEME SETUP
======================================================
*/
:root {
    /* DARK MODE (Default) */
    --bg-body: #0f172a;
    --bg-alt: #1e293b;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #38bdf8;
    /* Sky 400 */
    --primary-hover: #0ea5e9;
    /* Sky 500 */
    --border: #334155;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);

    --nav-height: 70px;
    --container-width: 1100px;
    --radius: 12px;
    --transition: all 0.3s ease;
}

[data-theme="light"] {
    --bg-body: #ffffff;
    --bg-alt: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #0284c7;
    /* Sky 600 */
    --primary-hover: #0369a1;
    /* Sky 700 */
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 
======================================================
    RESET & BASE STYLES
======================================================
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

section {
    padding: 5rem 0;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Utilities */
.bg-alt {
    background-color: var(--bg-alt);
}

.text-sm {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* 
======================================================
    NAVIGATION
======================================================
*/
.navbar {
    height: var(--nav-height);
    background-color: rgba(15, 23, 42, 0.85);
    /* Dark mode transparent */
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

[data-theme="light"] .navbar {
    background-color: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 45px;
    width: auto;
    transition: var(--transition);
}

/* Default Dark Mode: Logo needs to be White */
.logo img {
    filter: brightness(0) invert(1);
}

/* Light Mode: Logo stays original (Dark Blue) for visibility on white background */
[data-theme="light"] .logo img {
    filter: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a:not(.btn-nav) {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.btn-nav {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-nav:hover {
    background-color: var(--primary);
    color: #fff;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 1rem;
    transition: var(--transition);
}

#theme-toggle:hover {
    color: var(--primary);
    transform: rotate(15deg);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background-color: var(--bg-body);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    /* Hidden by default (slide up) - needs JS toggle */
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 999;
}

.mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.mobile-menu a {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
}

/* 
======================================================
    HERO SECTION
======================================================
*/
.hero-section {
    padding-top: calc(var(--nav-height) + 4rem);
    padding-bottom: 5rem;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-content {
    flex: 1;
    text-align: left;
    /* Align text to left */
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    /* Center image in its column */
    max-width: 450px;
}

.img-wrapper {
    position: relative;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    /* Organic shape */
    overflow: hidden;
    border: 5px solid var(--primary);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.img-wrapper:hover {
    transform: scale(1.02);
    border-radius: 50%;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Gradient text */
    color: var(--text-main);
    /* Fallback */
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.tagline .highlight {
    color: var(--primary);
    font-weight: 600;
}

.bio-summary {
    max-width: 600px;
    /* Still keep max width but aligned left */
    margin: 0 0 3rem 0;
    /* Align left */
    color: var(--text-muted);
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    /* Align left */
    margin-bottom: 3rem;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    border: 2px solid var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-start;
    /* Align left */
}

.social-links a {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.social-links a:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* 
======================================================
    SECTIONS: ABOUT, EXPERIENCE, RESEARCH
======================================================
*/
.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: justify;
}

.stats-list {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
}

.badge-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.badge-card h3 {
    margin-bottom: 1.5rem;
}

.badge-card p {
    margin-bottom: 1rem;
}

/* Experience Timeline */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border);
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 5px;
    width: 1rem;
    height: 1rem;
    background-color: var(--primary);
    border-radius: 50%;
    border: 4px solid var(--bg-body);
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.timeline-content h4 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.timeline-content p {
    color: var(--text-muted);
}

/* Research & Cards */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card:hover {
    /* Handled by JS or css hover class */
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.card-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.card h3 {
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.grant-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(56, 189, 248, 0.1) 100%);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tags span {
    background-color: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: var(--transition);
}

.tags span:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Focus Grid */
.focus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.focus-item h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.focus-item p {
    color: var(--text-muted);
}

/* Footer */
footer {
    background-color: var(--bg-alt);
    padding: 5rem 0 2rem;
    text-align: center;
}

/* 
======================================================
    TEACHING & TRAINING
======================================================
*/
.teaching-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.teaching-card {
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    height: 100%;
}

.teaching-card .card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
}

.teaching-card .card-header i {
    font-size: 2rem;
    color: var(--primary);
}

.teaching-card .card-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.course-list {
    list-style: none;
    padding: 0;
}

.course-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.course-list li::before {
    content: '•';
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
    line-height: 1.4;
}

.course-list .more-item {
    font-style: italic;
    opacity: 0.7;
    margin-top: 1rem;
}

.course-list .text-sm {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.8;
}

/* 
======================================================
    CHANNEL SECTION
======================================================
*/
.channel-wrapper {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.channel-wrapper:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.channel-icon {
    width: 80px;
    height: 80px;
    background-color: rgba(255, 0, 0, 0.1);
    /* Subtle red tint for Youtube brand feel */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.channel-icon i {
    font-size: 2.5rem;
    color: #ff0000;
    /* Youtube Red */
}

/* Override red for dark mode if needed, or keep branding. 
   Usually branding colors stay. */

.channel-wrapper h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.channel-wrapper p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* 
======================================================
    RESPONSIVENESS
======================================================
*/
@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .teaching-grid {
        grid-template-columns: 1fr;
    }

    /* Hero Responsive: Image Top, Text Bottom */
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }

    .hero-content {
        text-align: center;
    }

    .hero-image {
        justify-content: center;
        width: 100%;
        margin: 0 auto;
    }

    .img-wrapper {
        max-width: 280px;
        /* Limit image size on mobile */
        margin: 0 auto;
    }

    .bio-summary {
        margin: 0 auto 2rem;
    }

    .hero-btns {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}

.contact-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.contact-item i {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 
======================================================
    RESPONSIVENESS
======================================================
*/
@media (max-width: 768px) {
    .stats-list {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        text-align: center;
    }

    .timeline {
        padding-left: 1rem;
    }

    .timeline-item::before {
        left: -1.6rem;
    }
}

/* 
======================================================
    ANIMATIONS
======================================================
*/
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}