/* Theme tokens */
:root {
	--bg: #f6f9ff;
	--bg-alt: #eef3ff;
	--card: rgba(255, 255, 255, 0.82);
	--card-strong: rgba(255, 255, 255, 0.94);
	--border: rgba(42, 109, 246, 0.14);
	--divider: rgba(42, 109, 246, 0.14);
	--card-shadow: 0 12px 28px rgba(25, 60, 120, 0.18);
	--section-shadow: 0 18px 40px rgba(25, 60, 120, 0.12);
	--avatar-border: rgba(42, 109, 246, 0.18);
	--text: #1f2a44;
	--muted: rgba(31, 42, 68, 0.7);
	--accent: #2a6df6;
	--accent-2: #1aa6c9;
	--shadow: 0 28px 70px rgba(20, 50, 110, 0.16);
	--radius-lg: 28px;
	--radius-md: 18px;
	--font-serif: "Crimson Pro", "Times New Roman", serif;
	--font-sans: "Manrope", "Segoe UI", sans-serif;
}

/* Dark theme overrides (apply by adding `dark` class to <html>) */
.dark {
	--bg: #071016;
	--bg-alt: #0b131a;
	--card: rgba(10, 12, 16, 0.86);
	--card-strong: rgba(12, 14, 18, 0.92);
	--border: rgba(255,255,255,0.06);
	--divider: rgba(255, 255, 255, 0.24);
	--card-shadow: 0 12px 28px rgba(0,0,0,0.6);
	--section-shadow: 0 18px 40px rgba(0,0,0,0.5);
	--avatar-border: rgba(255,255,255,0.06);
	--text: #e7eef9;
	--muted: rgba(231, 238, 249, 0.72);
	--accent: #7aa7ff;
	--accent-2: #59d0e6;
	--shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
}

* {
	box-sizing: border-box;
}

html, body {
	min-height: 100%;
	margin: 0;
	color: var(--text);
	font-family: var(--font-sans);
	background: radial-gradient(circle at top, rgba(42, 109, 246, 0.06), transparent 50%),
		linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 55%, var(--bg) 100%);
}

body {
	position: relative;
	overflow-x: hidden;
	padding: 56px 16px 72px;
	font-size: 17px;
}

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

/* Background elements */
.bg {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 0;
}

.bg .orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(0px);
	opacity: 0.8;
	animation: float 18s ease-in-out infinite;
}

.bg .orb-1 {
	width: 380px;
	height: 380px;
	background: radial-gradient(circle, rgba(42, 109, 246, 0.3), transparent 70%);
	top: -120px;
	left: -80px;
}

.bg .orb-2 {
	width: 320px;
	height: 320px;
	background: radial-gradient(circle, rgba(26, 166, 201, 0.28), transparent 70%);
	bottom: -140px;
	right: -60px;
	animation-delay: -6s;
}

.bg .grid {
	position: absolute;
	inset: 0;
	background-image: linear-gradient(transparent 95%, rgba(42, 109, 246, 0.08) 96%),
		linear-gradient(90deg, transparent 95%, rgba(42, 109, 246, 0.08) 96%);
	background-size: 48px 48px;
	opacity: 0.4;
}

/* Layout */
.page {
	position: relative;
	z-index: 1;
	max-width: 980px;
	margin: 0 auto;
	background: transparent;
	border-radius: 0;
	padding: 48px clamp(20px, 4vw, 56px) 56px;
	box-shadow: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border: none;
	animation: rise 0.9s ease both;
}

/* Intro */
.intro {
	text-align: center;
	padding-bottom: 32px;
	border-bottom: none;
	position: relative;
}

.intro h1 {
	font-family: var(--font-serif);
	font-size: clamp(30px, 4vw, 44px);
	margin: 12px 0 4px;
	letter-spacing: 0.6px;
}

.tagline {
	margin: 0 0 18px;
	color: var(--muted);
	font-size: 17px;
}

.contact-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 16px;
}

.contact {
	margin: 0;
	font-size: 15px;
	color: var(--muted);
}

.email-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(42, 109, 246, 0.12);
	color: var(--accent);
	font-weight: 600;
	text-decoration: none;
	border: 1px solid rgba(42, 109, 246, 0.2);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.email-link:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(42, 109, 246, 0.2);
}

.links {
	margin: 0;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
}

.links a {
	color: var(--accent);
	text-decoration: none;
	font-size: 15px;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgba(42, 109, 246, 0.1);
	border: 1px solid rgba(42, 109, 246, 0.18);
	transition: transform 0.25s ease, background 0.25s ease, border 0.25s ease;
}

.links a:hover {
	transform: translateY(-2px);
	background: rgba(42, 109, 246, 0.2);
	border-color: rgba(42, 109, 246, 0.5);
}

/* Sections */

.section {
	/* Reduce vertical spacing between sections */
	margin: 18px 0;
	padding: 10px clamp(14px, 3vw, 14px);



	background: transparent;
	border-radius: 0;
	border: none;
	box-shadow: none;
}

.section + .section {
	border-top: none;
}

.section-header {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 18px;
}

.section-header::after {
	content: "";
	display: block;
	width: 100%;
	height: 1px;
	margin-top: 6px;
	background: var(--divider);
}

.eyebrow {
	text-transform: uppercase;
	letter-spacing: 2.8px;
	font-size: 11px;
	color: var(--accent);
}

.section h2 {
	margin: 0;
	font-family: var(--font-serif);
	font-size: 26px;
}

.section p {
	margin: 0;
	color: var(--muted);
	font-size: 16px;
	line-height: 1.7;
}

/* Publications list */
.publications ol {
	margin: 0;
	padding-left: 0;
	list-style-position: inside;
	display: grid;
	gap: 16px;
}

.publications li {
	padding: 16px 18px;
	background: transparent;
	border-radius: 0;
	border: none;
	box-shadow: none;
	line-height: 1.6;
	font-size: 16px;
	color: var(--text);
}

.publications li::marker {
	font-weight: 700;
	color: var(--accent-2);
	font-size: 1em;
}

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

.publications a:hover {
	text-decoration: underline;
}

/* Figures and videos */
.paper-figure img {
	margin: 12px auto 0;
	border-radius: 6px;
	box-shadow: none;
}

.paper-video {
	display: flex;
	justify-content: center;
	margin-top: 12px;
}

.paper-video iframe {
	width: 100%;
	max-width: 860px;
	aspect-ratio: 16/9;
	height: auto;
	border-radius: 6px;
	border: 0;
	box-shadow: none;
}

/* Avatar */
.avatar {
	width: 168px;
	height: 168px;
	border-radius: 50%;
	object-fit: cover;
	margin: 0 auto 14px;
	border: 3px solid var(--avatar-border);
	box-shadow: none;
}

/* Links section */
.links-section .links {
	justify-content: flex-start;
}

/* Message board */
.message-board .section-header {
	margin-bottom: 12px;
}

.message-form {
	display: grid;
	gap: 12px;
}

.message-form textarea {
	width: 100%;
	min-height: 96px;
	resize: vertical;
	padding: 12px 14px;
	font: inherit;
	font-size: 15px;
	line-height: 1.6;
	color: var(--text);
	background: transparent;
	border: 1px solid var(--divider);
	border-radius: 6px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.message-form textarea::placeholder {
	color: var(--muted);
}

.message-form textarea:focus {
	border-color: rgba(42, 109, 246, 0.5);
	box-shadow: 0 0 0 3px rgba(42, 109, 246, 0.16);
}

.message-form button {
	justify-self: start;
	padding: 8px 18px;
	font: inherit;
	font-weight: 700;
	font-size: 15px;
	color: #fff;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
	box-shadow: 0 10px 20px rgba(42, 109, 246, 0.28);
}

.message-form button:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 14px 24px rgba(42, 109, 246, 0.32);
}

.message-form button:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.form-status {
	min-height: 22px;
	margin: 0;
	font-size: 14px;
	font-weight: 600;
}

.form-status.pending {
	color: var(--muted);
}

.form-status.success {
	color: #1d9b58;
}

.form-status.error {
	color: #d0384f;
}

.dark .form-status.success {
	color: #59d793;
}

.dark .form-status.error {
	color: #ff7688;
}

/* Motion */
@keyframes float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(16px); }
}

@keyframes rise {
	from { transform: translateY(20px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
	body { padding: 40px 12px 56px; }
	.page { padding: 36px 18px 40px; }
	.section { margin-top: 28px; }
	.publications li { font-size: 15px; }
	.avatar { width: 130px; height: 130px; border-radius: 50%; }
}

@media (max-width: 520px) {
	.links { gap: 8px; }
	.links a { padding: 6px 10px; }
	.section h2 { font-size: 22px; }
	.message-form button { width: 100%; justify-self: stretch; }
}

/* Improve card width on very small screens (mobile portrait) */
@media (max-width: 420px) {
	.page {
		max-width: 100%;
		padding-left: 8px;
		padding-right: 8px;
		padding-top: 20px;
		padding-bottom: 32px;
	}

	/* Let sections stretch nearer to the viewport edges while keeping inner padding */
	.section {
		margin-left: -8px;
		margin-right: -8px;
		border-radius: 12px;
		padding: 12px 12px;
	}

	/* Reduce spacing between section and inner cards */
	.publications ol { gap: 8px; }

	/* Tighten list item padding so content appears wider */
	.publications li {
		padding: 10px 10px;
	}

	/* Avatar scale for small screens */
	.avatar { width: 110px; height: 110px; }
}

/* Theme toggle button */
.site-footer {
	text-align: center;
	color: var(--muted);
	margin-top: 24px;
	font-size: 14px;
}

@media (max-width: 520px) {
	.site-footer { margin-top: 18px; font-size: 13px; }
}

.theme-toggle {
	position: absolute;
	top: 18px;
	right: 18px;
	background: transparent;
	border: 1px solid rgba(31,42,68,0.06);
	color: var(--text);
	padding: 8px 10px;
	border-radius: 10px;
	cursor: pointer;
	font-size: 16px;
	display: inline-flex;
	align-items: center;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.dark .theme-toggle {
	border-color: rgba(255,255,255,0.06);
	background: rgba(255,255,255,0.02);
}

