:root {
    --rosewater: 245, 224, 220;
    --flamingo: 242, 205, 205;
    --pink: 245, 194, 231;
    --mauve: 203, 166, 247;
    --red: 243, 139, 168;
    --maroon: 235, 160, 172;
    --peach: 250, 179, 135;
    --yellow: 249, 226, 175;
    --green: 166, 227, 161;
    --teal: 148, 226, 213;
    --sky: 137, 220, 235;
    --sapphire: 116, 199, 236;
    --blue: 137, 180, 250;
    --lavender: 180, 190, 254;
    --text: 205, 214, 244;
    --subtext1: 186, 194, 222;
    --subtext0: 166, 173, 200;
    --overlay2: 147, 153, 178;
    --overlay1: 127, 132, 156;
    --overlay0: 108, 112, 134;
    --surface2: 88, 91, 112;
    --surface1: 69, 71, 90;
    --surface0: 49, 50, 68;
    --base: 30, 30, 46;
    --mantle: 24, 24, 37;
    --crust: 17, 17, 27;
}

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

body {
    color: rgb(var(--text));
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 2rem;
    line-height: 1.6;
    position: relative;
    /* Needed for the pseudo-element */
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(135deg,
            rgb(var(--base)) 0px,
            rgb(var(--base)) 33px,
            rgb(var(--mantle)) 33px,
            rgb(var(--mantle)) 66px,
            rgba(var(--crust)) 66px,
            rgba(var(--crust)) 100px);
    background-repeat: repeat;
    background-size: 100% 100%;
    /*filter: brightness(0.7) blur(0px);*/
    z-index: -4;
    /* Lower z-index to ensure the cube is visible */
    box-shadow: none;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--mantle), 0.0);
    /* Adds a dark overlay */
    z-index: -1;
    /* Places it above the blurred background */
    box-shadow: none;
    /* Ensures no vignette effect */
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding-bottom: 4rem;
}

header {
    background-color: rgba(var(--mantle), 0.7);
    /* Mantle with 70% opacity */
    backdrop-filter: blur(10px);
    /* Adds blur effect to the header background */
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
}

header h1 {
    color: var(--text);
    margin: 1rem;
}

nav {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

nav a {
    color: var(--blue);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

nav a:hover {
    background-color: rgb(var(--surface0));
}

section {
    padding: 2rem;
    max-width: 1300px;
    margin: 0 auto;
}

.about {
    text-align: justify;
    color: var(--subtext1);
    background-color: rgba(var(--mantle), 0.7);
	border-radius: 8px;
	backdrop-filter: blur(10px);
	margin-bottom: 2rem;
	margin-top: 2rem;
	overflow: hidden;
	width: 50%;
	min-width: 300px;
	padding: 1rem;
}
.about h2 {
	color: var(--peach);
	margin-bottom: 1rem;
	text-align: center;
}
.profile-pic {
	width: 20%;
	border-radius: 50%;
	margin-bottom: 1rem;
	border: 4px solid rgb(var(--surface0));
	min-width: 200px;
}

.projects h2 {
    color: var(--peach);
    margin-bottom: 2rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	padding: 50px;
    gap: 2rem;
	overflow: hidden;
}

.project-card {
    background-color: rgba(var(--crust), 0.8);
    position: relative;
    backdrop-filter: blur(5px);
    padding: 1.5rem;
    margin: 0.5rem;
    border-radius: 8px;
    overflow: visible;
    max-height: 300px;
    transition: max-height 0.5s ease, background 0.2s, backdrop-filter 0.2s, padding 0.2s, margin 0.2s;
}

.project-card::after,
.project-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    translate: -50% -50%;
    border-radius: 8px;
    pointer-events: none;
    z-index: -1;
    background: conic-gradient(from var(--angle),
            transparent 20%,
            rgb(var(--blue)) 30%,
            transparent 40%,
            transparent 70%,
            rgb(var(--green)) 80%,
            transparent 90%);
    padding: 4px;
    opacity: 0;
    animation: 3s spin linear infinite;
    transition: opacity 0.2s -0.2s;
}

.project-card::before {
    filter: blur(20px);
}

.project-card:hover::after,
.project-card:hover::before {
    opacity: 1.0;
    transition: opacity 0.2s 0.2s;
}

@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes spin {
    from {
        --angle: 0deg;
    }

    to {
        --angle: 360deg;
    }
}

.project-card:hover {
    background: rgb(var(--mantle));
    max-height: 500px; /* Expanded height to reveal the image */
    transition: max-height 0.5s ease, background 0.2s, padding 0.2s, margin 0.2s, backdrop-filter 0.0s 0.0s;
    padding: 2.5rem;
    margin: 0rem;
    backdrop-filter: none;
}

.project-card img {
    display: block; /* Ensure the image is part of the layout */
    width: 90%;
    max-height: 100%; /* Ensure the image fits within the card */
    max-width: 100%; /**/
    object-fit: cover; /* Maintain aspect ratio and cover the available space */
    margin: 1rem auto 0 auto; /* Center horizontally with top margin */
    border-radius: 8px;
    opacity: 0; /* Start fully transparent */
    transition: opacity 0.3s ease-in-out; /* Add fade-in effect */
}

.project-card:hover img {
    opacity: 1; /* Fade in to fully visible */
}

.project-card h3 a {
    color: var(--green);
    text-decoration: none;
}

.project-card p {
    color: var(--subtext0);
    margin-top: 1rem;
}

a {
	all: unset;
}

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

.links a {
    color: var(--teal);
    text-decoration: none;
    margin: 0 1rem;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.links a:hover {
    color: var(--sky);
}

@media (max-width: 1200px) {
    body {
        font-size: 16px;
    }

    section {
        padding: 1rem;
    }

    .project-card.mobile-hover {
        background: rgb(var(--mantle));
        max-height: 500px; /* Expanded height to reveal the image */
        transition: max-height 0.5s ease, background 0.2s, padding 0.2s, margin 0.2s, backdrop-filter 0.0s 0.0s;
        padding: 2.5rem;
        margin: 0rem;
        backdrop-filter: none;
    }
    
    .project-card.mobile-hover::after,
    .project-card.mobile-hover::before {
        opacity: 1.0;
    }
    
    .project-card.mobile-hover img {
        opacity: 1;
    }
}


.cool-border {
	position: relative;
	border-radius: 8px;
	background: rgba(var(--surface0), 0.4);
    transition: background 0.2s 0.2s, backdrop-filter 0.2s, padding 0.2s, margin 0.2s;
    margin: 1rem;
}

.cool-border:hover {
    backdrop-filter: none;
    background: rgb(var(--mantle));
    transition: background 0.2s, padding 0.2s, margin 0.2s, backdrop-filter 0.0s 0.0s;
}

.cool-border::after,
.cool-border::before {
    --spin-speed: 3s;
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	translate: -50% -50%;
	border-radius: 8px;
	pointer-events: none;
	z-index: -1;
	background: conic-gradient(from var(--angle),
			transparent 0%,
			rgb(var(--blue)) 100%
			);
	padding: 2px;
	opacity: 0;
	animation: var(--spin-speed) spin linear infinite;
	transition: opacity 0.0s -0.2s;
}
.cool-border::before {
	filter: blur(10px);
}
.cool-border:hover::after,
.cool-border:hover::before {
	opacity: 1.0;
	transition: opacity 0.2s 0.2s;
}

.education-card {
    padding: 2rem; 
    background-color: rgba(var(--mantle), 0.7); 
    border-radius: 8px; 
    backdrop-filter: blur(10px);
    margin: 1.5rem;
}

ul {
    margin-left: 2rem;
  }

footer {
    background-color: rgb(var(--crust)); 
    color: rgb(var(--text));
    text-align: center;  
    margin-top: 10rem; 
    border-radius: 8px;
    z-index: 2;
    position: absolute;
    margin-bottom: 0;
    width: 100%;
    left: 0;
    bottom: 0;
    padding-bottom: 2rem;
    padding-top: 2rem;
    overflow: hidden;
}