/* 0. Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

/* 1. Global Styles & Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.55;
    color: black;
    background-color: white;
    margin: 0;
    padding: 0;
}

b, h1, h2 {
    font-weight: 700;
}

h1 {
    font-size: 1.85em;
    margin: 0 0 1em 0;
}

h2 {
    font-family: 'Inter', sans-serif;
    font-size: 2em;
    margin-top: 2.5em;
    margin-bottom: 0.5em;
    padding-bottom: 0.5em;
    /* Accent ported from cv/cv.css's bio block: muted, translucent NVIDIA green. */
    border-bottom: 2px solid rgba(118, 185, 0, 0.65);
    display: block;
    width: 100%;
    float: none;
    letter-spacing: -0.02em;
}

.intro + h2 {
    margin-bottom: 0.75em;
}

a {
    text-decoration: none;
    color: #3c67c2;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(60, 103, 194, 0.45);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 10px 14px;
    color: #fff;
    background: #1f2937;
    border-radius: 6px;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.a_more {
    text-decoration: none;
    color: #3c67c2;
    font-weight: 300;
}

note {
    text-decoration: none;
    color: #595959;
    font-size: 11px;
}

/* 2. Layout & Containers */
.container {
    margin: 0 auto;
    font-size: 1em;
    text-align: left;
    width: min(900px, calc(100% - 40px));
}

.flcontainer {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.item, .outro {
    display: block;
    width: 100%;
    float: none;
    margin-top: 1.5em;
    margin-bottom: 0;
}

.outro {
    margin-bottom: 3.33em;
    text-align: right;
    font-style: italic;
    font-size: 10px;
}

/* 3. Intro / Profile Section */
.intro {
    display: flex;
    gap: 32px;
    align-items: center;
    margin-top: 5em;
    margin-bottom: 1em;
    width: 100%;
}

.profile-photo {
    flex: 0 0 200px;
    margin-right: 5px;
}

.profile-photo img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: none;
}

.intro-content {
    flex: 1;
}

.intro-content h1 {
    font-family: 'Inter', sans-serif;
    font-size: 3.0em;
    font-weight: 600;
    margin: 0 0 0 0;
    line-height: 1.1;
    color: #000000;
    letter-spacing: -0.035em;
    margin-left: -0.075em;
}

.intro-content p {
    font-size: 1.0em;
    line-height: 1.8;
    margin-bottom: 1em;
    width: 100%;
    float: none;
}

.intro-content .links {
    margin-top: 1.0em;
    font-size: 1em;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 7px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
    font-size: 0.9em;
    font-weight: 500;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.pill:hover {
    text-decoration: none;
    border-color: rgba(118, 185, 0, 0.65);
    color: #5c8f00;
    transform: translateY(-1px);
}

.intro-content small {
    font-family: 'Inter', sans-serif;
    display: block;
    font-size: 1em;
}

.email {
    display: inline-block;
    margin-top: 4px;
    color: #595959;
    font-family: 'Inter', sans-serif;
}

/* Selected research */
.selected-research-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    clear: both;
}

.selected-research-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    color: #111;
    background: #fff;
    border: 1px solid #e3e6e8;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.selected-research-item:hover {
    text-decoration: none;
    border-color: rgba(118, 185, 0, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.selected-research-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #fff;
    border-bottom: 1px solid #e3e6e8;
}

.selected-research-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.selected-research-item > span {
    display: block;
    padding: 13px 14px 14px;
}

.selected-research-item > .selected-research-media {
    display: flex;
    padding: 0;
}

.selected-research-item strong,
.selected-research-item small {
    display: block;
}

.selected-research-item small {
    margin-top: 3px;
    color: #595959;
    line-height: 1.4;
}

.selected-research-item .selected-research-venue {
    color: #477200;
    font-weight: 600;
}

.selected-research-item .selected-research-description {
    margin-top: 6px;
}

/* 4. Content Items (Publications) */
.pub-grid .item {
    box-sizing: border-box;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
    padding: 16px;
    /* margin-bottom: 5px; */
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pub-grid .item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(118, 185, 0, 0.4);
    transform: translateY(-2px);
}

.pub-grid .item {
    display: flex;
    align-items: center;
    gap: 2.75em;
}

.item img {
    width: 21em;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #fff;
    flex: 0 0 auto;
    margin-left: 10px;
    border: 0;
    border-radius: 6px;
}

.item video {
    width: 12.5em;
    flex: 0 0 auto;
    border: 0;
}

.item p {
    margin-top: 0;
    min-width: 0;
    max-width: 520px;
    flex: 1 1 auto;
}

.pub-title {
    display: block;
    font-size: 1.05em;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
}

.pub-venue {
    display: inline-flex;
    font-size: 0.78em;
    font-weight: 600;
    color: #477200;
    background: rgba(118, 185, 0, 0.12);
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.pub-authors {
    display: block;
    font-size: 0.9em;
    color: #595959;
    margin-bottom: 6px;
}

.pub-links {
    display: block;
    margin-bottom: 6px;
}

.pub-link {
    display: inline-block;
    font-size: 0.8em;
    font-weight: 500;
    color: #595959;
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin: 0 6px 6px 0;
}

.pub-link:hover {
    text-decoration: none;
    color: #5c8f00;
    border-color: rgba(118, 185, 0, 0.65);
}

.pub-note {
    color: #666;
    display: block;
}

.item p:last-child,
.intro p:last-child,
.outro p:last-child {
    margin-bottom: 0;
}

/* Lists */
li.yw_list { margin-left: -2%; }
li.exp_list { margin-left: -2%; margin-bottom: 1.5%; }

.list-item { margin-bottom: 10px; }

.custom-bullet::before {
    content: "\00a0·\00a0";
    font-size: 1.5em;
    line-height: 20px;
    vertical-align: top;
}

/* 5. Highlights & Effects */
.highlight-bg {
    position: relative;
    z-index: 1;
}

.highlight-bg::before {
    content: '';
    position: absolute;
    top: -10px;
    bottom: -2px;
    left: -10px;
    right: -5px;
    background-color: #FFFFD4;
    border-radius: 0px;
    z-index: -1;
}

span.highlight {
    background-color: #FFFFD4;
}

/* 6. Publication Filter Buttons */
.publications-header {
    display: flex;
    align-items: center;
    margin-top: 2.5em;
}

.publications-header h2 {
    float: none;
    width: 100%;
    margin: 30px 0 0.15em 0;
}

.pub-buttons {
    display: flex;
    gap: 10px;
}

.pub-button {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 5px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    font-weight: 400;
    transition: background-color 0.3s, color 0.3s;
}

.pub-button:hover {
    background-color: #e0e0e0;
}

.pub-button.active-button {
    background-color: #3c67c2;
    color: white;
    border-color: #3c67c2;
}

/* 7. Experience Section */
.experience-timeline {
    position: relative;
    clear: both;
    padding-top: 10px;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    top: 34px;
    bottom: 34px;
    left: 18px;
    width: 2px;
    background: linear-gradient(to bottom, rgba(118, 185, 0, 0.8), rgba(118, 185, 0, 0.16));
}

.experience-item {
    position: relative;
    width: 100%;
    padding: 0 0 0 52px;
    margin: 0 0 26px;
    border: 0;
}

.experience-card {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    align-items: stretch;
    gap: 20px;
    overflow: hidden;
    background: #fbfcfa;
    border: 1px solid #e4e8e0;
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.experience-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 11px;
    z-index: 1;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 4px solid #6ea900;
    border-radius: 50%;
    box-shadow: 0 0 0 4px #fff;
    transform: translateY(-50%);
}

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

.exp-detail {
    display: block;
    margin-top: 12px;
    color: #595959;
    font-size: 0.86em;
    line-height: 1.5;
}

.exp-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 92px;
    padding: 18px 10px 18px 18px;
}

.exp-logo img {
    max-width: 100%;
    height: auto;
    max-height: 48px;
    object-fit: contain;
}

.exp-content {
    min-width: 0;
    padding: 17px 20px 16px 0;
}

.experience-item:hover .experience-card {
    border-color: rgba(118, 185, 0, 0.5);
    box-shadow: 0 8px 22px rgba(38, 50, 26, 0.06);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    width: 100%;
}

.job-title {
    min-width: 0;
}

.job-title b {
    display: block;
    margin-bottom: 3px;
    font-family: 'Inter', sans-serif;
    font-size: 1.02em;
    line-height: 1.35;
}

.job-role,
.job-location {
    color: #555;
    font-size: 0.9em;
}

.job-role::after {
    content: ' · ';
    color: #9aa093;
}

.job-date {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 4px 9px;
    color: #477200;
    background: rgba(118, 185, 0, 0.11);
    border: 1px solid rgba(118, 185, 0, 0.2);
    border-radius: 6px;
    font-size: 0.76em;
    font-weight: 600;
    line-height: 1.2;
}

/* 8. Mobile / Responsive */
@media only screen and (max-width: 760px) {
    .container { width: min(100% - 32px, 900px); }

    .intro {
        align-items: flex-start;
        margin-top: 40px;
        gap: 22px;
    }

    .profile-photo { flex-basis: 160px; }
    .intro-content h1 { font-size: 2.45em; }
    .intro-content > p:not(.links) { font-size: calc(1em - 2pt); }

    .intro-content .links {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .intro-content .links .pill {
        justify-content: center;
        width: 100%;
        min-width: 0;
        margin: 0;
        text-align: center;
        white-space: nowrap;
    }

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

    .pub-grid .item {
        align-items: flex-start;
        gap: 20px;
    }

    .item img {
        width: 38%;
        margin-left: 0;
    }

    .experience-item {
        padding-left: 46px;
    }

    .experience-card {
        grid-template-columns: 100px minmax(0, 1fr);
        gap: 16px;
    }

    .experience-timeline::before { left: 16px; }
    .experience-item::before { left: 9px; }

    .exp-logo {
        min-height: 84px;
        padding: 16px 8px 16px 14px;
    }

    .job-header {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .job-date {
        align-self: flex-start;
        margin-left: 0;
    }
}

@media only screen and (max-width: 560px) {
    h2 {
        margin-top: 2em;
        font-size: 1.65em;
    }

    .intro {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-photo {
        width: min(62%, 220px);
        flex: none;
        margin-right: 0;
    }

    .intro-content { width: 100%; }
    .intro-content h1 { font-size: 2.35em; }
    .intro-content p { text-align: left; }
    .intro-content .links { justify-content: center; }
    .intro-content .links .pill {
        padding-right: 6px;
        padding-left: 6px;
        font-size: 0.82em;
    }
    .selected-research-grid { grid-template-columns: 1fr; }

    .pill {
        min-height: 40px;
        align-items: center;
    }

    .pub-links {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        margin-bottom: 0;
    }

    .pub-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        margin: 0;
        padding: 4px 9px;
        font-size: 0.76em;
        line-height: 1.2;
        white-space: nowrap;
    }

    .pub-grid .item {
        flex-direction: column;
        gap: 16px;
        padding: 12px;
    }

    .item img {
        width: 100%;
        margin: 0;
    }

    .item p { width: 100%; max-width: none; }

    .experience-item {
        padding: 0 0 0 32px;
        margin-bottom: 22px;
    }

    .experience-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        border-radius: 10px;
    }

    .experience-timeline::before {
        top: 26px;
        bottom: 26px;
        left: 9px;
    }

    .experience-item::before {
        top: 50%;
        left: 2px;
    }

    .exp-logo {
        justify-self: start;
        width: min(132px, 46%);
        height: 48px;
        min-height: 48px;
        padding: 10px 14px 0;
    }

    .exp-logo img { max-height: 28px; }

    .exp-content {
        padding: 8px 14px 14px;
    }

    .job-title b { font-size: 0.96em; }

    .job-role,
    .job-location {
        display: block;
        font-size: 0.84em;
    }

    .job-role::after { content: ''; }

    .job-date {
        margin-top: 5px;
        padding: 3px 8px;
    }

    .exp-detail {
        margin-top: 9px;
        font-size: 0.82em;
    }
}

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

.noscript-message {
    padding: 14px;
    background: #fff8df;
    border: 1px solid #e4ca69;
    border-radius: 8px;
}

footer {
    margin-top: 72px;
    padding: 24px 0 48px;
    color: #666;
    font-size: 0.85em;
    border-top: 1px solid #e5e5e5;
}
