/* * CSS VARIABLES FOR THEMES
 * This is the core of the theme switcher. We define a set of variables for each theme.
 * JavaScript will change the `data-theme` attribute on the <body> tag,
 * which instantly swaps out all the colors, fonts, and other properties.
 */
:root {
    /* Default Theme: Orbital Command */
    --bg-color: #0a192f;
    --bg-secondary-color: #112240;
    --text-color: #ccd6f6;
    --text-secondary-color: #8892b0;
    --accent-color: #64ffda;
    --accent-color-hover: rgba(100, 255, 218, 0.1);
    --border-color: #233554;
    --header-font: 'Orbitron', sans-serif;
    --body-font: 'Inter', sans-serif;
    --mono-font: 'Share Tech Mono', monospace;
    --bg-animation-opacity: 0.2;
}

[data-theme="glitch"] {
    --bg-color: #000000;
    --bg-secondary-color: #1a1a1a;
    --text-color: #e6e6e6;
    --text-secondary-color: #a8a8a8;
    --accent-color: #f72585;
    --accent-color-hover: rgba(247, 37, 133, 0.1);
    --border-color: #333;
    --header-font: 'Rajdhani', sans-serif;
    --body-font: 'Inter', sans-serif;
    --mono-font: 'Share Tech Mono', monospace;
    --bg-animation-opacity: 0.1;
}

[data-theme="blueprint"] {
    /* This is now a dark theme */
    --bg-color: #0b1d32;
    --bg-secondary-color: #112a45;
    --text-color: #e2e8f0;
    --text-secondary-color: #8892b0;
    --accent-color: #3182ce;
    --accent-color-hover: rgba(49, 130, 206, 0.1);
    --border-color: #234567;
    --header-font: 'Share Tech Mono', monospace;
    --body-font: 'Inter', sans-serif;
    --mono-font: 'Share Tech Mono', monospace;
    --bg-animation-opacity: 0.3;
}

/* * BASE STYLES & RESET
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

/* Background Canvas for animations */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: var(--bg-animation-opacity);
    transition: opacity 0.3s ease;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
    border-bottom: 1px solid var(--border-color);
}

section:last-of-type {
    border-bottom: none;
}

h1, h2, h3 {
    font-family: var(--header-font);
    color: var(--text-color);
    margin-bottom: 20px;
    font-weight: 700;
}

h2.section-title {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
}

h2.section-title::before {
    content: '>';
    color: var(--accent-color);
    margin-right: 10px;
    font-family: var(--mono-font);
}

p {
    color: var(--text-secondary-color);
    margin-bottom: 15px;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

a:hover {
    filter: brightness(1.2);
}

/* * HEADER & NAVIGATION
 */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 15px 0;
    background-color: rgba(10, 25, 47, 0.85); /* From orbital theme, for consistency */
    backdrop-filter: blur(10px);
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--mono-font);
    font-size: 1.5rem;
    color: var(--accent-color);
}

.main-nav ul {
    display: flex;
    list-style: none;
    align-items: center;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    font-family: var(--mono-font);
    color: var(--text-color);
}

/* Theme Switcher */
.theme-switcher select {
    background-color: var(--bg-secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-family: var(--mono-font);
    cursor: pointer;
}

/* Mobile Nav */
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 2rem;
}

/* * HERO SECTION
 */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 80px; /* Offset for fixed header */
}

#hero h1 {
    font-size: clamp(40px, 8vw, 80px);
    line-height: 1.1;
}

#hero .subtitle {
    font-size: clamp(20px, 5vw, 40px);
    color: var(--text-secondary-color);
    margin-bottom: 20px;
}

#hero p {
    max-width: 600px;
}

.cta-button {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 4px;
    margin-top: 30px;
    font-family: var(--mono-font);
}
.cta-button:hover {
    background-color: var(--accent-color-hover);
}

/* * SKILLS SECTION
 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.skill-card {
    background-color: var(--bg-secondary-color);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease-in-out;
}

.skill-card:hover {
    transform: translateY(-5px);
}

.skill-card h3 {
    color: var(--accent-color);
    font-family: var(--mono-font);
}

.skill-card ul {
    list-style: none;
    padding-top: 10px;
}

.skill-card li {
    color: var(--text-secondary-color);
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.skill-card li::before {
    content: '»';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* * EXPERIENCE SECTION
 */
.timeline {
    margin-top: 40px;
    position: relative;
    padding-left: 30px;
    border-left: 2px solid var(--border-color);
}

.timeline-item {
    margin-bottom: 40px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -37px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: 2px solid var(--bg-color);
}

.timeline-item h3 {
    font-size: 1.5rem;
}
.timeline-item .date {
    font-family: var(--mono-font);
    color: var(--text-secondary-color);
    margin-bottom: 10px;
}
.timeline-item ul {
    list-style: none;
}
.timeline-item li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}
.timeline-item li::before {
    content: '•';
    color: var(--accent-color);
    position: absolute;
    left: 0;
}

/* * PROJECTS SECTION
 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}
.project-card {
    background-color: var(--bg-secondary-color);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}
.project-card h3 {
    font-size: 1.2rem;
}
.project-card p {
    flex-grow: 1;
}
.project-card .tech-stack {
    margin-top: 15px;
    font-family: var(--mono-font);
    color: var(--text-secondary-color);
    font-size: 0.9rem;
}

/* * PUBLICATIONS SECTION
 */
.publication-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.publication-links .cta-button {
    margin-top: 0; /* Override default margin for this context */
}

.publications-list {
    margin-top: 40px;
}

.publication-item {
    background-color: var(--bg-secondary-color);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 20px;
    transition: transform 0.2s ease-in-out;
}

.publication-item:hover {
    transform: translateY(-5px);
}

.publication-item h3 {
    font-size: 1.1rem;
    font-family: var(--body-font);
    margin-bottom: 5px;
}

.publication-item h3 a {
    color: var(--text-color);
    font-weight: 600;
}
.publication-item h3 a:hover {
    color: var(--accent-color);
}

.publication-item .authors {
    font-size: 0.9rem;
    color: var(--text-secondary-color);
    margin-bottom: 5px;
}

.publication-item .journal {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-secondary-color);
    margin-bottom: 0;
}

.publication-divider {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--border-color), rgba(0, 0, 0, 0));
    margin: 30px 0;
}


/* * CONTACT SECTION
 */
#contact {
    text-align: center;
}
#contact p {
    max-width: 600px;
    margin: 20px auto;
}

/* * FOOTER
 */
footer {
    text-align: center;
    padding: 20px;
    font-family: var(--mono-font);
    color: var(--text-secondary-color);
}

/*
 * THEME-SPECIFIC ANIMATIONS & STYLES
 */

/* Glitch Theme Specifics */
[data-theme="glitch"] #hero h1 {
    animation: glitch 1s linear infinite;
}

@keyframes glitch {
    2%, 64% { transform: translate(2px, 0) skew(0deg); }
    4%, 60% { transform: translate(-2px, 0) skew(0deg); }
    62% { transform: translate(0, 0) skew(5deg); }
}

[data-theme="glitch"] .skill-card,
[data-theme="glitch"] .project-card,
[data-theme="glitch"] .publication-item {
    border-image: linear-gradient(to right, var(--accent-color), #4cc9f0) 1;
    border-left-width: 4px;
    border-right-width: 1px;
    border-top-width: 1px;
    border-bottom-width: 1px;
}

/* Blueprint Theme Specifics */
[data-theme="blueprint"] h2.section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, var(--accent-color) 50%, transparent 50%);
    background-size: 10px 2px;
}

[data-theme="blueprint"] .skill-card,
[data-theme="blueprint"] .project-card {
    box-shadow: 5px 5px 0px var(--border-color);
}

[data-theme="blueprint"] .publication-item {
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
}


/* * RESPONSIVENESS
 */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    .main-nav {
        position: fixed;
        top: 70px; /* Header height */
        right: 0;
        width: 100%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background-color: var(--bg-secondary-color);
        flex-direction: column;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }
    .main-nav.active {
        transform: translateX(0);
    }
    .main-nav ul {
        flex-direction: column;
    }
    .main-nav li {
        margin: 20px 0;
    }
}
