/* ===== CSS VARIABLES — LIGHT MODE ===== */
:root {
    --primary: #4a4e69;
    --accent:  #9a8c98;
    --text:    #2b2d42;
    --text-muted: #6c757d;
    --bg:      #fdfcfb;
    --bg-alt:  #f5f3f0;
    --border:  #e0ddd9;
    --link:    #4a4e69;
    --nav-bg:  #fdfcfb;
    --card-bg: #ffffff;
    --badge-bg: #f0eeec;
}

/* ===== CSS VARIABLES — DARK MODE ===== */
.dark {
    --primary: #a5b4fc;
    --accent:  #818cf8;
    --text:    #e2e8f0;
    --text-muted: #94a3b8;
    --bg:      #0f172a;
    --bg-alt:  #1e293b;
    --border:  #334155;
    --link:    #a5b4fc;
    --nav-bg:  #0f172a;
    --card-bg: #1e293b;
    --badge-bg: #1e293b;
}

/* ===== GLOBAL ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    background-color: var(--bg);
    transition: background-color 0.2s, color 0.2s;
}

h1, h2, h3, h4, h5 {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    color: var(--text);
}

a {
    color: var(--link);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ===== NAVBAR ===== */
#main-nav {
    background-color: var(--nav-bg);
    border-color: var(--border) !important;
}

.navbar-brand {
    font-family: 'Roboto Slab', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary) !important;
    letter-spacing: 0.02em;
}

.nav-link {
    color: var(--text-muted) !important;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.nav-link:hover, .nav-link-active {
    color: var(--primary) !important;
    border-bottom-color: var(--primary);
    text-decoration: none;
}

/* Dark mode toggle button */
#theme-toggle, #theme-toggle-mobile {
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
}
#theme-toggle:hover, #theme-toggle-mobile:hover {
    color: var(--primary);
    background: var(--bg-alt);
}
#mobile-menu-btn {
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
}

/* ===== PROFILE CARD ===== */
.profile-card { text-align: center; position: sticky; top: 72px; }

.profile-card img {
    width: 180px; height: 180px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--border);
    margin-bottom: 1rem;
}

.profile-card h1 { font-size: 1.3rem; margin-bottom: 0.2rem; }
.profile-title   { font-size: 0.9rem; color: var(--text-muted); }

.social-icons {
    display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1rem;
}
.social-icons a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--bg-alt); color: var(--primary);
    font-size: 0.9rem; border: 1px solid var(--border);
    transition: background 0.2s, color 0.2s;
}
.social-icons a:hover {
    background: var(--primary); color: var(--bg); text-decoration: none;
}

/* ===== SECTION HEADINGS ===== */
.section-heading {
    font-size: 1rem; font-weight: 700;
    text-transform: lowercase; letter-spacing: 0.06em;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.35rem; margin-bottom: 1.1rem;
}

/* ===== POST PREVIEWS ===== */
.post-preview { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.post-preview:last-child { border-bottom: none; }
.post-preview h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.post-date { font-size: 0.82rem; color: var(--text-muted); }
.post-preview p { margin-top: 0.25rem; font-size: 0.92rem; color: var(--text-muted); }

/* ===== PUBLICATION LIST ===== */
.pub-meta { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.3rem; }

.bibtex-block {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.9rem; font-size: 0.8rem;
    white-space: pre-wrap; word-break: break-all;
    color: var(--text);
}

/* ===== TYPE FILTER TABS ===== */
.type-filter { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.type-filter a {
    padding: 0.25rem 0.9rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    font-size: 0.82rem; font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-alt);
    transition: all 0.15s;
    text-decoration: none;
}
.type-filter a:hover, .type-filter a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
    text-decoration: none;
}

/* ===== PRESENTATION TYPE BADGE ===== */
.pres-badge {
    display: inline-block;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.1rem 0.5rem; border-radius: 4px;
    background: var(--bg-alt); border: 1px solid var(--border);
    color: var(--accent);
    vertical-align: middle;
}

/* ===== PROJECT CARDS ===== */
.project-card {
    background: var(--card-bg) !important;
    border-color: var(--border) !important;
    transition: transform 0.15s, box-shadow 0.15s;
}
.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.dark .project-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.project-card .card-body { background: var(--card-bg); color: var(--text); }
.project-card .card-title a { color: var(--text); }
.project-card .card-text { color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn-primary {
    background-color: var(--primary); border-color: var(--primary);
    color: var(--bg); font-weight: 600;
}
.btn-primary:hover {
    background-color: var(--accent); border-color: var(--accent);
    color: var(--bg);
}
.btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: var(--bg); }
.btn-outline-secondary { border-color: var(--border); color: var(--text-muted); }
.btn-outline-secondary:hover { background: var(--bg-alt); color: var(--text); border-color: var(--border); }
.btn-outline-success { border-color: #22c55e; color: #22c55e; }
.btn-outline-success:hover { background: #22c55e; color: #fff; }
.btn-outline-info { border-color: #38bdf8; color: #38bdf8; }
.btn-outline-info:hover { background: #38bdf8; color: #fff; }

/* ===== FORMS ===== */
.form-control, .form-select {
    background-color: var(--bg-alt) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(74,78,105,0.2) !important;
    background-color: var(--bg) !important;
}
.form-label { font-weight: 600; font-size: 0.9rem; color: var(--text); }

/* ===== CONTACT ===== */
.contact-section { max-width: 700px; }
.contact-social-icons { gap: 0.75rem; margin-top: 1.5rem; }
.contact-social-icons a { width: 44px; height: 44px; font-size: 1.2rem; }

/* ===== ABSTRACT BOX ===== */
.abstract-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
    padding: 1rem 1.1rem;
    font-size: 0.93rem;
    color: var(--text);
}

/* ===== FOOTER ===== */
.site-footer {
    border-color: var(--border) !important;
    font-size: 0.82rem; color: var(--text-muted);
    background: var(--bg);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }

/* ===== UTILITY ===== */
.bio-text { font-size: 1rem; line-height: 1.8; }
hr { border-color: var(--border); opacity: 1; }
details summary { color: var(--primary); cursor: pointer; }
.badge.bg-light { background: var(--badge-bg) !important; color: var(--text-muted) !important; border-color: var(--border) !important; }

    --primary: #4a4e69;
    --accent: #9a8c98;
    --text: #2b2d42;
    --text-muted: #6c757d;
    --bg: #fdfcfb;
    --bg-alt: #f5f3f0;
    --border: #e0ddd9;
    --link: #4a4e69;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    background-color: var(--bg);
}

h1, h2, h3, h4, h5 {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    color: var(--text);
}

a {
    color: var(--link);
    text-decoration: none;
}
a:hover { text-decoration: underline; color: var(--primary); }

/* ===== NAVBAR ===== */
#main-nav {
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0;
}

#main-nav .navbar-brand {
    font-family: 'Roboto Slab', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.02em;
}

#main-nav .nav-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    padding: 0.4rem 0.8rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
#main-nav .nav-link:hover,
#main-nav .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    text-decoration: none;
}

/* ===== PROFILE SIDEBAR ===== */
.profile-card {
    text-align: center;
    position: sticky;
    top: 80px;
}

.profile-card img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--border);
    margin-bottom: 1rem;
}

.profile-card h1 {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
}

.profile-card .profile-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.profile-card .profile-institution a {
    font-size: 0.9rem;
    color: var(--primary);
}

.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-alt);
    color: var(--primary);
    font-size: 1rem;
    border: 1px solid var(--border);
    transition: background 0.2s, color 0.2s;
}
.social-icons a:hover {
    background-color: var(--primary);
    color: #fff;
    text-decoration: none;
}

/* ===== SECTION HEADINGS ===== */
.section-heading {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.4rem;
    margin-bottom: 1.2rem;
}

/* ===== NEWS TABLE ===== */
.news-table td {
    padding: 0.4rem 0.6rem;
    vertical-align: top;
    border: none;
    font-size: 0.93rem;
}
.news-table td:first-child {
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.85rem;
    min-width: 110px;
}

/* ===== POST PREVIEW ===== */
.post-preview {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}
.post-preview:last-child { border-bottom: none; }
.post-preview h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.post-preview .post-date { font-size: 0.83rem; color: var(--text-muted); }
.post-preview p { margin-top: 0.3rem; font-size: 0.92rem; color: var(--text-muted); }

/* ===== PUBLICATION PAGE ===== */
.pub-meta { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.bibtex-block {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ===== CONTACT PAGE ===== */
.contact-section { max-width: 700px; }

.contact-social-icons { gap: 0.75rem; margin-top: 1.5rem; }
.contact-social-icons a {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
}

.form-label { font-weight: 600; font-size: 0.9rem; }
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(74, 78, 105, 0.2);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.03em;
}
.btn-primary:hover {
    background-color: #393c54;
    border-color: #393c54;
}

/* ===== FOOTER ===== */
.site-footer {
    margin-top: 4rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }

/* ===== HERO BIO TEXT ===== */
.bio-text { font-size: 1rem; line-height: 1.8; }
