/* General Body & Root Variables */
:root {
    --bg-color: #121212;
    --primary-color: #1a1a1a;
    --secondary-color: #242424;
    --text-color: #e0e0e0;
    --accent-color: #00aaff;
    --accent-hover: #0088cc;
    --border-color: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* General Styling */
h1, h2, h3 {
    font-weight: 600;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 0.5rem;
}

section {
    padding: 6rem 5%;
    text-align: center;
}

/* Header & Navigation */
header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.8);
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    backdrop-filter: blur(10px);
    transition: background 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 400;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger i {
    font-size: 1.5rem;
    color: var(--text-color);
}


/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    font-weight: 300;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.8rem;
    margin: 0 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-5px);
}

.cta-button {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 2rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
}

/* About Section */
.about {
    background-color: var(--primary-color);
}
.about-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: justify;
}

.resume-button {
    display: inline-block;
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 10px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1.5rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.resume-button:hover {
    background: var(--accent-color);
    color: #fff;
}

.resume-button i {
    margin-right: 8px;
}

/* Skills Section */
.skills {
    background-color: var(--bg-color);
}
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto 0;
    text-align: left;
}

.skill-category {
    background: var(--secondary-color);
    padding: 2rem;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 170, 255, 0.1);
}

.skill-category h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    border-bottom: none;
    display: block;
}

/* Projects Section */
.projects {
    background-color: var(--primary-color);
}
.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto 0;
}

.card {
    background: var(--secondary-color);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 170, 255, 0.15);
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.card-content p {
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.project-tags {
    margin-bottom: 1.5rem;
}

.project-tags span {
    display: inline-block;
    background: var(--bg-color);
    color: var(--accent-color);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    margin: 5px 5px 5px 0;
}

.project-links {
    margin-top: auto;
}

.project-button {
    text-decoration: none;
    color: var(--text-color);
    background: var(--primary-color);
    padding: 8px 15px;
    border-radius: 5px;
    border: 1px solid var(--accent-color);
    transition: background 0.3s ease, color 0.3s ease;
    margin-right: 10px;
}

.project-button:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Coding Profiles Section */
.profiles {
    background-color: var(--bg-color);
}
.profile-cards {
    display: flex; /* CHANGED: from grid to flex */
    flex-wrap: wrap; /* ADDED: allows cards to wrap to next line */
    justify-content: center; /* ADDED: centers the cards */
    gap: 1.5rem;
    max-width: 1200px;
    margin: 2rem auto 0;
}

.profile-card {
    background: var(--secondary-color);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex-basis: 220px; /* ADDED: gives each card a base width */
    flex-grow: 1; /* ADDED: allows cards to grow and fill space */
}

.profile-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 170, 255, 0.15);
}

.profile-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.profile-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.profile-stat {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.profile-button {
    text-decoration: none;
    color: #fff;
    background: var(--accent-color);
    padding: 8px 20px;
    border-radius: 50px;
    transition: background 0.3s ease;
    width: 80%;
}

.profile-button:hover {
    background: var(--accent-hover);
}

/* Contact Section */
.contact {
    text-align: center;
    padding: 6rem 5%;
    background-color: var(--primary-color);
}

.contact p {
    max-width: 600px;
    margin: 0 auto 1rem;
    font-size: 1.1rem;
}

.contact-details {
    margin-top: 2rem;
}

.contact-details p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.contact-details a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-details a:hover {
    color: var(--accent-hover);
}

.contact-details i {
    margin-right: 10px;
    color: var(--accent-color);
}


/* Footer */
footer {
    background: var(--primary-color);
    text-align: center;
    padding: 2rem 5%;
    border-top: 1px solid var(--border-color);
}

.footer-social-links {
    margin-bottom: 1rem;
}

.footer-social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    margin: 0 0.75rem;
    transition: color 0.3s ease;
}

.footer-social-links a:hover {
    color: var(--accent-color);
}

/* Animations */
.fade-in {
    animation: fadeInAnimation 1s ease-in forwards;
}

.anim-slide-in {
    opacity: 0;
    transform: translateY(40px);
    /* speed up: 0.3s instead of 0.6s */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.anim-slide-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInAnimation {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    h2 {
        font-size: 2rem;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--primary-color);
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
    }
    .nav-links.active {
        max-height: 300px; /* Adjust as needed */
    }
    .nav-links li {
        margin: 1rem 0;
    }
    .hamburger {
        display: block;
    }
}
    /* override only on the last .profile-card (AtCoder) */
/* make the last (AtCoder) profile card exactly like the others */
.profiles .profile-card:last-child {
  /* exactly the same base width as your other cards: */
  flex: 0 0 220px;
  /* vertically separate it a bit and center it horizontally: */
  margin: 2rem auto 0;
}
