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

:root {
    --primary: #1b2a4a;
    --accent: #2563eb;
    --accent-soft: rgba(37,99,235,0.08);
    --text: #1e293b;
    --text-secondary: #64748b;
    --bg: #ffffff;
    --bg-warm: #fafaf9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --max-w: 860px;
    --radius: 10px;
}


html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.75;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

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

/* ===== Nav ===== */
nav {
    position: fixed; top: 0; width: 100%; z-index: 100;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.3s;
}
.nav-inner {
    max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between; height: 56px;
}
.nav-name { font-weight: 700; color: var(--primary); font-size: 1rem; }
.nav-name:hover { text-decoration: none; }
.nav-menu { display: flex; gap: 1.75rem; list-style: none; }
.nav-menu a { color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; text-decoration: none; }
.nav-menu a:hover { color: var(--primary); }

/* ===== Hero ===== */
.hero {
    max-width: var(--max-w); margin: 0 auto; padding: 100px 2rem 24px;
    display: flex; gap: 2.5rem; align-items: flex-start;
}
.hero-img { flex-shrink: 0; text-align: center; }
.hero-img img {
    width: 160px; height: 160px; border-radius: 50%;
    object-fit: cover; border: 4px solid var(--border-light);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.hero-contact {
    display: flex; flex-direction: column; gap: 0.4rem; margin-top: 1rem;
}
.hero-contact a {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: 0.82rem; font-weight: 500; color: var(--text-secondary);
    text-decoration: none; transition: color 0.15s;
}
.hero-contact a:hover { color: var(--accent); }
.hero-contact i { width: 16px; text-align: center; color: var(--accent); font-size: 0.85rem; }
.hero-body h1 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 2.2rem; font-weight: 700; color: var(--primary);
    letter-spacing: -0.5px; margin-bottom: 0.75rem;
}
.hero-body p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 0.5rem; }
.hero-body p strong { color: var(--text); font-weight: 600; }
.hero-body p a { font-weight: 500; }

/* ===== Section ===== */
.section { max-width: var(--max-w); margin: 0 auto; padding: 3rem 2rem; }
.section + .section { border-top: 1px solid var(--border-light); }
.section-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.35rem; font-weight: 700; color: var(--primary);
    margin-bottom: 0.3rem; letter-spacing: -0.3px;
}
.section-sub { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1.5rem; }

/* ===== Research ===== */
.research-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.r-card {
    padding: 1.25rem; border-radius: var(--radius);
    background: var(--bg-warm); border: 1px solid var(--border-light);
    transition: border-color 0.2s;
}
.r-card:hover { border-color: var(--border); }
.r-card h3 { font-size: 0.9rem; font-weight: 600; color: var(--primary); margin-bottom: 0.3rem; }
.r-card h3 i { color: var(--accent); margin-right: 0.4rem; font-size: 0.85rem; }
.r-card p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

/* ===== Experience ===== */
.experience-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem;
}
.exp-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
    padding: 1.25rem 1rem; background: var(--bg-warm); border: 1px solid var(--border-light);
    border-radius: var(--radius); text-align: center; transition: transform 0.2s, box-shadow 0.2s;
}
.exp-card:hover { transform: translateY(-3px); box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.exp-logo-wrap { width: 100%; height: 40px; display: flex; align-items: center; justify-content: center; }
.company-logo { max-width: 40px; max-height: 40px; border-radius: 8px; object-fit: contain; }
.company-logo-wide { max-width: 140px; max-height: 45px; border-radius: 0; }
.company-logo-xl { max-width: 500px; max-height: 100px; border-radius: 0; }
.exp-info { display: flex; flex-direction: column; gap: 0.15rem; }
.exp-company { font-size: 0.92rem; font-weight: 600; color: var(--primary); }
.exp-role { font-size: 0.78rem; color: var(--text-secondary); }

/* ===== Publications ===== */
.pub-year {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.05rem; font-weight: 700; color: var(--primary);
    margin-top: 1.75rem; margin-bottom: 0.5rem;
    padding-bottom: 0.4rem; border-bottom: 2px solid var(--accent-soft);
    display: inline-block;
}
.pub {
    display: flex; gap: 0.75rem; padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}
.pub:last-child { border-bottom: none; }
.pub-badge {
    flex-shrink: 0; width: 100px; padding-top: 3px;
}
.pub-badge span {
    display: inline-block; font-size: 0.68rem; font-weight: 600;
    padding: 0.2rem 0.5rem; border-radius: 4px;
    background: var(--bg-warm); color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.3px;
    border: 1px solid var(--border-light);
}
.pub-body h3 { font-size: 0.88rem; font-weight: 600; color: var(--text); line-height: 1.45; margin-bottom: 0.15rem; }
.pub-body p { font-size: 0.78rem; color: var(--text-secondary); }

/* ===== Service ===== */
.svc-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem;
}
.svc-item {
    padding: 0.6rem 0.8rem;
    background: var(--bg-warm);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}
.svc-name { display: block; font-size: 0.85rem; font-weight: 600; color: var(--primary); }
.svc-years { display: block; font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.15rem; }

/* ===== Back to top ===== */
.back-to-top {
    position: fixed; bottom: 2rem; right: 2rem; z-index: 99;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--accent); color: #fff; border: none;
    cursor: pointer; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    transform: translateY(8px);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: #1d4ed8; }

/* ===== Publication row hover ===== */
.pub { transition: background 0.15s; border-radius: 6px; padding-left: 0.5rem; padding-right: 0.5rem; }
.pub:hover { background: var(--bg-warm); }

/* ===== Footer ===== */
footer {
    max-width: var(--max-w); margin: 0 auto;
    padding: 1.5rem 2rem; font-size: 0.75rem;
    color: var(--text-secondary); border-top: 1px solid var(--border-light);
}

/* ===== Scroll-spy active nav ===== */
.nav-menu a.active { color: var(--accent); font-weight: 600; }

/* ===== Section fade-in ===== */
.reveal {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== Nav toggle ===== */
.nav-toggle {
    display: none;
    flex-direction: column; justify-content: center; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--primary); border-radius: 2px; transition: all 0.2s;
}

/* ===== Publication title links ===== */
.pub-body h3 a {
    color: var(--text); text-decoration: none;
}
.pub-body h3 a:hover { color: var(--accent); }

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .hero { flex-direction: column; align-items: center; text-align: center; padding-top: 80px; }
    .hero-img img { width: 130px; height: 130px; }
    .hero-contact { align-items: center; }
    .research-grid { grid-template-columns: 1fr; }
    .experience-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-toggle { display: flex; }
    .nav-menu {
        display: none; flex-direction: column; gap: 0;
        position: absolute; top: 56px; left: 0; right: 0;
        background: rgba(255,255,255,0.98); border-bottom: 1px solid var(--border-light);
        padding: 0.5rem 0;
    }
    .nav-menu.open { display: flex; }
    .nav-menu li { padding: 0; }
    .nav-menu a { display: block; padding: 0.75rem 2rem; font-size: 0.95rem; }
    .svc-grid { grid-template-columns: repeat(2, 1fr); }
    .pub { flex-direction: column; gap: 0.3rem; }
    .pub-badge { width: auto; }
}
