:root {
    --accent: #0969da;
    --accent-dark: #0757b9;
    --accent-soft: #f1f7ff;
    --text: #1f2937;
    --muted: #667085;
    --border: #e4e7ec;
    --surface: #f8fafc;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: #fff;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: auto;
    max-width: 1120px;
    margin: 0 auto;
    padding-right: 24px;
    padding-left: 24px;
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0;
    padding: 18px 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none;
    backdrop-filter: blur(10px);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding-right: 24px;
    padding-left: 24px;
}

.navbar .container::before,
.navbar .container::after {
    display: none;
    content: none;
}

.navbar-header h1 {
    margin: 0;
    color: #111827;
    font-size: 1.75rem;
    font-weight: 720;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.navbar-header h1 a {
    color: inherit;
}

.navbar-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
    letter-spacing: 0.01em;
}

.navbar-nav {
    display: flex;
    flex-shrink: 0;
    gap: 24px;
    margin: 0;
}

.nav-item {
    position: relative;
    margin: 0;
    color: #344054;
    font-size: 0.94rem;
    font-weight: 600;
    text-decoration: none;
}

.nav-item::after {
    position: absolute;
    right: 0;
    bottom: -5px;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    content: "";
    opacity: 0;
    transform: scaleX(0.5);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active {
    color: var(--accent);
    text-decoration: none;
}

.nav-item:hover::after,
.nav-item:focus-visible::after,
.nav-item.active::after {
    opacity: 1;
    transform: scaleX(1);
}

/* Main layout */
.page-shell {
    padding-top: 20px;
}

.page-shell > .row {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 56px;
    margin-left: 0;
}

.page-shell > .row::before,
.page-shell > .row::after {
    display: none;
    content: none;
}

.page-shell > .row > [class*="span"] {
    float: none;
    width: auto;
    min-height: 0;
    margin-left: 0;
}

section {
    margin: 52px 0;
    scroll-margin-top: 120px;
}

#about {
    margin-top: 28px;
}

h2 {
    margin: 0 0 22px;
    color: #101828;
    font-size: 1.65rem;
    font-weight: 720;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

h2::after {
    display: block;
    width: 42px;
    height: 3px;
    margin-top: 9px;
    border-radius: 3px;
    background: var(--accent);
    content: "";
}

p {
    margin: 0 0 18px;
}

.section-intro {
    max-width: 760px;
    margin-top: -8px;
    margin-bottom: 8px;
    color: var(--muted);
}

.publication-note {
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 0.84rem;
}

.author-marker {
    margin-left: 1px;
    color: var(--accent-dark);
    font-size: 0.75em;
    font-weight: 700;
}

/* Profile */
.profile-sidebar {
    position: sticky;
    top: 120px;
    padding: 28px 0;
    text-align: center;
}

.profile-image {
    width: 184px;
    height: 184px;
    margin: 0 0 18px;
    border: 4px solid #fff;
    border-radius: 50%;
    box-shadow: 0 5px 22px rgba(16, 24, 40, 0.12);
    object-fit: cover;
}

.profile-role {
    margin: 0;
    color: #202939;
    font-size: 1rem;
    font-weight: 700;
}

.profile-location {
    margin: 2px 0 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

.profile-location i {
    margin-right: 4px;
    font-size: 0.8rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 0 10px;
}

.social-links a {
    display: inline-flex;
    min-height: 36px;
    padding: 0 11px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #475467;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.social-links a:hover,
.social-links a:focus-visible {
    border-color: #b9d4f7;
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
    transform: translateY(-1px);
}

.profile-email {
    color: var(--muted);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

/* Research */
.research-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.research-card {
    margin: 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.research-card h3 {
    margin: 0 0 8px;
    color: #174a86;
    font-size: 1.03rem;
    font-weight: 700;
    line-height: 1.35;
}

.research-card p {
    margin: 0;
    color: #536174;
    font-size: 0.93rem;
    line-height: 1.58;
}

/* Publications */
.publication-group {
    margin-bottom: 30px;
}

.publication-group h3 {
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: #344054;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.publication-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.publication-item {
    margin: 0;
    padding: 0 0 18px;
}

.publication-item + .publication-item {
    padding-top: 2px;
}

.publication-title {
    color: #1558a6;
    font-size: 1.01rem;
    font-weight: 680;
    line-height: 1.45;
}

.publication-heading {
    line-height: 1.45;
}

.publication-authors,
.publication-venue {
    margin-top: 3px;
    color: #596579;
    font-size: 0.9rem;
    line-height: 1.5;
}

.publication-authors strong {
    color: #202939;
}

.publication-venue {
    color: #7a8494;
    font-style: italic;
}

.publication-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 16px;
    margin-top: 7px;
}

.publication-resource {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #596579;
    font-size: 0.79rem;
    font-weight: 650;
    line-height: 1.4;
}

.publication-resource i {
    display: inline-block;
    flex: 0 0 0.9rem;
    width: 0.9rem;
    height: 0.9rem;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.publication-resource .fa-file-pdf {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23b54747' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 1.75h6l4 4v8.5H3z'/%3E%3Cpath d='M9 1.75v4h4M5 10.5h6'/%3E%3C/svg%3E");
}

.publication-resource .fa-github {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23344054' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 4.5 2 8l3.5 3.5M10.5 4.5 14 8l-3.5 3.5M9.5 3.5l-3 9'/%3E%3C/svg%3E");
}

.publication-resource .fa-file-pdf::before,
.publication-resource .fa-github::before {
    content: none;
}

.publication-resource-emoji {
    font-size: 0.84rem;
    line-height: 1;
}

.publication-resource:hover,
.publication-resource:focus-visible {
    color: var(--accent);
}

.quick-take-trigger {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 0 8px;
    padding: 2px 8px;
    border: 1px solid #cbdced;
    border-radius: 999px;
    background: #f9fbfe;
    color: #315d8f;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.79rem;
    font-weight: 650;
    line-height: 1.4;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    vertical-align: 0.08em;
}

.quick-take-trigger:hover,
.quick-take-trigger:focus-visible,
.quick-take-trigger.is-active {
    border-color: #8db5df;
    background: var(--accent-soft);
    color: var(--accent-dark);
    box-shadow: 0 1px 2px rgba(9, 105, 218, 0.09);
}

.quick-take-icon {
    color: var(--accent);
    font-size: 0.82rem;
    line-height: 1;
}

.quick-take-chevron {
    width: 6px;
    height: 6px;
    margin: -3px 1px 0 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.quick-take-trigger.is-active .quick-take-chevron {
    margin-top: 3px;
    transform: rotate(225deg);
}

.quick-take-panel[hidden] {
    display: none;
}

.quick-take-panel {
    position: relative;
    overflow: hidden;
    max-width: 760px;
    margin-top: 11px;
    padding: 13px 15px 15px;
    border: 1px solid #d7e3f2;
    border-radius: 12px;
    background: linear-gradient(145deg, #fcfdff 0%, #f4f8fd 100%);
    box-shadow: 0 1px 2px rgba(21, 88, 166, 0.055), 0 8px 24px rgba(21, 88, 166, 0.03);
    color: #46566a;
    font-size: 0.87rem;
    line-height: 1.58;
}

.quick-take-panel::before {
    display: block;
    margin-bottom: 9px;
    color: #5e6f83;
    content: "●  " attr(data-status);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.66rem;
    font-weight: 650;
    letter-spacing: 0.055em;
    line-height: 1.4;
    text-transform: uppercase;
}

.quick-take-panel::after {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -36%;
    width: 30%;
    background: linear-gradient(90deg, transparent, rgba(195, 220, 247, 0.58), transparent);
    content: "";
    opacity: 0;
    pointer-events: none;
    transform: skewX(-12deg);
}

.quick-take-panel.is-decoding::before {
    color: var(--accent);
    animation: quick-take-status-pulse 0.45s steps(2, end) infinite;
}

.quick-take-panel.is-decoding::after {
    animation: quick-take-scan 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quick-take-panel.is-decoded::before {
    color: #315d8f;
}

.quick-take-panel p {
    margin: 0;
}

.quick-take-panel p + p {
    margin-top: 7px;
}

.quick-take-panel strong {
    color: #174a86;
    font-weight: 720;
}

.quick-take-panel.is-decoding p {
    animation: quick-take-decode 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--decode-delay, 0ms);
}

@keyframes quick-take-decode {
    0% {
        clip-path: inset(0 100% 0 0);
        filter: blur(5px);
        opacity: 0;
        transform: translateY(5px);
    }

    45% {
        filter: blur(2px);
        opacity: 0.55;
    }

    100% {
        clip-path: inset(0 0 0 0);
        filter: blur(0);
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes quick-take-scan {
    0% {
        left: -36%;
        opacity: 0;
    }

    18% {
        opacity: 0.72;
    }

    100% {
        left: 108%;
        opacity: 0;
    }
}

@keyframes quick-take-status-pulse {
    50% {
        opacity: 0.48;
    }
}

/* Links and focus */
a {
    color: var(--accent-dark);
    text-decoration: none;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--accent);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(9, 105, 218, 0.24);
    outline-offset: 3px;
}

/* Footer */
.footer {
    margin-top: 56px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
    text-align: center;
}

.footer p {
    margin: 0;
}

.text-muted {
    color: #7a8494;
    font-size: 0.86rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding-right: 18px;
        padding-left: 18px;
    }

    .navbar {
        position: static;
        padding: 15px 0;
    }

    .navbar .container {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
        padding-right: 18px;
        padding-left: 18px;
    }

    .navbar-header h1 {
        font-size: 1.45rem;
    }

    .navbar-header p {
        font-size: 0.76rem;
    }

    .navbar-nav {
        gap: 20px;
    }

    .nav-item {
        font-size: 0.9rem;
    }

    .page-shell {
        padding-top: 0;
    }

    .page-shell > .row {
        display: block;
    }

    .profile-sidebar {
        position: static;
        padding: 32px 0 4px;
    }

    .profile-image {
        width: 158px;
        height: 158px;
    }

    section,
    #about {
        margin: 42px 0;
        scroll-margin-top: 20px;
    }

    h2 {
        font-size: 1.45rem;
    }

    .research-grid {
        grid-template-columns: 1fr;
    }

    .research-card {
        padding: 17px;
    }

    .quick-take-panel {
        padding: 12px 13px 14px;
        font-size: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
