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

:root {
    --primary-color: #353535;
    --secondary-color: #555;
    --accent-color: #000;
    --light-gray: #f5f5f5;
    --border-color: rgb(163, 163, 163);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--primary-color);
    line-height: 1.6;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 1.5rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: 500;
    transition: color 0.3s;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--accent-color);
    transition: 0.3s;
}

/* Sections */
section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 8rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-pic {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 3px solid var(--border-color);
    display: block;
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.hero-text h1 {
    font-size: 3rem;
    margin: 0.5rem 0;
}

.hero-text .title {
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    padding: 1rem 2rem;
    border: 2px solid var(--accent-color);
    background: white;
    color: var(--accent-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border-radius: 2rem;
}

.btn:hover {
    background: var(--accent-color);
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links img {
    width: 35px;
    height: 35px;
    cursor: pointer;
    transition: transform 0.3s;
}

.social-links img:hover {
    transform: scale(1.1);
}

.arrow {
    width: 30px;
    margin-top: 2rem;
    cursor: pointer;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header p {
    color: var(--secondary-color);
    font-size: 1rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-top: 0.5rem;
}

/* About Section */
.about-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
}

.about-pic {
    width: 100%;
    max-width: 400px;
    height: 400px;
    border-radius: 2rem;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0 auto;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.about-box {
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    padding: 2rem;
    text-align: center;
}

.about-box img {
    width: 40px;
    margin-bottom: 0.5rem;
}

.about-box h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.about-box p {
    color: var(--secondary-color);
}

/* Projects Section */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.project-card {
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    overflow: hidden;
    transition: transform 0.3s;
}

.project-card:hover {
    transform: translateY(-10px);
}

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

.project-info {
    padding: 2rem;
    text-align: center;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-small {
    padding: 0.7rem 1.5rem;
    border: 2px solid var(--accent-color);
    background: white;
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border-radius: 2rem;
}

.btn-small:hover {
    background: var(--accent-color);
    color: white;
}

/* Certificates Section */
.certificates-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.certificate-card {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    aspect-ratio: 4/3;
}

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

.certificate-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.certificate-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1.5rem 1rem 1rem;
    color: white;
}

.certificate-overlay p {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/* Certificate Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    color: white;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #ccc;
}

/* Contact Section */

/* Experience Section */
.experience-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(300px, 1fr));
    gap: 3rem;
    /* stretch cards to the same height */
    align-items: stretch;
}

.experience-box {
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    padding: 2rem;
}

/* Make all experience cards consistent size and layout */
.experience-box {
    min-height: 340px;
    /* make card fill the grid cell so all cards equal height */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.experience-box .skills-grid {
    /* allow grid to flow naturally inside flex column */
    margin-top: 0.5rem;
}

.experience-box h3 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.skill-item img {
    width: 30px;
}

/* Competitive Programming badges */
.cp-badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.cp-badges img {
    width: 32px;
    height: 32px;
}

/* Center the standalone Competitive Programming card */
.competitive-card {
    grid-column: auto;
    justify-self: stretch;
    max-width: none;
}

/* Subtle hover effect for professionalism */
.experience-box {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.experience-box:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

/* Responsive: single column on small screens */
@media (max-width: 700px) {
    .experience-container {
        grid-template-columns: 1fr;
    }

    .competitive-card {
        grid-column: auto;
        max-width: 100%;
    }
}

.skill-item div h4 {
    font-size: 1.1rem;
}

.skill-item div p {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.level-badge {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0.18rem 0.5rem;
    border-radius: 12px;
    background: #f0f0f0;
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    width: 215px;
}

.project-desc {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    color: #444
}

.system-design-card .skills-grid {
    display: block
}

.system-design-card .skill-item {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin: 0.45rem 0
}

.system-design-card .skill-item img {
    width: 18px;
    height: 18px;
    margin-top: 3px
}

/* Projects Section */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.project-card {
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    overflow: hidden;
    transition: transform 0.3s;
}

.project-card:hover {
    transform: translateY(-10px);
}

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

.project-info {
    padding: 2rem;
    text-align: center;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-small {
    padding: 0.7rem 1.5rem;
    border: 2px solid var(--accent-color);
    background: white;
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border-radius: 2rem;
}

.btn-small:hover {
    background: var(--accent-color);
    color: white;
}

/* Contact Section */
.contact-container {
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    padding: 3rem;
    max-width: 600px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-item img {
    width: 35px;
}

.contact-item a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1.1rem;
}

/* Footer */
footer {
    background: var(--light-gray);
    padding: 2rem;
    text-align: center;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    margin-bottom: 1rem;
}

.footer-nav a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-links.active {
        left: 0;
    }

    .about-container,
    .experience-container {
        grid-template-columns: 1fr;
    }

    .projects-container {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .profile-pic {
        width: 250px;
        height: 250px;
    }

    .contact-info {
        flex-direction: column;
        gap: 1.5rem;
    }
}