@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
	--fg: #e6e9ee;
	--fg-muted: #8b95a5;
	--bg: #101217;
	--bg-alt: #1a1d24;
	--border: #2a2e38;
	--accent: #5b9dfa;
	--accent-bg: #1c2c4a;
	--accent-ink: #0d1117;
	--amber: #e8a33d;
}

html.light-theme {
	--fg: #1c1f26;
	--fg-muted: #5b6472;
	--bg: #ffffff;
	--bg-alt: #f5f6f8;
	--border: #c7cdd6;
	--accent: #2563eb;
	--accent-bg: #eaf0fe;
	--accent-ink: #ffffff;
	--amber: #a15f04;
}

* { box-sizing: border-box; }

body, .topbar, .card-list li, .placeholder-box, .rtag {
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

html {
	font-size: 16px;
}

html, body {
	margin: 0;
	min-height: 100%;
}

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

h1, h2.page-title, h3.profile-section-header,
.ctitle, .category-label, .page-tagline, .home-main h1 {
	font-family: 'Space Grotesk', 'Inter', sans-serif;
}

/* Top bar (replaces the old left sidebar) */
.topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--bg-alt);
	border-bottom: 1px solid var(--border);
}

.topbar-inner {
	max-width: 1600px;
	margin: 0 auto;
	padding: 1rem 3rem 1rem 14rem;
	display: flex;
	align-items: center;
	gap: 3rem;
}

.top-nav {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.1rem;
}

.top-nav a {
	padding: 0.4rem 0.5rem;
	border-bottom: 2px solid transparent;
	color: var(--fg-muted);
	text-decoration: none;
	font-size: 0.85rem;
	font-weight: 500;
	white-space: nowrap;
}

.top-nav a:hover {
	color: var(--fg);
}

.top-nav a.active {
	color: var(--accent);
	border-bottom-color: var(--accent);
	font-weight: 600;
}

.topbar-actions {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.search-trigger {
	flex-shrink: 0;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: none;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--fg-muted);
	font-size: 0.8rem;
	cursor: pointer;
}

.search-trigger:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.theme-toggle {
	flex-shrink: 0;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: none;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--fg-muted);
	font-size: 0.8rem;
	cursor: pointer;
}

.theme-toggle:hover {
	border-color: var(--accent);
	color: var(--accent);
}

/* Search modal */
.search-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	align-items: flex-start;
	justify-content: center;
	padding-top: 10vh;
	z-index: 100;
}

.search-overlay.open {
	display: flex;
}

.search-modal {
	width: 90%;
	max-width: 640px;
	max-height: 70vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--bg-alt);
	border: 1px solid var(--border);
	border-radius: 10px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.search-input-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--border);
	color: var(--fg-muted);
}

#search-input {
	flex: 1;
	border: none;
	background: none;
	outline: none;
	color: var(--fg);
	font-size: 1rem;
	font-family: inherit;
}

#search-close {
	background: none;
	border: none;
	color: var(--fg-muted);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}

#search-close:hover {
	color: var(--fg);
}

.search-results {
	list-style: none;
	margin: 0;
	padding: 0.5rem;
	overflow-y: auto;
}

.search-results a {
	display: block;
	padding: 0.6rem 0.75rem;
	border-radius: 6px;
	text-decoration: none;
	color: var(--fg);
}

.search-results a:hover {
	background: var(--accent-bg);
}

.search-result-section {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--accent);
	font-weight: 600;
}

.search-result-title {
	font-weight: 600;
	font-size: 0.92rem;
	margin-top: 0.1rem;
}

.search-result-snippet {
	font-size: 0.82rem;
	color: var(--fg-muted);
	margin-top: 0.15rem;
}

.search-empty {
	padding: 1.5rem;
	text-align: center;
	color: var(--fg-muted);
	font-size: 0.9rem;
}

/* Reusable contact-column classes — used in the Home page hero, next to the photo */
.home-contact {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	width: 100%;
}

.contact-section-label {
	display: block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fg-muted);
	font-weight: 600;
	margin-top: 0.4rem;
	padding-bottom: 0.35rem;
	border-bottom: 1px solid var(--border);
}

.contact-section-label:first-child {
	margin-top: 0;
}

.contact-link {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--fg);
	text-decoration: none;
	font-size: 0.85rem;
}

.contact-link i {
	width: 1.1rem;
	color: var(--accent);
	text-align: center;
}

.contact-link-icon {
	width: 1.1rem;
	height: 1.1rem;
	object-fit: contain;
	flex-shrink: 0;
}

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

.contact-meta {
	color: var(--fg-muted);
	font-weight: 400;
}

.footer-note {
	text-align: center;
	font-size: 0.75rem;
	color: var(--fg-muted);
	padding: 2rem 0 2.5rem;
}

/* Content */
.container {
	max-width: 1150px;
	margin: 0 auto;
	padding: 3rem 2rem;
}

/* Education & Experience: two side-by-side columns */
.edu-exp-grid {
	display: flex;
	gap: 3rem;
	align-items: flex-start;
}

.edu-exp-col {
	flex: 1;
	min-width: 0;
}

h2.page-title {
	font-size: 1.7rem;
	font-weight: 700;
	margin: 0 0 1.5rem;
}

/* Home page hero: photo + contact column beside name/tagline/tags/bio */
.home-hero {
	display: flex;
	gap: 3rem;
	align-items: flex-start;
	margin-bottom: 1rem;
}

.home-highlights {
	margin-top: 2.5rem;
}

.highlights-title {
	text-align: center;
}

.highlights-rule {
	border: none;
	border-top: 1px solid var(--border);
	margin: 0.75rem 0 2rem;
}

.highlights-intro {
	text-align: center;
	max-width: 640px;
	margin: 0 auto 1.5rem;
}

.home-photo-col {
	flex: 0 0 240px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.25rem;
}

.home-avatar {
	width: 240px;
	height: 240px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid var(--border);
}

.home-main {
	flex: 1;
	min-width: 0;
}

.home-main h1 {
	font-size: 2rem;
	font-weight: 700;
	margin: 0 0 0.3rem;
}

.page-tagline {
	font-size: 1.05rem;
	color: var(--accent);
	margin: 0 0 1.25rem;
}

.profile-section-header {
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fg-muted);
	margin: 2.25rem 0 0.85rem;
	font-weight: 600;
}

.profile-section-header:first-child {
	margin-top: 0;
}

.research-bio {
	margin: 0;
	font-size: 0.98rem;
	line-height: 1.75;
}

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

.home-news {
	margin: 2rem 0;
}

.news-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.news-item {
	flex: 1;
	min-width: 260px;
	background: var(--accent-bg);
	border-left: 3px solid var(--accent);
	border-radius: 8px;
	padding: 1rem 1.25rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.news-date {
	display: block;
	color: var(--accent);
	font-weight: 700;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 0.35rem;
}

.side-photo-layout {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
}

.side-photo-text-col {
	flex: 1;
	min-width: 0;
}

.side-photo-col {
	flex: 0 0 400px;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.side-photo-col img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	border: 1px solid var(--border);
}

@media (max-width: 800px) {
	.side-photo-col {
		flex-direction: column;
		width: 100%;
	}
}

.research-bio a:hover {
	text-decoration: underline;
}

.research-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-bottom: 1.25rem;
}

.rtag {
	background: none;
	border: 1px solid var(--border);
	color: var(--fg-muted);
	padding: 0.3rem 0.75rem;
	border-radius: 5px;
	font-size: 0.78rem;
	font-weight: 500;
}

/* Research highlight cards (Home page, below Research Overview) */
.highlight-card {
	display: flex;
	gap: 1.1rem;
	align-items: center;
	padding: 1.75rem 0;
	border-top: 1px solid var(--border);
}

.highlight-card:first-of-type {
	border-top: none;
	padding-top: 0;
}

.hc-body {
	flex: 1;
	min-width: 0;
}

.hc-thumb {
	flex: 0 0 290px;
}

.hc-thumb--lg {
	flex: 0 0 380px;
}

.hc-thumb img {
	display: block;
	width: 100%;
	border-radius: 8px;
	border: 1px solid var(--border);
}

.hc-theme {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--accent);
	font-family: 'Space Grotesk', 'Inter', sans-serif;
	font-size: 1.3rem;
	text-transform: none;
	letter-spacing: 0.02em;
	font-weight: 700;
	margin: 0 0 0.7rem;
}

.hc-step {
	flex-shrink: 0;
	width: 1.7rem;
	height: 1.7rem;
	border-radius: 50%;
	background: var(--accent);
	color: var(--accent-ink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	font-weight: 700;
}

.hc-title {
	font-family: 'Space Grotesk', 'Inter', sans-serif;
	font-size: 1.2rem;
	font-weight: 600;
	margin: 0 0 0.3rem;
}

.hc-venue {
	font-size: 0.85rem;
	color: var(--accent);
	opacity: 0.75;
	margin: 0 0 0.2rem;
}

.hc-venue {
	margin-bottom: 0.85rem;
}

.hc-venue strong {
	color: var(--accent);
	opacity: 1;
	font-weight: 600;
}

.hc-venue a {
	color: var(--accent);
	text-decoration: underline;
}

.hc-desc {
	margin: 0.9rem 0 0;
	font-size: 0.92rem;
	font-style: italic;
	color: var(--fg-muted);
	line-height: 1.7;
}

@media (max-width: 800px) {
	.highlight-card {
		flex-direction: column;
	}
	.hc-thumb {
		flex-basis: auto;
		width: 100%;
		max-width: 280px;
	}
}

/* Category header + timeline entry list.
   Used on Education, Experience, Talks, Teaching, Service, Awards, Publications. */
.category-label {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--accent);
	margin: 2.2rem 0 1.1rem;
}

.category-label:first-child {
	margin-top: 0;
}

/* Category sections (Publications: By Year / By Venue Type) */
.cat-section {
	padding: 1.75rem 0;
	border-bottom: 1px solid var(--border);
}

.cat-section:first-child {
	padding-top: 0;
}

.cat-section:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.cat-count {
	color: var(--fg-muted);
	font-weight: 500;
	text-transform: none;
	letter-spacing: normal;
}

.acc-rate {
	font-style: italic;
	color: var(--amber);
}

/* Project showcase list (5G/xG Research Papers & Open Datasets) — image + title + teaser always visible, "Read more" expands the rest */
.project-list {
	display: flex;
	flex-direction: column;
}

.project-item {
	border-bottom: 1px solid var(--border);
	padding: 1.75rem 0;
}

.project-item:first-child {
	padding-top: 0;
}

.project-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.project-row {
	display: flex;
	gap: 1.5rem;
	align-items: flex-start;
}

.project-row .project-thumb {
	flex: 0 0 220px;
	width: 220px;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--border);
}

.project-info {
	flex: 1;
	min-width: 0;
}

.project-venue {
	display: inline-block;
	background: none;
	border: 1px solid var(--border);
	color: var(--fg-muted);
	padding: 0.25rem 0.65rem;
	border-radius: 5px;
	font-size: 0.72rem;
	font-weight: 500;
	margin-bottom: 0.5rem;
}

.project-title-inline {
	font-family: 'Space Grotesk', 'Inter', sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: var(--fg);
	line-height: 1.35;
	margin: 0 0 0.5rem;
}

.project-desc {
	font-size: 0.85rem;
	color: var(--fg-muted);
	line-height: 1.65;
	margin: 0 0 0.6rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.project-item.is-expanded .project-desc {
	-webkit-line-clamp: unset;
	overflow: visible;
}

.project-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: none;
	border: none;
	padding: 0;
	margin-bottom: 0.85rem;
	color: var(--accent);
	font-size: 0.8rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
}

.project-toggle:hover {
	text-decoration: underline;
}

.project-toggle-icon {
	font-weight: 700;
}

.project-links {
	display: none;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.project-item.is-expanded .project-links {
	display: flex;
}

.project-link {
	font-size: 0.76rem;
	padding: 0.3rem 0.7rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	color: var(--fg-muted);
	text-decoration: none;
}

.project-link:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.project-link--muted {
	color: var(--fg-muted);
	opacity: 0.55;
	cursor: default;
}

@media (max-width: 700px) {
	.project-row {
		flex-direction: column;
	}
	.project-row .project-thumb {
		width: 100%;
	}
}

.card-list {
	list-style: none;
	margin: 0 0 1.75rem;
	padding: 0 0 0 1.4rem;
	position: relative;
}

.card-list::before {
	content: '';
	position: absolute;
	left: 0.28rem;
	top: 0.35rem;
	bottom: 0.35rem;
	width: 1px;
	background: var(--border);
}

.card-list:last-child {
	margin-bottom: 0;
}

.card-list li {
	position: relative;
	padding: 0 0 1.5rem;
}

.card-list li:last-child {
	padding-bottom: 0;
}

.card-list li::before {
	content: '';
	position: absolute;
	left: -1.4rem;
	top: 0.3rem;
	width: 0.55rem;
	height: 0.55rem;
	border-radius: 50%;
	background: var(--bg);
	border: 2px solid var(--accent);
}

.card-list .subhead {
	font-weight: 600;
	font-size: 0.8rem;
	font-style: italic;
	color: var(--fg-muted);
	margin: 0.3rem 0 0.5rem;
}

.ctitle {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--fg);
	margin: 0 0 0.25rem;
}

.pub-view .ctitle {
	color: var(--accent);
}

.cvenue, .cmentor {
	font-size: 0.85rem;
	color: var(--fg-muted);
	margin: 0 0 0.3rem;
}

.cvenue strong {
	color: var(--accent);
	font-weight: 600;
}

.cmentor strong {
	color: var(--fg);
	font-weight: 700;
}

.cdesc {
	font-size: 0.9rem;
	color: var(--fg);
	margin: 0 0 0.35rem;
}

.cdate {
	font-size: 0.8rem;
	color: var(--fg-muted);
	margin: 0;
}

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

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

.caward {
	font-size: 0.85rem;
	color: var(--amber);
	font-style: italic;
	margin: 0.3rem 0 0;
}

.cdataset {
	margin: 0.3rem 0 0;
}

.dataset-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--accent) !important;
	border: 1px solid var(--accent);
	border-radius: 999px;
	padding: 0.15rem 0.65rem;
}

.dataset-link:hover {
	background: var(--accent-bg);
	text-decoration: none !important;
}

.dataset-link i {
	font-size: 0.7rem;
}

/* Publications toggle tabs */
.pub-toggle-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.pub-note {
	font-size: 0.8rem;
	font-style: italic;
	color: var(--fg-muted);
	margin: 0 0 1.5rem;
}

.pub-view {
	display: none;
}

.pub-view.active {
	display: block;
}

.toggle-btn {
	background: none;
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 0.4rem 0.9rem;
	font-size: 0.85rem;
	color: var(--fg-muted);
	cursor: pointer;
}

.toggle-btn:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.toggle-btn.active {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
	font-weight: 600;
}

.sub-toggle-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 1.5rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--border);
}

.sub-toggle-btn {
	background: none;
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0.3rem 0.75rem;
	font-size: 0.78rem;
	color: var(--fg-muted);
	cursor: pointer;
}

.sub-toggle-btn:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.sub-toggle-btn.active {
	background: var(--accent-bg);
	border-color: var(--accent);
	color: var(--accent);
	font-weight: 600;
}


/* Placeholder / empty-state sections */
.placeholder-box {
	border: 1px dashed var(--border);
	border-radius: 10px;
	padding: 1.5rem;
	color: var(--fg-muted);
	font-size: 0.92rem;
	background: var(--bg-alt);
}

.callout {
	background: var(--accent-bg);
	border-radius: 10px;
	padding: 1rem 1.25rem;
	font-size: 0.92rem;
	margin-bottom: 1.25rem;
}

/* Responsive */
@media (max-width: 800px) {
	.topbar-inner {
		flex-wrap: wrap;
		justify-content: center;
		padding: 0.85rem 1.25rem;
		gap: 0.5rem;
	}
	.topbar-actions {
		order: 1;
		width: 100%;
		justify-content: center;
		padding-bottom: 0.6rem;
		margin-bottom: 0.4rem;
		border-bottom: 1px solid var(--border);
	}
	.top-nav {
		order: 2;
		width: 100%;
		flex-wrap: wrap;
		justify-content: center;
		gap: 0.4rem;
	}
	.container {
		padding: 2rem 1.25rem;
	}
	.home-hero {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}
	.home-main h1, .page-tagline {
		text-align: center;
	}
	.edu-exp-grid {
		flex-direction: column;
		gap: 2rem;
	}
	.side-photo-layout {
		flex-direction: column-reverse;
	}
}
