/* =============================== */
/*        Light/Dark Variables     */
/* =============================== */
:root {
    --bg-color: #fdfdfd;
    --text-color: #222;
    --header-bg: #f0f0f0;
    --main-bg: #ffffff;
    --border-color: #ccc;
    --link-color: #003087;
    --link-hover: #0054a6;
    --button-bg: #003087;
    --button-hover: #0054a6;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --header-bg: #2c2c2c;
    --main-bg: #252525;
    --border-color: #444;
    --link-color: #4a8cff;
    --link-hover: #7aa6ff;
    --button-bg: #4a8cff;
    --button-hover: #7aa6ff;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* =============================== */
/*          Base Styles            */
/* =============================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Merriweather', Georgia, serif;
    margin: 40px;
    line-height: 1.8;
    color: var(--text-color);
    background: linear-gradient(to bottom, var(--bg-color) 0%, var(--main-bg) 100%);
    transition: background 0.3s ease, color 0.3s ease;
}

/* =============================== */
/*           Header                */
/* =============================== */
header {
    background-color: var(--header-bg);
    padding: 30px 0;
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    font-size: 2.2em;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-color);
}


/* =============================== */
/*          Navigation             */
/* =============================== */
nav[role="navigation"] {
    margin-top: 20px;
    position: relative;
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    display: inline;
    margin: 0 18px;
}

nav a {
    text-decoration: none;
    color: var(--link-color);
    font-weight: 500;
    font-size: 1.05em;
    transition: border-bottom 0.2s ease, color 0.2s ease;
    border-bottom: 2px solid transparent;
}

nav a:hover {
    border-bottom: 2px solid var(--link-hover);
    color: var(--link-hover);
}

nav a:focus {
    outline: 2px solid var(--link-hover);
    outline-offset: 2px;
}

/* =============================== */
/*       Theme Toggle Buttons      */
/* =============================== */
.theme-toggle,
.nav-toggle {
    background: none;
    border: none;
    font-size: 1.2em;
    color: var(--text-color);
    cursor: pointer;
    position: absolute;
    top: 20px;
}

.theme-toggle {
    right: 20px;
}

.nav-toggle {
    right: 60px;
    font-size: 1.5em;
    display: none;
}

.theme-toggle:hover,
.nav-toggle:hover {
    color: var(--link-hover);
}

.theme-toggle:focus,
.nav-toggle:focus {
    outline: 2px solid var(--link-hover);
    outline-offset: 2px;
}

/* =============================== */
/*             Main               */
/* =============================== */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    background-color: var(--main-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 10px var(--shadow-color);
    border-radius: 8px;
}

/* =============================== */
/*           Sections              */
/* =============================== */
section {
    margin-bottom: 60px;
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

h2 {
    font-size: 1.8em;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-top: 40px;
}

h3 {
    font-size: 1.4em;
    color: var(--text-color);
    margin: 20px 0 10px;
    border-radius: 4px;
    padding: 8px;
}

p {
    font-size: 1.05em;
    margin-top: 0.5em;
    color: var(--text-color);
}

/* =============================== */
/*         Hero Section            */
/* =============================== */
#hero {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

#hero img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    transition: transform 0.2s ease, border-color 0.3s;
}

#hero img:hover {
    transform: scale(1.05);
}

.hero-text {
    transition: background-color 0.3s, color 0.3s;
}

.hero-text h2 {
    font-size: 1.6em;
    margin: 0 0 10px;
    color: var(--text-color);
}

.hero-text p {
    font-size: 1em;
    color: var(--text-color);
}

/* =============================== */
/*       Projects Section          */
/* =============================== */
.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    background-color: var(--main-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.project-card:hover {
    box-shadow: var(--card-shadow);
    transform: translateY(-5px);
}

.project-card img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.project-card h3 {
    font-size: 1.4em;
    margin: 10px 0;
    color: var(--text-color);
}

.project-card p {
    font-size: 1em;
    color: var(--text-color);
}

/* =============================== */
/*       Publications Section      */
/* =============================== */
.publication-group {
    margin-bottom: 40px;
}

.publication-list {
    list-style: none;
    padding: 0;
}

.publication-list li {
    background: linear-gradient(to bottom, var(--main-bg) 0%, var(--bg-color) 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.publication-list li:hover {
    box-shadow: var(--card-shadow);
    transform: translateY(-3px);
}

/* =============================== */
/*             Buttons             */
/* =============================== */
.button,
.cta-button {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(to bottom, var(--button-bg) 0%, var(--button-hover) 100%);
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease;
    margin-top: 10px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.button:hover,
.cta-button:hover {
    background: linear-gradient(to bottom, var(--button-hover) 0%, var(--button-bg) 100%);
    transform: scale(1.05);
}

.button:focus,
.cta-button:focus {
    outline: 2px solid var(--button-hover);
    outline-offset: 2px;
}

/* =============================== */
/*            Footer               */
/* =============================== */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    background-color: var(--header-bg);
    color: var(--text-color);
    font-size: 0.9em;
    border-top: 1px solid var(--border-color);
}

/* =============================== */
/*         Global Links            */
/* =============================== */
a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--link-hover);
    outline-offset: 2px;
}

/* =============================== */
/*        Responsive Design        */
/* =============================== */
@media (max-width: 768px) {
    body {
        margin: 20px;
    }

    header {
        padding: 20px 0;
    }

    header h1 {
        font-size: 1.8em;
    }

    nav ul {
        display: block;
        max-height: 0;
        overflow: hidden;
        background-color: var(--header-bg);
        padding: 0 20px;
        text-align: center;
        border-top: 1px solid var(--border-color);
        transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    }

    nav ul.active {
        max-height: 500px;
        padding: 20px;
    }

    nav ul li {
        display: block;
        margin: 15px 0;
    }

    nav a {
        font-size: 1.1em;
        padding: 10px;
        display: block;
    }

    .nav-toggle {
        display: block;
    }

    main {
        padding: 20px;
    }

    h2 {
        font-size: 1.5em;
    }

    h3 {
        font-size: 1.3em;
    }

    #hero {
        flex-direction: column;
        text-align: center;
    }

    #hero img {
        width: 120px;
        height: 120px;
    }

    .projects {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    header h1 {
        font-size: 2.8em;
    }

    nav ul {
        display: block;
        max-height: initial;
        overflow: visible;
        padding: 0;
        border-top: none;
    }

    .nav-toggle {
        display: none;
    }
}


