:root {
    --bg: #f5f5f7;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --border: rgba(29, 29, 31, 0.08);
    --accent: #0a84ff;
    --accent-hover: #0066cc;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.06);
    --radius-lg: 20px;
    --radius-md: 14px;
    --layout-gap: 0.75rem;
}

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

.layout-shell {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(var(--layout-gap) * -0.5);
}

.layout-shell > * {
    padding: 0 calc(var(--layout-gap) * 0.5);
    min-width: 0;
}

.layout-spacer {
    width: 8.333333%;
    flex: 0 0 8.333333%;
}

.sidebar-col {
    width: 16.666667%;
    flex: 0 0 16.666667%;
}

.main-col {
    width: 66.666667%;
    flex: 0 0 66.666667%;
}

.section-block {
    margin-bottom: 1rem;
}


.footer-inner {
    max-width: 100%;
    text-align: center;
}

.site-footer {
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    padding-bottom: 3rem;
}

.image {
    width: 100%;
    margin: 0;
}

.image img {
    display: block;
    width: 100%;
    height: 100%;
}

.image.is-1by1 {
    aspect-ratio: 1 / 1;
}

.image.is-16by9 {
    aspect-ratio: 16 / 9;
}

@media (min-width: 1024px) {
    .sidebar-col {
        width: 16.666667%;
        flex: 0 0 16.666667%;
    }

    .main-col {
        width: 66.666667%;
        flex: 0 0 66.666667%;
    }

}

@media (max-width: 1023px) {
    .layout-spacer {
        display: none;
    }

    .sidebar-col,
    .main-col {
        width: 100%;
        flex: 0 0 100%;
    }

    .is-12-mobile { width: 100%; flex: 0 0 100%; }
}

@media (min-width: 1800px) {
    .main-col { width: 50%; flex: 0 0 50%; }
    .layout-spacer { width: 10%; flex: 0 0 10%; }
}

html,
body {
    background: radial-gradient(circle at top, #ffffff 0%, var(--bg) 58%);
    color: var(--text-primary);
    font-family:"SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body {
    line-height: 1.5;
    scroll-behavior: smooth;
}

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

a:focus,
a:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

.site-shell {
    padding-top: 2.25rem;
}

.profile-card {
    position: sticky;
    top: 2.25rem;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    margin-left: 0;
}

.profile-layout {
    display: block;
}

.profile-photo,
.profile-info {
    width: 100%;
}

.profile-info {
    text-align: left;
    padding-left: 0.25rem;
    padding-bottom: 0.25rem;
    padding-right: 0;
}

.profile-map {
    display: none;
    margin-top: 0.55rem;
}

.map-shell {
    min-height: 120px;
}

.avatar-wrap img {
    border-radius: 16px;
    object-fit: cover;
}

.avatar-wrap {
    margin: 0;
}

.avatar-image {
    transform: scale(1);
}

.profile-name {
    margin-top: 0.9rem;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.profile-meta {
    margin-bottom: 0.05rem;
    font-size: 0.9rem;
    line-height: 1.0;
    color: var(--text-secondary);
}

.section-card {
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 1.05rem 1.35rem;
    margin-bottom: 1rem;
    --section-pad-x: 1.35rem;
    padding-bottom: 0.5rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin-top: 0.1rem;
    margin-bottom: 0.18rem;
}

.section-title + * {
    margin-top: 0.32rem;
}

#research .section-title + .paper-row {
    margin-top: 0rem;
}

.section-copy {
    max-width: none;
    color: var(--text-primary);
}

.timeline-entry {
    display: grid;
    grid-template-columns: 15.5ch minmax(0, 1fr);
    column-gap: 0.5rem;
    align-items: baseline;
    margin: 0 0 0.15rem;
    white-space: nowrap;
}

.timeline-date {
    white-space: nowrap;
    color: var(--text-secondary);
}

.timeline-body a {
    white-space: nowrap;
}

.news-entry {
    display: grid;
    grid-template-columns: 10.2ch minmax(0, 1fr);
    column-gap: 0.5rem;
    align-items: baseline;
    margin: 0 0 0.15rem;
    white-space: nowrap;
}

.news-date {
    white-space: nowrap;
    color: var(--text-secondary);
}

.news-body a {
    white-space: nowrap;
    color: var(--text-primary);
}

.news-scroll {
    max-height: 120px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.work-scroll {
    max-height: 120px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.work-scroll::-webkit-scrollbar {
    width: 8px;
}

.work-scroll::-webkit-scrollbar-thumb {
    background: rgba(110, 110, 115, 0.45);
    border-radius: 999px;
}

.work-scroll::-webkit-scrollbar-track {
    background: transparent;
}


.paper-row {
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(29, 29, 31, 0.06);
    transition: border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}

.paper-row + .paper-row {
    padding-top: 1.5rem;
}

.paper-item {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.paper-media {
    width: calc(25% - var(--layout-gap));
    min-width: 190px;
}

.paper-main {
    flex: 1 1 0;
    min-width: 0;
}

.paper-body {
    background: transparent;
}

.paper-row:last-child {
    margin-bottom: 0;
    border-bottom: 0;
}

/* Add `is-highlighted` on a paper-row to feature a paper quickly. */
.paper-row.is-highlighted {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(10, 132, 255, 0.03) 30%,
        rgba(10, 132, 255, 0.07) 65%,
        rgba(10, 132, 255, 0.11) 100%
    );
}

.paper-row.is-highlighted .paper-title {
    color: #0a5fc4;
}

.paper-thumb img {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.paper-thumb {
    margin-top: 0;
}

.paper-title {
    font-size: 1.05rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin: 0rem;
}

.paper-authors,
.paper-meta,
.paper-desc {
    font-size: 0.92rem;
    margin: 0.00rem;
}

.paper-links a {
    display: inline-block;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    padding: 0.14rem 0.52rem;
    border-radius: 999px;
    border: 1px solid rgba(10, 132, 255, 0.24);
    background: rgba(10, 132, 255, 0.05);
    font-size: 0.77rem;
    line-height: 1.25;
}

.stars-badge {
    display: inline-block;
    vertical-align: middle;
}

.footer-note {
    font-size: 12px;
    color: var(--text-secondary);
}

@media (max-width: 1023px) {
    .site-shell {
        padding-top: 1rem;
    }

    .profile-card {
        position: static;
        margin-bottom: 1rem;
        margin-left: 0;
    }

    .profile-layout {
        display: grid;
        grid-template-columns: 42% 1fr;
        gap: 0.85rem;
        align-items: start;
    }

    .profile-photo,
    .profile-info {
        width: auto;
    }

    .profile-name {
        margin-top: 0;
    }

    .profile-map {
        display: none;
    }

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

    .paper-media {
        width: 100%;
        min-width: 0;
    }
}
