:root {
    --primary-color: #007bff;
    --dark-bg: #121212;
    --light-text: #e0e0e0;
    --card-bg: #1e1e1e;
    --border-color: #2c2c2c;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--dark-bg);
    color: var(--light-text);
    line-height: 1.6;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

header {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    color: #ffffff;
    padding: 1rem 0;
    text-align: center;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
}

nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    padding: 1rem 2rem;
    width: 100%;
    box-sizing: border-box;
}

nav .nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: 600;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

nav ul li {
    margin-left: 2rem;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 300;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--primary-color);
}

.hero-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 2rem; /* Add padding to prevent content from touching edges */
}

h1 {
    font-size: 3rem;
    margin: 0;
    font-weight: 600;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    margin-top: 0.5rem;
}

main {
    padding: 2rem 0;
}

section {
    padding: 3rem 2rem;
}

#about {
    padding-top: 4rem; /* Add padding to avoid overlap with sticky nav */
}

section:nth-child(odd) {
    background-color: var(--card-bg);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 0.5rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    text-align: left;
    align-items: stretch; /* Make cards in a row equal height */
}

.project-card {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.project-card-content {
    flex-grow: 1;
}

.project-card p {
    position: relative;
    margin-bottom: 1rem;
    overflow: hidden;
    max-height: 4.8em; /* line-height (1.6) * 3 lines */
    transition: max-height 0.4s ease;
}

.project-card .project-card-content p.is-truncated::after {
    content: ' ...';
    font-weight: bold;
    color: var(--primary-color);
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--dark-bg); /* Match card background to hide text underneath */
    padding-left: 4px;
}

.project-card.expanded p {
    max-height: 50em; /* A large value to show all text */
}

.project-card.expanded .project-card-content p.is-truncated::after {
    content: '';
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.2);
}

.current-project {
    background: rgba(0, 123, 255, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
    border-radius: 0 8px 8px 0;
}

.current-project h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.project-card h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    margin-top: auto; /* Pushes button to the bottom */
    transition: background-color 0.3s ease;
    align-self: flex-start; /* Aligns button to the start of the flex item */
}

.btn:hover {
    background: #0056b3;
}

footer {
    text-align: center;
    padding: 2rem 0;
    background: var(--card-bg);
    color: #aaa;
    margin-top: 2rem;
}

footer .social-links {
    margin-bottom: 1rem;
}

footer .social-links a {
    color: var(--light-text);
    text-decoration: none;
    margin: 0 1rem;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

footer .social-links a:hover {
    color: var(--primary-color);
}