/* s3labs — personal site stylesheet
   Design: calm editorial — generous whitespace, soft ink palette, a single
   warm accent, quiet type hierarchy, hairline structure. No clutter. */

/* ---------- Tokens ---------- */

:root {
	color-scheme: light dark;
	--font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont,
		"Segoe UI", sans-serif;
	--font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
	--max-width: 980px;
	--measure: 62ch;
	--radius: 12px;
	--radius-sm: 8px;
	--header-h: 66px;
}

/* Light (default) — soft, warm, editorial */
:root {
	--bg: #f7f6f2;
	--surface: #ffffff;
	--surface-2: #f0eee8;
	--text: #1b1c1f;
	--muted: #6b6e76;
	--faint: #9a9ea7;
	--border: rgba(27, 28, 31, 0.1);
	--border-strong: rgba(27, 28, 31, 0.16);
	--accent: #a8542b;
	--accent-soft: rgba(168, 84, 43, 0.09);
	--accent-border: rgba(168, 84, 43, 0.3);
	--shadow: 0 18px 40px -22px rgba(27, 28, 31, 0.28);
	--header-bg: rgba(247, 246, 242, 0.82);
	--overlay: rgba(24, 23, 21, 0.9);
}

/* Dark — explicit toggle */
:root[data-theme="dark"] {
	--bg: #131315;
	--surface: #1a1a1d;
	--surface-2: #202024;
	--text: #ecebe8;
	--muted: #a6a6ad;
	--faint: #7c7c84;
	--border: rgba(236, 235, 232, 0.1);
	--border-strong: rgba(236, 235, 232, 0.16);
	--accent: #d99a6a;
	--accent-soft: rgba(217, 154, 106, 0.1);
	--accent-border: rgba(217, 154, 106, 0.32);
	--shadow: 0 22px 48px -24px rgba(0, 0, 0, 0.65);
	--header-bg: rgba(19, 19, 21, 0.8);
	--overlay: rgba(9, 9, 10, 0.92);
}

/* Show the "More" menu even without JS (covers the extra nav targets) */
.more-menu {
	display: flex;
}

/* No-JS fallback follows the system preference */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		--bg: #131315;
		--surface: #1a1a1d;
		--surface-2: #202024;
		--text: #ecebe8;
		--muted: #a6a6ad;
		--faint: #7c7c84;
		--border: rgba(236, 235, 232, 0.1);
		--border-strong: rgba(236, 235, 232, 0.16);
		--accent: #d99a6a;
		--accent-soft: rgba(217, 154, 106, 0.1);
		--accent-border: rgba(217, 154, 106, 0.32);
		--shadow: 0 22px 48px -24px rgba(0, 0, 0, 0.65);
		--header-bg: rgba(19, 19, 21, 0.8);
		--overlay: rgba(9, 9, 10, 0.92);
	}
}

/* ---------- Base ---------- */

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

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16.5px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
	font-family: var(--font-display);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.015em;
}

::selection {
	background: var(--accent);
	color: #fff;
}

a {
	color: var(--text);
	text-decoration: none;
	transition: color 0.15s ease;
}

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

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

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 4px;
}

.container {
	max-width: var(--max-width);
	margin: 0 auto;
	padding-inline: 28px;
}

.measure {
	max-width: var(--measure);
}

/* Shared body copy (project pages, lab notes) */
main > section > p,
.cv-section > p {
	max-width: 68ch;
	color: var(--muted);
}

main > section > p + p {
	margin-top: 18px;
}

/* Lead paragraph right under a section label */
main > section > h2 + p,
.cv-section > h2 + p {
	color: var(--text);
	font-size: 17px;
}

section[id] {
	scroll-margin-top: calc(var(--header-h) + 24px);
}

/* ---------- Header ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--header-bg);
	backdrop-filter: blur(16px) saturate(1.2);
	-webkit-backdrop-filter: blur(16px) saturate(1.2);
	border-bottom: 1px solid var(--border);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	height: var(--header-h);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.brand:hover {
	text-decoration: none;
}

.brand img {
	width: 34px;
	height: auto;
}

.brand-word {
	font-family: var(--font-display);
	font-size: 18px;
	font-weight: 500;
	letter-spacing: -0.02em;
	color: var(--text);
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 26px;
}

.site-nav a {
	position: relative;
	color: var(--muted);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.005em;
	padding: 6px 0;
}

.site-nav a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: var(--text);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.28s ease;
}

.site-nav a:hover {
	color: var(--text);
}

.site-nav a:hover::after {
	transform: scaleX(1);
}

.site-nav a[aria-current="page"] {
	color: var(--text);
}

.site-nav a[aria-current="page"]::after {
	transform: scaleX(1);
	background: var(--accent);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

/* Theme toggle */
.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: transparent;
	color: var(--text);
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

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

.theme-toggle svg {
	display: block;
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.theme-toggle .icon-moon {
	display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
	display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
	display: block;
}

/* No-JS fallback */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) .theme-toggle .icon-sun {
		display: none;
	}

	:root:not([data-theme]) .theme-toggle .icon-moon {
		display: block;
	}
}

/* Hamburger */
.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 38px;
	height: 38px;
	padding: 10px;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}

.nav-toggle .bar {
	display: block;
	height: 1.6px;
	border-radius: 2px;
	background: var(--text);
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(1) {
	transform: translateY(6.6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(2) {
	opacity: 0;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
	transform: translateY(-6.6px) rotate(-45deg);
}

/* ---------- Scroll reveal ---------- */

.js .reveal {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.visible {
	opacity: 1;
	transform: none;
}

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

main {
	padding-block: 56px 96px;
}

/* ---------- Eyebrows & section labels ---------- */

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var(--accent);
}

.eyebrow::before {
	content: "";
	width: 26px;
	height: 1px;
	background: var(--accent);
}

.section-label {
	display: flex;
	align-items: baseline;
	gap: 14px;
	margin-top: 84px;
	margin-bottom: 30px;
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var(--faint);
}

.section-label .section-num {
	font-family: var(--font-display);
	font-size: 12px;
	font-weight: 500;
	color: var(--accent);
	letter-spacing: 0.02em;
}

.section-label::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
	transform: translateY(-3px);
}

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

.hero {
	padding: 40px 0 0;
}

.hero-inner {
	position: relative;
}

.hero-logo {
	position: absolute;
	top: 0;
	right: 0;
	width: 112px;
	height: auto;
	margin-top: -6px;
}

.hero h1 {
	max-width: 15ch;
	font-size: clamp(38px, 6vw, 62px);
	font-weight: 500;
	line-height: 1.03;
	letter-spacing: -0.03em;
	margin-bottom: 28px;
}

.lede {
	font-size: clamp(19px, 2.4vw, 22px);
	line-height: 1.55;
	letter-spacing: -0.01em;
	color: var(--text);
	max-width: 54ch;
}

.hero-inner > p:not(.lede) {
	max-width: 58ch;
	margin-top: 20px;
	font-size: 16px;
	line-height: 1.7;
	color: var(--muted);
}

.hero-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: 40px;
}

.hero-link {
	font-size: 14.5px;
	font-weight: 500;
	color: var(--muted);
}

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

/* ---------- Stats ---------- */

.stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 32px;
	margin-top: 72px;
	padding-top: 36px;
	border-top: 1px solid var(--border-strong);
}

.stat-num {
	display: block;
	font-family: var(--font-display);
	font-size: clamp(30px, 4vw, 40px);
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.1;
	color: var(--text);
	font-variant-numeric: tabular-nums;
}

.stat-label {
	display: block;
	margin-top: 10px;
	color: var(--muted);
	font-size: 13.5px;
	line-height: 1.45;
}

/* ---------- About ---------- */

.about-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
}

.about-grid .about-lead {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	align-items: start;
}

.avatar {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	border: 1px solid var(--border-strong);
	background: var(--surface);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display);
	font-size: 30px;
	font-weight: 500;
	color: var(--faint);
	letter-spacing: -0.01em;
}

.about-text p {
	color: var(--muted);
}

.about-text p:first-child {
	color: var(--text);
	font-size: 17px;
}

.about-meta {
	margin: 30px 0 0;
	list-style: none;
	display: grid;
	gap: 2px;
}

.about-meta li {
	display: flex;
	align-items: baseline;
	gap: 18px;
	padding: 12px 0;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 15px;
}

.about-meta .meta-key {
	min-width: 96px;
	color: var(--text);
	font-weight: 500;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.12em;
}

.skills {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin-top: 26px;
}

.skill-tag {
	padding: 6px 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--muted);
	font-size: 13px;
	transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.skill-tag:hover {
	color: var(--text);
	border-color: var(--accent-border);
	transform: translateY(-1px);
}

/* ---------- Timeline ---------- */

.timeline {
	list-style: none;
}

.timeline li {
	display: grid;
	grid-template-columns: 92px 1fr;
	gap: 28px;
	padding: 22px 0;
	border-top: 1px solid var(--border);
}

.timeline li:last-child {
	border-bottom: 1px solid var(--border);
}

.timeline .tl-year {
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 15px;
	color: var(--text);
	font-variant-numeric: tabular-nums;
	padding-top: 2px;
}

.timeline p {
	color: var(--muted);
	font-size: 15.5px;
	line-height: 1.65;
}

/* ---------- News ---------- */

.news-list {
	list-style: none;
}

.news-item {
	display: grid;
	grid-template-columns: 64px 1fr;
	gap: 28px;
	padding: 18px 0;
	border-top: 1px solid var(--border);
}

.news-item:last-child {
	border-bottom: 1px solid var(--border);
}

.news-item time {
	font-family: var(--font-display);
	color: var(--text);
	font-weight: 500;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	padding-top: 2px;
}

.news-item p {
	font-size: 15.5px;
	line-height: 1.6;
	color: var(--muted);
}

/* ---------- Quotes ---------- */

.quotes {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
}

.quote-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 34px 26px 24px;
	position: relative;
}

.quote-card::before {
	content: "\201C";
	position: absolute;
	top: 14px;
	left: 22px;
	font-family: var(--font-display);
	font-size: 48px;
	line-height: 1;
	color: var(--accent);
	opacity: 0.4;
}

.quote-card blockquote {
	font-size: 16px;
	line-height: 1.55;
	color: var(--text);
}

.quote-card figcaption {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid var(--border);
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--muted);
}

/* ---------- Projects ---------- */

.project-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 24px;
}

.project {
	display: block;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.project:hover {
	border-color: var(--border-strong);
	box-shadow: var(--shadow);
	transform: translateY(-4px);
}

.project-thumb {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.project:hover .project-thumb {
	transform: scale(1.04);
}

.project-body {
	padding: 22px 24px 26px;
}

.project h3 {
	font-size: 19px;
	font-weight: 500;
	color: var(--text);
	margin-bottom: 8px;
}

.project p {
	color: var(--muted);
	font-size: 14.5px;
	line-height: 1.6;
}

/* ---------- Page heading (subpages) ---------- */

.page-heading {
	padding-bottom: 40px;
	margin-bottom: 8px;
	border-bottom: 1px solid var(--border);
}

.page-heading h1 {
	max-width: 18ch;
	font-size: clamp(34px, 5vw, 52px);
	font-weight: 500;
	line-height: 1.06;
	letter-spacing: -0.03em;
	margin-top: 4px;
}

.page-heading p {
	margin-top: 22px;
	max-width: 60ch;
	font-size: 18px;
	line-height: 1.6;
	color: var(--muted);
}

.research-links {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 26px;
}

/* ---------- Research page ---------- */

.research-stats {
	margin-top: 52px;
}

.pub-year {
	margin-top: 64px;
}

.pub-year-label {
	display: flex;
	align-items: baseline;
	gap: 18px;
	margin-bottom: 26px;
}

.pub-year-num {
	font-family: var(--font-display);
	font-size: 34px;
	font-weight: 500;
	letter-spacing: 0.01em;
	line-height: 1;
	color: var(--text);
	font-variant-numeric: tabular-nums;
}

.pub-year-count {
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--faint);
}

.pub-year-label::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
	align-self: center;
}

.publications {
	list-style: none;
	display: grid;
	gap: 18px;
}

.publications li {
	display: flex;
	gap: 26px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.publications li:hover {
	border-color: var(--border-strong);
	box-shadow: var(--shadow);
	transform: translateY(-2px);
}

.js .publications li.reveal {
	transition: opacity 0.6s ease, transform 0.35s ease, border-color 0.2s ease,
		box-shadow 0.3s ease;
}

.pub-media {
	flex: 0 0 260px;
	align-self: stretch;
	background: var(--surface-2);
	border-radius: var(--radius-sm);
	overflow: hidden;
	display: flex;
	align-items: center;
}

.pub-thumb {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 10px;
}

.pub-body {
	min-width: 0;
	padding: 4px 4px 4px 0;
}

.publications h3 {
	font-size: 18px;
	font-weight: 500;
	line-height: 1.45;
	margin-bottom: 10px;
	color: var(--text);
}

.publications .authors {
	color: var(--muted);
	font-size: 13.5px;
	line-height: 1.55;
	margin-bottom: 6px;
}

.publications .venue {
	color: var(--muted);
	font-size: 14.5px;
	line-height: 1.55;
}

.publications .venue a {
	color: var(--accent);
}

/* .pub-links */
.pub-links {
	list-style: none;
	padding: 0;
	margin-top: 16px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.pub-links li {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 500;
	border-radius: 999px;
}

.pub-links li:has(.icon) {
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text);
	transition: border-color 0.15s ease, color 0.15s ease;
}

.pub-links li:has(.icon):hover {
	border-color: var(--accent-border);
	color: var(--accent);
}

.pub-links li:has(.cites) {
	border: none;
	padding: 0;
}

.pub-links .icon {
	display: block;
	width: 15px;
	height: 15px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pub-links a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	color: inherit;
	text-decoration: none;
}

.pub-links .cites {
	font-weight: 400;
	color: var(--muted);
	font-size: 12.5px;
}

/* Badges */
.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 11px;
	border: 1px solid var(--accent-border);
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 11.5px;
	font-weight: 500;
	letter-spacing: 0.01em;
	white-space: nowrap;
	vertical-align: 2px;
}

/* ---------- Project pages ---------- */

.parallax {
	position: relative;
	overflow: hidden;
	border-radius: var(--radius);
	margin: 36px 0 8px;
	aspect-ratio: 16 / 9;
	background: var(--surface-2);
}

.parallax .project-hero {
	position: absolute;
	inset: -6% 0;
	width: 100%;
	height: 112%;
	aspect-ratio: auto;
	object-fit: cover;
	transform: translateY(-1%) scale(1.03);
	will-change: transform;
}

/* ---------- Feature / related / press lists ---------- */

.feature-list {
	list-style: none;
	display: grid;
	gap: 16px;
}

.feature-list li {
	position: relative;
	padding-left: 26px;
	font-size: 15.5px;
	line-height: 1.65;
	color: var(--muted);
}

.feature-list li::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 0.62em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
}

.feature-list li a {
	color: var(--text);
}

.feature-list li a:hover {
	color: var(--accent);
}

.related-links {
	list-style: none;
	display: grid;
	gap: 12px;
}

.related-links a {
	position: relative;
	display: inline-block;
	padding-left: 24px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--text);
}

.related-links a::before {
	content: "\2192";
	position: absolute;
	left: 0;
	font-size: 14px;
	color: var(--accent);
}

.press-list {
	list-style: none;
	display: grid;
	gap: 12px;
}

.press-list li {
	position: relative;
	padding-left: 24px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--muted);
}

.press-list li::before {
	content: "\2192";
	position: absolute;
	left: 0;
	color: var(--accent);
}

.press-list a {
	color: var(--text);
}

/* ---------- Videos ---------- */

.video-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 22px;
}

.video-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px;
}

.video-embed {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--radius-sm);
	background: #000;
}

.video-embed iframe,
.video-embed video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.video-card figcaption {
	margin-top: 14px;
	padding: 0 4px 4px;
	color: var(--muted);
	font-size: 13.5px;
	line-height: 1.5;
}

/* ---------- Gallery + lightbox ---------- */

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}

.gallery figure {
	margin: 0;
}

.gallery img {
	width: 100%;
	aspect-ratio: 16 / 11;
	object-fit: cover;
	border-radius: var(--radius-sm);
	cursor: zoom-in;
	transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery img:hover {
	filter: brightness(1.04);
}

.gallery figcaption {
	margin-top: 10px;
	color: var(--muted);
	font-size: 12.5px;
	line-height: 1.5;
}

.lightbox {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: none;
	align-items: center;
	justify-content: center;
	background: var(--overlay);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.lightbox.open {
	display: flex;
}

.lightbox figure {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.lightbox img {
	max-width: min(92vw, 1100px);
	max-height: 78vh;
	border-radius: var(--radius-sm);
}

.lightbox figcaption {
	margin-top: 16px;
	color: var(--muted);
	font-size: 13.5px;
	line-height: 1.5;
	text-align: center;
	max-width: 80vw;
}

.lightbox button {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 46px;
	height: 46px;
	border: 1px solid var(--border-strong);
	border-radius: 50%;
	background: var(--surface);
	color: var(--text);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.lightbox button:hover {
	border-color: var(--accent-border);
	color: var(--accent);
}

.lightbox .lb-prev {
	left: 18px;
}

.lightbox .lb-next {
	right: 18px;
}

.lightbox .lb-close {
	top: 18px;
	right: 18px;
	transform: none;
}

/* ---------- Procedure steps ---------- */

.steps {
	counter-reset: step;
	display: grid;
	gap: 12px;
}

.step {
	counter-increment: step;
	display: flex;
	gap: 20px;
	align-items: flex-start;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 22px 24px;
}

.step-num {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--accent-border);
	border-radius: 50%;
	color: var(--accent);
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 15px;
	font-variant-numeric: tabular-nums;
}

.step-num::before {
	content: counter(step);
}

.step h3 {
	font-size: 17px;
	font-weight: 500;
	margin-bottom: 5px;
	color: var(--text);
}

.step p {
	color: var(--muted);
	font-size: 14.5px;
	line-height: 1.6;
}

/* ---------- Haptic loop ---------- */

.loop {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	align-items: stretch;
}

.loop-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 26px 22px;
}

.loop-card .freq {
	display: block;
	font-family: var(--font-display);
	font-size: 28px;
	font-weight: 500;
	letter-spacing: -0.02em;
	color: var(--text);
	font-variant-numeric: tabular-nums;
}

.loop-card .freq.freq-sm {
	font-size: 18px;
	line-height: 1.4;
}

.loop-card h3 {
	font-size: 15px;
	font-weight: 500;
	margin: 8px 0;
	color: var(--text);
}

.loop-card p {
	color: var(--muted);
	font-size: 13.5px;
	line-height: 1.55;
}

/* ---------- Component cards ---------- */

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 18px;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px;
}

.card img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--radius-sm);
	margin-bottom: 16px;
}

.card h3 {
	font-size: 16px;
	font-weight: 500;
	margin: 0 4px 6px;
	color: var(--text);
}

.card p {
	margin: 0 4px 6px;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.6;
}

/* ---------- Awards ---------- */

.award-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 18px;
}

.award-card {
	display: block;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 22px;
	transition: border-color 0.2s ease, transform 0.2s ease;
	color: var(--text);
}

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

.award-card .award-year {
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 13px;
	color: var(--accent);
	font-variant-numeric: tabular-nums;
}

.award-card h3 {
	font-size: 15.5px;
	font-weight: 500;
	margin: 8px 0;
	color: var(--text);
}

.award-card p {
	color: var(--muted);
	font-size: 13.5px;
	line-height: 1.5;
}

/* ---------- Contact ---------- */

.contact-links {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.contact-links a {
	display: inline-flex;
	align-items: center;
	padding: 10px 18px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font-size: 14px;
	font-weight: 500;
	transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.contact-links a:hover {
	border-color: var(--accent-border);
	color: var(--accent);
	transform: translateY(-1px);
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 22px;
	border: 1px solid var(--border-strong);
	border-radius: 999px;
	background: transparent;
	color: var(--text);
	font-family: var(--font-body);
	font-size: 14.5px;
	font-weight: 500;
	transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease,
		transform 0.15s ease;
}

.btn:hover {
	border-color: var(--text);
	text-decoration: none;
}

.btn-primary {
	background: var(--text);
	border-color: var(--text);
	color: var(--bg);
	font-weight: 500;
}

.btn-primary:hover {
	opacity: 0.88;
}

/* ---------- Footer ---------- */

.site-footer {
	border-top: 1px solid var(--border);
	padding: 34px 0 48px;
	color: var(--muted);
	font-size: 13.5px;
}

.footer-grid {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 24px;
}

.footer-links a {
	color: var(--muted);
}

.footer-links a:hover {
	color: var(--text);
}

/* ---------- Lab notes ---------- */

.note-card {
	padding: 40px 0;
	border-top: 1px solid var(--border);
}

.note-card:last-child {
	border-bottom: 1px solid var(--border);
}

.note-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	color: var(--faint);
	font-size: 12.5px;
	margin-bottom: 14px;
}

.note-meta time {
	color: var(--text);
	font-weight: 500;
	font-family: var(--font-display);
}

.note-card h2 {
	font-size: 24px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -0.01em;
	margin-bottom: 16px;
	color: var(--text);
}

.note-card p {
	color: var(--muted);
	font-size: 16px;
	line-height: 1.7;
}

.note-card p + p {
	margin-top: 16px;
}

.note-card a {
	color: var(--text);
}

.note-card a:hover {
	color: var(--accent);
}

.note-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 20px;
}

.note-card .badge {
	color: var(--muted);
	border-color: var(--border);
	background: transparent;
}

/* ---------- CV ---------- */

.cv-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 20px;
	flex-wrap: wrap;
}

.cv-head h1 {
	font-size: clamp(30px, 4.4vw, 42px);
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.cv-head .cv-role {
	color: var(--muted);
	font-size: 16px;
	margin-top: 10px;
}

.cv-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.cv-section {
	padding: 30px 0;
	border-top: 1px solid var(--border);
}

.cv-section h2 {
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var(--faint);
	margin-bottom: 20px;
}

.cv-entry {
	margin-bottom: 22px;
}

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

.cv-entry h3 {
	font-size: 17px;
	font-weight: 500;
	color: var(--text);
}

.cv-entry .cv-when {
	font-size: 13.5px;
	color: var(--muted);
	margin-top: 3px;
}

.cv-entry p:not(.cv-when) {
	margin-top: 10px;
	font-size: 14.5px;
	color: var(--muted);
	line-height: 1.6;
}

.cv-entry ul {
	margin: 12px 0 0 18px;
	display: grid;
	gap: 8px;
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--muted);
}

.cv-pubs {
	list-style: none;
	display: grid;
	gap: 14px;
}

.cv-pubs li {
	position: relative;
	padding-left: 22px;
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--muted);
}

.cv-pubs li::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 0.6em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
}

.cv-pubs .cv-venue {
	display: block;
	color: var(--accent);
	font-size: 13px;
	margin-top: 3px;
}

.cv-skills {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
}

/* ---------- "More" dropdown nav ---------- */

.site-nav .more-wrap {
	position: relative;
	display: inline-flex;
}

.site-nav .more-toggle {
	padding: 6px 0;
	color: var(--muted);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.005em;
	border: none;
	background: transparent;
	cursor: pointer;
	position: relative;
	transition: color 0.15s ease;
}

.site-nav .more-toggle::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: var(--text);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.28s ease;
}

.site-nav .more-toggle:hover {
	color: var(--text);
}

.site-nav .more-toggle:hover::after {
	transform: scaleX(1);
}

.site-nav .more-toggle[aria-current="page"] {
	color: var(--text);
}

.site-nav .more-toggle[aria-current="page"]::after {
	transform: scaleX(1);
	background: var(--accent);
}

.site-nav .more-toggle .chev {
	display: inline-block;
	margin-left: 6px;
	font-size: 11px;
	vertical-align: 2px;
}

.more-menu {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	display: flex;
	flex-direction: column;
	min-width: 170px;
	padding: 8px;
	list-style: none;
	margin: 0;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
	z-index: 60;
}

.more-wrap.open .more-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.more-menu a {
	display: block;
	padding: 9px 14px;
	border-radius: var(--radius-sm);
	color: var(--muted);
	font-size: 14px;
	white-space: nowrap;
}

.more-menu a:hover {
	background: var(--surface-2);
	color: var(--text);
}

.more-menu a[aria-current="page"] {
	color: var(--accent);
	background: var(--accent-soft);
}

/* ---------- 404 ---------- */

.notfound {
	text-align: center;
	padding: 80px 0 40px;
}

.notfound .code {
	font-family: var(--font-display);
	font-size: clamp(80px, 16vw, 140px);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.04em;
	color: var(--text);
	opacity: 0.12;
}

.notfound h1 {
	font-size: 24px;
	font-weight: 500;
	margin-top: 8px;
}

.notfound p {
	color: var(--muted);
	margin: 16px auto 30px;
	max-width: 440px;
	font-size: 16px;
}

.notfound .btn {
	margin: 0 6px;
}

/* ---------- Responsive ---------- */

@media (max-width: 920px) {
	.header-inner {
		flex-wrap: wrap;
		height: auto;
		padding-block: 12px;
	}

	.nav-toggle {
		display: inline-flex;
	}

	.header-actions {
		margin-left: auto;
	}

	.site-header {
		position: relative;
	}

	.site-nav {
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		flex-direction: column;
		gap: 0;
		padding: 8px 28px 18px;
		background: var(--header-bg);
		backdrop-filter: blur(16px);
		-webkit-backdrop-filter: blur(16px);
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow);
		display: none;
	}

	.site-nav.open {
		display: flex;
	}

	.site-nav > a {
		padding: 13px 0;
		border-top: 1px solid var(--border);
		font-size: 15px;
	}

	.site-nav > a::after {
		display: none;
	}

	.site-nav .more-wrap {
		border-top: 1px solid var(--border);
	}

	.site-nav .more-toggle {
		width: 100%;
		text-align: left;
		padding: 13px 0 5px;
	}

	.site-nav .more-toggle::after {
		display: none;
	}

	.more-menu {
		position: static;
		display: none;
		flex-direction: column;
		min-width: 0;
		padding: 0;
		background: transparent;
		border: none;
		border-radius: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.more-wrap.open .more-menu {
		display: flex;
	}

	.more-menu a {
		padding: 11px 0;
		border-top: 1px solid var(--border);
		border-radius: 0;
	}

	.more-menu a:hover {
		background: transparent;
	}
}

@media (max-width: 860px) {
	.quotes {
		grid-template-columns: 1fr;
	}

	.video-grid {
		grid-template-columns: 1fr;
	}

	.about-grid .about-lead {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.container {
		padding-inline: 20px;
	}

	main {
		padding-block: 32px 64px;
	}

	.hero {
		padding-top: 24px;
	}

	.hero-logo {
		position: static;
		width: 84px;
		margin-bottom: 28px;
	}

	.section-label {
		margin-top: 60px;
	}

	.stats {
		grid-template-columns: repeat(2, 1fr);
		row-gap: 30px;
		margin-top: 48px;
		gap: 0;
	}

	.about-meta .meta-key {
		min-width: 84px;
	}

	.loop {
		grid-template-columns: 1fr;
	}

	.timeline li {
		grid-template-columns: 64px 1fr;
		gap: 18px;
	}

	.news-item {
		grid-template-columns: 52px 1fr;
		gap: 18px;
	}

	.pub-year {
		margin-top: 48px;
	}

	.pub-year-num {
		font-size: 28px;
	}

	.publications li {
		flex-direction: column;
		gap: 16px;
		padding: 16px;
	}

	.pub-media {
		flex: 0 0 auto;
		width: 100%;
	}

	.pub-body {
		padding: 0;
	}

	.lightbox button {
		width: 40px;
		height: 40px;
	}
}

/* ---------- Print ---------- */

@media print {
	.site-header,
	.site-footer,
	.theme-toggle,
	.nav-toggle,
	.cv-actions,
	.pub-media,
	.pub-thumb {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
		font-size: 11pt;
	}

	a {
		color: #000;
	}

	a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 9pt;
		color: #555;
	}

	.js .reveal {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}

	.publications li {
		break-inside: avoid;
	}

	.cv-section {
		border-top-color: #ccc;
	}
}

/* ---------- Reduced motion ---------- */

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

	.js .reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.project,
	.project-thumb,
	.gallery img,
	.award-card,
	.parallax .project-hero,
	.publications li,
	.skill-tag,
	.contact-links a,
	.btn {
		transition: none;
	}
}
