:root {
    --bg: #02060d;
    --text: #e0e0e0;
    --accent: #4fc3f7;
    --card-bg: #1a1a2e;
    --border: #2a2a3e;
    --max-width: 950px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

/* Spiral backdrop on every page. Fixed so it stays put while long pages
   scroll; anchored bottom-right so the spiral survives `cover` cropping on
   any aspect ratio. Header and main sit above it. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("/static/images/bg-spiral.webp") no-repeat right bottom / cover;
    pointer-events: none;
}

header, main {
    position: relative;
    z-index: 1;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent);
    text-decoration: none;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

.nav-links a.active {
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
}

/* Sections */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border);
}

section:last-child { border-bottom: none; }

#hero {
    padding: 6rem 0 4rem;
    text-align: center;
}

.profile-frame {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent);
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.2);
    transform-origin: 52% 38%;
}

h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: #aaa;
    max-width: 640px;
    margin: 0 auto;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.social-links a {
    color: #aaa;
    display: inline-flex;
    transition: color 0.2s, transform 0.2s;
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

.social-links svg {
    width: 22px;
    height: 22px;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, border-color 0.2s;
}

.project-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.project-card h4 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.project-card p {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 0;
}

.project-card a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-block;
    margin-top: 0.75rem;
}

.project-card a:hover { text-decoration: underline; }

.group-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 2rem 0 1rem;
}

.group-title:first-of-type { margin-top: 0; }


/* Publications */
.pub-list {
    padding-left: 1.5rem;
}

.pub-list li {
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    color: #c0c0c0;
}

.pub-list li a {
    color: var(--accent);
    text-decoration: none;
}

.pub-list li a:hover { text-decoration: underline; }

.pub-list em { color: #aaa; }

/* CV (experience + education) */
.cv-entry {
    margin-bottom: 1.75rem;
}

.cv-entry:last-child { margin-bottom: 0; }

.cv-entry h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.cv-org {
    color: #aaa;
    font-weight: 400;
}

.cv-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.6rem;
}

.cv-entry ul {
    list-style: none;
    padding: 0;
}

.cv-entry ul li {
    font-size: 0.9rem;
    color: #c0c0c0;
    margin-bottom: 0.35rem;
    padding-left: 1rem;
    position: relative;
}

.cv-entry ul li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #fff;
}

/* Contact */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

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

#contact a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 600px) {
    h1 { font-size: 2rem; }
    nav { flex-direction: column; gap: 1rem; }
    .nav-links a { margin-left: 1rem; }
}

/* Prose sections */
#about p, #research p, .section-intro {
    margin-bottom: 1rem;
}

#about p:last-child, #research p:last-child { margin-bottom: 0; }

.section-intro { color: #c0c0c0; }

/* Project card details */
.project-card .card-subtitle {
    color: var(--accent);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.project-card p + p { margin-top: 0.6rem; }

.tech-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0;
    margin-top: 0.9rem;
}

.tech-list li {
    font-size: 0.75rem;
    color: #c0c0c0;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
}

.card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1rem;
}

.pub-links a { margin-left: 0.25rem; font-size: 0.85rem; }

/* Skills */
.skill-group { margin-bottom: 1.5rem; }
.skill-group:last-child { margin-bottom: 0; }
.skill-group .group-title { margin: 0 0 0.25rem; font-size: 0.9rem; }
.skill-group .tech-list { margin-top: 0.5rem; }

.cv-detail {
    font-size: 0.9rem;
    color: #c0c0c0;
}

/* Home page: hero fills the viewport, nothing else */
body.home {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.home main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

body.home #hero {
    border-bottom: none;
    padding: 2rem 0 4rem;
}
