/* --- ACADEMIC CV — sidebar resume style --- */
:root {
    --accent: #bd5d38;
    --accent-strong: #9c4a2a;
    --accent-soft: #fbf1ec;

    --ink: #343a40;
    --text: #6c757d;
    --muted: #8f979e;

    --bg: #ffffff;
    --bg-card: #ffffff;
    --border: #e7e9ec;
    --icon-bg: #495057;
    --sidebar-text: rgba(255, 255, 255, 0.72);

    --display: 'Saira Extra Condensed', 'Arial Narrow', sans-serif;
    --sans: 'Mulish', ui-sans-serif, system-ui, -apple-system, sans-serif;

    --sidebar-w: 17rem;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --accent: #d97a55;
        --accent-strong: #e89675;
        --accent-soft: #2a1d18;
        --ink: #eceff2;
        --text: #b5bcc4;
        --muted: #8c949c;
        --bg: #15181c;
        --bg-card: #1b1f24;
        --border: #2b3138;
        --icon-bg: #3a4149;
    }
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    font-size: 1.05rem;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* --- LOADER --- */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.35s ease;
}
.loader-overlay.fade-out { opacity: 0; pointer-events: none; }
.loader-spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- SIDEBAR --- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--accent);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    z-index: 10;
}

.avatar-container {
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    overflow: hidden;
    border: 0.5rem solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}
.avatar-container img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1.75rem;
    gap: 0.1rem;
}

.nav-link {
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.35rem 0.5rem;
    text-align: center;
    transition: color 0.15s;
}
.nav-link:hover,
.nav-link.active { color: #fff; }

/* --- MAIN --- */
.main-content { margin-left: var(--sidebar-w); }

.resume-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 5rem 3rem;
    max-width: 75rem;
}
.resume-section-content { width: 100%; }

.section-divider {
    margin: 0;
    border: 0;
    border-top: 1px solid var(--border);
}

/* --- HERO --- */
.hero-name {
    font-family: var(--display);
    font-size: clamp(3.5rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 0.95;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 0.75rem;
}
.hero-name .accent { color: var(--accent); }

.hero-subheading {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}
.hero-subheading a { color: var(--accent); text-decoration: none; }
.hero-subheading a:hover { text-decoration: underline; }

.hero-role {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 2.5rem;
    line-height: 1.3;
}

.hero-lead {
    font-size: 1.15rem;
    line-height: 1.8;
    max-width: 52rem;
    margin-bottom: 1rem;
}

.social-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }

.social-btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--icon-bg);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    transition: background-color 0.15s;
}
.social-btn:hover { background: var(--accent); }

/* --- SECTION HEADINGS --- */
.section-title {
    font-family: var(--display);
    font-size: 3.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 3rem;
}

.section-count {
    font-size: 0.45em;
    color: var(--accent);
    margin-left: 0.5rem;
    vertical-align: middle;
    font-weight: 500;
}

.resume-section p { margin-bottom: 1rem; line-height: 1.75; }
.resume-section ul { list-style: none; }

/* --- ENTRIES (appointments, education) --- */
.entry {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 2rem;
    margin-bottom: 3rem;
}
.entry:last-child { margin-bottom: 0; }
.entry-main { min-width: 0; }

.entry-title {
    font-family: var(--display);
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ink);
    line-height: 1.1;
}
.entry-org {
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0.8;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}
.entry-desc { line-height: 1.75; }
.entry-date {
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
    padding-top: 0.5rem;
    font-variant-numeric: tabular-nums;
}

/* --- TAGS (fields, languages) --- */
#research-fields ul,
#languages ul { display: flex; flex-wrap: wrap; gap: 0.75rem; }

#research-fields li,
#languages li {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--ink);
    padding: 0.25rem 1.1rem;
    border: 2px solid var(--accent);
    border-radius: 999px;
    line-height: 1.3;
}

/* --- PUBLICATIONS --- */
.pub-item { margin-bottom: 2rem; }
.pub-item:last-child { margin-bottom: 0; }

.pub-title {
    font-family: var(--sans);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.45;
    margin-bottom: 0.25rem;
}
.pub-title a { color: inherit; text-decoration: none; }
.pub-title a::after {
    content: "\f35d";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.7em;
    margin-left: 0.45em;
    color: var(--accent);
}
.pub-title a:hover { color: var(--accent); }

.pub-item p { margin-bottom: 0; line-height: 1.7; }

.pub-meta {
    display: block;
    font-style: normal;
    font-weight: 700;
    color: var(--accent);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

/* Research in the field: cards */
#research-in-the-field .pub-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1.25rem;
}
#research-in-the-field .pub-item {
    margin: 0;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 6px;
}
#research-in-the-field .pub-title {
    font-family: var(--display);
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

/* --- TIMELINE LISTS (presentations, grants, service) --- */
.tl-item {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 1.5rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    line-height: 1.65;
}
.tl-item:first-child { padding-top: 0; }
.tl-item:last-child { border-bottom: none; }
.tl-date {
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    line-height: 1.2;
}
.tl-body em { color: var(--ink); }

/* --- FOOTER --- */
.site-footer {
    padding: 2rem 3rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 991px) {
    html { scroll-padding-top: 4rem; }

    .sidebar {
        position: sticky;
        top: 0;
        inset: auto;
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.6rem 1rem;
        gap: 0.75rem;
        overflow: visible;
    }
    .avatar-container { width: 2.75rem; height: 2.75rem; border-width: 2px; }
    .sidebar-nav {
        flex-direction: row;
        margin-top: 0;
        overflow-x: auto;
        min-width: 0;
        scrollbar-width: none;
    }
    .sidebar-nav::-webkit-scrollbar { display: none; }
    .nav-link { white-space: nowrap; font-size: 0.85rem; }

    .main-content { margin-left: 0; }
    .resume-section { min-height: 0; padding: 3.5rem 1rem; }
    #about { padding-top: 3rem; }
    .section-title { font-size: 2.75rem; margin-bottom: 2rem; }
    .site-footer { padding: 1.5rem 1rem; }
}

@media (max-width: 640px) {
    .hero-subheading, .hero-role { font-size: 1.25rem; }
    .entry { grid-template-columns: 1fr; }
    .entry-date { order: -1; padding-top: 0; }
    .entry-title { font-size: 1.7rem; }
    .tl-item { grid-template-columns: 1fr; gap: 0.1rem; }
    .social-btn { width: 3rem; height: 3rem; font-size: 1.25rem; }
}
