@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500&display=swap');

:root {
	--light: hsl(0, 0%, 90%);
	--dark: hsl(0, 0%, 15%);
	--bg: hsl(0, 0%, 10%);
	--primary: hsl(30, 70%, 50%);
	--font-hero: clamp(3rem, 10vw + 1rem, 8rem);
	--font-medium: clamp(1.25rem, 1vw + 1rem, 2rem);
}
* {
	transition: color, 0.5s ease, background-color 0.5s ease;
}
html {
	scroll-behavior: smooth;
}
body {
	display: flex;
	margin: 0;
	height: 100vh;
	background-color: var(--bg);
	font-family: Kanit, 'Space Mono', monospace;
	overflow-x: hidden;
}
main {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
}
section {
	display: flex;
	flex-direction: column;
	justify-content: center;
}
a {
	text-decoration: none;
	color: var(--light);
	font-size: 2rem;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
	margin: 0;
}
.section-title {
	text-align: center;
	color: var(--light);
	font-size: var(--font-medium);
}
.hidden {
	transform: scale(0);
	transition: all 1s ease;
}
.visible {
	transform: scale(1);
}

/* LIGHT & DARK MODE TOGGLE */
#toggle {
	cursor: pointer;
	display: flex;
	gap: 20px;
	position: fixed;
	top: 20px;
	left: 30px;
	width: 50px;
	height: 50px;
	overflow: hidden;
	padding: 10px;
	border-radius: 100px;
	color: var(--light);
	background-color: var(--dark);
	z-index: 2;
}
#toggle > .icon {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}
#toggle.light > .icon {
	transform: translateX(calc(-100% - 20px));
}
body.light {
	--light: hsl(0, 0%, 20%);
	--dark: hsl(0, 0%, 90%);
	--bg: hsl(0, 0%, 95%);
}

/* NAVBAR */
#navbar {
	align-self: center;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	position: fixed;
	left: 0;
	gap: 30px;
	padding: 30px 20px;
	margin: 20px;
	border-radius: 50px;
	height: fit-content;
	width: 50px;
	background-color: var(--dark);
	transition: width 0.3s ease;
	overflow: hidden;
	z-index: 1;
}
#navbar:hover {
	width: 250px;
}
.nav-link {
	display: flex;
	align-items: center;
	gap: 20px;
}
.icon {
	width: 50px;
	height: 50px;
}
.nav-text {
	display: inline-block;
	position: relative;
	color: var(--light);
}
.nav-text:after {
	content: '';
	position: absolute;
	width: 100%;
	transform: scaleX(0);
	height: 3px;
	bottom: 0;
	left: 0;
	background-color: var(--primary);
	transform-origin: bottom right;
	transition: transform 0.25s ease-out;
}
.nav-text:hover:after {
	transform: scaleX(1);
	transform-origin: bottom left;
}

/* MOBILE NAVBAR */
#mobile-navbar {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--dark);
	transform: translateX(100%);
	transition: transform 0.3s ease;
	z-index: 2;
}
#mobile-navbar > a {
	font-size: 3rem;
}
.menu-btn.open + #mobile-navbar {
	transform: translateX(0);
}
.menu-btn {
	position: fixed;
	top: 20px;
	right: 20px;
	display: none;
	justify-content: center;
	align-items: center;
	width: 80px;
	height: 80px;
	cursor: pointer;
	transition: all 0.3s ease-in-out;
	background-color: var(--dark);
	border-radius: 10px;
	z-index: 3;
}
.menu-btn-bar {
	width: 50px;
	height: 6px;
	background: var(--light);
	border-radius: 50px;
	transition: all 0.3s ease-in-out;
}
.menu-btn-bar::before,
.menu-btn-bar::after {
	content: '';
	position: absolute;
	width: 50px;
	height: 6px;
	background: var(--light);
	border-radius: 50px;
	transition: all 0.3s ease-in-out;
}
.menu-btn-bar::before {
	transform: translateY(-16px);
}
.menu-btn-bar::after {
	transform: translateY(16px);
}
.menu-btn.open .menu-btn-bar {
	background: transparent;
}
.menu-btn.open .menu-btn-bar::before {
	transform: rotate(45deg);
}
.menu-btn.open .menu-btn-bar::after {
	transform: rotate(-45deg);
}

/* HOME */
#home {
	margin: 0 10px;
	color: var(--light);
	font-size: var(--font-medium);
	min-height: 100vh;
}
#title {
	font-size: var(--font-hero);
}

/* PROJECTS */
#projects {
	align-items: center;
}
.project-list {
	display: flex;
	flex-direction: column;
	width: min(800px, 90%);
}
.p-img {
	aspect-ratio: 3 / 2;
	width: min(600px, 100%);
	border-radius: 10px;
	margin-top: 20px;
	box-shadow: 0 0 10px -5px hsl(0, 0%, 10%);
}
.p-about {
	align-self: flex-end;
	margin-top: -40px;
	max-width: 400px;
	padding: 20px;
	padding-bottom: 40px;
	border-radius: 10px;
	color: var(--light);
	background-color: var(--dark);
	font-size: 1.5rem;
	font-weight: 300;
	box-shadow: 0 0 10px -5px hsl(0, 0%, 10%);
}

/* SKILLS */
#skills {
	min-height: 100vh;
}
.skill-list {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	padding: 0;
	column-gap: 30px;
	row-gap: 60px;
	list-style-type: none;
}
.skill-item > .icon {
	width: 100px;
	height: 100%;
}
.skill-item {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}
.skill-item::after {
	position: absolute;
	text-align: center;
	border-radius: 4px;
	padding: 10px;
	width: fit-content;
	background-color: var(--dark);
	transform: scale(0);
	transition: transform 0.2s;
	color: var(--light);
	font-size: 1.5rem;
}
.skill-item:hover::after {
	transform: scale(1) translateY(120%);
}
.javascript::after {
	content: 'JavaScript';
}
.css::after {
	content: 'CSS3';
}
.html::after {
	content: 'HTML5';
}
.react::after {
	content: 'React';
}
.nodejs::after {
	content: 'NodeJS';
}
.firebase::after {
	content: 'Firebase';
}

/* CONTACT */
#contact {
	min-height: 100vh;
}
.contact-list {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 30px;
	margin: 10px;
	list-style-type: none;
}
.contact-item {
	display: grid;
	place-content: center;
	width: 100px;
	height: 100px;
	padding: 20px;
	border-radius: 20px;
	background-color: var(--dark);
	transition: 0.3s ease;
}
.contact-item:hover {
	transform: scale(1.2);
}

@media screen and (max-width: 900px) {
	.menu-btn {
		display: flex;
	}
	body {
		margin: 0;
	}
	#navbar {
		display: none;
	}
	#mobile-navbar {
		display: flex;
	}
}
