:root {
    --bg: #0b1020;
    --surface: #0f172a;
    --surface-2: #111827;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --primary: #7c3aed;
    --primary-700: #6d28d9;
    --accent: #22d3ee;
    --ring: #a78bfa;
    --shadow: 0 10px 30px rgba(2, 8, 23, .35);
}

:root.light {
    --bg: #ffffff;
    --surface: #f8fafc;
    --surface-2: #f1f5f9;
    --text: #0f172a;
    --muted: #475569;
    --primary: #6d28d9;
    --primary-700: #5b21b6;
    --accent: #0891b2;
    --ring: #7c3aed;
    --shadow: 0 10px 30px rgba(2, 8, 23, .10);
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, system-ui, Segoe UI, Arial, sans-serif;
    background: linear-gradient(180deg, var(--bg), #050814);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, video {
    max-width: 100%;
    display: block;
    border-radius: 14px
}

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

a:hover {
    text-decoration: underline
}

.muted {
    color: var(--muted)
}

.small {
    font-size: .9rem
}

.container {
    width: min(1120px, 92%);
    margin-inline: auto
}

.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    background: var(--surface);
    color: var(--text);
    padding: .5rem .75rem;
    border-radius: 8px;
    z-index: 1000;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: linear-gradient(180deg, rgba(2, 6, 23, .8), rgba(2, 6, 23, 0));
    border-bottom: 1px solid rgba(148, 163, 184, .15);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 0
}

.logo {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    color: var(--text)
}

.logo img {
    width: 100px;
    height: auto
}

.logo-text {
    font-family: "Source Serif 4", serif;
    letter-spacing: .2px
}

.menu {
    display: flex;
    align-items: center;
    gap: .6rem;
    list-style: none;
    margin: 0;
    padding: 0
}

.menu a {
    padding: .4rem .6rem;
    border-radius: 8px
}

.menu a:hover {
    background: rgba(124, 58, 237, .12);
    text-decoration: none
}

.icon-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 10px;
    padding: .35rem .6rem;
    cursor: pointer
}

.hero {
    padding: clamp(40px, 8vw, 96px) 0 24px;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 2rem;
    align-items: center;
}

.hero-copy h1 {
    font-size: clamp(2.1rem, 4.4vw, 3.6rem);
    line-height: 1.1;
    margin: 0 0 .6rem 0;
    letter-spacing: .2px;
}

.accent-gradient {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 58ch
}

.hero-ctas {
    display: flex;
    gap: .8rem;
    margin-top: 1rem
}

.hero-stats {
    display: flex;
    gap: 2rem;
    padding: 0;
    margin: 1.2rem 0 0 0;
    list-style: none;
}

.hero-stats strong {
    font-size: 1.4rem;
    display: block;
    color: #fff
}

.hero-visual {
    position: relative
}

.hero-visual-link {
    display: block;
    position: relative;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.hero-visual-link:hover {
    text-decoration: none;
}

.hero-visual-link .hero-video {
    transition: transform .25s ease, opacity .25s ease;
}

.hero-visual-link:hover .hero-video {
    transform: scale(1.01);
    opacity: .96;
}

.hero-video {
    box-shadow: var(--shadow)
}

.glass-card {
    position: absolute;
    right: -12px;
    bottom: -12px;
    background: linear-gradient(180deg, rgba(124, 58, 237, .15), rgba(2, 6, 23, .6));
    border: 1px solid rgba(167, 139, 250, .25);
    color: #e9e7ff;
    border-radius: 16px;
    padding: .8rem 1rem;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
}

.glass-title {
    margin: 0;
    font-weight: 700
}

.glass-desc {
    margin: .2rem 0 0 0;
    color: #e5defa
}

.shape-divider {
    height: 60px;
    background: radial-gradient(80% 80% at 50% -20%, rgba(124, 58, 237, .35), transparent 60%),
    radial-gradient(60% 60% at 10% 10%, rgba(34, 211, 238, .15), transparent 60%);
}

.section {
    padding: 64px 0
}

.section.alt {
    background: linear-gradient(180deg, rgba(15, 23, 42, .3), rgba(15, 23, 42, 0))
}

.section-head {
    margin-bottom: 24px
}

.section-title {
    font-size: 1.9rem;
    margin: 0
}

.section-subtitle {
    color: var(--muted);
    margin: .4rem 0 0 0
}

.filters {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    margin: 10px 0 22px
}

.demo-chip,
.data-chip,
.pub-chip {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 999px;
    padding: .35rem .75rem;
    cursor: pointer;
}

.demo-chip.is-active,
.data-chip.is-active,
.pub-chip.is-active,
.demo-chip:hover,
.data-chip.hover,
.pub-chip:hover {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, .15)
}

.grid.cards {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax(280px, 1fr) );
    grid-auto-rows: auto;
    gap: 1rem;
    align-items: start;
}

/* Each card uses subgrid so its internal rows align across all sibling cards */
.card {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 16px;
    overflow: visible;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-rows: auto 1fr auto auto;  /* media | body(grows) | actions | meta */
}

.card-media {
    position: relative;
    grid-row: 1;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.card-media a {
    display: block;
    line-height: 0;
}

.card-media img {
    cursor: pointer;
    transition: transform .25s ease, opacity .25s ease;
}

.card-media a:hover img {
    transform: scale(1.02);
    opacity: .92;
}

.card-body {
    padding: 1rem 1rem 0 1rem;
    grid-row: 2;
    display: flex;
    flex-direction: column;
}

.card-title {
    margin: .1rem 0 .35rem 0;
}

.card-text {
    color: var(--muted);
    flex: 1;
}

.card-actions {
    grid-row: 3;
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    padding: .75rem 1rem;
}

.meta {
    grid-row: 4;
    border-top: 1px dashed rgba(148, 163, 184, .2);
    padding: .6rem 1rem;
    color: var(--muted);
    font-size: .9rem;
}

.play-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    border: none;
    cursor: pointer;
    background: rgba(2, 6, 23, .7);
    color: #fff;
    border-radius: 999px;
    padding: .5rem .7rem;
    border: 1px solid rgba(148, 163, 184, .3)
}

.table-wrap {
    overflow: auto;
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 16px
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px
}

.data-table th, .data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    text-align: left
}

.data-table thead th {
    position: sticky;
    top: 0;
    background: var(--surface-2)
}

.dataset-cta {
    display: flex;
    gap: .6rem;
    margin-top: 1rem
}

.pub-list {
    list-style: none;
    padding-left: 0
}

.news-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.news-post {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
}

.news-post iframe {
    display: block;
    border-radius: 0;
    max-width: 100%;
}

.awards-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.award-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 16px;
    padding: 1rem 1.2rem;
    box-shadow: var(--shadow);
}

.award-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: .1rem;
}

.award-body {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.award-title {
    font-weight: 700;
    font-size: 1rem;
}

.award-authors {
    color: var(--text);
    font-size: .95rem;
}

.award-paper {
    color: var(--text);
    font-size: .95rem;
    font-style: italic;
}

.award-detail {
    color: var(--text);
    font-size: .95rem;
}

.award-venue {
    color: var(--muted);
    font-size: .88rem;
}
.pub-item {
    margin-bottom: .8rem
}

.pub-see-more {
    display: flex;
    justify-content: center;
    margin-top: 1.2rem;
}

.pub-see-more[hidden] {
    display: none !important;
}

.pub-title {
    display: block;
    font-weight: 600
}

.award-badge {
    font-style: normal;
    font-size: .75em;
    vertical-align: super;
    cursor: default;
    margin-left: .2em;
    position: relative;
    display: inline-block;
}

/* Tooltip shown on hover */
.award-badge::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 8px;
    padding: .35rem .6rem;
    font-size: .78rem;
    font-weight: 400;
    white-space: nowrap;
    box-shadow: var(--shadow);
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 10;
}

.award-badge:hover::after {
    opacity: 1;
}

.pub-venue {
    color: var(--muted);
    margin-right: .6rem
}

.pub-links a {
    margin-right: .4rem
}

.team-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax(220px, 1fr) );
    gap: 1rem;
}

.person {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.avatar {
    width: 96px;
    height: 96px;
    border-radius: 999px;
    margin-inline: auto;
    object-fit: cover
}

.person-name {
    margin: .6rem 0 .2rem 0
}

.person-role {
    color: var(--muted);
    margin: 0
}

.person-links {
    margin-top: auto;
}

.contact-wrap {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 1rem
}

.contact-form {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow)
}

.field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: .7rem
}

input, textarea {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 10px;
    padding: .6rem .7rem;
    outline: none;
}

input:focus, textarea:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, .15)
}

.info-box {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem
}

.btn {
    --_bg: var(--primary);
    background: var(--_bg);
    color: white;
    border: none;
    border-radius: 12px;
    padding: .6rem .9rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(124, 58, 237, .35);
}

.btn:hover {
    transform: translateY(-1px)
}

.btn:active {
    transform: translateY(0)
}

.btn-sm {
    padding: .45rem .7rem;
    border-radius: 10px
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, .25);
    box-shadow: none;
}

.btn-primary {
    --_bg: linear-gradient(90deg, var(--primary), var(--accent))
}

.site-footer {
    border-top: 1px solid rgba(148, 163, 184, .15);
    padding: 28px 0;
    background: rgba(2, 6, 23, .3)
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem
}

.footer-title {
    margin: .2rem 0 .4rem 0
}

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

.footer-links li {
    margin: .25rem 0
}

.footer-logo {
    margin-bottom: .4rem
}

.modal[hidden] {
    display: none !important
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 100
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .65);
    backdrop-filter: blur(3px)
}

.modal-content {
    position: relative;
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 16px;
    padding: 1rem;
    width: min(900px, 92%);
    box-shadow: var(--shadow)
}

.modal-close {
    position: absolute;
    right: .6rem;
    top: .6rem
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr
    }

    .contact-wrap {
        grid-template-columns: 1fr
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr
    }

    .nav {
        flex-wrap: wrap;
        row-gap: .5rem;
    }

    .menu {
        flex-wrap: wrap;
        row-gap: .3rem;
    }
}

@media (max-width: 640px) {
    .menu {
        gap: .3rem
    }

    .footer-grid {
        grid-template-columns: 1fr
    }

    .logo img {
        width: 64px;
    }

    .logo-text {
        font-size: .95rem;
    }

    .hero {
        padding-top: clamp(24px, 6vw, 48px);
    }

    .hero-ctas {
        flex-wrap: wrap;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 1rem 1.4rem;
    }

    .hero-visual {
        margin-top: 1.2rem;
    }

    .glass-card {
        position: static;
        margin-top: .8rem;
        right: auto;
        bottom: auto;
    }
}

@media (max-width: 420px) {
    .logo-text {
        display: none;
    }

    .menu a {
        padding: .35rem .45rem;
    }
}

/* ---------- Light-mode overrides ---------- */
/* Dark mode is unchanged; these rules only apply when <html> has the .light class. */

:root.light body {
    background: linear-gradient(160deg,
        #ffffff 0%,
        #f0f4ff 20%,
        #e8f0fe 40%,
        #f3f0ff 60%,
        #fdf4ff 80%,
        #fff8f0 100%);
    background-attachment: fixed;
}

:root.light .site-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0));
    border-bottom-color: rgba(15, 23, 42, .10);
}

:root.light .hero-stats strong {
    color: var(--text);
}

:root.light .glass-card {
    background: linear-gradient(180deg, rgba(124, 58, 237, .10), rgba(255, 255, 255, .85));
    border-color: rgba(124, 58, 237, .25);
    color: var(--text);
}

:root.light .glass-desc {
    color: var(--muted);
}

:root.light .section.alt {
    background: linear-gradient(180deg, rgba(15, 23, 42, .04), rgba(15, 23, 42, 0));
}

:root.light .site-footer {
    background: rgba(15, 23, 42, .04);
    border-top-color: rgba(15, 23, 42, .10);
}
