:root {
    --navy: #003057;
    --gold: #b3a369;
    --ink: #1c2530;
    --muted: #5d6975;
    --line: #e4e8ec;
    --bg: #ffffff;
    --soft: #f5f7f9;
    --link: #0f5aa8;
    --nav-h: 48px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------- Hero ---------- */

.hero {
    background:
        linear-gradient(rgba(0, 48, 87, 0.55), rgba(0, 48, 87, 0.55)),
        url("images/Frame19.png") center / cover no-repeat,
        var(--navy);
    color: #fff;
    text-align: center;
    padding: 56px 16px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.hero p {
    margin: 0.4rem 0 0;
    font-size: 1.05rem;
    opacity: 0.92;
}

#hue {
    font: inherit;
    letter-spacing: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

/* ---------- Nav ---------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.nav ul {
    display: flex;
    gap: 4px;
    width: max-content;
    max-width: 100%;
    height: var(--nav-h);
    margin: 0 auto;
    padding: 0 12px;
    list-style: none;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.nav ul::-webkit-scrollbar {
    display: none;
}

.nav a {
    display: block;
    padding: 0 12px;
    line-height: var(--nav-h);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--muted);
}

.nav a:hover {
    color: var(--navy);
    text-decoration: none;
}

/* ---------- Layout ---------- */

.layout {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 20px 64px;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}

/* ---------- Profile sidebar ---------- */

.profile {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    font-size: 0.9rem;
}

.profile img {
    width: 100%;
    border-radius: 12px;
}

.profile .email {
    margin: 16px 0 12px;
    font-weight: 500;
}

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

.profile .facts li {
    color: var(--muted);
    margin-bottom: 6px;
    line-height: 1.45;
}

.profile .links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-weight: 500;
}

/* ---------- Sections ---------- */

main section {
    margin-bottom: 48px;
    scroll-margin-top: calc(var(--nav-h) + 16px);
}

main section:last-child {
    margin-bottom: 0;
}

h2 {
    margin: 0 0 16px;
    padding-bottom: 8px;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--navy);
    border-bottom: 1px solid var(--line);
}

main p {
    margin: 0 0 1em;
}

main p:last-child {
    margin-bottom: 0;
}

/* ---------- Publications ---------- */

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

.pub {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.pub:first-child {
    padding-top: 4px;
}

.pub:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.pub-venue {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    padding-top: 0;
}

.pub h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.pub p {
    margin: 4px 0 0;
    font-size: 0.92rem;
}

.pub .authors strong {
    font-weight: 600;
}

.pub .venue-full {
    color: var(--muted);
    font-style: italic;
}

.award {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    font-size: 0.78rem;
    font-weight: 600;
}

.pub-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.pub-links a {
    padding: 2px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--soft);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--navy);
}

.pub-links a:hover {
    border-color: var(--navy);
    text-decoration: none;
}

/* ---------- Vulnerabilities ---------- */

.vulns {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}

.vulns th,
.vulns td {
    padding: 10px 12px 10px 0;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.vulns th {
    padding-top: 0;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.vulns tbody tr:last-child td {
    border-bottom: 0;
}

.vulns td:first-child {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sev {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

a.sev:hover {
    text-decoration: none;
    filter: brightness(0.95);
}

.sev-critical { background: #fde4e4; color: #9b1c1c; }
.sev-high     { background: #feead9; color: #9a3412; }
.sev-medium   { background: #fdf3c4; color: #7a4a0a; }
.sev-low      { background: #e8ebee; color: #3d4852; }

/* ---------- Gallery ---------- */

.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.gallery img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 8px;
    transition: opacity 0.15s;
}

.gallery a:hover img {
    opacity: 0.85;
}

.caption {
    margin-top: 10px;
    font-size: 0.88rem;
    color: var(--muted);
}

/* ---------- Misc ---------- */

.misc {
    margin: 0;
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 10px 16px;
}

.misc dt {
    font-weight: 600;
    color: var(--navy);
    font-size: 0.92rem;
    padding-top: 1px;
}

.misc dd {
    margin: 0;
}

/* ---------- Back-to-top ---------- */

#topBtn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 20;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#topBtn[hidden] {
    display: none;
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
    .hero {
        padding: 40px 16px;
    }

    .layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
        padding: 28px 16px 48px;
    }

    .profile {
        position: static;
        text-align: center;
    }

    .profile img {
        width: 160px;
        margin: 0 auto;
    }

    .profile .links {
        justify-content: center;
    }

    .nav ul {
        padding: 0 4px;
    }

    .pub {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .misc dd {
        margin-bottom: 12px;
    }

    .vulns th,
    .vulns td {
        padding-right: 8px;
    }
}
