* {
    margin: 0;
    padding: 0;
    user-select: none;
    font-family: Arial, Helvetica, sans-serif;
    font-optical-sizing: auto;
    line-height: 1.5;
}

/* CSS Variables */
:root {
    --primary-bg-color: rgb(25, 25, 25);
    --secondary-bg-color: rgb(15, 15, 15);
    --text-color: rgb(250, 250, 250);
    --accent-color: #007BFF;
    --gradient-hover: linear-gradient(to right, #ff7eb3, #ff65a3, #ff47c2);
    --button-bg: linear-gradient(to right, #0099ff, #0066cc, #004d99);
    --button-hover-bg: linear-gradient(to right, #00bfae, #007f5f, #004d3d);
    --border-color: rgba(255, 255, 255, 0.1);
    --def-padding: min(0.4rem, 1vmin);
}

html {
    scroll-behavior: smooth;
}

p {
    font-size: clamp(0.9rem, 2.2vw, 1.25rem);
    padding: var(--def-padding);
    text-align: justify;
}

/* Heading Animations */
main h1 {
    opacity: 0;
    padding-left: var(--def-padding);
    padding-bottom: var(--def-padding);
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
}

h1.show {
    opacity: 1;
    transform: translateY(0);
}

body {
    background-color: var(--primary-bg-color);
    color: var(--text-color);
    font-size: medium;
}

/* Navigation Bar */
header {
    background-color: var(--secondary-bg-color);
    padding: 1rem;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center;
}

nav ul li {
    margin: auto;
    position: relative;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: clamp(0.82rem, 2.8vw, 1.4rem);
}

/* Hover effect for navigation links */
nav ul li a:hover {
    background: var(--gradient-hover);
    transition: color 0.3s;
    background-clip: text;
    color: transparent;
}

/* Dropdown Menu */
nav ul li ul {
    /* Hide dropdown by default */
    display: none;
    position: absolute;
    width: 120px;
    top: 100%;
    left: 0;
    background-color: var(--secondary-bg-color);
    list-style: none;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    /* Ensure dropdown appears above other content */
    z-index: 10;
}

/* Show dropdown when hovering over the parent item */
nav ul li:hover>ul {
    display: block;
}

/* Styling for dropdown links */
nav ul li ul li a {
    padding: 0.5rem;
    display: block;
    font-size: clamp(0.82rem, 2.2vw, 1rem);
}

/* Buttons */
button,
.btn {
    margin: 3vh auto;
    font-size: clamp(0.86rem, 2.2vw, 1.25rem);
    width: max-content;
    padding: 0.75rem 1.5rem;
    background: var(--button-bg);
    color: var(--text-color);
    border: none;
    text-decoration: none;
    text-align: center;
    transition: transform 0.1s ease-in-out, background-color 0.3 ease-in-out;
    cursor: pointer;
}

.btn:hover,
button:hover {
    background: var(--button-hover-bg);
    transform: scale(1.02);
    transition: background-color 0.3s ease-in-out, transform 0.1s ease-in-out;
}

/* Create the underline using the ::after pseudo-element */
.a-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, #00c6ff, #0072ff, #9c27b0, #ff9800);
    background-size: 200% 100%;
    background-position: 100% 100%;
    animation: aUnderline 1s ease-in-out infinite;
}

/* Animation for the underline */
@keyframes aUnderline {
    0% {
        background-position: 100% 100%;
    }

    50% {
        background-position: 50% 100%;
    }

    100% {
        background-position: 100% 100%;
    }
}

.glass-bg,
.card,
footer {
    /* So the backdrop filter affects only this container */
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(2px);
    border: 2px solid var(--border-color);
    box-shadow: 0 0 4px rgb(34, 0, 202);
    overflow: hidden;
    z-index: 1;
}

.glass-bg {
    margin: 4vh auto;
    border-radius: 15px;
    padding: 2rem;
    width: 80%;
    height: max-content;
}

/* Project Cards Layout */
.cards {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    flex-wrap: wrap;
}

/* Individual Project Card */
.card {
    margin: 0 auto;
    position: relative;
    width: 300px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.card>*:not(img) {
    margin: 1rem 1.4rem;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-title {
    font-size: min(1.5rem, 6vmin);
    font-weight: bold;
}

.card-desc {
    font-size: min(1rem, 5vmin);
    color: rgba(255, 255, 255, 0.8);
}

/* Links Styling */
.card-links {
    margin-bottom: 1vh;
}

.card-links * {
    font-size: min(1rem, 5vmin);
    padding: var(--def-padding);
}

.about-link,
.card-links * {
    display: block;
    color: #007BFF;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.about-link {
    padding: 5px var(--def-padding) 0px var(--def-padding);
}

.about-link:hover,
.card-links *:hover {
    color: #0056b3;
}

footer {
    padding: 1vmin;
    text-align: center;
}

footer * {
    line-height: 2;
}

@media (max-width: 768px) {
    .card:hover {
        transform: none;
    }

    .glass-bg {
        padding: 5vmin;
    }

    main h1 {
        font-size: 3.6vmax;
    }

    .btn:hover, button:hover {
        transform: none;
    }
}