/*
 * bruno.works — brand colors from the identity manual:
 *   blue  #3b7bff (logo + swatch)   near-black #292a2d
 *
 * Typography: the manual specifies Neopixel (titles) and Volte (text).
 * Both are commercial fonts. To use them, add licensed .woff2 files to
 * /fonts and uncomment the @font-face rules below. Until then the system
 * font stack is used, so the site makes no third-party font requests.
 */

/*
@font-face {
	font-family: "Volte";
	src: url("/fonts/volte-regular.woff2") format("woff2");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: "Volte";
	src: url("/fonts/volte-semibold.woff2") format("woff2");
	font-weight: 600;
	font-display: swap;
}
*/

:root {
	color-scheme: light dark;

	--brand: #3b7bff;
	--ink: #292a2d;

	--bg: #ffffff;
	--surface: #f4f6fa;
	--text: var(--ink);
	--muted: #5d6068;
	--line: #e2e5eb;
	/* Brand blue darkened so text links pass WCAG AA (5:1 on white). */
	--link: #2a66e8;

	--font: "Volte", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	/* Page width; --prose caps line length for paragraphs. */
	--measure: 76rem;
	--prose: 42rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: var(--ink);
		--surface: #323337;
		--text: #f2f3f5;
		--muted: #a9acb3;
		--line: #3d3f44;
		/* Brand blue lightened for AA contrast on #292a2d. */
		--link: #6d9bff;
	}
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--link);
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

a:hover {
	text-decoration-thickness: 2px;
}

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

.skip-link {
	position: absolute;
	left: 1rem;
	top: -3rem;
	padding: 0.5rem 0.75rem;
	background: var(--brand);
	color: #fff;
	z-index: 10;
}

.skip-link:focus {
	top: 1rem;
}

.wrap {
	width: min(100% - 3rem, var(--measure));
	margin-inline: auto;
}

/* Hidden on screen, still read by screen readers and search engines. */
.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

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

/*
 * The header is a contrasting band, following the brand manual's cover:
 *   light mode: near-black band, white logo with blue accent, blue pixels
 *   dark mode:  brand-blue band, all-white logo, white pixels
 * White or near-black text on brand blue is only ~3.8:1, so small text on the
 * blue band sits on solid chips, and the tagline is large bold text (3:1 is enough).
 */
.topbar {
	--band-bg: var(--ink);
	--band-fg: #ffffff;
	--band-accent: var(--brand);
	--logo-fg: #ffffff;
	--band-tagline: #6d9bff;
	--band-pixels: var(--brand);
	--chip-bg: transparent;
	--chip-border: rgba(255, 255, 255, 0.3);
	--chip-fg: #d5d7dc;
	--focus: var(--brand);

	position: relative;
	overflow: hidden;
	background: var(--band-bg);
	color: var(--band-fg);
	border-top: 12px solid var(--brand);
}

@media (prefers-color-scheme: dark) {
	.topbar {
		--band-bg: var(--brand);
		--band-accent: #ffffff;
		--logo-fg: #ffffff;
		--band-tagline: #ffffff;
		--band-pixels: #ffffff;
		--chip-bg: var(--ink);
		--chip-border: var(--ink);
		--chip-fg: #ffffff;
		--focus: #ffffff;
		border-top-color: var(--ink);
	}
}

.topbar :focus-visible {
	outline-color: var(--focus);
}

.topbar .wrap {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	padding-block: 1.25rem 2.5rem;
}

.logo {
	display: block;
	width: 65%;
	color: var(--logo-fg);
	line-height: 0;
}

.logo svg {
	width: 100%;
	height: auto;
}

.logo .accent {
	fill: var(--band-accent);
}

/* Toggle sits in its own row above the logo, top right, so it never overlaps it. */
.lang {
	order: -1;
	align-self: flex-end;
	display: flex;
	gap: 0.25rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
}

.lang a,
.lang span {
	padding: 0.35rem 0.6rem;
	border: 1px solid var(--chip-border);
	border-radius: 4px;
	background: var(--chip-bg);
	text-decoration: none;
	color: var(--chip-fg);
}

/* Current language: white chip, near-black text (14:1 on any band color). */
.lang [aria-current] {
	background: #ffffff;
	border-color: #ffffff;
	color: var(--ink);
}

.lang a:hover {
	border-color: #ffffff;
	color: #ffffff;
}

/* Tagline under the logo; .eyebrow.tagline beats the later .eyebrow rules. */
.eyebrow.tagline {
	margin: 0.75rem 0 0;
	color: var(--band-tagline);
	font-size: clamp(1.1875rem, 0.4vw + 1rem, 1.375rem);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-align: center;
}

/* Pixel graphics either side of the logo, only on wide screens where they stay outside its clear space. */
.band-pixels {
	display: none;
}

@media (min-width: 80rem) {
	.band-pixels {
		display: block;
	}

	.band-pixels svg {
		position: absolute;
		/* Free space beside the logo (65% of the content width), minus edge inset and clear space. */
		width: min(13rem, calc((100vw - 0.65 * min(100vw - 6rem, var(--measure))) / 2 - 5rem));
		height: auto;
		fill: var(--band-pixels);
	}

	.band-pixels svg:first-child {
		left: 1.5rem;
		bottom: 1.5rem;
		transform: scale(-1, -1);
	}

	.band-pixels svg:last-child {
		right: 1.5rem;
		top: 1.5rem;
	}
}

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

.hero {
	position: relative;
	padding-block: 3.5rem 3rem;
	overflow: hidden;
}

.hero .pixels {
	position: absolute;
	right: 0;
	top: 1.5rem;
	width: 15rem;
	height: auto;
	fill: var(--brand);
	opacity: 0.9;
	pointer-events: none;
}

.eyebrow,
h2 {
	margin: 0 0 1rem;
	color: var(--brand);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

@media (prefers-color-scheme: dark) {

	.eyebrow,
	h2 {
		color: var(--link);
	}
}

h1 {
	position: relative;
	margin: 0 0 1.5rem;
	/*
	 * Always one line: the size scales with the available width.
	 * --h1-fit is the headline's width in ems (+ ~5% margin), per language.
	 * Re-measure it if the headline text changes.
	 */
	--h1-fit: 15.2;
	white-space: nowrap;
	font-size: min(3rem, calc((100vw - 3rem) / var(--h1-fit)));
	line-height: 1.12;
	letter-spacing: -0.02em;
	font-weight: 700;
}

h1 .name,
h1 .role {
	display: block;
}

h1 .role {
	color: var(--brand);
}

@media (prefers-color-scheme: dark) {
	h1 .role {
		color: var(--link);
	}
}

:lang(pt-BR) h1 {
	--h1-fit: 21.2;
}

.lead {
	position: relative;
	max-width: 36rem;
	margin: 0 0 1rem;
	font-size: 1.1875rem;
	color: var(--muted);
}

.lead strong {
	color: var(--text);
	font-weight: 600;
}

/* ---------- Sections ---------- */

section {
	padding-block: 2.5rem;
	border-top: 1px solid var(--line);
}

/* Section headings sit centered above their content at every width. */
section>h2 {
	font-size: clamp(1rem, 0.5vw + 0.85rem, 1.25rem);
	letter-spacing: 0.14em;
	text-align: center;
}

.privacyNote {
	text-align: justify;
}

h2::before {
	content: "<";
	margin-right: 0.4em;
}

h2::after {
	content: ">";
	margin-left: 0.4em;
}

h3 {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.4;
}

p {
	margin: 0 0 1rem;
}

/* Focus areas */

.focus {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.focus li {
	padding: 1.25rem;
	background: var(--surface);
	border-left: 3px solid var(--brand);
	border-radius: 2px 6px 6px 2px;
}

.focus p {
	margin: 0.35rem 0 0;
	font-size: 0.9375rem;
	color: var(--muted);
}

/* Timeline (experience + education) */

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

.timeline>li {
	display: grid;
	grid-template-columns: 9.5rem 1fr;
	gap: 0.25rem 1.5rem;
	padding-block: 1.5rem;
}

.timeline>li+li {
	border-top: 1px dashed var(--line);
}

.timeline .when {
	margin: 0;
	font-size: 0.875rem;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
	padding-top: 0.1rem;
}

.timeline .place {
	display: block;
}

.duties {
	margin: 0.75rem 0 0;
	padding-left: 1.1rem;
	max-width: var(--prose);
}

.duties li {
	padding-left: 0.25rem;
}

.duties li+li {
	margin-top: 0.25rem;
}

.duties li::marker {
	content: "> ";
	color: var(--brand);
	font-weight: 600;
}

.stack {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0.9rem 0 0;
	padding: 0;
	list-style: none;
}

.stack li {
	padding: 0.15rem 0.55rem;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--surface);
	font-size: 0.8125rem;
	color: var(--muted);
}

/* Skills */

.skills {
	display: grid;
	gap: 1.25rem;
	margin: 0;
}

.skills dt {
	font-weight: 600;
}

.skills dd {
	margin: 0;
}

.skills .stack {
	margin-top: 0.5rem;
}

/* Job and degree titles stand out from the rest of the entry. */
.timeline h3 {
	font-size: 1.25rem;
	line-height: 1.3;
}

.timeline .where {
	margin: 0;
	color: var(--muted);
}

.timeline .note {
	font-size: 0.875rem;
}

@media (max-width: 63.99rem) {
	.hero .pixels {
		display: none;
	}
}

@media (max-width: 34rem) {

	/* Phones: logo spans the full content width. */
	.logo {
		width: 100%;
	}

	/* Contact links become stacked, full-width buttons with centered content.
	   (Child/element selectors outrank the base .contact rules defined later.) */
	ul.contact {
		flex-direction: column;
	}

	.contact>li>a {
		display: flex;
		justify-content: center;
		padding-block: 0.8rem;
	}

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

	.timeline>li {
		grid-template-columns: 1fr;
	}

	/* Phones: title, company, then dates/place, then details.
	   display: contents lets the inner blocks be reordered alongside .when. */
	.timeline>li>div {
		display: contents;
	}

	.timeline>li>div>h3 {
		order: 1;
	}

	.timeline>li>div>.where {
		order: 2;
	}

	.timeline>li>.when {
		order: 3;
		margin-top: 0.35rem;
	}

	.timeline>li>div>.duties {
		order: 4;
	}

	.timeline>li>div>.stack {
		order: 5;
	}
}

/* Projects */

.projects {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.projects li {
	padding: 1.25rem;
	border: 1px solid var(--line);
	border-radius: 6px;
}

.projects p {
	margin: 0.35rem 0 0;
	color: var(--muted);
}

/* Contact */

.contact {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.contact a {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.6rem 1rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	color: var(--text);
	text-decoration: none;
	font-weight: 600;
}

/* Brand icons keep their official proportions; only the height is set. */
.contact .icon {
	flex: none;
	width: auto;
	height: 1.25em;
}

/* Single-color brand icons (LinkedIn, Telegram) with cut-out symbols:
   white in dark mode; near-black on the light page, where white would vanish. */
.contact .icon-mono {
	color: var(--ink);
}

@media (prefers-color-scheme: dark) {
	.contact .icon-mono {
		color: #ffffff;
	}
}

.contact a:hover {
	border-color: var(--brand);
}

/* ---------- Content pages (e.g. Acknowledgements) ---------- */

.page {
	padding-block: 3rem 1rem;
}

.page-title {
	margin: 0 0 2rem;
	font-size: clamp(2rem, 4vw + 1rem, 3rem);
	line-height: 1.15;
	letter-spacing: -0.02em;
	text-align: center;
}

/* A single readable column, centered like the section headings. */
.prose {
	max-width: var(--prose);
	margin-inline: auto;
}

.prose h2 {
	margin: 2.5rem 0 1rem;
	font-size: clamp(1rem, 0.5vw + 0.85rem, 1.25rem);
	letter-spacing: 0.14em;
	text-align: center;
}

.prose h2:first-child {
	margin-top: 0;
}

.prose ul {
	padding-left: 1.1rem;
}

.prose li + li {
	margin-top: 0.35rem;
}

.prose li::marker {
	content: "> ";
	color: var(--brand);
	font-weight: 600;
}

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

/* Footer: set apart by a brand-blue bar (echoing the header) and a light surface. */
footer {
	margin-top: 3rem;
	padding-block: 2.5rem 3rem;
	border-top: 6px solid var(--brand);
	background: var(--surface);
	font-size: 0.875rem;
	color: var(--muted);
}

footer p {
	margin: 0 0 0.25rem;
}

/* Privacy note: justified on phones and tablets, centered on desktop. */
footer .privacyNote {
	text-align: justify;
}

@media (min-width: 64rem) {
	footer .privacyNote {
		text-align: center;
	}
}

footer .footer-links {
	margin-top: 0.75rem;
	text-align: center;
}

footer .copyright {
	margin-top: 1.5rem;
	text-align: center;
}

/* ---------- Larger screens ---------- */

@media (min-width: 64rem) {
	.wrap {
		width: min(100% - 6rem, var(--measure));
	}

	/* Hero: copy on the left, pixel graphic filling the right. */
	.hero {
		padding-block: 5.5rem 5rem;
	}

	/* Headline spans the full width; pixel graphic gets its own column beside the bio. */
	.hero {
		display: grid;
		grid-template-columns: 1fr min(20rem, 30%);
		column-gap: 3rem;
	}

	.hero>* {
		grid-column: 1;
	}

	.hero>h1 {
		grid-column: 1 / -1;
	}

	.hero .pixels {
		position: static;
		grid-column: 2;
		grid-row: 2 / span 2;
		align-self: center;
		width: 100%;
	}

	h1 {
		font-size: min(4.25rem, calc(min(100vw - 6rem, var(--measure)) / var(--h1-fit)));
	}

	.lead {
		max-width: var(--prose);
		font-size: 1.3125rem;
	}

	/* Sections: heading on top, content full width below. */
	section {
		padding-block: 3.5rem;
	}

	ection>h2 {
		margin-bottom: 1.5rem;
	}

	/* With the full width available, focus cards fit four across. */
	.focus {
		grid-template-columns: repeat(4, 1fr);
	}

	/* With the full width available, focus cards fit four across. */
	.focus {
		grid-template-columns: repeat(4, 1fr);
	}

	.timeline>li {
		grid-template-columns: 11rem 1fr;
		gap: 0.25rem 2.5rem;
	}

	.skills {
		grid-template-columns: repeat(2, 1fr);
		gap: 1.5rem 3rem;
	}

	.projects p {
		max-width: var(--prose);
	}
}

@media (prefers-reduced-motion: no-preference) {

	a,
	.lang a,
	.contact a {
		transition: border-color 0.15s ease, color 0.15s ease;
	}
}

@media print {

	.topbar,
	.hero .pixels,
	.lang {
		display: none;
	}
}