/* Armando Teles Fortes — homepage styles */

:root {
	--serif: "Source Serif 4", Iowan Old Style, Georgia, serif;
	--sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

	--bg: #fbfaf8;
	--surface: #ffffff;
	--text: #15171a;
	--muted: #62666e;
	--faint: #8b9098;
	--line: #e7e4de;
	--accent: #2f5aa0;
	--accent-soft: rgba(47, 90, 160, 0.09);
	--link-underline: rgba(47, 90, 160, 0.32);
	--shadow: 0 1px 2px rgba(15, 17, 20, 0.04), 0 12px 28px rgba(15, 17, 20, 0.06);

	--maxw: 900px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #101215;
		--surface: #171a1f;
		--text: #e9e7e3;
		--muted: #a0a6ae;
		--faint: #7f858d;
		--line: #262a31;
		--accent: #8fb5ef;
		--accent-soft: rgba(143, 181, 239, 0.12);
		--link-underline: rgba(143, 181, 239, 0.36);
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 28px rgba(0, 0, 0, 0.35);
	}
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	padding: 0 24px;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.65;
	font-feature-settings: "cv05" 1, "ss01" 1;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.wrap {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 76px 0 40px;
}

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

a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* In running text, links stay in the body colour with a quiet underline so the
   accent is reserved for headings, venues and hover states. */
.prose a, .row-val a, .edu-degree a, .affil a {
	color: var(--text);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	text-decoration-color: var(--link-underline);
	transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.prose a:hover, .row-val a:hover, .edu-degree a:hover, .affil a:hover {
	color: var(--accent);
	text-decoration-color: var(--accent);
}

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

::selection { background: var(--accent-soft); }

img, video { max-width: 100%; }

/* The markup carries width/height attributes for layout stability, so images
   must scale proportionally rather than take the attribute height. */
img { height: auto; }

/* ---------- masthead ---------- */

.masthead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 44px;
}

.name {
	margin: 0 0 0.2rem;
	font-family: var(--serif);
	font-size: clamp(2.1rem, 5vw, 2.7rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.08;
}

.role {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--accent);
}

.affil {
	margin: 1.05rem 0 0;
	font-size: 0.97rem;
	line-height: 1.55;
	color: var(--muted);
}

.contact {
	margin: 0.45rem 0 0;
	font-size: 0.92rem;
	color: var(--muted);
}

.links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 1.2rem;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 0.3rem 0.78rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font-size: 0.85rem;
	line-height: 1.5;
	white-space: nowrap;
	transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

a.chip:hover {
	border-color: var(--accent);
	background: var(--accent-soft);
	color: var(--accent);
	text-decoration: none;
	transform: translateY(-1px);
}

.chip svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
	flex: 0 0 auto;
	opacity: 0.75;
	transition: opacity 0.18s ease;
}

a.chip:hover svg { opacity: 1; }

.portrait {
	flex: 0 0 auto;
	width: 190px;
	aspect-ratio: 5 / 6;
	overflow: hidden;
	border-radius: 16px;
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
}

.portrait img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.43);
	transform-origin: 50% 32%;
}

/* ---------- sections ---------- */

.section { margin-top: 3.4rem; }

.section-title {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 0 0 1.5rem;
	font-size: 0.86rem;
	font-weight: 600;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--faint);
}

.section-title .rule {
	flex: 1;
	height: 1px;
	background: var(--line);
}

.section-title a {
	font-size: 0.79rem;
	letter-spacing: 0.06em;
	white-space: nowrap;
}

.prose p {
	margin: 0 0 0.95rem;
	font-size: 1.02rem;
	color: var(--text);
}

.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; }

/* ---------- education ---------- */

.edu-list { list-style: none; margin: 0; padding: 0; }

.edu {
	display: grid;
	grid-template-columns: 58px 1fr auto;
	align-items: center;
	gap: 20px;
	padding: 1.05rem 0;
}

.edu + .edu { border-top: 1px solid var(--line); }

.logo {
	--mark: 40px;
	--tall-mark: 34px;
	--tall-nudge: 1px;
	position: relative;
	width: 58px;
	height: 58px;
	display: grid;
	place-items: center;
	padding: 8px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 13px;
}

.logo img {
	width: auto;
	height: auto;
	max-width: var(--mark);
	max-height: var(--mark);
}

/* Tall crests are sized by width, so they stand taller than the square marks —
   absolute centring keeps their overflow even instead of hanging low. */
.logo--tall img {
	position: absolute;
	top: 50%;
	left: 50%;
	max-width: var(--tall-mark);
	max-height: none;
	/* A hair below centre: these crests taper downward, so dead-centre reads high. */
	transform: translate(-50%, calc(-50% + var(--tall-nudge)));
}

.edu-school {
	font-weight: 600;
	font-size: 1.01rem;
}

.edu-degree {
	font-size: 0.93rem;
	color: var(--muted);
}

.edu-meta {
	text-align: right;
	font-size: 0.88rem;
	color: var(--faint);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* ---------- publications ---------- */

.pubs { list-style: none; margin: 0; padding: 0; }

.pub {
	display: grid;
	grid-template-columns: 210px 1fr;
	gap: 24px;
	margin: 0 -18px;
	padding: 18px;
	border-radius: 16px;
	transition: background 0.22s ease, box-shadow 0.22s ease;
}

.pub:hover {
	background: var(--surface);
	box-shadow: var(--shadow);
}

.thumb {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 11px;
	background-color: var(--line);
	background-size: cover;
	background-position: 50% 23%;
	background-repeat: no-repeat;
}

.thumb video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 23%;
	transition: transform 0.45s ease;
}

.pub:hover .thumb video { transform: scale(1.035); }

.pub-title {
	font-family: var(--serif);
	font-size: 1.12rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--text);
	letter-spacing: -0.005em;
}

.pub-title:hover { color: var(--accent); text-decoration: none; }

.authors {
	margin: 0.4rem 0 0;
	font-size: 0.93rem;
	color: var(--muted);
}

.authors .me { color: var(--text); font-weight: 600; }

.venue {
	margin: 0.2rem 0 0;
	font-size: 0.9rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.venue-name { color: var(--accent); font-weight: 600; }

.res-links {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-top: 0.75rem;
}

.res-links .chip { padding: 0.2rem 0.62rem; font-size: 0.81rem; gap: 5px; }
.res-links .chip svg { width: 12px; height: 12px; }

.chip.soon {
	border-style: dashed;
	color: var(--faint);
	background: transparent;
}

/* ---------- year / item rows ---------- */

.rows {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: max-content 1fr;
	column-gap: 20px;
}

/* Rows share the list's columns so every entry lines up; the fixed width is the
   fallback for browsers without subgrid. */
.row {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: 5.9rem 1fr;
	grid-template-columns: subgrid;
	column-gap: 20px;
	padding: 0.7rem 0;
}

.row + .row { border-top: 1px solid var(--line); }

.row-key {
	font-size: 0.88rem;
	color: var(--faint);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.row-val { font-size: 0.97rem; }
.row-val strong { font-weight: 600; }
.row-note { color: var(--muted); }

.subhead {
	margin: 0 0 0.3rem;
	font-size: 0.93rem;
	font-weight: 600;
	color: var(--muted);
}

/* ---------- footer ---------- */

.footer {
	margin-top: 4.2rem;
	padding-top: 1.2rem;
	border-top: 1px solid var(--line);
	font-size: 0.85rem;
	color: var(--faint);
}

/* ---------- small screens ---------- */

@media (max-width: 680px) {
	body { padding: 0 20px; }

	.wrap { padding: 40px 0 32px; }

	.masthead {
		flex-direction: column;
		align-items: flex-start;
		gap: 22px;
	}

	.chip svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
	flex: 0 0 auto;
	opacity: 0.75;
	transition: opacity 0.18s ease;
}

a.chip:hover svg { opacity: 1; }

.portrait { width: 142px; order: -1; }

	.section { margin-top: 2.6rem; }

	/* Keep the label and its rule on one line; the trailing link drops below. */
	.section-title {
		flex-wrap: wrap;
		row-gap: 7px;
	}

	.section-title a {
		order: 3;
		flex-basis: 100%;
	}

	.edu {
		grid-template-columns: 46px 1fr;
		gap: 16px;
		align-items: start;
	}

	.logo { --mark: 32px; --tall-mark: 27px; --tall-nudge: 0.8px; width: 46px; height: 46px; padding: 6px; border-radius: 11px; }

	.edu-meta {
		grid-column: 2;
		text-align: left;
		margin-top: 0.25rem;
	}

	.pub {
		grid-template-columns: 1fr;
		gap: 14px;
		margin: 0 -12px;
		padding: 12px;
	}

	.rows { column-gap: 14px; }
	.row { column-gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
	.pub:hover .thumb video { transform: none; }
}
