:root {
    /* Light Theme (Default) */
    --bg-color: #f0f0f0;
    --text-color: #1a1a1a;
    --font-main: 'Space Grotesk', sans-serif;
    --spacing-unit: 1rem;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    /* margin-left: auto; Removed to let nav-links handle the spacing */
    margin-right: 1rem;
}

#theme-toggle svg {
    transition: transform 0.3s ease;
}

#theme-toggle:hover svg {
    transform: rotate(15deg);
}

/* Hide moon in light mode (default), hide sun in dark mode */
[data-theme="dark"] .sun {
    display: none;
}

[data-theme="dark"] .moon {
    display: block !important;
}

/* By default light mode: show sun, hide moon (handled inline style or here) */
.moon {
    display: none;
}

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

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

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--text-color);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    margin-left: auto;
    /* Push links to the right */
    margin-right: 2rem;
    /* Add space between links and toggle */
}

.nav-links a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.nav-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.bar {
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -2px;
}

.text-highlight {
    color: transparent;
    -webkit-text-stroke: 1px var(--text-color);
    position: relative;
}

/* Optional: Different style for light/dark mode if needed, 
   but text-stroke handles contrast naturally with var(--text-color) */

.hero-content h2 {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.exp-highlight {
    margin: 1rem 0 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.exp-number {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -4px;
    margin-bottom: 0.5rem;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--text-color);
    transition: all 0.3s ease;
    cursor: default;
}

.exp-number:hover {
    color: var(--text-color);
    -webkit-text-stroke: 1px transparent;
}

.exp-text {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.9;
    margin-bottom: 0.2rem;
}

.exp-domains {
    font-size: 0.9rem;
    opacity: 0.6;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Mobile adjustments for hero stats */
@media (max-width: 768px) {
    .exp-number {
        font-size: 4rem;
    }

    .exp-text {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }

    .exp-domains {
        font-size: 0.75rem;
    }
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 2rem;
    border: 1px solid var(--text-color);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    cursor: pointer;
}

.btn.primary {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.btn.primary:hover {
    background-color: transparent;
    color: var(--text-color);
}

.btn.secondary:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}

/* General Section Styles */
section {
    padding: 8rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

h3 {
    font-size: 2rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--text-color);
    padding-bottom: 1rem;
    display: inline-block;
}

/* About Section */
.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    max-width: 800px;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    /* Increased gap */
    margin-top: 3rem;
}

.edu-item {
    /* Removed border for a cleaner look, or could keep it subtle */
    border-left: 2px solid var(--text-color);
    padding-left: 1.5rem;
    padding-bottom: 0.5rem;
}

.edu-item h4 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.edu-item span {
    display: block;
    /* Make spans stack */
    margin-bottom: 0.3rem;
    font-size: 1rem;
    opacity: 0.9;
}

.edu-item span:last-child {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 0;
    font-family: monospace;
    /* Monospace for dates looks nice */
}

/* Timeline */
.timeline {
    border-left: 2px solid var(--text-color);
    padding-left: 2rem;
}

.timeline-item {
    margin-bottom: 4rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 5px;
    width: 1rem;
    height: 1rem;
    background-color: var(--bg-color);
    border: 2px solid var(--text-color);
    border-radius: 50%;
}

.timeline-date {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.timeline-content h5 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    font-style: normal;
    opacity: 0.75;
    color: var(--text-color);
}

.timeline-content ul {
    list-style-type: square;
    margin-left: 1.5rem;
}

/* Projects Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    border: 1px solid var(--text-color);
    padding: 2rem;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    background-color: var(--text-color);
    color: var(--bg-color);
}

.project-card:hover .tags span {
    border-color: var(--bg-color);
}

.project-card h4 {
    margin-bottom: 1rem;
}

.tags {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags span {
    font-size: 0.7rem;
    border: 1px solid var(--text-color);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

/* Skills */
.skills-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
}

.skill-category h4 {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    border-bottom: 1px solid var(--text-color);
    display: inline-block;
    padding-bottom: 0.2rem;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.skill-pill {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--text-color);
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.3s ease;
    background-color: transparent;
}

.skill-pill:hover {
    opacity: 1;
    background-color: var(--text-color);
    color: var(--bg-color);
    transform: translateY(-2px);
}

/* Publications */
.pub-list li {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--text-color);
}

.pub-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.pub-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.pub-header strong {
    font-size: 1.1rem;
    padding-right: 1rem;
}

.pub-link {
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid var(--text-color);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.pub-link:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    opacity: 1;
}

.pub-authors {
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.pub-journal {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Contact */
.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-btn {
    font-size: 1.2rem;
    border-bottom: 1px solid transparent;
}

.social-btn:hover {
    border-bottom: 1px solid var(--text-color);
    text-decoration: none;
}

/* Footer */
footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid var(--text-color);
    margin-top: 4rem;
}

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

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


/* Role Categories */
.role-category {
    margin-top: 1.5rem;
}

.role-category h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    border-bottom: 1px dotted var(--text-color);
    display: inline-block;
}

.role-category ul {
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Add JS toggle later if needed, simple for now */
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--bg-color);
        flex-direction: column;
        padding: 2rem;
        border-bottom: 1px solid var(--text-color);
    }

    .nav-links.active {
        display: flex;
    }

    /* Push toggle to the right next to hamburger */
    #theme-toggle {
        margin-left: auto;
    }

    .menu-toggle {
        display: flex;
    }

    #hero h1 {
        font-size: 2.5rem;
    }

    .timeline::before {
        left: -1rem;
    }

    .timeline {
        padding-left: 1.5rem;
    }
}

/* Core Focus Summary Style */
.core-focus {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--secondary-color);
    margin: 0.5rem 0 1rem 0;
    padding-left: 0.8rem;
    border-left: 3px solid var(--secondary-color);
    font-style: italic;
    letter-spacing: 0.02em;
}

/* Company Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-block;
    margin-left: 0.5rem;
    cursor: help;
    vertical-align: middle;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.timeline-content h5:hover .tooltip-icon {
    opacity: 1;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: var(--text-color);
    color: var(--bg-color);
    text-align: center;
    border-radius: 6px;
    padding: 0.8rem;
    position: absolute;
    z-index: 100;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    font-size: 0.85rem;
    font-weight: 500;
    font-style: normal;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-color) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text,
.tooltip-container.active .tooltip-text {
    visibility: visible;
    opacity: 1;
    bottom: 125%;
}