/* Tokens */
:root {
	--paper: #E7EAE6;
	--ink: #20242A;
	--muted: #5A626C;
	--rule: #C4CAC4;
	--accent: #2F3BD6;
	--layer: #3A4049;

	--display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
	--text: "Schibsted Grotesk", system-ui, sans-serif;

	--gutter: clamp(16px, 5vw, 64px);
	--rail: 11rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #1C1F23;
		--ink: #E4E7E3;
		--muted: #9AA2AB;
		--rule: #363B42;
		--accent: #8C95FF;
		--layer: #C9CDC8;
	}
}

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

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 1.0625rem/1.6 var(--text);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd {
	margin: 0;
}

a {
	color: inherit;
	text-decoration-color: var(--accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

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

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

.skip {
	position: absolute;
	left: var(--gutter);
	top: -3rem;
	padding: 0.5rem 0.75rem;
	background: var(--ink);
	color: var(--paper);
}

.skip:focus {
	top: 1rem;
}

/* Hero */
.hero {
	display: flex;
	flex-direction: column;
	padding: 1.5rem var(--gutter) 4rem;
	border-bottom: 1px solid var(--rule);
}

.top {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	font-size: 0.9375rem;
	color: var(--muted);
}

.top a {
	text-decoration: none;
}

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

/*
 * O nome é "impresso" de cima para baixo, camada por camada: as listras são
 * as linhas de camada de uma impressora FDM e o clip-path em steps() revela
 * uma faixa por vez. A primeira linha imprime antes da segunda.
 */
.name {
	padding-top: clamp(2.5rem, 8vh, 5rem);
	font-family: var(--display);
	font-weight: 800;
	font-variation-settings: "wdth" 78, "opsz" 96;
	font-size: clamp(3.5rem, 15vw, 12.5rem);
	line-height: 0.86;
	letter-spacing: -0.02em;
}

.name-line {
	display: block;
	width: fit-content;
	/* sobra para o descendente do "p", que passa da caixa com line-height < 1 */
	padding-bottom: 0.08em;
	margin-bottom: -0.08em;
	color: transparent;
	background: repeating-linear-gradient(
		to bottom,
		var(--ink) 0 0.042em,
		var(--layer) 0.042em 0.05em
	);
	-webkit-background-clip: text;
	background-clip: text;
	animation: print 1.6s steps(22, end) both;
}

.name-line:last-child {
	animation-delay: 1.6s;
	animation-duration: 1.4s;
}

@keyframes print {
	from {
		clip-path: inset(0 -0.1em 100% -0.1em);
	}
	to {
		clip-path: inset(-0.1em -0.1em -0.1em -0.1em);
	}
}

.lede {
	max-width: 34em;
	margin-top: 2.5rem;
	font-size: clamp(1.125rem, 2.2vw, 1.375rem);
	line-height: 1.45;
}

.links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin-top: 1.75rem;
	padding: 0;
	list-style: none;
	font-weight: 600;
}

/* Seções: trilho à esquerda com o nome da seção, conteúdo à direita */
.block {
	display: grid;
	grid-template-columns: var(--rail) minmax(0, 46rem);
	gap: 1rem 3rem;
	padding: 4.5rem var(--gutter);
	border-bottom: 1px solid var(--rule);
}

.block h2 {
	font-family: var(--display);
	font-weight: 700;
	font-variation-settings: "wdth" 85;
	font-size: 1.375rem;
	line-height: 1.2;
}

@media (min-width: 900px) {
	.block h2 {
		position: sticky;
		top: 1.5rem;
		align-self: start;
	}
}

.prose p + p {
	margin-top: 1em;
}

.prose {
	max-width: 38em;
}

/* Ferramentas */
.stack div {
	display: grid;
	grid-template-columns: 6rem 1fr;
	gap: 1rem;
	padding: 0.75rem 0;
	border-top: 1px solid var(--rule);
}

.stack div:first-child {
	border-top: 0;
	padding-top: 0;
}

.stack dt {
	color: var(--muted);
}

/* Projetos e bancada */
.rows {
	padding: 0;
	list-style: none;
}

.prose + .rows {
	margin-top: 2rem;
}

.row {
	padding: 1.25rem 0;
	border-top: 1px solid var(--rule);
}

.rows.body .row:first-child {
	padding-top: 0;
	border-top: 0;
}

.row h3,
.timeline h3 {
	font-family: var(--display);
	font-weight: 700;
	font-variation-settings: "wdth" 90;
	font-size: 1.375rem;
	line-height: 1.25;
	margin-bottom: 0.25rem;
}

.tech {
	margin-top: 0.375rem;
	font-size: 0.9375rem;
	color: var(--muted);
}

.status {
	margin-left: 0.5rem;
	padding: 0.125rem 0.5rem;
	border: 1px solid var(--accent);
	border-radius: 999px;
	font-family: var(--text);
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--accent);
	vertical-align: 0.2em;
	white-space: nowrap;
}

.downloads {
	margin-top: 0.125rem;
	font-weight: 600;
	font-size: 0.9375rem;
}

/* Trajetória: é sequência de verdade, então vai em lista ordenada */
.timeline {
	padding: 0;
	list-style: none;
	border-left: 2px solid var(--rule);
}

.timeline li {
	position: relative;
	padding: 0 0 2.25rem 1.75rem;
}

.timeline li:last-child {
	padding-bottom: 0;
}

.timeline li::before {
	content: "";
	position: absolute;
	left: -7px;
	top: 0.45rem;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--paper);
	border: 2px solid var(--muted);
}

.timeline li:first-child::before {
	background: var(--accent);
	border-color: var(--accent);
}

.when {
	font-size: 0.9375rem;
	color: var(--muted);
}

.timeline h3 span {
	font-weight: 500;
	color: var(--muted);
}

.timeline h3 span::before {
	content: "em ";
}

/* Contato */
.mail {
	margin-top: 1.25rem;
	font-family: var(--display);
	font-weight: 700;
	font-variation-settings: "wdth" 80;
	font-size: clamp(1.5rem, 5vw, 2.75rem);
	line-height: 1.1;
	overflow-wrap: anywhere;
}

.foot {
	padding: 2rem var(--gutter);
	font-size: 0.875rem;
	color: var(--muted);
}

@media (max-width: 899px) {
	.block {
		grid-template-columns: minmax(0, 1fr);
		padding-block: 3.5rem;
	}
}

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

	.name-line {
		animation: none;
	}
}
