/* ============================================================
   Academic Profile — Refined Design System
   Color: Dark Forest Green accent on warm off-white
   Typography: Source Serif 4 (headings) + Inter (body)
   Layout: Single-column, centered, content-first
   ============================================================ */

:root {
    /* Palette */
    --bg: #fafaf7;
    --bg-alt: #f3f2ed;
    --surface: #ffffff;
    --text: #1c1c1c;
    --text-muted: #5a5a58;
    --text-light: #888884;
    --accent: #2d5f3f;
    --accent-light: #3a7a52;
    --accent-bg: rgba(45, 95, 63, 0.06);
    --border: #e3e0da;
    --border-light: #eceae5;

    /* Typography */
    --font-heading: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, system-ui, sans-serif;

    /* Sizing */
    --container-width: 820px;
    --transition: 0.15s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg: #111310;
    --bg-alt: #191c18;
    --surface: #1e211c;
    --text: #e8e6e1;
    --text-muted: #9e9c97;
    --text-light: #6b6a66;
    --accent: #6aad7e;
    --accent-light: #82c496;
    --accent-bg: rgba(106, 173, 126, 0.08);
    --border: #2a2d28;
    --border-light: #232621;
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition), color var(--transition);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

img {
    max-width: 100%;
    display: block;
}

::selection {
    background-color: var(--accent);
    color: #fff;
}

/* ============================================================
   Container
   ============================================================ */

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

/* ============================================================
   Profile Hero
   ============================================================ */

.profile-hero {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 4rem 0 2rem;
}

.profile-image {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px var(--border-light);
    transition: box-shadow var(--transition);
}

.profile-image:hover {
    box-shadow: 0 0 0 2px var(--accent);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.name {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.35rem;
}

.title-line {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
    letter-spacing: -0.005em;
}

.affiliation {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
    font-weight: 400;
}

.affiliation a {
    color: var(--text);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    transition: color var(--transition), border-color var(--transition);
}

.affiliation a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Contact row */
.contact-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.8rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.contact-row a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
}

.contact-row a:hover {
    color: var(--accent);
}

.contact-row .separator {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--border);
    flex-shrink: 0;
}

.contact-row .location-text {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Social icons */
.social-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color var(--transition), background-color var(--transition);
}

.social-links a:hover {
    color: var(--accent);
    background-color: var(--accent-bg);
}

/* ============================================================
   Navigation Bar
   ============================================================ */

.nav-bar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
    margin-bottom: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    position: relative;
    transition: color var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0.25rem;
    left: 0.85rem;
    right: 0.85rem;
    height: 1.5px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

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

.nav-link.active::after {
    transform: scaleX(1);
}

/* ============================================================
   Sections — Shared
   ============================================================ */

.section {
    padding: 3rem 0;
}

.section + .section {
    border-top: 1px solid var(--border-light);
}

.section-title {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.section p {
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.section p:last-child {
    margin-bottom: 0;
}

.section p b,
.section p strong {
    color: var(--text);
    font-weight: 600;
}

#about p {
    color: var(--text);
}

.section p a,
.news-content a {
    color: var(--text);
    font-weight: 500;
    border-bottom: 1px solid var(--accent);
    transition: color var(--transition);
}

.section p a:hover,
.news-content a:hover {
    color: var(--accent);
}

/* ============================================================
   News
   ============================================================ */

.news-year-heading {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin: 1.75rem 0 0.75rem;
    padding-bottom: 0;
}

.news-year-heading:first-of-type {
    margin-top: 0;
}

.news-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.news-list li {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 1rem;
    align-items: baseline;
    padding: 0.25rem 0;
}

.news-list .date {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.01em;
}

.news-content {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.6;
}

.news-content b,
.news-content strong {
    font-weight: 600;
}

/* ============================================================
   Publications
   ============================================================ */

.pub-year-heading {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin: 1.75rem 0 0.75rem;
    padding-bottom: 0;
}

.pub-year-heading:first-child {
    margin-top: 0;
}

.year-publications {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.publication-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.pub-thumbnail {
    width: 180px;
    height: 108px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--bg-alt);
    border: 1px solid var(--border-light);
}

.pub-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.publication-item:hover .pub-thumbnail img {
    transform: scale(1.03);
}

.pub-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-alt);
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 500;
}

.pub-details {
    flex: 1;
    min-width: 0;
}

.pub-title {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text);
    line-height: 1.45;
    letter-spacing: -0.01em;
}

.pub-authors {
    color: var(--text-muted);
    font-size: 0.84rem;
    margin-bottom: 0.15rem;
    line-height: 1.5;
    transition: color var(--transition);
}

.publication-item:hover .pub-authors {
    color: var(--text);
}

.pub-authors b,
.pub-authors .pub-author-me {
    color: var(--text);
    font-weight: 600;
}

/* Linked author name — no underline, just color shift on hover */
.pub-authors .pub-author-link {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

.pub-authors .pub-author-link:hover {
    color: var(--accent);
}

.pub-venue {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    font-style: italic;
    line-height: 1.45;
}

.pub-abstract {
    font-size: 0.82rem !important;
    color: var(--text-muted);
    margin-bottom: 0.5rem !important;
    line-height: 1.55;
}

.pub-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.45rem;
    flex-wrap: wrap;
}

.pub-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.01em;
    position: relative;
    transition: color var(--transition);
}

.pub-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.pub-link:hover::after {
    transform: scaleX(1);
}

/* ============================================================
   Press & Media
   ============================================================ */

.press-list {
    display: flex;
    flex-direction: column;
}

.press-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    transition: opacity var(--transition);
}

.press-item:last-of-type {
    border-bottom: none;
}

.press-item:hover {
    opacity: 0.75;
}

.hidden-press-item {
    display: none !important;
}

.hidden-news-item {
    display: none !important;
}

.press-thumbnail {
    width: 72px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--bg-alt);
    border: 1px solid var(--border-light);
}

.press-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.press-content {
    flex: 1;
    min-width: 0;
}

.press-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.15rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.press-meta {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 400;
}

.show-more-container {
    padding-top: 0.25rem;
}

.show-more-text {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.3rem 0;
    font-family: inherit;
    transition: color var(--transition);
}

.show-more-text:hover {
    color: var(--accent);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0;
    font-weight: 500;
    font-size: 0.84rem;
    cursor: pointer;
    transition: color var(--transition);
    font-family: inherit;
    border: none;
    background: none;
    color: var(--accent);
    position: relative;
}

.btn::after {
    content: '';
    position: absolute;
    bottom: 0.2rem;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent);
    opacity: 0.4;
    transition: opacity var(--transition);
}

.btn:hover::after {
    opacity: 1;
}

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

.btn-primary:hover {
    color: var(--accent-light);
}

.btn-secondary {
    color: var(--text-muted);
}

.btn-secondary:hover {
    color: var(--accent);
}

/* ============================================================
   Projects Grid (kept for future use)
   ============================================================ */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.project-card {
    background-color: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all var(--transition);
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.project-image {
    width: 100%;
    height: 120px;
    background-color: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 500;
}

.project-info {
    padding: 1rem;
}

.project-title {
    font-size: 0.93rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.project-desc {
    font-size: 0.82rem !important;
    margin-bottom: 0.8rem !important;
    color: var(--text-muted);
    line-height: 1.5;
}

.project-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
}

.project-link:hover {
    border-bottom: 1px solid var(--accent);
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
    color: var(--text-light);
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

/* ============================================================
   Theme Toggle
   ============================================================ */

.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ============================================================
   Fade-in Animation (subtle)
   ============================================================ */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Responsive — Tablet
   ============================================================ */

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    .profile-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
        padding: 3rem 0 2rem;
    }

    .profile-image {
        width: 120px;
        height: 120px;
    }

    .name {
        font-size: 1.65rem;
    }

    .contact-row {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

    .nav-bar {
        justify-content: center;
        flex-wrap: wrap;
    }

    .section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 1.2rem;
    }
}

/* ============================================================
   Responsive — Mobile
   ============================================================ */

@media (max-width: 560px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 1rem;
    }

    .profile-hero {
        padding: 2.5rem 0 1.5rem;
    }

    .profile-image {
        width: 100px;
        height: 100px;
    }

    .name {
        font-size: 1.45rem;
    }

    .nav-link {
        padding: 0.35rem 0.6rem;
        font-size: 0.78rem;
    }

    .publication-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pub-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9.5;
    }

    .news-list li {
        grid-template-columns: 45px 1fr;
        gap: 0.75rem;
    }

    .press-item {
        gap: 0.75rem;
    }

    .press-thumbnail {
        width: 56px;
        height: 36px;
    }
}