:root {
    --bg: #08192b;
    --surface: rgba(255, 255, 255, 0.03);
    --text: #dbe8ff;
    --muted: #9eb3d6;
    --accent: #0ef;
    --border: rgba(14, 255, 255, 0.2);
}

body.light-mode {
    --bg: #f5f8ff;
    --surface: rgba(0, 48, 130, 0.05);
    --text: #0f2345;
    --muted: #3f557d;
    --accent: #005ce6;
    --border: rgba(0, 92, 230, 0.25);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Poppins, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 6%;
    background: rgba(8, 25, 43, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(6px);
    flex-wrap: wrap;
}

body.light-mode .site-header {
    background: rgba(245, 248, 255, 0.96);
    border-bottom: 1px solid rgba(15, 35, 69, 0.15);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.25px;
    text-shadow: 0 0 14px rgba(14, 255, 255, 0.25);
    animation: slideRight 0.8s ease both;
}

body.light-mode .brand {
    color: #0f2345;
    text-shadow: none;
}

.site-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.site-nav a {
    text-decoration: none;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    opacity: 0;
    animation: slideTop 0.7s ease forwards;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, text-shadow 0.2s ease;
    white-space: nowrap;
}

body.light-mode .site-nav a {
    color: #163466;
    background: rgba(15, 35, 69, 0.06);
}

.site-nav a:nth-child(1) { animation-delay: .10s; }
.site-nav a:nth-child(2) { animation-delay: .20s; }
.site-nav a:nth-child(3) { animation-delay: .30s; }
.site-nav a:nth-child(4) { animation-delay: .40s; }
.site-nav a:nth-child(5) { animation-delay: .50s; }
.site-nav a:nth-child(6) { animation-delay: .60s; }

.site-nav a:hover {
    color: var(--accent);
    border-color: var(--border);
    background: rgba(14, 255, 255, 0.1);
    text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
}

.site-nav a.active {
    color: var(--accent);
    border-color: var(--border);
    background: rgba(14, 255, 255, 0.12);
    text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
}

body.light-mode .site-nav a:hover {
    color: #005ce6;
    border-color: rgba(0, 92, 230, 0.28);
    background: rgba(0, 92, 230, 0.12);
    text-shadow: none;
}

body.light-mode .site-nav a.active {
    color: #005ce6;
    border-color: rgba(0, 92, 230, 0.3);
    background: rgba(0, 92, 230, 0.14);
    text-shadow: none;
}

.site-nav a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.theme-toggle {
    width: 38px;
    height: 38px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    background: transparent;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all .25s ease;
}

.theme-toggle:hover {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
}

.section {
    max-width: 980px;
    margin: 0 auto;
    padding: 48px 20px;
}

.hero {
    min-height: 78vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.hero.section {
    max-width: 1140px;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 24px;
    align-items: center;
}

.hero h1 {
    font-size: 42px;
    color: var(--text);
    animation: slideTop 0.9s ease both;
    animation-delay: .2s;
}

.hero h2 {
    font-size: 26px;
    color: var(--accent);
    min-height: 38px;
    animation: slideTop 0.9s ease both;
    animation-delay: .35s;
}

.meta {
    color: var(--muted);
    font-size: 14px;
}

.affiliations {
    display: grid;
    gap: 4px;
    margin-top: 6px;
}

.affiliation {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: slideTop 0.8s ease forwards;
}

.affiliation a {
    color: inherit;
    text-decoration: none;
}

.affiliation a:hover {
    color: var(--accent);
}

.affiliation-1 { animation-delay: .26s; }
.affiliation-2 { animation-delay: .34s; }
.affiliation-3 { animation-delay: .42s; }
.affiliation-4 { animation-delay: .50s; }

.lead {
    color: var(--text);
    max-width: 760px;
    animation: slideTop 0.9s ease both;
    animation-delay: .5s;
}

.contact-inline {
    margin-top: 12px;
    margin-bottom: 10px;
    list-style: none;
    display: inline-grid;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    transform-origin: left center;
    animation: contactFrameIn 0.85s ease both, contactFrameGlow 2.6s ease-in-out infinite;
    animation-delay: .5s, 1.45s;
}

.contact-inline li {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.45;
    opacity: 0;
    animation: slideTop 0.8s ease forwards;
}

.contact-inline li:nth-child(1) { animation-delay: .65s; }
.contact-inline li:nth-child(2) { animation-delay: .8s; }
.contact-inline li:nth-child(3) { animation-delay: .95s; }

.contact-inline li i {
    width: 20px;
    text-align: center;
    color: var(--accent);
    animation: iconPulse 2.2s ease-in-out infinite;
}

.contact-inline a {
    color: var(--text);
    text-decoration: none;
}

.contact-inline a:hover {
    color: var(--accent);
}

.socials {
    margin-top: 14px;
    display: flex;
    gap: 12px;
}

.socials a {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
    opacity: 0;
    animation: slideLeft 0.8s ease forwards;
}

.socials a:nth-child(1) { animation-delay: 1.15s; }
.socials a:nth-child(2) { animation-delay: 1.25s; }
.socials a:nth-child(3) { animation-delay: 1.35s; }
.socials a:nth-child(4) { animation-delay: 1.45s; }
.socials a:nth-child(5) { animation-delay: 1.55s; }

.socials a:hover {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent), 0 0 30px var(--accent);
    transform: translateY(-2px) scale(1.05);
}

.socials .x-label {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.hero-actions {
    margin-top: 12px;
    opacity: 0;
    animation: slideTop 0.8s ease forwards;
    animation-delay: 1.05s;
}

.btn {
    display: inline-block;
    text-decoration: none;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
}

.btn:hover {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 12px var(--accent), 0 0 24px var(--accent);
    transform: translateY(-2px);
}

.hero-photo-wrap {
    display: flex;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(14, 255, 255, 0.16), rgba(14, 255, 255, 0.04));
    border: 1px solid var(--border);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
    animation: photoFrameIn 0.9s ease both, frameGlow 3.2s ease-in-out infinite;
    animation-delay: 0.12s, 1.15s;
}

.hero-photo-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(8, 25, 43, 0.55);
    opacity: 0;
    animation: photoRevealMask 0.9s ease forwards;
    animation-delay: 0.15s;
    pointer-events: none;
    z-index: 2;
}

body.light-mode .hero-photo-wrap {
    background: linear-gradient(145deg, rgba(0, 92, 230, 0.16), rgba(0, 92, 230, 0.05));
    box-shadow: 0 14px 24px rgba(15, 35, 69, 0.12);
}

body.light-mode .hero-photo-wrap::before {
    background: rgba(245, 248, 255, 0.62);
}

.hero-photo {
    width: 260px;
    height: 260px;
    display: block;
    object-fit: cover;
    object-position: center 20%;
    image-rendering: auto;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
    animation: slideLeft 0.9s ease both;
    animation-delay: .35s;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    max-width: 100%;
    will-change: transform;
}

.hero-photo:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

body.light-mode .hero-photo {
    border-color: rgba(15, 35, 69, 0.18);
    box-shadow: 0 10px 20px rgba(15, 35, 69, 0.14);
}

h3 {
    font-size: 30px;
    margin-bottom: 18px;
    color: var(--text);
}

h4 {
    color: var(--text);
    margin-bottom: 8px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(14, 255, 255, 0.45);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.stack {
    display: grid;
    gap: 14px;
}

.publication-card {
    position: relative;
    padding-left: 58px;
}

.publication-card::before {
    content: attr(data-publication-number);
    position: absolute;
    left: 16px;
    top: 18px;
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

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

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

ul {
    padding-left: 18px;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 20px 40px;
    text-align: center;
    color: var(--muted);
}

.to-top {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.to-top:hover {
    color: var(--accent);
    border-color: rgba(14, 255, 255, 0.45);
    background: rgba(14, 255, 255, 0.08);
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes slideRight {
    0% { opacity: 0; transform: translateX(-80px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideTop {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideLeft {
    0% { opacity: 0; transform: translateX(80px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes photoRevealMask {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

@keyframes photoFrameIn {
    0% {
        opacity: 0;
        transform: translateX(48px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes frameGlow {
    0%, 100% {
        box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
        border-color: var(--border);
    }
    50% {
        box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(14, 255, 255, 0.24) inset;
        border-color: rgba(14, 255, 255, 0.45);
    }
}

@keyframes contactFrameGlow {
    0%, 100% {
        border-color: var(--border);
        box-shadow: 0 0 0 rgba(14, 255, 255, 0);
        transform: translateY(0);
    }
    50% {
        border-color: rgba(14, 255, 255, 0.58);
        box-shadow: 0 0 0 1px rgba(14, 255, 255, 0.18) inset, 0 0 18px rgba(14, 255, 255, 0.3);
        transform: translateY(-1px);
    }
}

@keyframes contactFrameIn {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 860px) {
    .site-header {
        padding: 12px 20px;
        gap: 10px;
    }

    .brand {
        font-size: 20px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero h2 {
        font-size: 22px;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .hero-layout {
        grid-template-columns: 1fr;
    }

    .hero-photo {
        width: 220px;
        height: 220px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .site-nav {
        width: 100%;
        gap: 8px;
    }

    .site-nav a {
        padding: 8px 10px;
        font-size: 14px;
    }

    .section {
        padding: 40px 18px;
    }
}

@media (max-width: 560px) {
    .site-header {
        padding: 10px 14px;
    }

    .brand {
        font-size: 18px;
    }

    .site-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-nav a {
        text-align: center;
    }

    .hero {
        min-height: auto;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero h2 {
        font-size: 20px;
        min-height: 32px;
    }

    .lead {
        font-size: 15px;
    }

    .contact-inline {
        gap: 6px;
    }

    .socials a {
        width: 38px;
        height: 38px;
    }

    .hero-photo {
        width: min(84vw, 240px);
        height: min(84vw, 240px);
    }

    .section {
        padding: 34px 14px;
    }

    h3 {
        font-size: 26px;
        margin-bottom: 14px;
    }

    .card {
        padding: 14px;
    }

    .site-footer {
        padding: 20px 14px 30px;
    }
}