:root {
    --ink: #15233f;
    --muted: #66738b;
    --paper: #f7f9fc;
    --white: #ffffff;
    --line: #dfe6f1;
    --blue: #335fae;
    --blue-deep: #21498e;
    --blue-soft: #e9f0fc;
    --violet: #7557b8;
    --shadow: 0 24px 70px rgba(19, 37, 74, 0.12);
    --radius-lg: 28px;
    --radius-md: 18px;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 92px;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 84% 5%, rgba(80, 118, 188, 0.16), transparent 30rem),
        linear-gradient(180deg, #f7f9fc 0%, #eef3fa 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

body.modal-open { overflow: hidden; }

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    opacity: 0.18;
    background-image: url(../images/bg/bg5.png);
}

a { color: var(--blue); }
a:hover, a:focus { color: var(--blue-deep); text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid #f3b63d; outline-offset: 4px; }

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.view-panel[hidden] { display: none !important; }

.error-page {
    min-height: 100vh;
    padding-block: clamp(100px, 18vh, 180px);
}
.error-page h1 { margin: 0; font-size: clamp(44px, 8vw, 82px); line-height: 1; }
.error-page p:not(.section-kicker) { color: var(--muted); font-size: 18px; }
.error-page a { font-weight: 750; }

.skip-link {
    position: fixed;
    left: 16px;
    top: -80px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--ink);
    color: white;
}
.skip-link:focus { top: 16px; color: white; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    border-bottom: 1px solid rgba(213, 223, 239, 0.86);
    background: rgba(247, 249, 252, 0.9);
    backdrop-filter: blur(16px);
}

.header-inner, .footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-inner { min-height: 76px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 750;
    letter-spacing: -0.02em;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue);
    color: white;
    font-size: 14px;
}

.primary-nav { display: flex; align-items: center; gap: 10px; }
.primary-nav a, .view-toggle, .back-overview {
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 14px;
}
.primary-nav a:hover, .view-toggle:hover { color: var(--blue); background: var(--blue-soft); }
.view-toggle { border: 1px solid #cbd7ea; color: var(--blue); }
.view-toggle.active { background: var(--blue); border-color: var(--blue); color: white; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    align-items: center;
    gap: clamp(32px, 5vw, 64px);
    min-height: auto;
    padding-block: 36px 32px;
}

.eyebrow, .section-kicker {
    margin: 0 0 16px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 760px;
    margin: 0;
    color: var(--ink);
    font-size: clamp(38px, 4.1vw, 58px);
    font-weight: 760;
    letter-spacing: -0.055em;
    line-height: 0.98;
    text-transform: none;
}

.hero-lede {
    max-width: 680px;
    margin: 30px 0 0;
    color: var(--muted);
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.55;
}

.about-label { margin: 0 0 22px; color: var(--blue); font-size: clamp(24px, 2.5vw, 32px); font-weight: 780; line-height: 1.2; }
.hero-interests { margin: 22px 0 0; line-height: 1.7; }
.profile-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.profile-links a, .connect-links a, .paper-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 750;
}
.profile-links a {
    padding: 10px 16px;
    border: 1px solid #ccd7e9;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
}

.section { padding-block: clamp(82px, 10vw, 132px); }
.section-heading { margin-bottom: 44px; }
.section-heading h2, .connect-section h2, .gallery-heading h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(34px, 4.5vw, 56px);
    font-weight: 740;
    letter-spacing: -0.045em;
    line-height: 1.05;
    text-transform: none;
}
.split-heading { display: flex; align-items: end; justify-content: space-between; gap: 48px; }
.split-heading > p { max-width: 410px; margin: 0; color: var(--muted); }

.publications-section .section-heading { margin-inline: 0; }
.research-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 1080px; margin: 0 0 44px; }
.research-intro > p { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.75; }
.research-intro .research-tags { margin-top: 0; }
.research-intro .lead-copy { color: var(--ink); font-size: clamp(23px, 2.5vw, 30px); font-weight: 640; letter-spacing: -0.025em; line-height: 1.45; }
.research-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.research-tags span { padding: 7px 12px; border-radius: 7px; background: var(--blue-soft); color: var(--blue-deep); font-size: 13px; font-weight: 750; }
.about-figure { margin: 0; }
.about-slides { display: block; position: relative; aspect-ratio: 2088 / 2736; overflow: hidden; border-radius: var(--radius-lg); background: var(--blue-soft); box-shadow: var(--shadow); cursor: zoom-in; }
.about-slide { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .65s ease; }
.about-slide.is-active { opacity: 1; }
.about-lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 64px 64px 24px; border: 0; background: transparent; color: white; }
.about-lightbox[open] { display: grid; place-items: center; }
.about-lightbox::backdrop { background: rgba(7, 14, 29, .9); backdrop-filter: blur(8px); }
.about-lightbox-image { display: block; max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: 10px; }
.about-lightbox button { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; background: #15233f; color: white; font: inherit; font-size: 32px; line-height: 1; cursor: pointer; }
.about-lightbox button:hover { background: var(--blue); }
.about-lightbox-close { top: 14px; right: 14px; }
.about-lightbox-prev { top: calc(50% - 22px); left: 12px; }
.about-lightbox-next { top: calc(50% - 22px); right: 12px; }
@media (prefers-reduced-motion: reduce) { .about-slide { transition: none; } }

.publications-section { border-top: 1px solid var(--line); background: #fff; padding-top: clamp(41px, 5vw, 66px); padding-bottom: 24px; }
.research-demo-band { display: flow-root; background: #fff; padding-bottom: 32px; }
.research-demo-band .tf-demo { margin-top: 0; }
.publication-list { border-top: 1px solid var(--line); }
.publication-card {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 28px;
    padding: 34px 10px;
    border-bottom: 1px solid var(--line);
    transition: transform .2s ease, background .2s ease;
}
.publication-card:last-child { border-bottom: 0; padding-bottom: 12px; }
.publications-section { padding-bottom: 8px; }
.publication-card:hover { transform: translateX(5px); }
.publication-meta { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.publication-meta .year { color: var(--blue); font-size: 27px; font-weight: 780; letter-spacing: -0.04em; }
.publication-aside { min-width: 0; }
.research-gif { display: block; width: 100%; height: auto; margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: #edf1f6; }
.research-image-link { display: block; margin-top: 18px; border-radius: 12px; cursor: zoom-in; }
.research-still { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
.publication-card h3 { max-width: 900px; margin: 0; color: var(--ink); font-size: clamp(20px, 2.1vw, 27px); font-weight: 720; letter-spacing: -0.025em; line-height: 1.25; }
.publication-card p { max-width: 850px; margin: 10px 0 0; color: var(--muted); }
.publication-card .authors { color: #54627a; font-size: 14px; line-height: 1.55; }
.publication-card .authors strong { color: var(--violet); }
.publication-card .publication-award { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 7px 12px; border-radius: 7px; background: #24334e; color: #ffdc73; font-size: 14px; font-weight: 800; }
.paper-link { margin-top: 13px; font-size: 14px; }
.featured-publication { margin-top: 12px; padding-inline: 22px; border: 1px solid #cedaf0; border-radius: var(--radius-md); background: linear-gradient(120deg, #f4f7fd, #ecf2fc); }
.featured-publication + .publication-card { border-top: 0; }

.skill-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skill-card { min-height: 250px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.72); }
.skill-number { color: #a8b7cc; font-size: 12px; font-weight: 800; letter-spacing: .13em; }
.skill-card h3 { margin: 16px 0 24px; font-size: 20px; font-weight: 750; }
.skill-card ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; padding: 0; list-style: none; }
.skill-card li { display: grid; justify-items: center; align-content: start; gap: 8px; min-width: 0; color: var(--blue-deep); font-size: 12px; font-weight: 700; line-height: 1.4; text-align: center; }
.skill-logo { position: relative; display: grid; width: 72px; height: 56px; place-items: center; }
.skill-logo img { position: absolute; width: 64px; height: 52px; object-fit: contain; opacity: 0; }
.skill-logo-fallback { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 12px; background: var(--blue-soft); font-size: 18px; }
.skill-logo.is-loaded img { opacity: 1; }
.skill-logo.is-loaded .skill-logo-fallback { visibility: hidden; }
.skill-logo.is-symbol .skill-logo-fallback { font-size: 28px; }
.background-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 42px; margin-top: 72px; }
.background-column > h3 { padding-bottom: 15px; border-bottom: 2px solid var(--ink); font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.timeline-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.timeline-date { margin: 0 0 4px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.timeline-item h4 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 730; line-height: 1.35; }
.timeline-item > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.award-details > span { display: block; }
.award-details > span + span { margin-top: 4px; }

.skills-section { padding-bottom: 28px; }
.connect-section { grid-column: 1 / -1; margin-top: 30px; }
.connect-section h3 { margin: 0 0 16px; font-size: 28px; font-weight: 750; letter-spacing: -.025em; line-height: 1.3; }
.publications-section .section-heading h2, .skills-section .section-heading h2, .connect-section h3 { color: var(--blue); font-size: clamp(24px, 2.5vw, 32px); font-weight: 780; line-height: 1.2; letter-spacing: normal; }
.skills-section { padding-top: clamp(24.6px, 3vw, 39.6px); }
.timeline-details span { display: block; }
.timeline-details span + span { margin-top: 5px; }
.skill-logo svg { width: 48px; height: 48px; }
.skill-logo .brand-wordmark { width: 80px; }
.connect-links { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; font-size: 15px; line-height: 1.7; }
.connect-links a { min-height: 44px; padding: 10px 16px; border: 1px solid #ccd7e9; border-radius: 999px; background: rgba(255,255,255,.7); white-space: nowrap; color: var(--blue); }
.connect-links a:hover { background: var(--blue-soft); border-color: var(--blue); }
.external-link-icon { display: inline-grid; position: relative; flex: 0 0 18px; width: 18px; height: 18px; place-items: center; vertical-align: -.15em; }
.external-link-icon img { position: absolute; inset: 0; width: 18px; height: 18px; object-fit: contain; opacity: 0; }
.external-link-fallback { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 4px; font: 13px/1 sans-serif; }
.external-link-icon.is-loaded img { opacity: 1; }
.external-link-icon.is-loaded .external-link-fallback { visibility: hidden; }
a.has-external-icon:not(.paper-link):not(.profile-links a):not(.connect-links a) > .external-link-icon { margin-right: 7px; }

@media (min-width: 981px) {
    .background-grid { grid-template-rows: auto repeat(4, auto); row-gap: 0; }
    .background-column { display: grid; grid-row: 1 / span 5; grid-template-rows: subgrid; }
    .background-column:nth-child(1) { grid-column: 1; }
    .background-column:nth-child(2) { grid-column: 2; }
    .background-column:nth-child(3) { grid-column: 3; }
    .connect-section { grid-column: 1 / span 2; grid-row: 5; align-self: start; margin-top: 0; padding-top: 20px; }
}

.site-footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.62); }
.footer-inner { min-height: 90px; color: var(--muted); font-size: 13px; }
.footer-inner p { margin: 0; }
.footer-inner p:first-child { flex-shrink: 0; white-space: nowrap; }
.footer-inner { gap: 28px; padding-block: 18px; }

.gallery-view { padding: 90px 0 120px; }
.gallery-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 48px; }
.gallery-heading > div > p:last-child { max-width: 600px; margin: 18px 0 0; color: var(--muted); }
.back-overview { flex: none; border: 1px solid #cbd7ea; color: var(--blue); }
.back-overview:hover { background: var(--blue); color: white; }
.gallery-shell { padding: 28px; border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow); }
.gallery-shell #portfolio { height: auto !important; }
.gallery-shell .h-bloc { display: none; }
.gallery-shell .container-portfolio { padding-top: 0; }
.gallery-shell #filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 30px; }
.gallery-shell #filters li { margin: 0; }
.gallery-shell #filters .filter { display: inline-block; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: #f8fafd; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 750; }
.gallery-shell #filters .filter.active, .gallery-shell #filters .filter:hover { border-color: var(--blue); background: var(--blue); color: white; }
.gallery-shell #portfoliolist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: 100%; }
.gallery-shell #portfoliolist > .portfolio { display: block; width: auto; margin: 0; float: none; overflow: hidden; border-radius: 13px; }
.gallery-shell #portfoliolist > .portfolio[hidden] { display: none; }
.gallery-shell .portfolio-wrapper { position: relative; overflow: hidden; aspect-ratio: 1.15 / 1; background: #e7edf6; }
.gallery-shell .portfolio-wrapper > a { display: block; height: 100%; }
.gallery-shell .portfolio-wrapper img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery-shell .portfolio-wrapper:hover img { transform: scale(1.04); }
.gallery-shell .portfolio .label { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: block; width: 100%; height: 52px; color: white; }
.gallery-shell .portfolio .label-bg { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(21,35,63,.96), rgba(33,73,142,.9)); }
.gallery-shell .portfolio .label-text { padding: 7px 12px; }
.gallery-shell .portfolio .text-title { display: block; overflow: hidden; max-width: 100%; color: white; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.gallery-shell .portfolio .text-category { display: block; color: #cbd8ee; font-size: 10px; line-height: 1.25; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    overflow: auto;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(7, 14, 29, .86);
    backdrop-filter: blur(8px);
}
.modal.is-open { display: flex; }
.modal-dialog { width: min(1100px, 96vw); margin: auto; }
.modal-content { position: relative; overflow: hidden; border-radius: 18px; background: #101827; box-shadow: 0 30px 100px rgba(0,0,0,.5); }
.modal-body { position: relative; padding: 0; }
.gallery-modal-close { position: absolute; top: 12px; right: 12px; z-index: 8; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: rgba(10,20,38,.74); color: white; cursor: pointer; font: inherit; font-size: 27px; line-height: 1; }
.carousel { position: relative; }
.carousel-inner { position: relative; overflow: hidden; min-height: min(72vh, 760px); }
.carousel-inner > .item { display: none; align-items: center; justify-content: center; min-height: min(72vh, 760px); }
.carousel-inner > .item.active { display: flex; }
.carousel-inner > .item > img { display: block; max-width: 100%; max-height: 76vh; margin: auto; object-fit: contain; }
.carousel-caption { display: none; }
.carousel-control { position: absolute; top: 50%; z-index: 6; display: grid; width: 48px; height: 48px; place-items: center; border-radius: 50%; background: rgba(10,20,38,.72); color: white; font-size: 0; transform: translateY(-50%); }
.carousel-control:hover, .carousel-control:focus { color: white; background: var(--blue); }
.carousel-control.left { left: 14px; }
.carousel-control.right { right: 14px; }
.glyphicon-chevron-left::before { content: "‹"; font-size: 36px; line-height: 1; }
.glyphicon-chevron-right::before { content: "›"; font-size: 36px; line-height: 1; }
.carousel-indicators { position: absolute; right: 72px; bottom: 18px; left: 72px; z-index: 6; display: flex; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.carousel-indicators li { width: 7px; height: 7px; border: 0; border-radius: 50%; background: rgba(255,255,255,.42); cursor: pointer; }
.carousel-indicators li.active { width: 18px; border-radius: 999px; background: white; }

@media (max-width: 980px) {
    .hero { grid-template-columns: 1fr; min-height: auto; padding-block: 36px 32px; }
    .about-figure { max-width: 720px; }
    .skill-grid { grid-template-columns: repeat(2, 1fr); }
    .background-grid { grid-template-columns: 1fr 1fr; }
    .gallery-shell #portfoliolist { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
    .shell { width: min(100% - 28px, 1180px); }
    .header-inner { min-height: 68px; }
    .primary-nav a { display: none; }
    .hero { padding-block: 32px; gap: 46px; }
    .hero h1 { font-size: clamp(36px, 12vw, 54px); }
    .section { padding-block: 78px; }
    .publications-section { padding-top: 39px; padding-bottom: 8px; }
    .skills-section { padding-top: 23.4px; padding-bottom: 24px; }
    .about-lightbox { padding: 64px 12px 24px; }
    .about-lightbox-prev { left: 4px; }
    .about-lightbox-next { right: 4px; }
    .split-heading, .gallery-heading { align-items: flex-start; flex-direction: column; }
    .publication-card { grid-template-columns: 1fr; gap: 12px; padding-block: 28px; }
    .publication-meta { flex-direction: row; align-items: baseline; gap: 10px; }
    .publication-meta .year { font-size: 21px; }
    .publication-aside { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
    .publication-aside:has(.research-gif, .research-still) .publication-meta { flex-direction: column; gap: 2px; max-width: calc(100% - 152px); }
    .research-gif, .research-image-link { width: 140px; margin-top: 0; }
    .featured-publication { padding-inline: 18px; }
    .skill-grid, .background-grid { grid-template-columns: 1fr; }
    .skill-card { min-height: 210px; }
    .background-grid { gap: 30px; margin-top: 52px; }
    .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; padding-block: 20px; }
    .gallery-view { padding-top: 62px; }
    .gallery-shell { padding: 18px; }
    .gallery-shell #portfoliolist { grid-template-columns: repeat(2, 1fr); gap: 9px; }
}

@media (max-width: 430px) {
    .connect-links { gap: 6px; font-size: 12px; }
    .connect-links a { padding: 8px 6px; gap: 4px; }
    .connect-links .external-link-icon { width: 14px; height: 14px; flex-basis: 14px; }
    .connect-links .external-link-icon img { width: 14px; height: 14px; }
    .brand > span:last-child { display: none; }
    .profile-links { align-items: stretch; flex-direction: column; }
    .profile-links a { justify-content: space-between; }
    .gallery-shell #portfoliolist { grid-template-columns: 1fr; }
}

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