:root {
    color-scheme: light;
    --bg-primary: #f6f7f9;
    --bg-secondary: #ffffff;
    --bg-soft: #eef3f7;
    --bg-card: #ffffff;
    --text-primary: #18212f;
    --text-secondary: #4b5565;
    --text-muted: #687385;
    --accent: #2c5aa0;
    --accent-strong: #1a3a5c;
    --accent-warm: #c78323;
    --accent-soft: #eaf0fa;
    --accent-border: #9db6df;
    --warm-soft: #fff2df;
    --navbar-bg: rgba(255, 255, 255, 0.92);
    --border-color: #dfe5ec;
    --shadow: 0 18px 45px rgba(24, 33, 47, 0.09);
    --shadow-soft: 0 10px 25px rgba(24, 33, 47, 0.08);
    --hero-bg: linear-gradient(135deg, #111d2d 0%, #2c5aa0 58%, #edf2fb 58%, #ffffff 100%);
}

body.dark-mode {
    color-scheme: dark;
    --bg-primary: #101419;
    --bg-secondary: #161c23;
    --bg-soft: #1c252d;
    --bg-card: #1b232c;
    --text-primary: #edf2f7;
    --text-secondary: #c2ccd6;
    --text-muted: #9aa8b7;
    --accent: #6f9ee8;
    --accent-strong: #a9c7f5;
    --accent-warm: #f0b45b;
    --accent-soft: #17243a;
    --accent-border: #496a9f;
    --warm-soft: #3a2b18;
    --navbar-bg: rgba(16, 20, 25, 0.92);
    --border-color: #2c3743;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.26);
    --hero-bg: linear-gradient(135deg, #0d1420 0%, #1a3a5c 58%, #182129 58%, #101419 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.6;
    transition: background-color 0.25s ease, color 0.25s ease;
}

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

a {
    color: inherit;
}

section {
    padding: 88px 0;
    scroll-margin-top: 92px;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-warm), var(--accent));
}

#back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    width: 46px;
    height: 46px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--accent-strong);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-size: 1.3rem;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

#back-to-top:hover,
#back-to-top:focus-visible {
    border-color: var(--accent);
    outline: none;
}

.navbar {
    position: fixed;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(18px);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
}

.logo {
    color: var(--text-primary);
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

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

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 11px;
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
    background: var(--bg-soft);
    color: var(--accent-strong);
    outline: none;
}

#dark-mode-toggle {
    min-width: 58px;
    min-height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 750;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#dark-mode-toggle:hover,
#dark-mode-toggle:focus-visible {
    border-color: var(--accent);
    color: var(--accent-strong);
    outline: none;
}

.hero {
    min-height: 720px;
    display: flex;
    align-items: center;
    margin-top: 72px;
    padding: 96px 0;
    background: var(--hero-bg);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    align-items: center;
    gap: 56px;
}

.hero-content {
    color: #ffffff;
}

body.dark-mode .hero-content {
    color: var(--text-primary);
}

.eyebrow,
.section-kicker,
.project-type,
.award-label {
    color: var(--accent-warm);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 760px;
    margin-top: 12px;
    font-size: clamp(3rem, 7vw, 5.8rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.hero h2 {
    min-height: 44px;
    margin-top: 20px;
    color: #d9eef1;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    font-weight: 500;
}

body.dark-mode .hero h2 {
    color: var(--text-secondary);
}

.typed-cursor {
    display: inline-block;
    color: var(--accent-warm);
    font-weight: 300;
    animation: blink 0.75s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-summary {
    max-width: 680px;
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.08rem;
}

body.dark-mode .hero-summary {
    color: var(--text-secondary);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-2px);
    outline: none;
}

.btn-primary {
    background: #ffffff;
    color: #1a3a5c;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}

.btn-secondary {
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

body.dark-mode .btn-secondary {
    border-color: var(--border-color);
    color: var(--text-primary);
}

.hero-panel {
    display: grid;
    gap: 14px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

body.dark-mode .hero-panel {
    border-color: var(--border-color);
    background: rgba(27, 35, 44, 0.82);
}

.metric {
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
}

.metric-value {
    display: block;
    color: var(--accent-strong);
    font-size: 1.25rem;
    font-weight: 850;
}

.metric-label {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.section-heading {
    max-width: 760px;
    margin: 0 auto 36px;
    text-align: center;
}

.section-title {
    margin-top: 8px;
    color: var(--text-primary);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    letter-spacing: 0;
}

.section-title::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    margin: 18px auto 0;
    border-radius: 999px;
    background: var(--accent);
}

.about,
.projects,
.awards {
    background: var(--bg-secondary);
}

.skills,
.experience,
.publications,
.contact {
    background: var(--bg-primary);
}

.about-content {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    max-width: 980px;
    margin: 0 auto;
}

.about-image img {
    width: 280px;
    height: 280px;
    border: 8px solid var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow);
    object-fit: cover;
}

.about-text {
    padding: 28px;
    border-left: 4px solid var(--accent);
    background: var(--bg-card);
    box-shadow: var(--shadow-soft);
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.04rem;
}

.about-text p + p {
    margin-top: 16px;
}

.skills-grid,
.awards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.skill-card,
.project-card,
.publication-item,
.award-card,
.experience-card,
.contact-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.skill-card.revealed,
.project-card.revealed,
.publication-item.revealed,
.award-card.revealed,
.experience-card.revealed,
.contact-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

.skill-card {
    padding: 24px;
}

.skill-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-border);
    box-shadow: var(--shadow);
}

.skill-card h3 {
    margin-bottom: 14px;
    color: var(--accent-strong);
    font-size: 1.1rem;
}

.skill-card ul,
.workshop-list {
    list-style: none;
}

.skill-card li,
.workshop-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.skill-card li:last-child,
.workshop-list li:last-child {
    border-bottom: none;
}

.experience-card {
    max-width: 980px;
    margin: 0 auto 18px;
    padding: 32px;
}

.experience-card:last-child {
    margin-bottom: 0;
}

.experience-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.experience-card h3 {
    color: var(--accent-strong);
    font-size: 1.35rem;
}

.experience-card p {
    color: var(--text-secondary);
}

.date-pill,
.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--warm-soft);
    color: var(--accent-warm);
    font-size: 0.8rem;
    font-weight: 850;
    white-space: nowrap;
}

.date-pill {
    padding: 8px 12px;
}

.status-badge {
    margin-left: 6px;
    padding: 4px 8px;
    vertical-align: middle;
}

.role-list {
    display: grid;
    gap: 10px;
    margin-top: 24px;
    padding-left: 20px;
    color: var(--text-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
    text-decoration: none;
}

.project-card-link:hover,
.project-card-link:focus-visible,
.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-border);
    box-shadow: var(--shadow);
    outline: none;
}

.project-featured {
    grid-column: span 2;
}

.project-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-soft);
    object-fit: cover;
    object-position: top center;
}

.project-thumb-placeholder {
    display: grid;
    place-items: center;
    color: var(--accent-strong);
    font-size: 2.3rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.project-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px;
}

.project-card h3 {
    margin-top: 8px;
    color: var(--text-primary);
    font-size: 1.18rem;
    line-height: 1.3;
}

.project-card p:not(.project-type) {
    margin-top: 12px;
    color: var(--text-muted);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 750;
}

.project-link {
    margin-top: auto;
    padding-top: 18px;
    color: var(--accent-strong);
    font-weight: 850;
}

.publications-content {
    display: grid;
    gap: 18px;
    max-width: 900px;
    margin: 0 auto;
}

.publication-item {
    padding: 26px;
}

.publication-item h3 {
    margin-bottom: 10px;
    color: var(--accent-strong);
    font-size: 1.2rem;
}

.publication-item p {
    color: var(--text-secondary);
}

.publication-item p + p {
    margin-top: 6px;
}

.publication-item em {
    color: var(--text-muted);
}

.awards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 900px;
    margin: 0 auto;
}

.award-card {
    padding: 28px;
}

.award-card h3 {
    margin: 8px 0 10px;
    color: var(--accent-strong);
}

.award-card p {
    color: var(--text-secondary);
}

.award-date {
    margin-top: 16px;
    font-weight: 800;
}

.contact-content {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.contact-content > p {
    color: var(--text-secondary);
    font-size: 1.04rem;
}

.contact-info {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.contact-item {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    min-width: min(100%, 360px);
    padding: 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-item:hover,
.contact-item:focus-visible {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
    outline: none;
}

.contact-item strong {
    color: var(--accent-strong);
}

.contact-item span {
    color: var(--text-secondary);
}

.detail-theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;
    min-width: 62px;
    min-height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-weight: 750;
}

.detail-theme-toggle:hover,
.detail-theme-toggle:focus-visible {
    border-color: var(--accent);
    color: var(--accent-strong);
    outline: none;
}

.project-detail {
    color: var(--text-primary);
}

.project-section,
.metric-card,
.model-card,
.performance-card,
.recommendation-card,
.insight-card,
.visualization-card {
    background: var(--bg-card) !important;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft) !important;
}

.project-section h2,
.project-section h3,
.metric-value,
.model-card h3,
.performance-card h3,
.recommendation-card h3,
.insight-card h3 {
    color: var(--accent-strong) !important;
}

.back-link {
    color: var(--accent-strong) !important;
    background: var(--accent-soft) !important;
}

.tech-badge {
    background: var(--accent) !important;
}

footer {
    padding: 28px 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 980px) {
    .nav-container {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding-top: 14px;
        padding-bottom: 12px;
    }

    .nav-actions {
        width: 100%;
    }

    .nav-links {
        flex: 1;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .nav-links a {
        white-space: nowrap;
    }

    .hero {
        margin-top: 116px;
    }

    .hero-grid,
    .about-content {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        max-width: 620px;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-featured {
        grid-column: span 2;
    }
}

@media (max-width: 680px) {
    section {
        padding: 64px 0;
        scroll-margin-top: 128px;
    }

    .container {
        padding: 0 18px;
    }

    .hero {
        min-height: auto;
        margin-top: 116px;
        padding: 64px 0;
        background: linear-gradient(180deg, #111d2d 0%, #2c5aa0 100%);
    }

    body.dark-mode .hero {
        background: linear-gradient(180deg, #0d1420 0%, #1a3a5c 100%);
    }

    .hero-grid {
        gap: 32px;
    }

    .hero-content {
        color: #ffffff;
    }

    .hero h2 {
        min-height: 70px;
    }

    .hero-actions,
    .experience-header {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .hero-panel,
    .about-text,
    .experience-card,
    .publication-item,
    .award-card {
        padding: 22px;
    }

    .about-image img {
        width: 220px;
        height: 220px;
        margin: 0 auto;
    }

    .about-text {
        border-left: none;
        border-top: 4px solid var(--accent);
    }

    .skills-grid,
    .projects-grid,
    .awards-grid {
        grid-template-columns: 1fr;
    }

    .project-featured {
        grid-column: span 1;
    }

    #back-to-top {
        right: 18px;
        bottom: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
