:root {
    --primary-color: #2d3436;
    --secondary-color: #64748b;
    --accent-color: #0984e3;
    --text-color: #2d3436;
    --bg-color: #f0f4f8;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 255, 255, 0.6);
    --card-hover-bg: rgba(255, 255, 255, 0.95);
    --border-radius: 12px;
    --container-width: 1100px;
    --transition: all 0.3s ease;
    --orb-opacity: 0.5;
    --shadow-color: rgba(0,0,0,0.05);
}

[data-theme="dark"] {
    --primary-color: #f1f5f9;
    --secondary-color: #94a3b8;
    --accent-color: #60a5fa;
    --text-color: #e2e8f0;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(148, 163, 184, 0.1);
    --card-hover-bg: rgba(30, 41, 59, 0.9);
    --orb-opacity: 0.3;
    --shadow-color: rgba(0,0,0,0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 50% 0%, rgba(200, 220, 255, 0.1) 0, transparent 70%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Decorative background elements */
body::before, body::after {
    content: '';
    position: fixed;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    z-index: -1;
    filter: blur(100px);
    opacity: var(--orb-opacity);
    transition: opacity 0.5s ease;
    animation: floatBackground 25s infinite alternate ease-in-out;
}

body::before {
    background: radial-gradient(circle, #a5b4fc 0%, rgba(165, 180, 252, 0) 70%);
    top: -200px;
    right: -200px;
}

body::after {
    background: radial-gradient(circle, #67e8f9 0%, rgba(103, 232, 249, 0) 70%);
    bottom: -200px;
    left: -200px;
    animation-delay: -10s;
}

@keyframes floatBackground {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 50px) scale(1.1); }
    100% { transform: translate(-20px, 20px) scale(1); }
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

/* Hero Section */
.hero-section {
    padding: 6rem 0 4rem;
    text-align: center;
}

.profile-column {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.about-column {
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}

.about-column h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-container {
    margin-bottom: 2.5rem;
    position: relative;
    display: inline-block;
    padding: 6px;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    border-radius: 50%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Remove old pseudo-element */
.profile-container::before {
    display: none;
}

.profile-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-color);
    display: block;
    background-color: var(--bg-color);
    transition: border-color 0.5s ease, background-color 0.5s ease;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.4rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.email {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.email-protect span {
    display: none;
}

/* Sections */
section {
    padding: 6rem 0;
}

h2 {
    font-size: 2.2rem;
    margin-bottom: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.01em;
}

.about-text {
    font-size: 1.15rem;
    color: var(--text-color);
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 40px var(--shadow-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Publications */
.publication-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.pub-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px var(--shadow-color);
    cursor: pointer;
}

.pub-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px var(--shadow-color);
    background: var(--card-hover-bg);
    border-color: var(--accent-color);
}

.venue-tag {
    display: inline-block;
    background-color: rgba(9, 132, 227, 0.1);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(9, 132, 227, 0.2);
}

[data-theme="dark"] .venue-tag {
    background-color: rgba(96, 165, 250, 0.1);
    color: var(--accent-color);
    border-color: rgba(96, 165, 250, 0.2);
}

.pub-content {
    padding: 1.5rem;
}

.pub-title {
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.pub-links {
    display: flex;
    gap: 1rem;
}

.pub-link {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.pub-link:hover {
    text-decoration: underline;
}

/* Footer & Socials */
footer {
    padding: 4rem 0;
    border-top: 1px solid #eee;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.social-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.social-link:hover {
    color: var(--accent-color);
}

.social-logo {
    color: var(--secondary-color);
    transition: all 0.3s ease;
    opacity: 0.7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-logo:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
    opacity: 1;
}

.rug-logo {
    height: 32px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.social-logo:hover .rug-logo {
    filter: grayscale(0%);
    opacity: 1;
}

[data-theme="dark"] .rug-logo {
    filter: grayscale(100%) invert(0.8);
}

[data-theme="dark"] .social-logo:hover .rug-logo {
    filter: none;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 0 2rem;
    }

    .about-column {
        text-align: left;
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .social-links {
        gap: 1.5rem;
    }
}

/* Dark Mode Toggle */
.theme-switch-wrapper {
    position: absolute;
    top: 2rem;
    left: 2rem;
    right: 2rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-icon {
    width: 22px;
    height: 22px;
    fill: var(--secondary-color);
    transition: all 0.3s ease;
}

.cv-button {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 0.4rem 1rem;
    border: 2px solid var(--accent-color);
    border-radius: 20px;
    margin-right: auto;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.cv-button:hover {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 5px 15px var(--shadow-color);
}



[data-theme="dark"] .icon-sun {
    opacity: 0.3;
}

[data-theme="dark"] .icon-moon {
    opacity: 1;
    fill: #f1c40f;
}

[data-theme="light"] .icon-moon {
    opacity: 0.3;
}

[data-theme="light"] .icon-sun {
    opacity: 1;
    fill: #f39c12;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: rgba(0,0,0,0.1);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--card-border);
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Modal Window */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.4); 
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: var(--card-hover-bg);
    margin: 10% auto; 
    padding: 3rem;
    border: 1px solid var(--card-border);
    width: 80%; 
    max-width: 800px;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--text-color);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close {
    color: var(--secondary-color);
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover,
.close:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.modal-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
}

.modal-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.modal-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
