/* ============================================================
   work.css: projects, publications, theses and awards.
   ============================================================ */

/* ── Media slots ───────────────────────────────────────────── */
.media {
	position: relative;
	overflow: hidden;
	border-radius: 10px;
	background: var(--surface);
	aspect-ratio: 16 / 9;
}

.media img,
.media video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* A figure from a paper: shown whole, on white like the page it came
   from, in both themes. */
.media.figure {
	background: #ffffff;
	border: 1px solid var(--line);
	padding: 0.6rem;
}

.media.figure img {
	object-fit: contain;
}

/* A video: a local poster with a play button, swapped for the player on
   click. */
.media.video a {
	display: block;
	width: 100%;
	height: 100%;
}

.media.video iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 4rem;
	height: 4rem;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	display: grid;
	place-items: center;
	transition: transform 0.15s, background-color 0.15s;
}

.play::before {
	content: "";
	margin-left: 0.3rem;
	border-left: 1.2rem solid #ffffff;
	border-top: 0.75rem solid transparent;
	border-bottom: 0.75rem solid transparent;
}

.media.video a:hover .play,
.media.video a:focus-visible .play {
	transform: scale(1.08);
	background: var(--accent);
}

.dur {
	position: absolute;
	right: 0.6rem;
	bottom: 0.6rem;
	padding: 0.1rem 0.45rem;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.7);
	color: #ffffff;
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
}

/* An empty slot, marked so it cannot be published by mistake. */
.media.empty {
	display: grid;
	place-items: center;
	padding: 1rem;
	background: var(--slot);
	border: 1.5px dashed var(--accent);
	color: var(--accent-text);
	font-size: 0.8rem;
	font-weight: 700;
	text-align: center;
}

/* ── Projects ──────────────────────────────────────────────── */
.projects {
	display: grid;
	grid-template-columns: 1.7fr 1fr;
	gap: 2rem;
}

.project-main h3 {
	font-size: 1.5rem;
	margin: 1rem 0 0.4rem;
}

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

.project-side {
	display: grid;
	gap: 1.4rem;
	align-content: start;
}

.project-side article {
	display: grid;
	grid-template-columns: 8rem 1fr;
	gap: 0.9rem;
	align-items: start;
}

.project-side .media {
	aspect-ratio: 4 / 3;
	border-radius: 8px;
	font-size: 0.65rem;
	padding: 0.4rem;
}

.project-side h3 {
	font-size: 1.05rem;
	margin-bottom: 0.2rem;
}

.project-side p {
	font-size: 0.9rem;
}

/* ── Publications ──────────────────────────────────────────── */
.pub-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
}

.pub-filter button {
	border: 0;
	border-bottom: 2px solid transparent;
	background: none;
	padding: 0 0 0.25rem;
	font-weight: 700;
	color: var(--muted);
}

.pub-filter button[aria-pressed="true"] {
	color: var(--ink);
	border-color: var(--accent);
}

.pub-filter small {
	font-weight: 400;
	margin-left: 0.3rem;
	font-variant-numeric: tabular-nums;
}

.pub {
	display: grid;
	grid-template-columns: 13.75rem 1fr;
	gap: 1.75rem;
	padding-block: 1.6rem;
	border-top: 1px solid var(--line);
}

.pub .media {
	aspect-ratio: 4 / 3;
	border-radius: 8px;
}

.pub-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.9rem;
	color: var(--muted);
	margin-bottom: 0.5rem;
}

.badge {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 0.15rem 0.65rem;
	border-radius: 999px;
	border: 1.5px solid var(--accent);
	color: var(--accent-text);
}

.badge.j {
	background: var(--accent);
	color: var(--accent-ink);
}

.badge.t {
	border-color: var(--steel);
	color: var(--ink);
	background: color-mix(in srgb, var(--steel) 16%, transparent);
}

.pub h3 {
	font-size: 1.35rem;
	line-height: 1.2;
	margin-bottom: 0.6rem;
}

.pub h3 a {
	text-decoration: none;
}

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

.pub p {
	max-width: 42rem;
}

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

.pub .by {
	font-size: 0.9rem;
	color: var(--muted);
}

.doi a {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--accent-text);
}

/* ── Awards ────────────────────────────────────────────────── */
.awards {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.9rem;
	max-width: 46rem;
}

.awards li {
	display: grid;
	grid-template-columns: 6rem 1fr;
	gap: 1rem;
	align-items: baseline;
}

.awards .yr {
	font-family: var(--display);
	font-weight: 700;
	color: var(--accent-text);
	font-variant-numeric: tabular-nums;
}

@media (max-width: 52rem) {
	.projects,
	.pub {
		grid-template-columns: 1fr;
	}

	.pub .media {
		max-width: 22rem;
	}
}

@media (max-width: 30rem) {
	.project-side article {
		grid-template-columns: 6rem 1fr;
	}

	.awards li {
		grid-template-columns: 1fr;
		gap: 0.1rem;
	}
}

/* ── Project cards and the arena diagram ───────────────────── */
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 1.5rem;
}

.card .media {
	aspect-ratio: 4 / 3;
	border-radius: 8px;
	margin-bottom: 0.75rem;
}

.card h4 {
	font-size: 1.1rem;
	margin: 0;
}

.card .card-meta {
	font-size: 0.85rem;
	color: var(--muted);
	margin-bottom: 0.35rem;
}

.card p {
	font-size: 0.95rem;
	color: var(--muted);
}

.card .card-link {
	margin-top: 0.4rem;
}

.card-link a {
	font-weight: 700;
	color: var(--accent-text);
}

/* Drawn in the page's own colours, so it follows the theme. */
.media.diagram {
	background: var(--surface);
	border: 1px solid var(--line);
}

.arena {
	display: block;
	width: 100%;
	height: 100%;
}

.arena .wall {
	fill: color-mix(in srgb, var(--muted) 6%, transparent);
	stroke: var(--muted);
	stroke-width: 1;
	stroke-dasharray: 3 3;
	opacity: 0.8;
}

.arena .floor {
	fill: color-mix(in srgb, var(--steel) 14%, transparent);
}

.arena .grid {
	fill: none;
	stroke: var(--steel);
	stroke-width: 0.6;
	opacity: 0.45;
}

.arena .track {
	fill: none;
	stroke: var(--accent);
	stroke-width: 2;
	stroke-dasharray: 5 4;
}

.arena .cone {
	stroke: var(--accent);
	stroke-width: 0.6;
	opacity: 0.35;
}

.arena .cam {
	fill: var(--ink);
}

.arena .lens {
	fill: var(--accent);
}

.arena .shadow {
	fill: var(--ink);
	opacity: 0.12;
}

.arena .drop {
	stroke: var(--muted);
	stroke-width: 0.8;
	stroke-dasharray: 2 3;
}

.arena .arm {
	stroke: var(--ink);
	stroke-width: 2.5;
	stroke-linecap: round;
}

.arena .rotor {
	fill: color-mix(in srgb, var(--steel) 25%, transparent);
	stroke: var(--steel);
	stroke-width: 1;
}

.arena .body {
	fill: var(--accent);
}

/* ── Authorship ─────────────────────────────────────────────── */
.by .me {
	color: var(--ink);
}

.badge.co {
	border-color: var(--steel);
	color: var(--steel);
	background: none;
}

.media.diagram svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* ── Pictures open large ──────────────────────────────────── */
#projects .media:not(.video),
#publications .media:not(.video) {
	cursor: zoom-in;
	transition: box-shadow 0.15s;
}

#projects .media:not(.video):hover,
#publications .media:not(.video):hover {
	box-shadow: 0 0 0 2px var(--accent);
}

.lightbox {
	width: min(92vw, 70rem);
	max-height: 92vh;
	padding: 1rem 1rem 0.75rem;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
	color: var(--ink);
}

.lightbox::backdrop {
	background: rgba(10, 12, 15, 0.75);
}

.lightbox-body {
	display: grid;
	place-items: center;
	border-radius: 8px;
	overflow: hidden;
}

.lightbox-body.is-diagram {
	background: var(--bg);
}

.lightbox-body img,
.lightbox-body svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: 78vh;
	object-fit: contain;
}

.lightbox-caption {
	margin-top: 0.6rem;
	font-size: 0.9rem;
	color: var(--muted);
	max-width: 60rem;
}

.lightbox-close {
	position: absolute;
	top: 0.4rem;
	right: 0.4rem;
	z-index: 1;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: var(--surface);
	font-size: 1.3rem;
	line-height: 1;
}

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