@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&display=swap');

/* Keyframe animations */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideInLeft {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes scaleIn {
	from {
		opacity: 0;
		transform: scale(0.85);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes glow {
	0%, 100% {
		box-shadow: 0 0 10px rgba(94, 124, 255, 0.3);
	}
	50% {
		box-shadow: 0 0 20px rgba(94, 124, 255, 0.6);
	}
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.8;
	}
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	width: 100%;
	height: 100%;
	overflow-x: hidden;
}

.mw {
	text-align: center;
	font-family: "Merriweather", serif;
	font-optical-sizing: auto;
	font-weight: 650;
	font-style: bold;
	font-variation-settings: "wdth" 100;
	font-size: 25px;
	position: relative;
	z-index: 0;
}

.mwp {
	text-align: center;
	font-family: "Merriweather", serif;
	font-optical-sizing: auto;
	font-weight: 650;
	font-style: normal;
	font-variation-settings: "wdth" 100;
	font-size: 25px;
	position: relative;
	z-index: 0;
	margin-bottom: 12px;
}

.topnavbar {
	position: relative;
	overflow: visible;
	height: 55px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

.topnavbar.animate {
	animation: slideInLeft 0.6s ease-out;
}

.topnavbar.animate .mw {
	animation: fadeIn 0.8s ease-out;
}

.topnavbar::before {
	content: "";
	position: absolute;
	inset: 0;
	background-color: #5e7cff64;
	filter: blur(0px);
	z-index: 0;
	border-radius: 200px;
	animation: glow 2s ease-in-out infinite;
}

.backdrop {
	position: fixed;
	inset: -30px;
	background-image: url('background.png');
	background-size: cover;
	background-position: center;
	filter: blur(6px) brightness(0.6);
	z-index: -1;
	animation: pulse 4s ease-in-out infinite;
}

.textbox {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	position: absolute;
	left: 20px;
	right: 20px;
	top: 75px;
	padding: 12px 16px;
	border-radius: 8px;
	background-color: rgba(255, 255, 255, 0.75);
	backdrop-filter: blur(10px) brightness(1);
	-webkit-backdrop-filter: blur(10px);
	z-index: 10;
	max-height: 60vh;
	overflow-y: auto;
	transition: all 0.3s ease;
}

.textbox.animate {
	animation: fadeIn 0.8s ease-out 0.2s both;
}

.textbox:hover {
	background-color: rgba(255, 255, 255, 0.85);
	box-shadow: 0 8px 30px rgba(94, 124, 255, 0.2);
}

.portfolio-item {
	flex: 1 1 250px;
	min-width: 0;
	opacity: 0;
	transform: scale(0.85);
	transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portfolio-item.animate {
	animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.portfolio-item:hover {
	transform: scale(1.05);
}

.portfolio-item:hover .portfolio-img {
	filter: brightness(1.1);
	box-shadow: 0 10px 30px rgba(94, 124, 255, 0.3);
}

.portfolio-img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Tablet/Medium screens */
@media (max-width: 1024px) {
	.mw {
		font-size: 22px;
	}

	.mwp {
		font-size: 18px;
	}

	.textbox {
		right: 15px;
		left: 15px;
		top: 65px;
	}
}

/* Mobile/Small screens */
@media (max-width: 768px) {
	.mw {
		font-size: 20px;
	}

	.mwp {
		font-size: 16px;
	}

	.topnavbar {
		height: 50px;
	}

	.textbox {
		left: 10px;
		right: 10px;
		top: 60px;
		gap: 10px;
	}

	.portfolio-item {
		flex: 1 1 100%;
	}

	.portfolio-item:hover {
		transform: scale(1.02);
	}
}

/* Very small screens */
@media (max-width: 480px) {
	.mw {
		font-size: 18px;
	}

	.mwp {
		font-size: 14px;
		margin-bottom: 8px;
	}

	.textbox {
		top: 55px;
		padding: 8px 12px;
		gap: 8px;
	}

	.portfolio-item {
		flex: 1 1 100%;
	}

	.portfolio-item:hover {
		transform: scale(1.01);
	}
}

/* Landscape mobile */
@media (max-height: 600px) and (max-width: 768px) {
	.textbox {
		top: 50px;
	}

	.mwp {
		font-size: 14px;
	}
}

/* Scrollbar styling */
.textbox::-webkit-scrollbar {
	width: 8px;
}

.textbox::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 10px;
}

.textbox::-webkit-scrollbar-thumb {
	background: rgba(94, 124, 255, 0.5);
	border-radius: 10px;
	transition: background 0.3s;
}

.textbox::-webkit-scrollbar-thumb:hover {
	background: rgba(94, 124, 255, 0.8);
}
