/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary:       #004F71;
    --primary-dark:  #003a52;
    --primary-light: #006fa0;
    --hero-bg:       #0b2535;
    --text:          #1a2535;
    --text-2:        #445568;
    --text-muted:    #6b7c90;
    --bg:            #ffffff;
    --bg-alt:        #f0f5f9;
    --border:        #cdd8e3;
    --border-light:  #e4ecf2;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.07);
    --shadow:        0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:     0 12px 32px rgba(0,0,0,0.1);
    --radius:        7px;
    --radius-lg:     12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-light);
}

/* =============================================
   LAYOUT
   ============================================= */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* =============================================
   NAVIGATION
   ============================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    transition: box-shadow 0.3s;
}

.navbar.scrolled {
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.nav-brand:hover {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0.125rem;
}

.nav-link {
    display: block;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-2);
    border-radius: 5px;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: rgba(0, 79, 113, 0.07);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s;
    border-radius: 2px;
}

/* =============================================
   HERO
   ============================================= */
.hero {
    background: var(--hero-bg);
    color: white;
    padding: 110px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 60%, rgba(0, 111, 160, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 79, 113, 0.12) 0%, transparent 50%);
    pointer-events: none;
}

.hero-layout {
    display: flex;
    align-items: center;
    gap: 3.5rem;
    position: relative;
}

/* Avatar */
.avatar {
    width: 136px;
    height: 136px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(135deg, rgba(0, 111, 160, 0.45), rgba(0, 58, 82, 0.7));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Lora', Georgia, serif;
    font-size: 2.25rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 2px;
}

.avatar img + .avatar-fallback {
    display: none;
}

/* When img fails to load, show fallback */
.avatar--initials .avatar-fallback {
    display: flex;
}

.hero-body {
    flex: 1;
    min-width: 0;
}

.hero-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.tag {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.09);
    padding: 0.25rem 0.7rem;
    border-radius: 100px;
    letter-spacing: 0.02em;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

a.tag:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.25);
}

.hero-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: white;
    margin-bottom: 0.2rem;
}

.hero-role {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.2rem;
    font-weight: 400;
}

.hero-degrees {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 1.35rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.hero-bio {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.75;
    margin-bottom: 1.5rem;
    text-align: justify;
}

.hero-stats {
    display: flex;
    gap: 2.25rem;
    margin-bottom: 1.75rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-num {
    font-size: 1.85rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Buttons */
.btn-primary {
    padding: 0.6rem 1.4rem;
    background: white;
    color: var(--hero-bg);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    border: 2px solid white;
    display: inline-block;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--hero-bg);
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 0.6rem 1.4rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-block;
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.7);
    color: white;
    background: rgba(255, 255, 255, 0.07);
}

.btn-ghost {
    padding: 0.6rem 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-block;
}

.btn-ghost:hover {
    color: rgba(255, 255, 255, 0.85);
}

/* =============================================
   SECTIONS
   ============================================= */
.section {
    padding: 80px 0;
}

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

.section-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.85rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 2.75rem;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: -2.25rem;
    margin-bottom: 2.75rem;
}

/* =============================================
   ABOUT
   ============================================= */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 4rem;
    align-items: start;
}

.about-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-2);
}

.about-text--full {
    max-width: 100%;
    text-align: justify;
}

.about-text p {
    margin-bottom: 1.15rem;
}

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

.about-text strong {
    color: var(--text);
    font-weight: 600;
}

.about-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.info-block ul {
    list-style: none;
    font-size: 0.875rem;
    color: var(--text-2);
    line-height: 1.9;
}

.link-list li a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
}

.link-list li a:hover {
    color: var(--primary-light);
}

/* =============================================
   RESEARCH
   ============================================= */
.research-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.research-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.75rem;
    transition: all 0.25s;
}

.research-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.rc-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
    opacity: 0.6;
}

.research-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.7rem;
    line-height: 1.4;
}

.research-card p {
    font-size: 0.875rem;
    color: var(--text-2);
    line-height: 1.7;
}

/* =============================================
   PUBLICATIONS
   ============================================= */
.pub-year-group {
    margin-bottom: 2.75rem;
}

.pub-year-group:last-child {
    margin-bottom: 0;
}

.pub-year-header {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 0;
}

.pub-list {
    margin-left: 0;
    padding-left: 0;
}

.pub-item {
    display: flex;
    gap: 1rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
}

.pub-item:last-child {
    border-bottom: none;
}

.pub-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.05rem;
    opacity: 0.75;
}

.pub-authors {
    font-size: 0.845rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    line-height: 1.55;
}

.pub-authors strong {
    color: var(--text);
    font-weight: 600;
}

.pub-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

.pub-meta {
    font-size: 0.825rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.pub-meta em {
    font-style: italic;
    color: var(--text-2);
}

.pub-meta a {
    color: var(--primary);
    font-size: 0.8rem;
}

.pub-meta a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* =============================================
   BACKGROUND (EDUCATION & EXPERIENCE)
   ============================================= */
.bg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.bg-col-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 1.75rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.25rem;
    border-left: 2px solid var(--border);
}

.tl-item {
    position: relative;
    padding-bottom: 2rem;
}

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

.tl-item::before {
    content: '';
    position: absolute;
    left: -1.625rem;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-alt);
    z-index: 1;
}

.tl-period {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    opacity: 0.8;
    margin-bottom: 0.3rem;
    letter-spacing: 0.01em;
}

.tl-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
    line-height: 1.4;
}

.tl-place {
    font-size: 0.825rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.tl-note {
    font-size: 0.795rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.tl-note em {
    font-style: italic;
}

/* =============================================
   TEACHING
   ============================================= */
.teaching-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.teaching-col-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

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

.teach-item {
    display: flex;
    gap: 1.1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
}

.teach-item:last-child {
    border-bottom: none;
}

.teach-term {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 68px;
    flex-shrink: 0;
    padding-top: 0.1rem;
    line-height: 1.4;
}

.teach-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
    line-height: 1.4;
}

.teach-meta {
    font-size: 0.795rem;
    color: var(--text-muted);
}

.teach-thesis {
    font-size: 0.795rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* =============================================
   CONTACT
   ============================================= */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 4rem;
    align-items: start;
}

.contact-intro {
    font-size: 1rem;
    color: var(--text-2);
    line-height: 1.75;
    margin-bottom: 1.4rem;
    max-width: 460px;
}

.contact-email {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.1rem;
    margin-bottom: 2rem;
    transition: all 0.2s;
}

.contact-email:hover {
    color: var(--primary-light);
    border-color: var(--primary-light);
}

.contact-rows {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-row {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    align-items: baseline;
}

.contact-label {
    font-weight: 600;
    color: var(--text);
    min-width: 64px;
    flex-shrink: 0;
}

.contact-row span:last-child {
    color: var(--text-2);
    line-height: 1.5;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.clc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: all 0.2s;
    background: var(--bg);
}

.clc:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(3px);
    box-shadow: var(--shadow-sm);
}

.clc-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.clc-arrow {
    color: var(--border);
    font-size: 1rem;
    transition: color 0.2s;
}

.clc:hover .clc-arrow {
    color: var(--primary);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: var(--text);
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.825rem;
}

.footer-legal-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.825rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s;
}

.footer-legal-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* =============================================
   LEGAL MODAL
   ============================================= */
.legal-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 500;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.legal-modal.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.legal-modal-box {
    background: var(--bg);
    border-radius: var(--radius-lg);
    max-width: 660px;
    width: 100%;
    padding: 2.5rem;
    position: relative;
    margin: auto;
}

.legal-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.legal-modal-close:hover {
    color: var(--text);
}

.legal-modal-box h2 {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

.legal-modal-box h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    margin: 1.5rem 0 0.5rem;
}

.legal-modal-box p {
    font-size: 0.875rem;
    color: var(--text-2);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.legal-modal-box a {
    color: var(--primary);
}

.legal-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 2rem 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .research-grid {
        grid-template-columns: 1fr;
    }

    .bg-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .teaching-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 58px;
        left: 0;
        right: 0;
        background: white;
        border-bottom: 1px solid var(--border-light);
        flex-direction: column;
        padding: 0.75rem 0;
        gap: 0;
        transform: translateY(-110%);
        opacity: 0;
        transition: transform 0.3s, opacity 0.3s;
        box-shadow: var(--shadow);
        z-index: 99;
    }

    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-link {
        padding: 0.7rem 1.5rem;
        border-radius: 0;
        font-size: 0.9rem;
    }

    .hamburger {
        display: flex;
    }

    .hero {
        padding: 90px 0 60px;
    }

    .hero-layout {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

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

    .hero-bio {
        max-width: 100%;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .section {
        padding: 60px 0;
    }

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

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

    .nav-container {
        padding: 0 1.25rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 1.75rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
}
