:root {
    --primary: #FF3B30; 
    --bg: #0A0A0A;
    --card-bg: #141414;
    --text-main: #FFFFFF;
    --text-dim: #A0A0A0;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
}

main{
    max-width: 1920px;
}

/* --- Navigation --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 10%;
    position: sticky;
    top: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1000;
    max-width: 1920px;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-decoration: none;
    letter-spacing: -1px;
}

.logo span { color: var(--primary); }

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: var(--transition);
}

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

.nav-cta {
    background: var(--primary);
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
}

/* --- Menu --- */

.hamburger{
    display: none;
}

.hamburger button {
    background: transparent; 
    border: none;            
    padding: 0;              
    outline: none;           
    cursor: pointer;         
    appearance: none;      
}

.hamburger span {
    display: block; 
    height: 4px;
    width: 25px;
    background-color: var(--primary);
    color: transparent;
    margin: 4px 0;
    transition: 0.3s; 
}

.hamburger span:not(:first-child):not(:last-child){ 
    width: 20px;
    background-color: var(--primary);
}

.hamburger span:last-child{
    width: 15px;
    background-color: var(--primary);
}

/* --- Projects Section --- */
#projects {
    padding: 6rem 10%;
}

.section-intro {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
}

.section-title span {
    color: transparent;
    -webkit-text-stroke: 1px white;
}

.section-subtitle {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    font-size: 0.9rem;
}

/* --- Filter Buttons --- */
.project-header {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 4rem;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    border: 1px solid #222;
    background: var(--card-bg);
    color: var(--text-dim);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}



/* --- Project Grid --- */
.project-content {
    max-width: 1920px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    transition: opacity 0.4s ease, transform 0.4s ease;
    min-height: 400px;
    align-items: start;
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #1a1a1a;
    transition: var(--transition);
    position: relative;
}

.card a{
    position: relative;
}

.card .overlay{
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    overflow: hidden;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);

}

.card .overlay span{
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.5rem;
    padding: 1rem;
    border-radius: 16px;
    letter-spacing: 2px;
    color: transparent;
    -webkit-text-stroke: 1px #FFFFFF;
}

.card:hover .overlay{
    display: flex;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.9);
}

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

.card-content {
    padding: 2rem;
}

.card-description {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 1.5rem;
    line-height: 1.5;
    
    /* The Magic: */
    display: -webkit-box;
    /* -webkit-line-clamp: 3;  */
    -webkit-box-orient: vertical;  
    overflow: hidden;
    min-height: 4.5em; /* Ensures cards without descriptions stay the same height */
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.status-ribbon {
    position: absolute;
    top: 20px;
    right: -35px;
    width: 150px;
    transform: rotate(45deg);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 0;
    color: #fff;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    z-index: 10;
}

.status-ribbon.completed {
    background: #28a745; 
}

.status-ribbon.ongoing {
    background: var(--primary); 
}

/* --- Tech Stack Badges --- */
.tech-stack-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tech-stack-content span {
    font-size: 0.75rem;
    background: #000;
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #222;
    font-weight: 500;
}

/* --- Footer --- */
footer { 
    text-align: center;
    padding: 3rem;
    border-top: 1px solid #1a1a1a;
    color: var(--text-dim);
    margin-top: 5rem;
}

footer .socials{
    display: flex;
    justify-content: center;
    align-items: center;
}

footer .socials a{
    text-decoration: none;
    padding: 1rem;
    color: white;
}

footer .socials a img{
    width: 60px;
    height: 60px;
    padding: 1rem;
    border-radius: 16px;
    background-color: var(--primary);
}

/* --- Mobile Fixes --- */
@media (max-width: 767px) {
    #projects { 
        padding: 4rem 5%; 
    }
    .project-header { 
        flex-wrap: wrap;
    }
    .filter-btn { 
        flex: 1;
        text-align: center;
        font-size: 0.9rem;
    }

    .nav-links{
        position: fixed;
        top: -300%;
        right: 0;
        width: 100%;
        background-color: var(--card-bg);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;

        transition: top 0.4s ease-in-out;
        /* transform: translateY(-100%); */
        z-index: 100;
        padding: 1rem;
    }

    .nav-links a{
        font-size: 0.9rem;
        margin-top: 0.8rem;
    }

    .nav-links .nav-cta{
        width: 100px;
        padding: 0.5rem;
    }

    .nav-links.toggle{
        top: 0;
    }

    .hamburger{
        display: block;
        z-index: 101;
    }

    footer .socials a img{
        width: 40px;
        height: 40px;
        padding: 0.5rem;
        border-radius: 16px;
        background-color: var(--primary);
    }
}