/* ================================================================
   Nguyen Ha Thanh — Academic Personal Page
   Style: Clean, professional, senior academic
   ================================================================ */

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg:          #ffffff;
    --color-bg-alt:      #f7f7f5;
    --color-bg-dark:     #1a2332;
    --color-bg-darker:   #111b28;
    --color-text:        #1c1c1e;
    --color-text-muted:  #6b7280;
    --color-accent:      #1d4ed8;
    --color-accent-light:#dbeafe;
    --color-border:      #e5e7eb;
    --color-badge:       #d1fae5;
    --color-badge-text:  #065f46;

    --font-serif:  'Merriweather', Georgia, serif;
    --font-sans:   'Inter', system-ui, sans-serif;

    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   16px;

    --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:   0 4px 12px rgba(0,0,0,.10);
    --shadow-lg:   0 10px 30px rgba(0,0,0,.12);

    --max-w:       1080px;
    --section-py:  80px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

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

a:hover {
    text-decoration: underline;
}

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

/* ── Layout ───────────────────────────────────────────────────── */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: var(--section-py) 0;
}

.section-alt {
    background: var(--color-bg-alt);
}

/* ── Navigation ───────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-brand {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: color .2s, background .2s;
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--color-text);
    background: var(--color-bg-alt);
}

.nav-cta {
    background: var(--color-accent) !important;
    color: #fff !important;
    border-radius: var(--radius-sm);
}

.nav-cta:hover {
    background: #1e40af !important;
    color: #fff !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
    padding: 80px 0 72px;
    border-bottom: 1px solid var(--color-border);
}

.hero-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 56px;
    align-items: start;
}

.hero-photo-wrap {
    position: sticky;
    top: 80px;
}

.hero-photo {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    object-fit: cover;
    aspect-ratio: 3/4;
}

.hero-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 12px;
}

.hero-name {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: 8px;
}

.hero-title {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.hero-affil {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.hero-bio {
    font-size: 0.975rem;
    color: var(--color-text);
    line-height: 1.8;
    margin-bottom: 32px;
    max-width: 640px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary {
    display: inline-block;
    padding: 10px 24px;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background .2s, transform .15s;
    text-decoration: none;
}

.btn-primary:hover {
    background: #1e40af;
    transform: translateY(-1px);
    text-decoration: none;
    color: #fff;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1.5px solid var(--color-accent);
    color: var(--color-accent);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background .2s, color .2s;
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
}

/* ── Section Typography ───────────────────────────────────────── */
.section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 16px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--color-accent);
    border-radius: 2px;
}

.section-title.light {
    color: #fff;
}

.section-title.light::after {
    background: rgba(255,255,255,.5);
}

.section-lead {
    font-size: 0.975rem;
    color: var(--color-text-muted);
    max-width: 680px;
    margin-bottom: 32px;
    line-height: 1.8;
}

/* ── Research Tags ────────────────────────────────────────────── */
.tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
}

.research-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ── Timeline ─────────────────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    padding-bottom: 36px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 2.5px solid var(--color-accent);
}

.timeline-period {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.timeline-role {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}

.timeline-org {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.timeline-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    background: var(--color-badge);
    color: var(--color-badge-text);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
}

/* ── Awards ───────────────────────────────────────────────────── */
.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.award-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}

.award-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.award-year {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 8px;
}

.award-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.award-org {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* ── Contact ──────────────────────────────────────────────────── */
.section-contact {
    background: var(--color-bg-dark);
    padding: var(--section-py) 0;
}

.contact-inner {
    text-align: center;
}

.contact-desc {
    font-size: 0.975rem;
    color: rgba(255,255,255,.65);
    max-width: 520px;
    margin: 16px auto 32px;
    line-height: 1.8;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: rgba(255,255,255,.08);
    border: 1.5px solid rgba(255,255,255,.2);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background .2s, border-color .2s;
    text-decoration: none;
    letter-spacing: .01em;
}

.contact-email:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.4);
    text-decoration: none;
    color: #fff;
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
    background: var(--color-bg-darker);
    padding: 28px 0;
    border-top: 1px solid rgba(255,255,255,.06);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.footer-inner p {
    font-size: 0.8125rem;
    color: rgba(255,255,255,.4);
}

.footer-affil {
    font-size: 0.75rem !important;
    color: rgba(255,255,255,.25) !important;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --section-py: 56px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-photo-wrap {
        position: static;
        max-width: 200px;
        margin: 0 auto;
    }

    .hero-text {
        text-align: center;
    }

    .hero-bio {
        margin-left: auto;
        margin-right: auto;
    }

    .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .section-lead {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .tags-grid {
        justify-content: center;
    }

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

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: 12px 0;
        gap: 0;
        box-shadow: var(--shadow-md);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 12px 24px;
        border-radius: 0;
        display: block;
        width: 100%;
    }

    .nav-toggle {
        display: flex;
    }

    .site-header {
        position: sticky;
    }
}

@media (max-width: 480px) {
    .awards-grid {
        grid-template-columns: 1fr;
    }

    .hero-name {
        font-size: 1.75rem;
    }
}
