:root {
    /* Light Theme */
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #0066cc;
    --secondary-text: #666666;
    --border-color: #e0e0e0;
    --card-bg: #f9f9f9;
    --link-color: #6db6f3;
    --active-link-color: #42A5F5;
    --clicked-link-color: #7f64f6;
}

[data-theme="dark"] {
    /* Dark Theme - Cleaner / Lighter */
    --bg-color: #212121;
    --text-color: #ECEFF1;
    --accent-color: #90CAF9;
    --secondary-text: #B0BEC5;
    --border-color: #424242;
    --card-bg: #212121;
    --link-color: #64B5F6;
    --active-link-color: #42A5F5;
    --clicked-link-color: #7f64f6;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.texta {
    color: var(--link-color);
    text-decoration: none;
}

.texta:hover {
    text-decoration: underline;
}

.texta:active {
    color: var(--active-link-color);
}

.texta:visited {
    color: var(--clicked-link-color);
}

/* Header Layout */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a {
    background-color: var(--bg-color);
    text-decoration: none;
    color: var(--secondary-text);
    margin-right: 0px;
    font-weight: 500;
    padding: 10px;
    clip-path: url(#squircle-sharp-clip);
    -webkit-clip-path: url(#squircle-sharp-clip);
    transition: color 0.2s;
}

nav .border-nav {
    display: inline-flex;
    padding: 0.75px;
    background-color: var(--bg-color);
    clip-path: url(#squircle-sharp-clip);
    -webkit-clip-path: url(#squircle-sharp-clip);
    transition: background-color 0.1s ease-in-out;
}

nav .border-nav:has(a:hover),
nav .border-nav:has(a.active) {
    background-color: var(--secondary-text);
}

nav a:hover,
nav a.active {
    color: var(--text-color);
    text-decoration: none;

}


/* Profile Image: Squircle */
.profile-section {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 3rem;
}

.profile-img {
    width: 300px;
    height: 300px;
    object-fit: cover;
    /* Use the SVG clip path for a true squircle */
    clip-path: url(#squircle-clip);
    -webkit-clip-path: url(#squircle-clip);
    border: none;
    align-self: center;
}

.profile-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Social Icons in Header */
.social-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.social-link {
    text-decoration: none;
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-link svg {
    width: 40px;
    height: 40px;
    fill: currentColor;
}

.social-link>svg>path:nth-child(1) {
    stroke-width: 25px;
    stroke: var(--secondary-text);
}

.social-link>svg>path:nth-child(2) {
    stroke-dasharray: var(--icon-path-length);
    stroke-dashoffset: var(--icon-path-length);
    stroke-width: 50px;
    stroke: transparent;
    transition: stroke-dashoffset 0.2s ease-in-out, stroke 0s;
    transition-delay: 0s, 0.2s;
}

.social-link>svg:hover {
    :nth-child(2) {
        stroke-dashoffset: 0;
        stroke: var(--accent-color);
        transition-delay: 0s;
    }
}


/* Sliding Theme Toggle */
#theme-toggle {
    border-radius: 1em;
    text-align: center;
    width: 50px;
    height: 50px;
    /* padding: 4px; */
    margin-left: 2em;
    /* background-color: #707070; */
    border: solid 1px black;
    background-repeat: no-repeat;
    background-size: auto;
    cursor: pointer;
    overflow: hidden
}

#theme-toggle svg {
    object-fit: cover;
    transform: translate(0px, 31px) scale(2) rotate(var(--rotation));
    transition: all 0.5s ease-in-out;
}

#theme-toggle svg:hover {
    transform: translate(0px, 31px) scale(2) rotate(calc(var(--rotation) - 10deg));
}

#theme-toggle svg path {
    stroke-width: 20px;
}

/* Toggle State for Dark Mode */
[data-theme="dark"] #theme-toggle {
    background-color: var(--bg-color);
    border: solid 1px white;
}

[data-theme="dark"] #theme-toggle svg {
    transform: translate(2px, 31px) scale(2) rotate(var(--rotation));
}

[data-theme="dark"] #theme-toggle svg:hover {
    transform: translate(0px, 31px) scale(2) rotate(calc(var(--rotation) - 10deg));
}

[data-theme="dark"] #theme-toggle svg path:nth-child(2) {
    stroke: var(--accent-color);
}

.section-title {
    display: flex;
    gap: 1rem;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.publication-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    margin-top: 2rem;
    padding-bottom: 1rem;
    /* border-bottom: 1px solid var(--border-color); */
}

.pub-img {
    width: 150px;
    height: 150px;
    background-color: white;
    clip-path: url(#squircle-clip);
    -webkit-clip-path: url(#squircle-clip);
    margin: 0px;
    padding: 0px;
    border: 0px;
}

.border-span {
    display: flex;
    height: 152px;
    width: 152px;
    background-color: black;
    clip-path: url(#squircle-clip);
    -webkit-clip-path: url(#squircle-clip);
    padding: 1px;
    margin: 0px;
    margin-right: 10px;
    border: 0px;
}

.pub-infos {
    align-self: center;
}

.pub-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--text-color);
    text-decoration: none;
}

.pub-title:hover {
    color: var(--accent-color);
}

.pub-authors {
    color: var(--secondary-text);
    margin-bottom: 0.25rem;
}

.pub-venue,
.pub-year {
    font-style: italic;
    color: var(--secondary-text);
    font-size: 0.9rem;
}

footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--secondary-text);
    font-size: 0.9rem;
}

@media (max-width: 800px) {
    .container {
        max-width: 600px;
        margin: 0 auto;
        padding: 2rem;
    }

    .profile-section {
        flex-direction: column;
        align-items: center;
        /* text-align: center; */
    }

    header {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        display: flex;
        gap: 1rem;
    }

    nav a {
        margin: 0;
    }

    .profile-img {
        width: min(300px, 100vw - 4rem);
        height: min(300px, 100vw - 4rem);
    }
}