:root {
	--color-charcoal: #202329;
	--color-white: #fff;
	--color-off-white-rgb: 244 245 246;
	--color-off-white: rgb(var(--color-off-white-rgb));
	--color-slate: #565b64;
	--color-silver-rgb: 184 190 200;
	--color-silver: rgb(var(--color-silver-rgb));
	--color-light-gray: #d5d9df;
	--color-image-overlay: rgb(34 34 34 / 96%);
	--header-height: 64px;
}

html,
body {
	font-family: system-ui, sans-serif;
	margin: 0;
}

header {
	--navigation-shadow: 0 4px 10px -4px rgb(0 0 0 / 24%);

	position: fixed;
	inset: 0 0 auto;
	z-index: 10;
	height: var(--header-height);
	background-color: var(--color-charcoal);
	color: var(--color-off-white);
	box-shadow: var(--navigation-shadow);

	@supports (animation-timeline: scroll()) {
		background-color: transparent;
		box-shadow: none;
		animation: navigation-colors 1ms linear both;
		animation-timeline: scroll(root block);
		animation-range: 0px 80px;
	}

	@media (prefers-reduced-motion: reduce) {
		animation-timing-function: steps(1, end);
	}

	nav {
		height: 100%;

		ul {
			display: flex;
			align-items: center;
			justify-content: center;
			gap: clamp(24px, 6vw, 80px);
			height: 100%;
			max-width: 1200px;
			margin: 0 auto;
			padding: 0 24px;
			box-sizing: border-box;
			list-style: none;

			a {
				display: flex;
				align-items: center;
				height: 100%;
				font-size: 16px;
				font-weight: 400;
				color: inherit;
				text-decoration: none;
				text-transform: uppercase;
				white-space: nowrap;
				transition: opacity 0.2s ease;

				@media (prefers-reduced-motion: reduce) {
					transition: none;
				}

				&:hover {
					opacity: 0.65;
				}

				&:focus-visible {
					outline: 2px solid currentColor;
					outline-offset: -8px;
				}
			}

			@media (width < 375px) {
				gap: 12px;
				padding-inline: 12px;

				a {
					font-size: 14px;
				}
			}
		}
	}
}

@keyframes navigation-colors {
	from {
		background-color: rgb(var(--color-off-white-rgb) / 0);
		color: var(--color-off-white);
		box-shadow: none;
	}

	to {
		background-color: var(--color-off-white);
		color: var(--color-charcoal);
		box-shadow: var(--navigation-shadow);
	}
}

.intro,
.skills {
	.background {
		position: absolute;
		display: block;

		img {
			display: block;
			width: 100%;
			height: 100%;
			object-fit: cover;
		}
	}
}

.intro {
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100vh;
	overflow: hidden;

	.background {
		inset: 0;
		width: 100%;
		height: 100%;

		&::before {
			content: "";
			position: absolute;
			inset: 0;
			z-index: 1;
			background-color: var(--color-image-overlay);
		}
	}

	.content {
		position: relative;
		z-index: 2;
		display: flex;
		flex-direction: column;
		align-items: center;

		.photo {
			display: block;
			width: 170px;
			height: 170px;
			box-sizing: border-box;
			border: 3px solid var(--color-off-white);
			border-radius: 50%;
			overflow: hidden;

			img {
				display: block;
				width: 100%;
				height: 100%;
				object-fit: cover;
			}
		}

		h1 {
			margin: 30px 0 0;
			font-size: 32px;
			font-weight: 700;
			line-height: 1.2;
			color: var(--color-off-white);
		}

		p {
			margin: 5px 0 0;
			font-size: 24px;
			font-weight: 400;
			line-height: 1.4;
			color: var(--color-silver);
		}

		@media (width <= 600px) {
			h1 {
				font-size: 26px;
			}

			p {
				font-size: 20px;
			}
		}
	}

	.mouse {
		position: absolute;
		bottom: 25px;
		left: 50%;
		z-index: 2;
		transform: translateX(-50%);
		box-sizing: border-box;
		display: block;
		width: 28px;
		height: 48px;
		border: 2px solid var(--color-off-white);
		border-radius: 16px;
		cursor: pointer;

		&::before {
			content: "";
			position: absolute;
			top: 9px;
			left: 50%;
			width: 4px;
			height: 9px;
			border-radius: 2px;
			background-color: var(--color-off-white);
			animation: mouse-scroll 1.6s ease-in-out infinite;
		}
	}
}

@keyframes mouse-scroll {
	0% {
		transform: translate(-50%, 0);
		opacity: 1;
	}

	60%,
	100% {
		transform: translate(-50%, 12px);
		opacity: 0;
	}
}

.contacts {
	display: flex;
	justify-content: center;
	gap: 16px;
	margin-top: 65px;

	a {
		display: grid;
		place-items: center;
		width: 38px;
		height: 38px;
		border: 1px solid var(--color-silver);
		color: var(--color-silver);
		text-decoration: none;
		transition: background-color 0.2s, border-color 0.2s;

		&:hover {
			background-color: rgb(var(--color-silver-rgb) / 15%);
			border-color: var(--color-off-white);
		}

		img {
			display: block;
			width: 20px;
			height: 20px;
		}
	}
}

.about,
.skills,
.career,
.contact {
	--section-padding-block: 96px;
	--section-padding-inline: 24px;
	--section-content-gap: 64px;

	padding: var(--section-padding-block) var(--section-padding-inline);
	scroll-margin-top: var(--header-height);

	h2 {
		margin: 0;
		font-size: 36px;
		font-weight: 700;
		text-align: center;
	}

	@media (width <= 700px) {
		--section-padding-block: 72px;
		--section-padding-inline: 20px;
		--section-content-gap: 42px;

		h2 {
			font-size: 30px;
		}
	}
}

.about,
.contact {
	background-color: var(--color-white);
	color: var(--color-charcoal);
}

.about {
	.content {
		max-width: 900px;
		margin: var(--section-content-gap) auto 0;

		p {
			margin: 0 0 24px;
			font-size: 17px;
			line-height: 1.8;
			color: var(--color-slate);

			@media (width <= 700px) {
				font-size: 16px;
				line-height: 1.7;
			}

			&:last-child {
				margin-bottom: 0;
			}
		}
	}
}

.skills {
	position: relative;
	isolation: isolate;
	overflow: clip;
	background-color: var(--color-charcoal);
	color: var(--color-off-white);
	--parallax-distance: 40vh;
	view-timeline-name: --skills;

	.background {
		inset: 0 0 auto;
		z-index: -2;
		height: calc(100% + var(--parallax-distance));
		pointer-events: none;

		@supports (animation-timeline: view()) {
			animation: skills-parallax 1ms linear both;
			animation-timeline: --skills;
			animation-range: cover 0% cover 100%;
		}

		@media (prefers-reduced-motion: reduce) {
			animation: none;
		}

		img {
			object-position: center 25%;
		}
	}

	&::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: -1;
		background-color: var(--color-image-overlay);
		pointer-events: none;
	}

	.areas {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 80px;
		row-gap: 48px;
		max-width: 1000px;
		margin: var(--section-content-gap) auto 0;
		padding: 0;
		list-style: none;

		li {
			h3 {
				margin: 0 0 14px;
				padding-bottom: 12px;
				border-bottom: 1px solid rgb(var(--color-silver-rgb) / 45%);
				font-size: 20px;
				font-weight: 600;
			}

			p {
				margin: 0;
				font-size: 16px;
				line-height: 1.7;
				color: var(--color-light-gray);
			}
		}
	}

	@media (width <= 700px) {
		.background {
			margin-block: calc(-1 * var(--section-padding-block)) var(--section-padding-block);
			margin-inline: calc(-1 * var(--section-padding-inline));
		}

		.areas {
			grid-template-columns: 1fr;
			gap: 36px;

			li h3 {
				font-size: 19px;
			}
		}
	}
}

@keyframes skills-parallax {
	from {
		transform: translateY(0);
	}

	to {
		transform: translateY(calc(-1 * var(--parallax-distance)));
	}
}

.career {
	background-color: var(--color-off-white);
	color: var(--color-charcoal);

	.timeline {
		--timeline-axis: 50%;

		position: relative;
		max-width: 1100px;
		margin: var(--section-content-gap) auto 0;
		padding: 0;
		list-style: none;

		&::before {
			content: "";
			position: absolute;
			top: 7px;
			bottom: 8px;
			left: var(--timeline-axis);
			width: 1px;
			background-color: var(--color-silver);
			transform: translateX(-50%);
		}

		li {
			position: relative;
			display: grid;
			grid-template-columns: repeat(2, minmax(0, 1fr));
			column-gap: 70px;
			margin-bottom: 64px;

			&::before {
				content: "";
				position: absolute;
				top: 6px;
				left: var(--timeline-axis);
				z-index: 1;
				width: 12px;
				height: 12px;
				border-radius: 50%;
				background-color: var(--color-slate);
				transform: translateX(-50%);
			}

			&:last-child {
				margin-bottom: 0;
			}

			.entry {
				grid-column: 1;
				text-align: right;
			}

			&:nth-child(even) .entry {
				grid-column: 2;
				text-align: left;
			}

			.period,
			p {
				font-size: 15px;
				color: var(--color-slate);
			}

			.period {
				display: block;
				margin-bottom: 8px;
			}

			h3 {
				margin: 0;
				font-size: 21px;
				font-weight: 700;
				line-height: 1.35;
			}

			p {
				margin: 8px 0 0;
				line-height: 1.6;
			}

			.role {
				font-weight: 600;
				color: var(--color-charcoal);
			}
		}

		@media (width <= 700px) {
			--timeline-axis: 8px;

			&::before {
				transform: none;
			}

			li {
				display: block;
				padding-left: 38px;
				margin-bottom: 40px;

				.entry {
					text-align: left;
				}

				h3 {
					font-size: 19px;
				}
			}
		}
	}
}

.contact {
	text-align: center;

	.details {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 48px;
		max-width: 800px;
		margin: var(--section-content-gap) auto 0;

		.item {
			display: flex;
			flex-direction: column;
			align-items: center;
			color: inherit;
			text-decoration: none;

			img {
				display: block;
				width: 36px;
				height: 36px;
				margin-bottom: 18px;
			}

			.label {
				margin-bottom: 8px;
				font-size: 13px;
				font-weight: 500;
				letter-spacing: 0.06em;
				text-transform: uppercase;
				color: var(--color-slate);
			}

			.value {
				font-size: 19px;
				font-weight: 500;
				overflow-wrap: anywhere;
			}
		}
	}

	.whatsapp {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		margin-top: 52px;
		font-size: 16px;
		color: var(--color-slate);
		text-decoration: none;

		img {
			display: block;
			width: 20px;
			height: 20px;
		}
	}

	.details .item,
	.whatsapp {
		&:focus-visible {
			outline: 2px solid var(--color-slate);
			outline-offset: 8px;
		}
	}

	.details .item:hover .value,
	.whatsapp:hover {
		text-decoration: underline;
		text-underline-offset: 4px;
	}

	@media (width <= 700px) {
		.details {
			grid-template-columns: 1fr;
			gap: 42px;

			.item .value {
				font-size: 17px;
			}
		}

		.whatsapp {
			margin-top: var(--section-content-gap);
		}
	}
}

footer {
	padding: 60px 20px 48px;
	background-color: var(--color-charcoal);
	color: var(--color-silver);
	text-align: center;

	.contacts {
		margin-bottom: 22px;
	}

	small {
		display: block;
		font-size: 14px;
		line-height: 1.5;
	}
}
