/* ===== CSS Variables & Reset ===== */
:root {
    --color-bg: #fafaf9;
    --color-surface: #ffffff;
    --color-text: #1a1a1a;
    --color-text-secondary: #555555;
    --color-text-light: #888888;
    --color-primary: #1e40af;
    --color-primary-light: #dbeafe;
    --color-primary-hover: #1a3590;
    --color-accent: #2563eb;
    --color-accent-light: #dbeafe;
    --color-green: #0f5132;
    --color-green-light: #e8f5e9;
    --color-border: #e5e5e5;
    --color-border-light: #f0f0f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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;
    overflow-x: hidden;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

/* ===== Layout ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-text);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--color-primary);
    margin-top: 12px;
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 48px;
    max-width: 600px;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(250, 250, 249, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

.navbar.scrolled {
    border-bottom-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

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

.nav-menu {
    list-style: none;
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    position: relative;
    padding: 4px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

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

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 70px;
    overflow: hidden;
}

.hero-bg-pattern {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(15, 81, 50, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 60% 80%, rgba(15, 81, 50, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
}

.hero-tag {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-primary-light);
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
    color: var(--color-text);
}

.hero-heading {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--color-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.hero-tag-item {
    display: inline-block;
    padding: 4px 14px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 500;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.highlight {
    color: var(--color-primary);
    font-weight: 600;
}

.hero-affiliation {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 32px;
}

.hero-affiliation .divider {
    margin: 0 10px;
    color: var(--color-border);
}

.hero-roles {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.hero-roles a {
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hero-roles a:hover {
    color: var(--color-primary-hover);
}

.hero-roles .divider {
    margin: 0 10px;
    color: var(--color-border);
}

.hero-social {
    display: flex;
    gap: 14px;
    margin-bottom: 28px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    transition: all var(--transition);
}

.social-icon:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
}

/* Hero Image */
.hero-image-wrapper {
    display: flex;
    justify-content: center;
}

.hero-image-container {
    width: 360px;
    height: 420px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent-light));
}

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

.image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.placeholder-active .image-placeholder {
    display: flex;
}

.hero-image + .image-placeholder {
    display: none;
}

.placeholder-active .hero-image {
    display: none;
}

.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    color: var(--color-text-light);
    opacity: 0.5;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-8px); }
    60% { transform: translateX(-50%) translateY(-4px); }
}

/* ===== About ===== */
.about {
    background: var(--color-surface);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-text .lead {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}

.about-text p {
    color: var(--color-text-secondary);
    margin-bottom: 16px;
    line-height: 1.8;
}

/* Research Framework Graphic */
.research-framework {
    margin: 48px 0 40px;
    max-width: 750px;
}

.framework-canvas-wrapper {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.framework-canvas-wrapper:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-border);
}

.framework-canvas-wrapper canvas {
    width: 100%;
    height: 380px;
    display: block;
}

.about-highlights {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.highlight-card {
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    background: var(--color-bg);
    display: flex;
    gap: 16px;
    align-items: start;
    transition: all var(--transition);
}

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

.highlight-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--color-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.highlight-icon svg {
    width: 22px;
    height: 22px;
}

.highlight-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.highlight-card p {
    font-size: 0.88rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

/* ===== Projects ===== */
.projects {
    background: var(--color-bg);
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.project-card {
    display: grid;
    grid-template-columns: 400px 1fr;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border-light);
    transition: all var(--transition);
}

.project-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--color-border);
}

.project-visual {
    position: relative;
    min-height: 300px;
    overflow: hidden;
}

.project-graphic {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

.project-graphic canvas {
    width: 100%;
    height: 100%;
}

.network-graphic {
    background: linear-gradient(135deg, #0f513215, #2563eb10);
}

.finance-graphic {
    background: linear-gradient(135deg, #2563eb10, #7c3aed10);
}

.deployment-graphic {
    background: linear-gradient(135deg, #0f513210, #05966910);
}

[data-project="deployment"] .project-visual {
    min-height: 380px;
}

.spillover-graphic {
    background: linear-gradient(135deg, #2563eb08, #7c3aed10);
}

.project-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 2;
}

.project-content {
    padding: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-content h3 {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.35;
}

.project-question {
    font-style: italic;
    color: var(--color-primary);
    font-size: 0.95rem;
    margin-bottom: 14px;
    font-weight: 500;
}

.project-content > p:last-of-type {
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* ===== Publications ===== */
.publications {
    background: var(--color-surface);
}

.pub-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.pub-filter {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: transparent;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
}

.pub-filter:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pub-filter.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

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

.pub-item {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 24px;
    padding: 28px 0;
    border-bottom: 1px solid var(--color-border-light);
    transition: opacity 0.3s, transform 0.3s;
}

.pub-item.hidden {
    display: none;
}

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

.pub-year {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text-light);
    padding-top: 4px;
}

.pub-venue {
    margin-bottom: 8px;
}

.venue-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.journal-badge {
    background: var(--color-green-light);
    color: var(--color-green);
}

.conf-badge {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.wp-badge {
    background: #fef3c7;
    color: #92400e;
}

.report-badge {
    background: #f3e8ff;
    color: #6b21a8;
}

.pub-citation {
    font-size: 0.88rem;
    color: var(--color-text-light);
    line-height: 1.5;
    font-style: normal;
}

.pub-link {
    margin-bottom: 6px;
}

.pub-link a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Working Papers section */
.working-papers {
    background: var(--color-bg);
}

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

.pub-authors {
    font-size: 0.88rem;
    color: var(--color-text-light);
    line-height: 1.5;
    margin-bottom: 8px;
}

.pub-abstract-toggle {
    font-size: 0.82rem;
    color: var(--color-accent);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    user-select: none;
}

.pub-abstract-toggle:hover {
    color: var(--color-primary);
}

.pub-abstract-toggle svg {
    transition: transform var(--transition);
}

.pub-abstract-toggle.open svg {
    transform: rotate(180deg);
}

.pub-abstract {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.pub-abstract.open {
    max-height: 800px;
    opacity: 1;
}

.pub-abstract p {
    padding-top: 10px;
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    border-left: 3px solid var(--color-primary-light);
    padding-left: 16px;
}

/* ===== Video ===== */
.video-section {
    background: var(--color-bg);
}

.video-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #111;
    box-shadow: var(--shadow-xl);
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #666;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.video-placeholder svg {
    color: rgba(255,255,255,0.3);
}

.video-placeholder p {
    color: rgba(255,255,255,0.5);
    font-size: 1rem;
}

.video-placeholder span {
    color: rgba(255,255,255,0.25);
    font-size: 0.8rem;
}

.video-container video:valid ~ .video-placeholder {
    display: none;
}

/* ===== Contact ===== */
.contact {
    background: var(--color-surface);
}

.contact-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.contact-card {
    text-align: center;
    padding: 36px 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    background: var(--color-bg);
    transition: all var(--transition);
}

.contact-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.contact-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 14px;
    background: var(--color-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.contact-icon svg {
    width: 24px;
    height: 24px;
}

.contact-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.contact-card p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* ===== Footer ===== */
.footer {
    padding: 32px 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border-light);
}

/* ===== Scroll Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .hero-heading {
        font-size: 1.3rem;
    }

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

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

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

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

    .hero-roles .divider {
        display: none;
    }

    .hero-roles span {
        display: block;
    }

    .hero-image-container {
        width: 280px;
        height: 330px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .project-card {
        grid-template-columns: 1fr;
    }

    .project-visual {
        min-height: 220px;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(250, 250, 249, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px 24px;
        gap: 0;
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
    }

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

    .nav-menu li {
        padding: 12px 0;
        border-bottom: 1px solid var(--color-border-light);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.open span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero {
        padding-top: 90px;
        min-height: auto;
        padding-bottom: 60px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-heading {
        font-size: 1.15rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-affiliation {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .hero-affiliation .divider {
        display: none;
    }

    .section {
        padding: 64px 0;
    }

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

    .pub-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .pub-year {
        padding-top: 0;
    }

    .project-content {
        padding: 24px;
    }

    .project-content h3 {
        font-size: 1.15rem;
    }

    .scroll-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-image-container {
        width: 220px;
        height: 270px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 260px;
    }

    .pub-filters {
        gap: 6px;
    }

    .pub-filter {
        padding: 6px 14px;
        font-size: 0.82rem;
    }
}
