* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --main-color: #8b5cf6;
    --accent-color: #ec4899;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

.back-home {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    background: rgba(139, 92, 246, 0.2);
    color: var(--main-color);
    padding: 0.8rem 1.5rem;
    border-radius: 3rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.back-home:hover {
    transform: translateY(-2px);
    background: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 1rem var(--main-color);
}

.page-header {
    text-align: center;
    padding: 8rem 1rem 4rem;
    position: relative;
    overflow: hidden;
}

.page-header h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--main-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.2rem;
    max-width: 500px;
    margin: 0 auto 2rem;
    opacity: 0.8;
    color: #94a3b8;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
    line-height: 1.6;
    color: #cbd5e1;
}

.projects-grid {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--main-color);
    box-shadow: 0 1rem 2rem rgba(139, 92, 246, 0.2);
}

.project-image {
    height: 180px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.project-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
}

.project-category {
    display: inline-block;
    background: rgba(139, 92, 246, 0.1);
    color: var(--main-color);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

.project-description {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
    opacity: 0.8;
    color: #cbd5e1;
}

.project-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.feature-tag {
    background: rgba(139, 92, 246, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--main-color);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--main-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 3rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 1rem var(--main-color);
}

.design-process {
    max-width: 1000px;
    margin: 4rem auto;
    padding: 3rem 1rem;
    background: var(--card-bg);
    border-radius: 1.5rem;
}

.process-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--main-color);
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.process-step {
    text-align: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.process-step:hover {
    border-color: var(--main-color);
    transform: translateY(-5px);
}

.step-icon {
    width: 60px;
    height: 60px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--main-color);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.step-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.step-description {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.8;
    color: #cbd5e1;
}

.cta-section {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, var(--card-bg) 0%, #253148 100%);
    margin-top: 4rem;
}

.cta-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.cta-title span {
    background: linear-gradient(45deg, var(--main-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cta-description {
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    opacity: 0.9;
    color: #cbd5e1;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    padding: 0.8rem 2rem;
    border-radius: 3rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.cta-btn.primary {
    background: var(--main-color);
    color: white;
}

.cta-btn.secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--main-color);
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 1rem var(--main-color);
}

/* ===== VIDEO POPUP MODAL STYLES ===== */
/* The Modal (background) */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 9999;
    /* Sit on top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    /* Dimmed background */
    animation: fadeIn 0.3s ease;
}

/* Modal Content Box */
.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    /* Centered */
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--main-color);
    width: 90%;
    max-width: 900px;
    position: relative;
    animation: slideUp 0.4s ease;
}

/* The Close Button */
.close-modal {
    position: absolute;
    top: -15px;
    right: -15px;
    color: #fff;
    background: var(--main-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

.close-modal:hover {
    background: var(--accent-color);
    transform: rotate(90deg);
}

/* Responsive Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.5rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Adjustments for Mobile */
@media (max-width: 768px) {
    .page-header {
        padding: 6rem 1rem 3rem;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

    .page-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-image {
        height: 160px;
    }

    .project-content {
        padding: 1.2rem;
    }

    .project-title {
        font-size: 1.3rem;
    }

    .process-title {
        font-size: 1.8rem;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }

    .process-step {
        padding: 1.5rem;
    }

    .cta-title {
        font-size: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .back-home {
        position: relative;
        top: 0;
        left: 0;
        margin: 1rem;
        display: inline-flex;
    }

    /* Video Modal Mobile Adjustments */
    .modal-content {
        margin: 10% auto;
        padding: 1rem;
        width: 95%;
    }

    .close-modal {
        top: -12px;
        right: -12px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    /* ===== ONLY RESPONSIVE PATCH | NO DESIGN CHANGE ===== */

    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Extra small devices fix */
    @media (max-width: 360px) {
        .projects-grid {
            padding-left: 0.75rem;
            padding-right: 0.75rem;
        }

        .project-card {
            max-width: 100%;
        }
    }

    /* Back button safe wrap */
    @media (max-width: 480px) {
        .back-home {
            max-width: calc(100% - 2rem);
            white-space: nowrap;
        }
    }
}
